Skip to content

Commit

Permalink
fix(jsii-pacmak): show custom pack-command in timer label (#4392)
Browse files Browse the repository at this point in the history
Currently 'npm pack' is shown in the logs regardless of the custom command.  Like in:
```log
[jsii-pacmak] [INFO] Packaged. npm pack (42.4s) | cleanup (3.8s) | load jsii (0.0s) | js (0.0s)
```

This behaviour is confusing because it leaves doubt about which command was actually applied. This PR passes the value of the pack-command option to the timer label.

---

By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].

[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
  • Loading branch information
gmeligio committed Jan 9, 2024
1 parent 8695e72 commit 3c1b4b1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/jsii-pacmak/lib/index.ts
Expand Up @@ -74,11 +74,10 @@ export async function pacmak({
await updateAllNpmIgnores(modulesToPackageFlat);
}

await timers.recordAsync('npm pack', () => {
const packCommand = argv['pack-command'];
await timers.recordAsync(packCommand, () => {
logging.info('Packaging NPM bundles');
return Promise.all(
modulesToPackageFlat.map((m) => m.npmPack(argv['pack-command'])),
);
return Promise.all(modulesToPackageFlat.map((m) => m.npmPack(packCommand)));
});

await timers.recordAsync('load jsii', () => {
Expand Down

0 comments on commit 3c1b4b1

Please sign in to comment.