Skip to content

Commit

Permalink
chore: make node-bundle's "build" script behave as others (aws#19307)
Browse files Browse the repository at this point in the history
The default `projen` build step re-generates the `package.json` file and
re-install dependencies, which breaks in case the `align-versions.sh`
script was run (as the re-generated `package.json` has version `0.0.0`
again).

This inserts a hack to reset the `build` script and make it a synonym
to the `compile` script.

This was breaking the `jsii` integration tests (they try to build, but
not test, `aws-cdk`).
  • Loading branch information
RomainMuller authored Mar 9, 2022
1 parent f9b35cf commit b61a8c5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tools/@aws-cdk/node-bundle/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tools/@aws-cdk/node-bundle/.projenrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ const project = new typescript.TypeScriptProject({

project.gitignore.exclude('.vscode/');

// Ensure `npm run build` behaves the same as in other packages. Failure to do
// so results in re-generating the `package.json` with `version: 0.0.0` which
// undoes the work of `align-versions.sh` and breaks jsii integration tests.
// This can be removed if the `@aws-cdk/node-bundle` is moved out of this mono
// repository.
project.buildTask._locked = false; // <-- !HAXX! there is (understandably) not API to unlock...
project.buildTask.reset();
project.buildTask.prependSpawn(project.compileTask);

// needed for CLI tests to run
project.testTask.prependSpawn(project.compileTask);

Expand Down

0 comments on commit b61a8c5

Please sign in to comment.