Skip to content

Commit 2a57bc9

Browse files
authored
docs(toolkit-lib): include VERSION file (#131)
The docs build requires this file to contain the current version number. --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent a8b73da commit 2a57bc9

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

.projenrc.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1217,18 +1217,19 @@ for (const tsconfig of [toolkitLib.tsconfigDev]) {
12171217
}
12181218
}
12191219

1220+
// Ad a command for the docs
12201221
const toolkitLibDocs = toolkitLib.addTask('docs', {
12211222
exec: 'typedoc lib/index.ts',
12221223
receiveArgs: true,
12231224
});
1224-
toolkitLib.packageTask.spawn(toolkitLibDocs, {
1225-
// the nested directory is important
1226-
// the zip file needs to have this structure when created
1227-
args: ['--out dist/docs/cdk/api/toolkit-lib'],
1228-
});
1229-
toolkitLib.packageTask.exec('zip -r ../docs.zip cdk ', {
1230-
cwd: 'dist/docs',
1231-
});
1225+
1226+
// When packaging, output the docs into a specific nested directory
1227+
// This is required because the zip file needs to have this structure when created
1228+
toolkitLib.packageTask.spawn(toolkitLibDocs, { args: ['--out dist/docs/cdk/api/toolkit-lib'] });
1229+
// The docs build needs the version in a specific file at the nested root
1230+
toolkitLib.packageTask.exec('(cat dist/version.txt || echo "latest") > dist/docs/cdk/api/toolkit-lib/VERSION');
1231+
// Zip the whole thing up, again paths are important here to get the desired folder structure
1232+
toolkitLib.packageTask.exec('zip -r ../docs.zip cdk', { cwd: 'dist/docs' });
12321233

12331234
toolkitLib.addTask('publish-local', {
12341235
exec: './build-tools/package.sh',

packages/@aws-cdk/toolkit-lib/.projen/tasks.json

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

0 commit comments

Comments
 (0)