Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to pnpm #2570

Merged
merged 11 commits into from
Jun 26, 2023
140 changes: 85 additions & 55 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,31 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: volta-cli/action@25888009cd70dbe17a140f1c56d93f8c09f7bcef # tag=v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: install dependencies
run: yarn install
run: pnpm install

- name: lint
run: yarn workspace ${{ matrix.workspace }} lint
run: pnpm run --filter ${{ matrix.workspace }} lint

tests:
name: Tests
Expand Down Expand Up @@ -74,25 +80,31 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: volta-cli/action@25888009cd70dbe17a140f1c56d93f8c09f7bcef # tag=v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: install dependencies
run: yarn install
run: pnpm install

- name: tests
run: yarn workspace ${{ matrix.workspace }} ${{ matrix.test-suite }}
run: pnpm run --filter ${{ matrix.workspace }} ${{ matrix.test-suite }}
continue-on-error: ${{ matrix.allow-failure }}

allow-fail-try-scenarios:
Expand All @@ -115,26 +127,32 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: volta-cli/action@25888009cd70dbe17a140f1c56d93f8c09f7bcef # tag=v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: install dependencies
run: yarn install
run: pnpm install

- name: Allowed to fail tests
id: allowed_to_fail_tests
run: yarn workspace ${{ matrix.workspace }} ${{ matrix.test-suite }}
run: pnpm run --filter ${{ matrix.workspace }} ${{ matrix.test-suite }}
continue-on-error: true

- uses: mainmatter/continue-on-error-comment@v1
Expand All @@ -157,25 +175,31 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: volta-cli/action@25888009cd70dbe17a140f1c56d93f8c09f7bcef # tag=v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: install dependencies
run: yarn install --no-lockfile
run: pnpm install --no-lockfile

- name: tests
run: yarn workspace ${{ matrix.workspace }} test
run: pnpm run --filter ${{ matrix.workspace }} test
continue-on-error: true

node-tests:
Expand All @@ -185,22 +209,28 @@ jobs:

steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
- uses: volta-cli/action@25888009cd70dbe17a140f1c56d93f8c09f7bcef # tag=v4
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT

- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: yarn-cache
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-pnpm-store-

- name: install dependencies
run: yarn install
run: pnpm install

- name: tests
run: yarn workspace ember-simple-auth test:node
run: pnpm run --filter ember-simple-auth test:node
5 changes: 1 addition & 4 deletions .release-it.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"plugins": {
"release-it-lerna-changelog": {
"@release-it-plugins/lerna-changelog": {
"infile": "CHANGELOG.md"
},
"release-it-yarn-workspaces": {
"publish": false
}
},
"git": {
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Here's a few steps to follow to make sure your pull request gets accepted:

## Run Tests

After you have forked the repository, run `yarn install` and `bower install`.
After you have forked the repository, run `pnpm install`.
Also install [PhantomJS](http://phantomjs.org/) to run the tests.

To run tests against the currently installed Ember version, run `ember test`. To
simulate a CI run -- testing multiple versions of Ember, Ember Data and the
included addon generators -- run `yarn test && yarn run test:node`.
included addon generators -- run `pnpm test && pnpm run test:node`.
2 changes: 1 addition & 1 deletion Procfile.client
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: yarn workspace test-app start:fastboot
web: pnpm run --filter test-app start:fastboot
2 changes: 1 addition & 1 deletion Procfile.server
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: yarn workspace test-app start:demo-api
web: pnpm run --filter test-app start:demo-api
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ start it, run
```
git clone https://github.com/mainmatter/ember-simple-auth.git
cd ember-simple-auth/packages/test-app
yarn install && ember serve
pnpm install && ember serve
```

and go to [http://localhost:4200](http://localhost:4200).
Expand Down
4 changes: 2 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Once the prep work is completed, the actual release is straight forward:
* First, ensure that you have installed your projects dependencies:

```sh
yarn install
pnpm install
```

* Second, ensure that you have obtained a
Expand All @@ -50,7 +50,7 @@ yarn install
* And last (but not least 😁) do your release.

```sh
yarn release
pnpm release
```

[release-it](https://github.com/release-it/release-it/) manages the actual
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,18 @@
"scripts": {
"changelog": "lerna-changelog",
"diagrams": "mmdc -i guides/assets/esa-initial-flow.txt -o guides/assets/esa-initial-flow.svg",
"heroku-postbuild": "yarn workspace test-app build -prod",
"heroku-postbuild": "pnpm run --filter test-app build -prod",
"release": "release-it"
},
"workspaces": [
"packages/*"
],
"devDependencies": {
"@mermaid-js/mermaid-cli": "^10.0.0",
"lerna-changelog": "^2.0.0",
"release-it": "^15.0.0",
"release-it-lerna-changelog": "^5.0.0",
"release-it-yarn-workspaces": "^3.0.0"
"@release-it-plugins/lerna-changelog": "^5.0.0"
},
"version": "6.0.0-rc.1",
"volta": {
"node": "16.20.0",
"yarn": "1.22.19"
"pnpm": ">=8"
}
}
3 changes: 2 additions & 1 deletion packages/classic-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "~2.7.0",
"@embroider/test-setup": "^2.1.1",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"body-parser": "^1.19.0",
Expand Down Expand Up @@ -59,7 +60,7 @@
"glob": "^10.0.0",
"handlebars": "~4.7.1",
"loader.js": "^4.7.0",
"my-engine": "./packages/classic-test-app/lib/my-engine",
"my-engine": "workspace:../classic-test-app/lib/my-engine",
"npm-run-all": "^4.1.5",
"pretender": "3.4.7",
"qunit": "^2.17.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/ember-simple-auth/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = function() {
const betaUrl = urls[1];
const canaryUrl = urls[2];
return {
useYarn: true,
usePnpm: true,
scenarios: [
{
name: 'ember-lts-3.28',
Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = function() {
npm: {
devDependencies: {
'ember-cli': '~4.8.0',
'ember-data': '~4.8.0',
'ember-data': '~4.8.2',
'ember-source': '~4.8.0',
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/ember-simple-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"test:node": "mocha node-tests --recursive"
},
"dependencies": {
"ember-cli-babel": "^7.20.5",
"ember-auto-import": "^2.4.2",
"ember-cli-babel": "^7.20.5",
"ember-cli-is-package-missing": "^1.0.0",
"ember-cookies": "^1.0.0",
"silent-error": "^1.0.0"
Expand All @@ -36,7 +36,7 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "~2.7.0",
"@embroider/test-setup": "^2.0.0",
"@embroider/test-setup": "^2.1.1",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"broccoli-asset-rev": "^3.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@ember/test-helpers": "~2.7.0",
"@embroider/test-setup": "^2.1.1",
"@glimmer/component": "^1.0.0",
"@glimmer/tracking": "^1.0.0",
"body-parser": "^1.19.0",
Expand Down Expand Up @@ -61,7 +62,7 @@
"glob": "^10.0.0",
"handlebars": "~4.7.1",
"loader.js": "^4.7.0",
"my-engine": "./packages/test-app/lib/my-engine",
"my-engine": "workspace:../test-app/lib/my-engine",
"najax": "^1.0.7",
"npm-run-all": "^4.1.5",
"pretender": "3.4.7",
Expand Down
Loading