Skip to content

Commit

Permalink
Migrate to pnpm
Browse files Browse the repository at this point in the history
in order to avoid ember-source `peerDependency` being hoisted to the
root node_modules, which causes unreliable imports in embroider.

see: embroider-build/embroider#1169 (comment)

Also:

- [Breaking] Drop Node@12 support due to `pnpm` requires it
- Use slightly dated pnpm@7.5.2, since in the later version there are
  issues with `--frozen-lockfile` installations
  • Loading branch information
ro0gr committed Jul 30, 2022
1 parent 32d7c7b commit 5749f64
Show file tree
Hide file tree
Showing 9 changed files with 16,751 additions and 58,538 deletions.
71 changes: 40 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,30 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 12.x
cache: npm
node-version: 14.x

- name: npm8
run: npm install -g npm@8
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.2
run_install: false

- name: Install Dependencies
run: npm ci
- name: Install dependencies
run: pnpm install

- name: Lint Addon
run: npm run lint
run: pnpm lint
working-directory: addon

- name: Lint Test App
run: npm run lint
run: pnpm lint
working-directory: test-app

- name: Run Tests
run: npm run test:ember
run: pnpm test:ember
working-directory: test-app

floating:
Expand All @@ -49,23 +51,26 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
node-version: 14.x

- name: npm8
run: npm install -g npm@8
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.2
run_install: false

- name: Install Dependencies
run: npm install --no-package-lock
run: pnpm install --frozen-lockfile=false

- name: Run Tests
run: npm run test:ember
run: pnpm test:ember
working-directory: test-app

node-tests:
Expand All @@ -75,23 +80,26 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x, 16.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2

- name: Install Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
node-version: 14.x

- name: npm8
run: npm install -g npm@8
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.2
run_install: false

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Run Tests
run: npm run test
run: pnpm test
working-directory: addon

try-scenarios:
Expand All @@ -118,15 +126,16 @@ jobs:
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 12.x
cache: npm
node-version: 14.x

- name: npm8
run: npm install -g npm@8
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.2
run_install: false

- name: Install Dependencies
run: npm ci
run: pnpm install

- name: Run Tests
run: ../node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
working-directory: test-app
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
7 changes: 4 additions & 3 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"test": "mocha node-tests --recursive"
},
"dependencies": {
"@embroider/addon-shim": "^1.6.0",
"@embroider/addon-shim": "^1.8.0",
"@ro0gr/ceibo": "^2.2.0",
"@types/jquery": "^3.5.14",
"jquery": "^3.5.1"
Expand All @@ -57,7 +57,7 @@
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-decorators": "^7.17.9",
"@embroider/addon-dev": "^1.6.0",
"@embroider/addon-dev": "^1.8.0",
"@rollup/plugin-babel": "^5.3.1",
"chai": "^4.1.2",
"ember-cli-blueprint-test-helpers": "^0.18.2",
Expand All @@ -68,7 +68,8 @@
"eslint-plugin-prettier": "^4.0.0",
"mocha": "^4.0.1",
"prettier": "^2.6.2",
"rollup": "^2.71.1"
"rollup": "^2.71.1",
"npm-run-all": "^4.1.5"
},
"peerDependencies": {
"@ember/test-helpers": "^2.5.0",
Expand Down
Loading

0 comments on commit 5749f64

Please sign in to comment.