Skip to content

Commit fc147a3

Browse files
committed
chore: move integ-runner over
2 parents 4ea903f + a139c52 commit fc147a3

File tree

263 files changed

+17132
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+17132
-181
lines changed

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/deps.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 144 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { JsiiBuild } from './projenrc/jsii';
1111
import { PrLabeler } from './projenrc/pr-labeler';
1212
import { RecordPublishingTimestamp } from './projenrc/record-publishing-timestamp';
1313
import { S3DocsPublishing } from './projenrc/s3-docs-publishing';
14+
import { TypeScriptWorkspaceOptions } from 'cdklabs-projen-project-types/lib/yarn';
1415

1516
// 5.7 sometimes gives a weird error in `ts-jest` in `@aws-cdk/cli-lib-alpha`
1617
// https://github.com/microsoft/TypeScript/issues/60159
@@ -33,7 +34,7 @@ function configureProject<A extends pj.typescript.TypeScriptProject>(x: A): A {
3334
x.addDevDeps(
3435
'@typescript-eslint/eslint-plugin@^8',
3536
'@typescript-eslint/parser@^8',
36-
'@stylistic/eslint-plugin',
37+
'@stylistic/eslint-plugin@^3',
3738
'@cdklabs/eslint-plugin',
3839
'eslint-plugin-import',
3940
'eslint-plugin-jest',
@@ -86,6 +87,15 @@ const ADDITIONAL_CLI_IGNORE_PATTERNS = [
8687

8788
const CLI_SDK_V3_RANGE = '^3';
8889

90+
const defaultTsOptions: NonNullable<TypeScriptWorkspaceOptions['tsconfig']>['compilerOptions'] = {
91+
target: 'ES2020',
92+
module: 'commonjs',
93+
lib: ['es2020', 'dom'],
94+
incremental: true,
95+
esModuleInterop: false,
96+
skipLibCheck: true,
97+
};
98+
8999
/**
90100
* Shared jest config
91101
*
@@ -412,7 +422,7 @@ const cloudFormationDiff = configureProject(
412422
// (EDIT: or should it? We're going to bundle it into aws-cdk-lib)
413423
tsconfig: {
414424
compilerOptions: {
415-
esModuleInterop: false,
425+
...defaultTsOptions,
416426
},
417427
},
418428

@@ -480,6 +490,11 @@ const yargsGen = configureProject(
480490
deps: ['@cdklabs/typewriter', 'prettier@^2.8', 'lodash.clonedeep'],
481491
devDeps: ['@types/semver', '@types/yarnpkg__lockfile', '@types/lodash.clonedeep', '@types/prettier@^2'],
482492
minNodeVersion: '17.0.0', // Necessary for 'structuredClone'
493+
tsconfig: {
494+
compilerOptions: {
495+
...defaultTsOptions,
496+
},
497+
},
483498
}),
484499
);
485500

@@ -502,6 +517,11 @@ const nodeBundle = configureProject(
502517
},
503518
},
504519
}),
520+
tsconfig: {
521+
compilerOptions: {
522+
...defaultTsOptions,
523+
},
524+
},
505525
}),
506526
);
507527
// Too many console statements
@@ -521,6 +541,11 @@ const cliPluginContract = configureProject(
521541
],
522542
devDeps: [
523543
],
544+
tsconfig: {
545+
compilerOptions: {
546+
...defaultTsOptions,
547+
},
548+
},
524549
}),
525550
);
526551

@@ -574,21 +599,13 @@ const cdkAssets = configureProject(
574599
],
575600
tsconfigDev: {
576601
compilerOptions: {
577-
target: 'ES2020',
578-
module: 'commonjs',
579-
lib: ['es2020', 'dom'],
580-
incremental: true,
581-
esModuleInterop: false,
602+
...defaultTsOptions,
582603
},
583604
include: ['bin/**/*.ts'],
584605
},
585606
tsconfig: {
586607
compilerOptions: {
587-
target: 'ES2020',
588-
module: 'commonjs',
589-
lib: ['es2020', 'dom'],
590-
incremental: true,
591-
esModuleInterop: false,
608+
...defaultTsOptions,
592609
rootDir: undefined,
593610
outDir: undefined,
594611
},
@@ -664,10 +681,10 @@ const tmpToolkitHelpers = configureProject(
664681
],
665682
tsconfig: {
666683
compilerOptions: {
684+
...defaultTsOptions,
667685
target: 'es2022',
668-
lib: ['es2022', 'esnext.disposable'],
686+
lib: ['es2022', 'esnext.disposable', 'dom'],
669687
module: 'NodeNext',
670-
esModuleInterop: false,
671688
},
672689
},
673690
}),
@@ -787,6 +804,8 @@ const cli = configureProject(
787804
},
788805
tsconfig: {
789806
compilerOptions: {
807+
...defaultTsOptions,
808+
790809
// Changes the meaning of 'import' for libraries whose top-level export is a function
791810
// 'aws-cdk' has been written against `false` for interop
792811
esModuleInterop: false,
@@ -980,6 +999,11 @@ const cliLib = configureProject(
980999
moduleFileExtensions: undefined,
9811000
},
9821001
}),
1002+
tsconfig: {
1003+
compilerOptions: {
1004+
...defaultTsOptions,
1005+
},
1006+
},
9831007
}),
9841008
);
9851009

