@@ -178,7 +178,6 @@ function transitiveFeaturesAndFixes(thisPkg: string, depPkgs: string[]) {
178
178
function transitiveToolkitPackages ( thisPkg : string ) {
179
179
const toolkitPackages = [
180
180
'aws-cdk' ,
181
- '@aws-cdk/tmp-toolkit-helpers' ,
182
181
'@aws-cdk/cloud-assembly-schema' ,
183
182
'@aws-cdk/cloudformation-diff' ,
184
183
'@aws-cdk/toolkit-lib' ,
@@ -705,135 +704,6 @@ cdkAssets.eslint?.addRules({ 'jest/no-export': ['off'] });
705
704
706
705
//////////////////////////////////////////////////////////////////////
707
706
708
- const tmpToolkitHelpers = configureProject (
709
- new yarn . TypeScriptWorkspace ( {
710
- ...genericCdkProps ( {
711
- private : true ,
712
- } ) ,
713
- parent : repo ,
714
- name : '@aws-cdk/tmp-toolkit-helpers' ,
715
- description : 'A temporary package to hold code shared between aws-cdk and @aws-cdk/toolkit-lib' ,
716
- devDeps : [
717
- '@types/archiver' ,
718
- '@types/semver' ,
719
- 'aws-sdk-client-mock' ,
720
- 'aws-sdk-client-mock-jest' ,
721
- 'fast-check' ,
722
- 'nock' ,
723
- '@smithy/util-stream' ,
724
- 'xml-js' ,
725
- ] ,
726
- deps : [
727
- cloudAssemblySchema . name ,
728
- cloudFormationDiff ,
729
- cxApi ,
730
- `@aws-sdk/client-appsync@${ CLI_SDK_V3_RANGE } ` ,
731
- `@aws-sdk/client-cloudcontrol@${ CLI_SDK_V3_RANGE } ` ,
732
- `@aws-sdk/client-cloudformation@${ CLI_SDK_V3_RANGE } ` ,
733
- `@aws-sdk/client-cloudwatch-logs@${ CLI_SDK_V3_RANGE } ` ,
734
- `@aws-sdk/client-codebuild@${ CLI_SDK_V3_RANGE } ` ,
735
- `@aws-sdk/client-ec2@${ CLI_SDK_V3_RANGE } ` ,
736
- `@aws-sdk/client-ecr@${ CLI_SDK_V3_RANGE } ` ,
737
- `@aws-sdk/client-ecs@${ CLI_SDK_V3_RANGE } ` ,
738
- `@aws-sdk/client-elastic-load-balancing-v2@${ CLI_SDK_V3_RANGE } ` ,
739
- `@aws-sdk/client-iam@${ CLI_SDK_V3_RANGE } ` ,
740
- `@aws-sdk/client-kms@${ CLI_SDK_V3_RANGE } ` ,
741
- `@aws-sdk/client-lambda@${ CLI_SDK_V3_RANGE } ` ,
742
- `@aws-sdk/client-route-53@${ CLI_SDK_V3_RANGE } ` ,
743
- `@aws-sdk/client-s3@${ CLI_SDK_V3_RANGE } ` ,
744
- `@aws-sdk/client-secrets-manager@${ CLI_SDK_V3_RANGE } ` ,
745
- `@aws-sdk/client-sfn@${ CLI_SDK_V3_RANGE } ` ,
746
- `@aws-sdk/client-ssm@${ CLI_SDK_V3_RANGE } ` ,
747
- `@aws-sdk/client-sts@${ CLI_SDK_V3_RANGE } ` ,
748
- `@aws-sdk/credential-providers@${ CLI_SDK_V3_RANGE } ` ,
749
- `@aws-sdk/lib-storage@${ CLI_SDK_V3_RANGE } ` ,
750
- `@aws-sdk/ec2-metadata-service@${ CLI_SDK_V3_RANGE } ` ,
751
- '@smithy/middleware-endpoint' ,
752
- '@smithy/node-http-handler' ,
753
- '@smithy/property-provider' ,
754
- '@smithy/shared-ini-file-loader' ,
755
- '@smithy/types' ,
756
- '@smithy/util-retry' ,
757
- '@smithy/util-waiter' ,
758
- cdkAssets ,
759
- 'archiver' ,
760
- 'chalk@4' ,
761
- 'fs-extra@^9' ,
762
- 'glob' ,
763
- 'minimatch' ,
764
- 'p-limit@^3' ,
765
- 'promptly' , // @todo remove this should only be in CLI
766
- 'proxy-agent' , // @todo remove this should only be in CLI
767
- 'semver' ,
768
- 'uuid' ,
769
- 'wrap-ansi@^7' , // Last non-ESM version
770
- 'yaml@^1' ,
771
- ] ,
772
-
773
- tsconfig : {
774
- compilerOptions : {
775
- ...defaultTsOptions ,
776
- target : 'es2022' ,
777
- lib : [ 'es2022' , 'esnext.disposable' , 'dom' ] ,
778
- module : 'NodeNext' ,
779
-
780
- // Temporarily, because it makes it impossible for us to use @internal functions
781
- // from other packages. Annoyingly, VSCode won't show an error if you use @internal
782
- // because it looks at the .ts, but the compilation will fail because it will use
783
- // the .d.ts.
784
- stripInternal : false ,
785
- } ,
786
- } ,
787
-
788
- jestOptions : jestOptionsForProject ( {
789
- jestConfig : {
790
- coverageThreshold : {
791
- // We want to improve our test coverage
792
- // DO NOT LOWER THESE VALUES!
793
- // If you need to break glass, open an issue to re-up the values with additional test coverage
794
- statements : 70 ,
795
- branches : 70 ,
796
- functions : 70 ,
797
- lines : 70 ,
798
- } ,
799
- // We have many tests here that commonly time out
800
- testTimeout : 30_000 ,
801
- testEnvironment : './test/_helpers/jest-bufferedconsole.ts' ,
802
- setupFilesAfterEnv : [ '<rootDir>/test/_helpers/jest-setup-after-env.ts' ] ,
803
- } ,
804
- } ) ,
805
- } ) ,
806
- ) ;
807
-
808
- new TypecheckTests ( tmpToolkitHelpers ) ;
809
-
810
- // Prevent imports of private API surface
811
- tmpToolkitHelpers . package . addField ( 'exports' , {
812
- '.' : './lib/index.js' ,
813
- './package.json' : './package.json' ,
814
- './api' : './lib/api/index.js' ,
815
- './util' : './lib/util/index.js' ,
816
- } ) ;
817
-
818
- tmpToolkitHelpers . eslint ?. addRules ( {
819
- '@cdklabs/no-throw-default-error' : 'error' ,
820
- } ) ;
821
- tmpToolkitHelpers . eslint ?. addOverride ( {
822
- files : [ './test/**' ] ,
823
- rules : {
824
- '@cdklabs/no-throw-default-error' : 'off' ,
825
- } ,
826
- } ) ;
827
-
828
- tmpToolkitHelpers . gitignore . addPatterns ( 'test/**/*.map' ) ;
829
-
830
- tmpToolkitHelpers . npmignore ?. addPatterns (
831
- '!lib/api/bootstrap/bootstrap-template.yaml' ,
832
- ) ;
833
- tmpToolkitHelpers . postCompileTask . exec ( 'mkdir -p ./lib/api/bootstrap/ && cp ../../aws-cdk/lib/api/bootstrap/bootstrap-template.yaml ./lib/api/bootstrap/' ) ;
834
-
835
- //////////////////////////////////////////////////////////////////////
836
-
837
707
const TOOLKIT_LIB_EXCLUDE_PATTERNS = [
838
708
'lib/init-templates/*/typescript/*/*.template.ts' ,
839
709
] ;
@@ -914,12 +784,12 @@ const toolkitLib = configureProject(
914
784
'@smithy/types' ,
915
785
'@types/fs-extra' ,
916
786
'@types/split2' ,
917
- tmpToolkitHelpers ,
918
787
'aws-cdk-lib' ,
919
788
'aws-sdk-client-mock' ,
920
789
'aws-sdk-client-mock-jest' ,
921
790
'[email protected] ' , // use this specific version because newer versions are much slower. This is a temporary arrangement we hope to remove soon anyway.
922
791
'esbuild' ,
792
+ 'fast-check' ,
923
793
'typedoc' ,
924
794
'@microsoft/api-extractor' ,
925
795
] ,
@@ -936,10 +806,10 @@ const toolkitLib = configureProject(
936
806
jestConfig : {
937
807
coverageThreshold : {
938
808
// this is very sad but we will get better
939
- statements : 85 ,
940
- branches : 76 ,
941
- functions : 77 ,
942
- lines : 85 ,
809
+ statements : 60 ,
810
+ branches : 70 ,
811
+ functions : 55 ,
812
+ lines : 60 ,
943
813
} ,
944
814
testEnvironment : './test/_helpers/jest-bufferedconsole.ts' ,
945
815
setupFilesAfterEnv : [ '<rootDir>/test/_helpers/jest-setup-after-env.ts' ] ,
@@ -1021,13 +891,6 @@ new pj.JsonFile(toolkitLib, 'api-extractor.json', {
1021
891
// Eslint rules
1022
892
toolkitLib . eslint ?. addRules ( {
1023
893
'@cdklabs/no-throw-default-error' : 'error' ,
1024
- 'import/no-restricted-paths' : [ 'error' , {
1025
- zones : [ {
1026
- target : './' ,
1027
- from : '../tmp-toolkit-helpers' ,
1028
- message : 'All `@aws-cdk/tmp-toolkit-helpers` code must be used via lib/api/shared-*.ts' ,
1029
- } ] ,
1030
- } ] ,
1031
894
} ) ;
1032
895
toolkitLib . eslint ?. addOverride ( {
1033
896
files : [ './test/**' ] ,
@@ -1142,7 +1005,6 @@ const cli = configureProject(
1142
1005
nodeBundle ,
1143
1006
yargsGen ,
1144
1007
cliPluginContract ,
1145
- tmpToolkitHelpers ,
1146
1008
toolkitLib ,
1147
1009
'@octokit/rest' ,
1148
1010
'@types/archiver' ,
@@ -1241,6 +1103,15 @@ const cli = configureProject(
1241
1103
skipLibCheck : true ,
1242
1104
} ,
1243
1105
} ,
1106
+ tsconfigDev : {
1107
+ compilerOptions : {
1108
+ ...defaultTsOptions ,
1109
+ lib : [ 'es2019' , 'esnext.disposable' , 'es2022.error' ] ,
1110
+ esModuleInterop : false ,
1111
+ skipLibCheck : true ,
1112
+ } ,
1113
+
1114
+ } ,
1244
1115
eslintOptions : {
1245
1116
dirs : [ 'lib' ] ,
1246
1117
ignorePatterns : [ '*.template.ts' , '*.d.ts' , 'test/**/*.ts' ] ,
@@ -1356,7 +1227,7 @@ cli.gitignore.addPatterns('build-info.json');
1356
1227
const cliPackageJson = `${ cli . workspaceDirectory } /package.json` ;
1357
1228
1358
1229
cli . preCompileTask . prependExec ( './generate.sh' ) ;
1359
- cli . preCompileTask . prependExec ( 'ts-node --prefer-ts-exts scripts/user-input-gen.ts' ) ;
1230
+ cli . preCompileTask . prependExec ( 'ts-node -P tsconfig.dev.json - -prefer-ts-exts scripts/user-input-gen.ts' ) ;
1360
1231
1361
1232
const includeCliResourcesCommands = [
1362
1233
'cp $(node -p \'require.resolve("cdk-from-cfn/index_bg.wasm")\') ./lib/' ,
0 commit comments