Skip to content

Commit a8b73da

Browse files
authored
chore: remove duplicate cli resource files (#129)
CLI derivative packages should never check-in their own version of CLI resource files (bootstrap template, init templates, etc.). Instead they are expected to copy any required files over at build time. This PR removes the checked-in version of `init-templates` and bootstrap template from `cli-lib-alpha`. It also adds respective gitignore and npmignore rules. Note that neither `cli-lib-alpha` nor `toolkit-lib` currently support the init command and therefore don't need the templates just yet. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 46d28cb commit a8b73da

File tree

137 files changed

+38
-4037
lines changed

Some content is hidden

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

137 files changed

+38
-4037
lines changed

.npmignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

+17-4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ function configureProject<A extends pj.typescript.TypeScriptProject>(x: A): A {
6161
// As a rule we don't include .ts sources in the NPM package
6262
x.npmignore?.addPatterns('*.ts', '!*.d.ts');
6363

64+
// Never include the build-tools directory
65+
x.npmignore?.addPatterns('build-tools');
66+
6467
return x;
6568
}
6669

@@ -77,7 +80,6 @@ const ADDITIONAL_CLI_IGNORE_PATTERNS = [
7780
'index_bg.wasm',
7881
'build-info.json',
7982
'.recommended-feature-flags.json',
80-
'!lib/init-templates/**',
8183
];
8284

8385
// Specifically this and not ^ because when the SDK version updates there is a
@@ -835,7 +837,10 @@ cli.npmignore?.addPatterns(
835837
'generate.sh',
836838
);
837839

838-
cli.gitignore.addPatterns(...ADDITIONAL_CLI_IGNORE_PATTERNS);
840+
cli.gitignore.addPatterns(
841+
...ADDITIONAL_CLI_IGNORE_PATTERNS,
842+
'!lib/init-templates/**',
843+
);
839844

840845
// People should not have imported from the `aws-cdk` package, but they have in the past.
841846
// We have identified all locations that are currently used, are maintaining a backwards compat
@@ -962,10 +967,16 @@ const cliLib = configureProject(
962967
);
963968

964969
// Do include all .ts files inside init-templates
965-
cliLib.npmignore?.addPatterns('!lib/init-templates/**/*.ts');
970+
cliLib.npmignore?.addPatterns(
971+
'!lib/init-templates/**/*.ts',
972+
'!lib/api/bootstrap/bootstrap-template.yaml',
973+
);
966974

967975
cliLib.gitignore.addPatterns(
968976
...ADDITIONAL_CLI_IGNORE_PATTERNS,
977+
'lib/**/*.yaml',
978+
'lib/**/*.yml',
979+
'lib/init-templates/**',
969980
'cdk.out',
970981
);
971982

@@ -1171,13 +1182,13 @@ toolkitLib.postCompileTask.exec('node ./lib/api/aws-cdk.js >/dev/null 2>/dev/nul
11711182
// Do include all .ts files inside init-templates
11721183
toolkitLib.npmignore?.addPatterns(
11731184
'assets',
1174-
'build-tools',
11751185
'docs',
11761186
'typedoc.json',
11771187
'*.d.ts.map',
11781188
// Explicitly allow all required files
11791189
'!build-info.json',
11801190
'!db.json.gz',
1191+
'!lib/init-templates/**/*.ts',
11811192
'!lib/api/bootstrap/bootstrap-template.yaml',
11821193
'!lib/*.js',
11831194
'!lib/*.d.ts',
@@ -1192,7 +1203,9 @@ toolkitLib.gitignore.addPatterns(
11921203
'build-info.json',
11931204
'lib/**/*.wasm',
11941205
'lib/**/*.yaml',
1206+
'lib/**/*.yml',
11951207
'lib/**/*.js.map',
1208+
'lib/init-templates/**',
11961209
'!test/_fixtures/**/app.js',
11971210
'!test/_fixtures/**/cdk.out',
11981211
);

packages/@aws-cdk/cdk-build-tools/.npmignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cdk-cli-wrapper/.npmignore

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cli-lib-alpha/.gitignore

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/cli-lib-alpha/.npmignore

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)