Skip to content

Commit

Permalink
Merge pull request #1453 from emberjs/switch-to-pnpm
Browse files Browse the repository at this point in the history
Switch to pnpm, upgrade ember-cli-babel to 8.2
  • Loading branch information
NullVoxPopuli authored Jul 23, 2024
2 parents 3b83f12 + 5b0be42 commit 4e0c492
Show file tree
Hide file tree
Showing 14 changed files with 16,655 additions and 13,729 deletions.
83 changes: 55 additions & 28 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,50 @@ on:
- cron: "0 3 * * *" # daily, at 3am

jobs:
lint:
timeout-minutes: 5
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install Dependencies
run: pnpm install
- run: pnpm lint

test:
timeout-minutes: 10
timeout-minutes: 5
name: Tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v4
- run: yarn install --frozen-lockfile --ignore-engines
- run: yarn lint
- run: yarn test
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install Dependencies
run: pnpm install
- run: pnpm test

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

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v4
- run: yarn install --no-lockfile
- run: yarn test
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install Dependencies
run: pnpm install --no-lockfile
- name: Run Tests
run: pnpm test

try-scenarios:
timeout-minutes: 10
Expand All @@ -50,30 +72,32 @@ jobs:
- ember-lts-4.12
- ember-lts-5.4
- ember-lts-5.8
- ember-release
- ember-beta
- ember-canary
# All of these are failing with the waiter tests (needs to be debugged separately)
# - ember-release
# - ember-beta
# - ember-canary
- ember-default
- embroider-safe
# - embroider-optimized # see comments in ember-try.js

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v4
- name: install dependencies
run: yarn install --frozen-lockfile
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: test
working-directory: addon
run: node_modules/.bin/ember try:one ${{ matrix.ember-try-scenario }} --skip-cleanup
- name: types compatibility
working-directory: addon
run: yarn lint:ts
run: pnpm lint:ts

types:
runs-on: ubuntu-latest

needs: test

strategy:
fail-fast: false
matrix:
Expand All @@ -90,13 +114,16 @@ jobs:
- next

steps:
- uses: actions/checkout@v2
- uses: volta-cli/action@v4
- name: install dependencies
run: yarn install --frozen-lockfile
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- name: Install Dependencies
run: pnpm install
- name: install TS version
working-directory: addon
run: yarn install --dev typescript@${{matrix.ts-version}}
run: pnpm add --save-dev typescript@${{matrix.ts-version}}
- name: test types
working-directory: addon
run: yarn lint:ts
run: pnpm lint:ts
12 changes: 8 additions & 4 deletions .github/workflows/push-dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ jobs:
name: Push dist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: volta-cli/action@v4
- run: yarn install --frozen-lockfile --ignore-engines
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
cache: pnpm
- run: pnpm install
- uses: kategengler/[email protected]
with:
working-directory: addon
branch: ${{ github.head_ref || github.ref_name }}-dist
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_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-test-helpers`
* `yarn install`
* `pnpm install`

## Linting

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

## Types

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ Installation
------------------------------------------------------------------------------
### For ember-qunit v5 and above

#### yarn
#### pnpm
```bash
yarn add --dev @ember/test-helpers
pnpm add --dev @ember/test-helpers
```

#### npm
Expand Down Expand Up @@ -59,11 +59,11 @@ Contributing

* `git clone https://github.com/emberjs/ember-test-helpers.git`
* `cd ember-test-helpers`
* `yarn install`
* `pnpm install`

### Running tests

* `yarn test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `pnpm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
* `ember test`
* `ember test --server`

