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

Migrate to pnpm #772

Merged
merged 9 commits into from
Mar 14, 2024
Merged
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
87 changes: 49 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,49 +18,53 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
node-version: 16.x
cache: yarn
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

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

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

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

test-docs:
name: "Test Docs"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16.x
cache: yarn
node-version: 18
cache: pnpm

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Lint
run: yarn lint
run: pnpm lint
working-directory: docs

- name: Run Tests
run: yarn test:ember
run: pnpm test:ember
working-directory: docs

floating:
Expand All @@ -69,17 +73,20 @@ jobs:
timeout-minutes: 20

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16.x
cache: yarn
node-version: 18
cache: pnpm

- name: Install Dependencies
run: yarn install --no-lockfile
run: pnpm install --frozen-lockfile

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

try-scenarios:
Expand All @@ -105,18 +112,20 @@ jobs:
- embroider-optimized

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
node-version: 16.x
cache: yarn
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- 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

ember-modifier-scenarios:
Expand All @@ -135,20 +144,22 @@ jobs:
- ember-modifier@4.1

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 16.x
cache: yarn
node-version: 18
cache: pnpm

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

- name: Update ember-modifier version
run: yarn add -D ${{ matrix.ember-modifier-scenario }}
run: pnpm add ${{ matrix.ember-modifier-scenario }}
working-directory: addon

- name: Run Tests
run: yarn test:ember
run: pnpm test:ember
working-directory: test-app
11 changes: 7 additions & 4 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
cache: yarn
- run: yarn install --frozen-lockfile
- run: yarn deploy
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm deploy
working-directory: docs
- run: git push origin

14 changes: 8 additions & 6 deletions .github/workflows/publish-unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
node-version: 16.x
cache: yarn
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: pnpm
# This creates an .npmrc that reads the NODE_AUTH_TOKEN environment variable
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile

# We need a workspace aware version of npm because our addon is in a subdir but our .npmrc is in the root
- name: npm8
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ coverage/
libpeerconnection.log
npm-debug.log*
testem.log
yarn-error.log

# ember-try
.node_modules.ember-try/
bower.json.ember-try
package.json.ember-try
yarn.lock.ember-try
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How To Contribute

This repo is divided into multiple packages using Yarn workspaces:
This repo is divided into multiple packages using workspaces:

- `addon` is the actual `ember-keyboard` addon
- `docs` documentation app for `ember-keyboard` Ember.js addon
Expand All @@ -10,24 +10,24 @@ This repo is divided into multiple packages using Yarn workspaces:

* `git clone https://github.com/adopted-ember-addons/ember-keyboard.git`
* `cd ember-keyboard`
* `yarn install`
* `pnpm install`

## Linting

Inside any of the packages you can run:

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

## Running tests

* `cd addon && yarn start` – Builds the addon in "watch mode" so changes picked up by test app.
* `cd addon && pnpm start` – Builds the addon in "watch mode" so changes picked up by test app.
* `cd test-app && ember test` – Runs the test suite on the current Ember version
* `cd test-app && ember test --server` – Runs the test suite in "watch mode"
* `cd test-app && ember try:each` – Runs the test suite against multiple Ember versions

During development, if you'd like test app to pick up changes in the addon, make sure to run both
`cd addon && yarn start` and `cd test-app && ember test --server` in different terminals.
`cd addon && pnpm start` and `cd test-app && ember test --server` in different terminals.

## Running the test application

Expand Down
1 change: 0 additions & 1 deletion addon/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
1 change: 0 additions & 1 deletion docs/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
2 changes: 0 additions & 2 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try

# broccoli-debug
/DEBUG/
3 changes: 0 additions & 3 deletions docs/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@
/ember-cli-build.js
/testem.js
/tests/
/yarn-error.log
/yarn.lock
.gitkeep

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/yarn.lock.ember-try

# custom
/.codeclimate.yml
Expand Down
1 change: 0 additions & 1 deletion docs/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,3 @@
/npm-shrinkwrap.json.ember-try
/package.json.ember-try
/package-lock.json.ember-try
/yarn.lock.ember-try
8 changes: 4 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ You will need the following things properly installed on your computer.

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org/)
* [Yarn](https://yarnpkg.com/)
* [Pnpm](https://pnpm.io/)
* [Ember CLI](https://cli.emberjs.com/release/)
* [Google Chrome](https://google.com/chrome/)

## Installation

* `git clone https://github.com/adopted-ember-addons/ember-keyboard.git` this repository
* `cd ember-keyboard/docs`
* `yarn install`
* `pnpm install`

## Running / Development

Expand All @@ -36,8 +36,8 @@ Make use of the many generators for code, try `ember help generate` for more det

### Linting

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

### Building

Expand Down
2 changes: 1 addition & 1 deletion docs/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"codemodsSource": "ember-app-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--yarn",
"--pnpm",
"--no-welcome"
]
}
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"build": "ember build --environment=production",
"deploy": "yarn ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\" --destination \"..\"; git push; git checkout -",
"deploy": "pnpm ember github-pages:commit --message \"Deploy gh-pages from commit $(git rev-parse HEAD)\" --destination \"..\"; git push; git checkout -",
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:!(fix)\"",
"lint:fix": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*:fix",
"lint:hbs": "ember-template-lint .",
Expand All @@ -40,7 +40,7 @@
"ember-cli": "~4.3.0",
"ember-cli-babel": "^7.26.11",
"ember-cli-dependency-checker": "^3.3.1",
"ember-cli-fastboot": "^3.3.2",
"ember-cli-fastboot": "^4.0.0",
"ember-cli-github-pages": "0.2.2",
"ember-cli-htmlbars": "^6.1.1",
"ember-cli-inject-live-reload": "^2.1.0",
Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,15 @@
"type": "git",
"url": "https://github.com/adopted-ember-addons/ember-keyboard.git"
},
"workspaces": [
"addon",
"docs",
"test-app"
],
"scripts": {
"prepare": "cd addon && yarn build",
"test": "cd test-app && yarn test"
"prepare": "cd addon && pnpm build",
"test": "cd test-app && pnpm test"
},
"devDependencies": {
"release-plan": "^0.8.0"
},
"volta": {
"node": "16.20.0",
"yarn": "1.22.18"
"node": "18.19.1"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
Expand Down
Loading