Skip to content

Commit

Permalink
Merge pull request #880 from ember-modifier/pnpm
Browse files Browse the repository at this point in the history
Switch from yarn to pnpm
  • Loading branch information
SergeAstapov authored Jul 4, 2024
2 parents 22dc0b7 + 8dda5a2 commit a687e4a
Show file tree
Hide file tree
Showing 16 changed files with 13,902 additions and 14,727 deletions.
39 changes: 25 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Lint
run: yarn lint
run: pnpm lint
- name: Run Tests
run: yarn test
run: pnpm test

floating:
name: "Floating Dependencies"
Expand All @@ -37,14 +40,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm
- name: Install Dependencies
run: yarn install --no-lockfile
run: pnpm install --no-lockfile
- name: Run Tests
run: yarn test
run: pnpm test

try-scenarios:
name: ${{ matrix.try-scenario }}
Expand All @@ -71,12 +77,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
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 }} --skip-cleanup
working-directory: test-app
Expand All @@ -102,17 +111,19 @@ jobs:

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

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

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

- name: Type checking
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
- uses: actions/setup-node@v4
with:
node-version: 18
cache: yarn
cache: pnpm
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- uses: kategengler/[email protected]
with:
branch: dist
Expand Down
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,3 @@ yarn-error.log
/package-lock.json.ember-try
/yarn.lock.ember-try
/pnpm-lock.ember-try.yaml


# https://yarnpkg.com/getting-started/qa/#which-files-should-be-gitignored
.yarn/*
!.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ This repo is divided into multiple packages using Yarn workspaces:

- `git clone https://github.com/ember-modifier/ember-modifier.git`
- `cd ember-modifier`
- `yarn install`
- `pnpm install`

## Linting

Inside any of the packages you can run:

- `yarn lint`
- `yarn lint:fix`
- `pnpm lint`
- `pnpm lint:fix`

## Building the addon

- `cd ember-modifier`
- `yarn build`
- `pnpm build`

## Running tests

- `cd ember-modifier && yarn start` – Builds the addon in "watch mode" so changes picked up by test app.
- `cd ember-modifier && 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 ember-modifier && yarn start` and `cd test-app && ember test --server` in different terminals.
`cd ember-modifier && pnpm start` and `cd test-app && ember test --server` in different terminals.

## Running the test application

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
```

* Second, ensure that you have obtained a
Expand All @@ -50,7 +50,7 @@ Once the prep work is completed, the actual release is straight forward:
* 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
4 changes: 2 additions & 2 deletions config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"isBaseBlueprint": true,
"options": [
"--ci-provider=github",
"--pnpm",
"--release-it",
"--typescript",
"--yarn"
"--typescript"
]
}
]
Expand Down
12 changes: 6 additions & 6 deletions ember-modifier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@
"dist"
],
"scripts": {
"build": "concurrently 'yarn:build:*'",
"build": "concurrently 'pnpm:build:*'",
"build:js": "rollup --config",
"build:types": "glint --declaration",
"lint": "concurrently 'yarn:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'yarn:lint:*:fix' --names 'fix:'",
"lint": "concurrently 'pnpm:lint:*(!fix)' --names 'lint:'",
"lint:fix": "concurrently 'pnpm:lint:*:fix' --names 'fix:'",
"lint:js": "eslint . --cache",
"lint:js:fix": "eslint . --fix",
"lint:types": "glint",
"prepack": "concurrently 'yarn:build:*'",
"start": "concurrently 'yarn:start:*'",
"prepack": "concurrently 'pnpm:build:*'",
"start": "concurrently 'pnpm:start:*'",
"start:js": "rollup --config --watch --no-watch.clearScreen",
"start:types": "glint --declaration --watch",
"test": "echo 'A v2 addon does not have tests, run tests in test-app'"
Expand Down Expand Up @@ -85,7 +85,7 @@
"typescript": "^5.3.3"
},
"peerDependencies": {
"ember-source": "*"
"ember-source": "^3.24 || >=4.0"
},
"peerDependenciesMeta": {
"ember-source": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { capabilities } from '@ember/modifier';
import { dependencySatisfies } from '@embroider/macros';
import type { FunctionBasedModifierDefinition, Teardown } from './modifier';
import type { ArgsFor, ElementFor } from '../signature';

Expand Down Expand Up @@ -34,9 +33,7 @@ function installElement<S>(
}

export default class FunctionBasedModifierManager<S> {
capabilities = capabilities(
dependencySatisfies('ember-source', '>=3.22.0') ? '3.22' : '3.13',
);
capabilities = capabilities('3.22');

createModifier(
instance: FunctionBasedModifierDefinition<S>,
Expand Down
37 changes: 16 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,17 @@
"type": "git",
"url": "https://github.com/ember-modifier/ember-modifier.git"
},
"workspaces": [
"ember-modifier",
"test-app"
],
"scripts": {
"build": "yarn workspace ember-modifier run build",
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"prepare": "yarn build",
"build": "pnpm --filter ember-modifier build",
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"prepare": "pnpm build",
"release": "release-it",
"start": "concurrently 'yarn:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "yarn workspace ember-modifier run start",
"start:test-app": "yarn workspace test-app run start",
"test": "yarn workspaces run test",
"test:ember": "yarn workspace test-app run test:ember"
"start": "concurrently 'pnpm:start:*' --restart-after 5000 --prefix-colors cyan,white,yellow",
"start:addon": "pnpm --filter ember-modifier start --no-watch.clearScreen",
"start:test-app": "pnpm --filter test-app start",
"test": "pnpm --filter '*' test",
"test:ember": "pnpm --filter '*' test:ember"
},
"devDependencies": {
"@release-it-plugins/lerna-changelog": "^5.0.0",
Expand All @@ -27,12 +23,16 @@
"release-it": "^15.10.3"
},
"volta": {
"node": "18.20.3",
"yarn": "1.22.19"
"node": "18.20.3"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
},
"pnpm": {
"overrides": {
"@types/eslint": "^7.0.0"
}
},
"release-it": {
"hooks": {
"before:init": "cp README.md LICENSE.md ember-modifier/"
Expand All @@ -45,12 +45,7 @@
"@release-it-plugins/workspaces": {
"workspaces": [
"ember-modifier"
],
"additionalManifests": {
"dependencyUpdates": [
"test-app/package.json"
]
}
]
}
},
"git": {
Expand Down
Loading

0 comments on commit a687e4a

Please sign in to comment.