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

Switch to pnpm #348

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Setup node and pnpm
description: Setup node and install dependencies using pnpm
runs:
using: "composite"
steps:
- uses: volta-cli/action@v1
# minimum supported Node
with:
node-version: 14.x
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- uses: pnpm/action-setup@v2.2.2
with:
version: 7.5.2
run_install: true
37 changes: 10 additions & 27 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,19 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 12.x
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test:ember
- uses: ./.github/actions/pnpm
- run: pnpm lint
- run: pnpm test:ember

floating-dependencies:
name: "Floating Dependencies"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 14.x
- run: yarn install --no-lockfile
- run: yarn test:ember
- uses: ./.github/actions/pnpm
- run: rm pnpm-lock.yaml && pnpm install
- run: pnpm test:ember

try-scenarios:
name: "Try: ${{ matrix.ember-try-scenario }}"
Expand All @@ -58,11 +53,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v1
with:
node-version: 12.x
- name: install dependencies
run: yarn install --frozen-lockfile
- uses: ./.github/actions/pnpm
- name: test
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup

Expand All @@ -73,20 +64,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install node
uses: actions/setup-node@v2
with:
node-version: 14.x
registry-url: 'https://registry.npmjs.org'

- name: install dependencies
run: yarn install --frozen-lockfile
- uses: ./.github/actions/pnpm

- name: auto-dist-tag
run: npx auto-dist-tag@1 --write

- name: publish to npm
run: npm publish
run: pnpm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

* `git clone <repository-url>`
* `cd @ember/string`
* `yarn install`
* `pnpm install`

## Linting

* `yarn lint`
* `yarn lint:fix`
* `pnpm lint`
* `pnpm lint:fix`

## Running tests

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Compatibility

* Ember.js v3.20 or above
* Ember CLI v3.20 or above
* Node.js v12 or above
* Node.js v14 or above
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want to flag up: this is breaking! That's fine as long as it's intentional. 😅

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is!

node 12 is EOL'd, and pnpm doesn't support it



Installation
Expand Down
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 1 addition & 1 deletion config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { embroiderSafe, embroiderOptimized } = require('@embroider/test-setup');

module.exports = async function () {
return {
useYarn: true,
usePnpm: true,
scenarios: [
{
name: 'ember-lts-3.20',
Expand Down
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"test:ember": "ember test",
"test:ember-compatibility": "ember try:each",
"test-typings": "node node_modules/typescript/bin/tsc",
"prepack": "yarn babel --extensions '.ts' --presets @babel/preset-typescript addon --out-dir addon/ --ignore '**/*.d.ts'",
"prepack": "pnpm babel --extensions '.ts' --presets @babel/preset-typescript addon --out-dir addon/ --ignore '**/*.d.ts'",
"postpack": "rimraf addon/**/*.js",
"postpublish": "npm-run-all clean"
},
Expand All @@ -36,6 +36,7 @@
},
"devDependencies": {
"@babel/cli": "^7.17.6",
"@babel/core": "^7.18.9",
NullVoxPopuli marked this conversation as resolved.
Show resolved Hide resolved
"@babel/preset-typescript": "^7.16.0",
"@ember/optional-features": "^2.0.0",
"@ember/test-helpers": "^2.6.0",
Expand Down Expand Up @@ -69,7 +70,7 @@
"ember-source": "~3.28.6",
"ember-source-channel-url": "^3.0.0",
"ember-template-lint": "^3.12.0",
"ember-try": "^1.4.0",
"ember-try": "^2.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-ember": "^10.5.7",
Expand All @@ -88,7 +89,7 @@
"webpack": "^5"
},
"engines": {
"node": "12.* || 14.* || >= 16"
"node": ">= 16"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down Expand Up @@ -117,8 +118,16 @@
"publish": false
}
},
"pnpm": {
"overrides": {
"@octokit/core": "^4.0.0"
},
"overrides-notes": {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super nice. Is override-notes a baked-in pnpm thing or does it just ignore unknown keys?

Copy link
Sponsor Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It ignores unknown keys - would be cool if this were standardized or something 🤔

"@octokit/core": "release-it -> @octokit/rest -> @octokit/plugin-paginate-rest wants @octokit/core v4, but found 3.6. The problem is that release-it-lerna-changelog + release-it have incompatible peers. This 'fix' relies on the accident that @octokit/core happens to work with all the other deps"
}
},
"volta": {
"node": "12.22.3",
"yarn": "1.22.11"
"node": "16.20.0",
"pnpm": "8.1.1"
}
}
Loading