Skip to content

Commit

Permalink
fix(deps): frozen installation fails during ugprade workflow (#801)
Browse files Browse the repository at this point in the history
Fixes #800.

The problem was that projen itself can change `package.json` files due to its own requirements. 

> For example https://github.com/cdklabs/cdk-triggers/blob/main/.projenrc.js#L6

Which causes the `package.json` file to change after running `yarn install` - and a subsequent frozen installation would fail. 

This PR uses projen itself to install the dependencies and update the lock file, so this happens after all `package.json` mutations have happened. 

---

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • Loading branch information
iliapolo committed May 18, 2021
1 parent dff296c commit 06465af
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 75 deletions.
5 changes: 4 additions & 1 deletion .projen/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@
},
"upgrade-dependencies": {
"name": "upgrade-dependencies",
"env": {
"CI": "0"
},
"steps": [
{
"exec": "npm-check-updates --upgrade --target=minor --reject='projen'"
},
{
"exec": "yarn install --check-files"
"exec": "/bin/bash ./projen.bash"
}
]
},
Expand Down
13 changes: 0 additions & 13 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2870,19 +2870,6 @@ removeScript(name: string): void



#### renderInstallCommand(frozen)🔹 <a id="projen-nodepackage-renderinstallcommand"></a>



```ts
renderInstallCommand(frozen: boolean): string
```

* **frozen** (<code>boolean</code>) *No description*

__Returns__:
* <code>string</code>

#### setScript(name, command)🔹 <a id="projen-nodepackage-setscript"></a>

Override the contents of an npm package.json script.
Expand Down
40 changes: 32 additions & 8 deletions src/__tests__/__snapshots__/integ.test.ts.snap

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

95 changes: 53 additions & 42 deletions src/__tests__/__snapshots__/new.test.ts.snap

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

10 changes: 8 additions & 2 deletions src/__tests__/web/__snapshots__/nextjs-project.test.ts.snap

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

10 changes: 8 additions & 2 deletions src/__tests__/web/__snapshots__/nextjs-ts-project.test.ts.snap

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

0 comments on commit 06465af

Please sign in to comment.