@@ -1152,10 +1176,10 @@ const toolkitLib = configureProject(
11521176
}),
11531177
tsconfig: {
11541178
compilerOptions: {
1179+
...defaultTsOptions,
11551180
target: 'es2022',
1156-
lib: ['es2022', 'esnext.disposable'],
1181+
lib: ['es2022', 'esnext.disposable', 'dom'],
11571182
module: 'NodeNext',
1158-
esModuleInterop: false,
11591183
},
11601184
},
11611185
}),
@@ -1278,7 +1302,7 @@ const cdkCliWrapper = configureProject(
12781302
name: '@aws-cdk/cdk-cli-wrapper',
12791303
description: 'CDK CLI Wrapper Library',
12801304
srcdir: 'lib',
1281-
devDeps: ['aws-cdk-lib', cli, 'constructs', '@aws-cdk/integ-runner'],
1305+
devDeps: [],
12821306
nextVersionCommand: `tsx ../../../projenrc/next-version.ts copyVersion:../../../${cliPackageJson}`,
12831307
releasableCommits: transitiveToolkitPackages('@aws-cdk/cdk-cli-wrapper'),
12841308

@@ -1289,15 +1313,23 @@ const cdkCliWrapper = configureProject(
12891313
},
12901314
},
12911315
}),
1316+
1317+
tsconfig: {
1318+
compilerOptions: {
1319+
...defaultTsOptions,
1320+
}
1321+
},
12921322
}),
12931323
);
12941324

1325+
/* Can't have this -- the integ-runner depends on this package
12951326
(() => {
12961327
const integ = cdkCliWrapper.addTask('integ', {
12971328
exec: 'integ-runner --language javascript',
12981329
});
12991330
cdkCliWrapper.testTask.spawn(integ);
13001331
})();
1332+
*/
13011333

13021334
//////////////////////////////////////////////////////////////////////
13031335

@@ -1311,12 +1343,107 @@ const cdkAliasPackage = configureProject(
13111343
deps: [cli.customizeReference({ versionType: 'exact' })],
13121344
nextVersionCommand: `tsx ../../projenrc/next-version.ts copyVersion:../../${cliPackageJson}`,
13131345
releasableCommits: transitiveToolkitPackages('cdk'),
1346+
tsconfig: {
1347+
compilerOptions: {
1348+
...defaultTsOptions,
1349+
},
1350+
},
13141351
}),
13151352
);
13161353
void cdkAliasPackage;
13171354

13181355
//////////////////////////////////////////////////////////////////////
13191356

