Skip to content

Commit

Permalink
fix(node): operation not permitted: unlink 'node_modules/projen'
Browse files Browse the repository at this point in the history
After yarn installs `node_modules/projen`, it is no longer a file but a directory
so unlinking it fails.

Now, the heuristics are as follows:

If `node_modules/projen/package.json` does not exist or `node_modules/projen` is not a directory (could be a symlink from another run), we recreate it as a symlink to the executing cli.

Then, after synthesis, before running `yarn install`, if there's a symlink, we remove it.
We also run `yarn install` with `--check-files` to verify the integrity of `node_modules`.

Additionally, in CI builds, we run yarn install with `--frozen-lockfile`.

Fixes projen#93
  • Loading branch information
Elad Ben-Israel committed Sep 2, 2020

Verified

This commit was created on GitHub.com and signed with GitHubโ€™s verified signature.
1 parent a6c40c3 commit e310054
Showing 7 changed files with 55 additions and 315 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
26 changes: 13 additions & 13 deletions API.md
Original file line number Diff line number Diff line change
@@ -179,7 +179,7 @@ new ConstructLibrary(options: ConstructLibraryOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **authorName** (<code>string</code>) *No description*
@@ -319,7 +319,7 @@ new ConstructLibraryAws(options: ConstructLibraryAwsOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **authorName** (<code>string</code>) *No description*
@@ -791,7 +791,7 @@ new JsiiProject(options: JsiiProjectOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **authorName** (<code>string</code>) *No description*
@@ -1044,7 +1044,7 @@ new NodeProject(options: NodeProjectOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **name** (<code>string</code>) This is the name of your package.
@@ -1616,7 +1616,7 @@ new TypeScriptLibraryProject(options: TypeScriptProjectOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **name** (<code>string</code>) This is the name of your package.
@@ -1699,7 +1699,7 @@ new TypeScriptProject(options: TypeScriptProjectOptions)
* **start** (<code>boolean</code>) Defines a `yarn start` interactive experience. __*Default*__: true
* **startOptions** (<code>[StartOptions](#projen-startoptions)</code>) Options for `yarn start`. __*Default*__: default options
* **testdir** (<code>string</code>) Tests directory. __*Default*__: "test"
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
* **workflowBootstrapSteps** (<code>Array<any></code>) Workflow steps to use in order to bootstrap this repo. __*Default*__: "npx projen${PROJEN_VERSION}"
* **workflowContainerImage** (<code>string</code>) Container image to use for GitHub workflows. __*Default*__: default image
* **workflowNodeVersion** (<code>string</code>) The node version to use in GitHub workflows. __*Default*__: same as `minNodeVersion`
* **name** (<code>string</code>) This is the name of your package.
@@ -1898,7 +1898,7 @@ Name | Type | Description
**start**?๐Ÿ”น | <code>boolean</code> | Defines a `yarn start` interactive experience.<br/>__*Default*__: true
**startOptions**?๐Ÿ”น | <code>[StartOptions](#projen-startoptions)</code> | Options for `yarn start`.<br/>__*Default*__: default options
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -1972,7 +1972,7 @@ Name | Type | Description
**start**?๐Ÿ”น | <code>boolean</code> | Defines a `yarn start` interactive experience.<br/>__*Default*__: true
**startOptions**?๐Ÿ”น | <code>[StartOptions](#projen-startoptions)</code> | Options for `yarn start`.<br/>__*Default*__: default options
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -2177,7 +2177,7 @@ Name | Type | Description
**start**?๐Ÿ”น | <code>boolean</code> | Defines a `yarn start` interactive experience.<br/>__*Default*__: true
**startOptions**?๐Ÿ”น | <code>[StartOptions](#projen-startoptions)</code> | Options for `yarn start`.<br/>__*Default*__: default options
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -2318,7 +2318,7 @@ Name | Type | Description
**start**?๐Ÿ”น | <code>boolean</code> | Defines a `yarn start` interactive experience.<br/>__*Default*__: true
**startOptions**?๐Ÿ”น | <code>[StartOptions](#projen-startoptions)</code> | Options for `yarn start`.<br/>__*Default*__: default options
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -2384,7 +2384,7 @@ Name | Type | Description
**start**?๐Ÿ”น | <code>boolean</code> | Defines a `yarn start` interactive experience.<br/>__*Default*__: true
**startOptions**?๐Ÿ”น | <code>[StartOptions](#projen-startoptions)</code> | Options for `yarn start`.<br/>__*Default*__: default options
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -2527,7 +2527,7 @@ Name | Type | Description
**testdir**?โš ๏ธ | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**tsconfig**?โš ๏ธ | <code>[TypescriptConfigOptions](#projen-typescriptconfigoptions)</code> | Custom TSConfig.<br/>__*Optional*__
**typescriptVersion**?โš ๏ธ | <code>[Semver](#projen-semver)</code> | TypeScript version to use.<br/>__*Default*__: ^3.9.5
**workflowBootstrapSteps**?โš ๏ธ | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?โš ๏ธ | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?โš ๏ธ | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?โš ๏ธ | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

@@ -2602,7 +2602,7 @@ Name | Type | Description
**testdir**?๐Ÿ”น | <code>string</code> | Tests directory.<br/>__*Default*__: "test"
**tsconfig**?๐Ÿ”น | <code>[TypescriptConfigOptions](#projen-typescriptconfigoptions)</code> | Custom TSConfig.<br/>__*Optional*__
**typescriptVersion**?๐Ÿ”น | <code>[Semver](#projen-semver)</code> | TypeScript version to use.<br/>__*Default*__: ^3.9.5
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: [ { run: `npx projen${PROJEN_VERSION}` }, { run: 'yarn install --frozen-lockfile' } ]
**workflowBootstrapSteps**?๐Ÿ”น | <code>Array<any></code> | Workflow steps to use in order to bootstrap this repo.<br/>__*Default*__: "npx projen${PROJEN_VERSION}"
**workflowContainerImage**?๐Ÿ”น | <code>string</code> | Container image to use for GitHub workflows.<br/>__*Default*__: default image
**workflowNodeVersion**?๐Ÿ”น | <code>string</code> | The node version to use in GitHub workflows.<br/>__*Default*__: same as `minNodeVersion`

Loading

0 comments on commit e310054

Please sign in to comment.