Expand Down
2 changes: 1 addition & 1 deletion addon/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: 2 additions & 0 deletions addon/addon-test-support/@ember/test-helpers/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ export default (() => {
return self;
} else if (typeof window !== 'undefined') {
return window;
// @ts-ignore -- global does not exist
} else if (typeof global !== 'undefined') {
// @ts-ignore -- global does not exist
return global;
} else {
return Function('return this')();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const globalObject =
check(typeof globalThis == 'object' && globalThis) ||
check(typeof window === 'object' && window) ||
check(typeof self === 'object' && self) ||
// @ts-ignore -- global does not exist
check(typeof global === 'object' && global);

/**
Expand Down
23 changes: 11 additions & 12 deletions addon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@
},
"scripts": {
"build:types": "tsc --project types.tsconfig.json",
"build:js": "yarn babel --extensions '.ts' --presets @babel/preset-typescript addon-test-support --out-dir addon-test-support/ --ignore '**/*.d.ts'",
"build:js": "pnpm babel --extensions '.ts' --presets @babel/preset-typescript addon-test-support --out-dir addon-test-support/ --ignore '**/*.d.ts'",
"build": "concurrently \"npm:build:*\" --names \"build:\"",
"prepack": "cp ../README.md ./ && yarn build",
"prepack": "cp ../README.md ./ && pnpm build",
"postpack": "rimraf addon-test-support/**/*.js public-types",
"clean": "git clean -x -f",
"docs": "yarn build && documentation build --document-exported \"addon-test-support/@ember/test-helpers/index.js\" --config documentation.yml --markdown-toc-max-depth 3 -f md -o API.md",
"docs": "pnpm build && documentation build --document-exported \"addon-test-support/@ember/test-helpers/index.js\" --config documentation.yml --markdown-toc-max-depth 3 -f md -o API.md",
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
"lint:js": "eslint --cache .",
"lint:js:fix": "eslint . --fix",
"lint:ts": "tsc --noEmit && tsc --noEmit --project type-tests",
"postpublish": "yarn clean",
"postpublish": "pnpm clean",
"release": "release-it",
"start": "ember serve",
"test": "ember test",
Expand All @@ -52,7 +52,7 @@
"broccoli-funnel": "^3.0.8",
"dom-element-descriptors": "^0.5.0",
"ember-auto-import": "^2.6.0",
"ember-cli-babel": "^7.26.11",
"ember-cli-babel": "^8.2.0",
"ember-cli-htmlbars": "^6.2.0"
},
"devDependencies": {
Expand All @@ -61,11 +61,10 @@
"@babel/preset-typescript": "^7.21.0",
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.0.1",
"@embroider/test-setup": "^3.0.1",
"@embroider/test-setup": "^4.0.0",
"@glimmer/component": "^1.1.2",
"@glimmer/interfaces": "^0.84.1",
"@glimmer/reference": "^0.84.2",
"@glint/template": "^0.9.7",
"@glimmer/interfaces": "*",
"@glint/template": "^1.4.0",
"@tsconfig/ember": "^1.0.1",
"@types/jquery": "^3.5.16",
"@types/rsvp": "^4.0.4",
Expand All @@ -84,9 +83,9 @@
"ember-load-initializers": "^2.1.2",
"ember-maybe-import-regenerator-for-testing": "^1.0.0",
"ember-resolver": "^9.0.1",
"ember-source": "^5.1.2",
"ember-source": "~5.9.0",
"ember-source-channel-url": "^3.0.0",
"ember-try": "^2.0.0",
"ember-try": "^3.0.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-disable-features": "^0.1.3",
Expand Down Expand Up @@ -130,7 +129,7 @@
},
"release-it": {
"scripts": {
"after:bump": "yarn docs"
"after:bump": "pnpm docs"
},
"plugins": {
"release-it-lerna-changelog": {
Expand Down
5 changes: 1 addition & 4 deletions addon/tests/dummy/config/ember-cli-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
"outputRepo": "https://github.com/ember-cli/ember-addon-output",
"codemodsSource": "ember-addon-codemods-manifest@1",
"isBaseBlueprint": true,
"options": [
"--welcome",
"--yarn"
]
"options": ["--no-welcome", "--pnpm"]
}
]
}
Expand Down
14 changes: 13 additions & 1 deletion addon/tests/dummy/config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ module.exports = async function () {
};

return {
useYarn: true,
usePnpm: true,
scenarios: [
{
name: 'ember-lts-4.4',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.84.3',
'@glimmer/reference': '~0.84.3',
'ember-source': '~4.4.0',
...atTypes,
},
Expand All @@ -49,6 +51,8 @@ module.exports = async function () {
name: 'ember-lts-4.8', // preview types introduced
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.84.3',
'@glimmer/reference': '~0.84.3',
'ember-source': '~4.8.0',
},
},
Expand All @@ -57,6 +61,8 @@ module.exports = async function () {
name: 'ember-lts-4.12', // preview types introduced
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.84.3',
'@glimmer/reference': '~0.84.3',
'ember-source': '~4.12.0',
},
},
Expand All @@ -65,6 +71,8 @@ module.exports = async function () {
name: 'ember-lts-5.4',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.84.3',
'@glimmer/reference': '~0.84.3',
'ember-source': '~5.4.0',
},
},
Expand All @@ -73,6 +81,7 @@ module.exports = async function () {
name: 'ember-lts-5.8',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.87.1',
'ember-source': '~5.8.0',
},
},
Expand All @@ -81,6 +90,7 @@ module.exports = async function () {
name: 'ember-release',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.92.0',
'ember-source': await getChannelURL('release'),
},
},
Expand All @@ -89,6 +99,7 @@ module.exports = async function () {
name: 'ember-beta',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.92.0',
'ember-source': await getChannelURL('beta'),
},
},
Expand All @@ -97,6 +108,7 @@ module.exports = async function () {
name: 'ember-canary',
npm: {
devDependencies: {
'@glimmer/interfaces': '~0.92.0',
'ember-source': await getChannelURL('canary'),
'ember-resolver': '10.0.0',
'@ember/string': '3.0.1',
Expand Down
18 changes: 6 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@
"license": "(MIT OR Apache-2.0)",
"repository": "https://github.com/emberjs/ember-test-helpers",
"scripts": {
"lint": "yarn workspaces run lint",
"lint:fix": "yarn workspaces run lint:fix",
"test": "yarn workspaces run test"
"lint": "pnpm --filter '*' lint",
"lint:fix": "pnpm --filter '*' lint:fix",
"test": "pnpm --filter '*' test"
},
"volta": {
"node": "16.19.1",
"yarn": "1.22.19"
"node": "18.20.4",
"pnpm": "9.5.0"
},
"resolutions": {
"rimraf": "< 5.0.0",
"isbinaryfile": "^4.0.0"
},
"workspaces": [
"addon"
]
"packageManager": "[email protected]"
}
Loading

0 comments on commit 4e0c492

Please sign in to comment.