1357+
const integRunner = configureProject(
1358+
new yarn.TypeScriptWorkspace({
1359+
...genericCdkProps(),
1360+
parent: repo,
1361+
name: '@aws-cdk/integ-runner',
1362+
description: 'CDK Integration Testing Tool',
1363+
srcdir: 'lib',
1364+
deps: [
1365+
cloudAssemblySchema.customizeReference({ versionType: 'exact' }),
1366+
cxApi,
1367+
cdkCliWrapper.customizeReference({ versionType: 'exact' }),
1368+
cli.customizeReference({ versionType: 'exact' }),
1369+
cdkAssets.customizeReference({ versionType: 'exact' }),
1370+
cloudFormationDiff.customizeReference({ versionType: 'exact' }),
1371+
'workerpool@^6',
1372+
'chokidar@^3',
1373+
'chalk@^4',
1374+
'fs-extra@^9',
1375+
'yargs@^16',
1376+
'@aws-cdk/aws-service-spec',
1377+
'@aws-sdk/client-cloudformation@^3',
1378+
],
1379+
devDeps: [
1380+
'aws-cdk-lib',
1381+
'@types/fs-extra',
1382+
'@types/mock-fs@^4',
1383+
'mock-fs@^5',
1384+
'@types/workerpool@^6',
1385+
'@types/yargs',
1386+
'constructs@^10',
1387+
'@aws-cdk/[email protected]',
1388+
],
1389+
allowPrivateDeps: true,
1390+
tsconfig: {
1391+
compilerOptions: {
1392+
...defaultTsOptions,
1393+
}
1394+
},
1395+
}),
1396+
);
1397+
integRunner.gitignore?.addPatterns(
1398+
// Ignore this symlink, we recreate it at test time
1399+
'test/test-archive-follow/data/linked',
1400+
1401+
// These files are needed for unit tests
1402+
'!test/test-data/cdk-integ.out*/',
1403+
1404+
'!**/*.snapshot/**/asset.*/*.js',
1405+
'!**/*.snapshot/**/asset.*/*.d.ts',
1406+
'!**/*.snapshot/**/asset.*/**',
1407+
1408+
'lib/recommended-feature-flags.json',
1409+
);
1410+
integRunner.tsconfig?.addInclude('lib/*.json');
1411+
integRunner.tsconfig?.addInclude('lib/init-templates/*/*/add-project.hook.ts');
1412+
integRunner.tsconfig?.addExclude('lib/init-templates/*/typescript/**/*.ts');
1413+
integRunner.tsconfig?.addExclude('test/language-tests/**/integ.*.ts');
1414+
1415+
integRunner.preCompileTask.prependExec('./build-tools/generate.sh');
1416+
1417+
new BundleCli(integRunner, {
1418+
externals: {
1419+
optionalDependencies: [
1420+
'fsevents',
1421+
],
1422+
dependencies: [
1423+
'@aws-cdk/aws-service-spec',
1424+
'aws-cdk',
1425+
],
1426+
},
1427+
allowedLicenses: [
1428+
'Apache-2.0',
1429+
'MIT',
1430+
'BSD-3-Clause',
1431+
'ISC',
1432+
'BSD-2-Clause',
1433+
'0BSD',
1434+
'MIT OR Apache-2.0',
1435+
],
1436+
dontAttribute: '^@aws-cdk/|^@cdklabs/|^cdk-assets$|^cdk-cli-wrapper$',
1437+
test: 'bin/integ-runner --version',
1438+
entryPoints: [
1439+
'lib/index.js',
1440+
'lib/workers/extract/index.js',
1441+
],
1442+
minifyWhitespace: true,
1443+
});
1444+
1445+
//////////////////////////////////////////////////////////////////////
1446+
13201447
// The pj.github.Dependabot component is only for a single Node project,
13211448
// but we need multiple non-Node projects
13221449
new pj.YamlFile(repo, '.github/dependabot.yml', {

0 commit comments

Comments
 (0)