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

build: migrate to yarn v4 #671

Open
wants to merge 1 commit into
base: main
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
54 changes: 20 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
- name: Locate Yarn Cache
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18
cache: yarn
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: yarn --immutable
- name: Lint
run: yarn lint
- name: Build
Expand All @@ -56,17 +48,18 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: yarn
- name: Install Dependencies
uses: nick-fields/retry@v2
with:
max_attempts: 2
timeout_minutes: 10
command: yarn install --frozen-lockfile
command: yarn --immutable
- name: Build
run: yarn build
- name: Test @glint/core
Expand All @@ -89,13 +82,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 18
cache: yarn
- name: Install Dependencies
run: yarn install --no-lockfile
run: yarn --no-immutable
- name: Build
run: yarn build
- name: Run Tests
Expand All @@ -108,22 +102,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Locate Yarn Cache
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
uses: actions/setup-node@v4
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18
cache: yarn
- name: Install Dependencies
run: yarn add --dev -W typescript@next
run: yarn add --dev typescript@next
- name: Build
run: yarn build
- name: Run Tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ test-packages/ephemeral
.eslintcache
*.tsbuildinfo
*.js.map
/.yarn/*
!/.yarn/releases
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs
Copy link
Contributor

Choose a reason for hiding this comment

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

does this file need to be checked in? wouldn't it come from an npm package?

Copy link
Author

Choose a reason for hiding this comment

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

It can be enabled via corepack, but the usage is a bit strict. The current approach is much flexible.

See also #671 (comment)

wouldn't it come from an npm package?

It's not in npm.

image

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
Copy link
Author

Choose a reason for hiding this comment

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

Not using corepack because it does not work quite well with Windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently there is some aversion to corepack as well

nodejs/node#50963 (comment)

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"lint": "yarn lint:scripts && yarn lint:formatting",
"lint:scripts": "yarn eslint --max-warnings 0 --cache .",
"lint:formatting": "yarn prettier --check .",
"test": "yarn workspaces run test",
"test": "yarn workspaces foreach -Ap --topological-dev run test",
"build": "tsc --build",
"release-it": "echo \"Running release-it via yarn breaks publishing! Use npx or a Volta global installation.\""
},
"volta": {
"node": "16.17.1",
"yarn": "1.22.4"
"node": "18.18.0",
"yarn": "1.22.21"
},
"devDependencies": {
"@release-it-plugins/lerna-changelog": "^5.0.0",
Expand All @@ -39,5 +39,6 @@
"@types/node": "^20.10.6",
"ember-cli-htmlbars": "^6.0.1"
},
"version": "1.2.2"
"version": "1.2.2",
"packageManager": "yarn@4.0.2"
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"yargs": "^17.5.1"
},
"devDependencies": {
"glint-monorepo-test-utils": "^1.2.2",
"@types/common-tags": "^1.8.0",
"@types/node": "^18.11.5",
"@types/semver": "^7.3.13",
Expand All @@ -52,6 +51,7 @@
"@vitest/ui": "^0.23.4",
"common-tags": "^1.8.0",
"execa": "^4.0.1",
"glint-monorepo-test-utils": "workspace:*",
"strip-ansi": "^6.0.0",
"vitest": "^0.22.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/environment-ember-loose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
},
"devDependencies": {
"@glimmer/component": "^1.1.2",
"@glint/core": "workspace:*",
"@glint/template": "workspace:*",
"@types/ember__array": "^4.0.2",
"@types/ember__component": "^4.0.10",
"@types/ember__controller": "^4.0.2",
Expand Down
8 changes: 5 additions & 3 deletions packages/environment-glimmerx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
"component/**/*.{js,d.ts}"
],
"peerDependencies": {
"@glint/template": "^1.2.2",
"@glimmerx/component": "^0.6.7",
"@glimmerx/helper": "^0.6.7",
"@glimmerx/modifier": "^0.6.7",
"@glimmerx/helper": "^0.6.7"
"@glint/template": "^1.2.2"
},
"peerDependenciesMeta": {
"@glimmerx/component": {
Expand All @@ -48,8 +48,10 @@
},
"devDependencies": {
"@glimmerx/component": "^0.6.7",
"@glimmerx/modifier": "^0.6.7",
"@glimmerx/helper": "^0.6.7",
"@glimmerx/modifier": "^0.6.7",
"@glint/core": "workspace:*",
"@glint/template": "workspace:*",
"expect-type": "^0.15.0"
},
"publishConfig": {
Expand Down
5 changes: 4 additions & 1 deletion packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@
"prepack": "yarn build"
},
"dependencies": {
"golden-fleece": "^1.0.9",
"glob": "^7.2.0",
"golden-fleece": "^1.0.9",
"js-yaml": "^4.1.0",
"ora": "^6.1.2",
"true-myth": "^6.1.0",
"yargs": "^17.5.1",
"zod": "^3.22.3"
},
"devDependencies": {
"@glint/core": "workspace:*",
"@types/glob": "^8.1.0",
"@types/js-yaml": "^4.0.5",
"@types/node": "^18.11.5",
"@types/yargs": "^17.0.10",
"json5": "^2.2.2",
"vitest": "^0.22.0"
Expand Down
1 change: 1 addition & 0 deletions packages/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@glimmer/component": "^1.1.2",
"@glimmerx/component": "^0.6.7",
"@types/ember__component": "~4.0.8",
"@types/ember__template": "^4.0.5",
"expect-type": "^0.15.0",
"sums-up": "^2.1.0"
},
Expand Down
4 changes: 4 additions & 0 deletions packages/type-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
"peerDependencies": {
"@glint/template": "^1.2.2"
},
"devDependencies": {
"@glint/environment-ember-loose": "workspace:*",
"@glint/template": "workspace:*"
},
"publishConfig": {
"access": "public"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ export default class Greeting extends Component<GreetingSignature> {
private message = 'Hello';

<template>
{{this.message}}, {{@target}}!
{{@undocumentedProperty}} {{this.message}}, {{@target}}!
Copy link
Contributor

Choose a reason for hiding this comment

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

why this addition?

Copy link
Author

Choose a reason for hiding this comment

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

I don't know, I just run yarn test

</template>
}
9 changes: 4 additions & 5 deletions packages/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"Linters"
],
"scripts": {
"pretest": "yarn build",
"test": "node lib/__tests__/support/launch-from-cli.mjs",
"test": "yarn build && node lib/__tests__/support/launch-from-cli.mjs",
"build": "yarn compile && yarn bundle",
"compile": "tsc --build",
"bundle": "esbuild lib/src/extension.js --bundle --outfile=dist/extension.js --platform=node --external:vscode --minify",
Expand Down Expand Up @@ -104,15 +103,15 @@
"@vscode/test-electron": "Dropped support for Node < 16 in the 2.2.1 patch release, so locking to 2.2.0 while we still support Node 14."
},
"devDependencies": {
"@glint/core": "^1.2.2",
"@glint/core": "workspace:*",
"@types/mocha": "^10.0.1",
"@types/vscode": "^1.68.1",
"@vscode/test-electron": "^2.3.8",
"@vscode/vsce": "^2.22.0",
"esbuild": "^0.15.16",
"expect": "^29.5.0",
"mocha": "^10.2.0",
"glob": "^10.2.4"
"glob": "^10.2.4",
"mocha": "^10.2.0"
},
"volta": {
"extends": "../../package.json"
Expand Down
6 changes: 3 additions & 3 deletions test-packages/js-glimmerx-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
"scripts": {
"build": "NODE_ENV=production webpack",
"start": "webpack-dev-server",
"test": "true # TODO: we'll make this do type-checking soon!"
"test": "echo \"TODO: we'll make this do type-checking soon!\""
},
"devDependencies": {
"@babel/core": "^7.9.0",
"@babel/preset-env": "^7.9.0",
"@glimmerx/babel-preset": "^0.6.7",
"@glimmer/babel-plugin-glimmer-env": "~2.0.0-beta.12",
"@glimmer/env": "^0.1.7",
"@glimmer/syntax": "^0.84.2",
"@glimmerx/babel-preset": "^0.6.7",
"@glimmerx/component": "^0.6.7",
"@glimmerx/core": "^0.6.7",
"@glimmerx/eslint-plugin": "^0.6.7",
"@glimmerx/helper": "^0.6.7",
"@glimmerx/modifier": "^0.6.7",
"@glint/core": "^1.2.2",
"@glint/core": "workspace:*",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^5.1.1",
Expand Down
4 changes: 2 additions & 2 deletions test-packages/test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dependencies": {
"execa": "^7.1.1"
},
"scripts": {
"test": "true"
"devDependencies": {
"@glint/core": "workspace:*"
}
}
4 changes: 2 additions & 2 deletions test-packages/ts-ember-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@ember/test-helpers": "^2.9.1",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
"@glint/core": "^1.2.2",
"@glint/environment-ember-loose": "^1.2.2",
"@glint/core": "workspace:*",
"@glint/environment-ember-loose": "workspace:*",
"@types/ember": "~4.0.0",
"@types/qunit": "^2.11.1",
"broccoli-asset-rev": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test-packages/ts-glimmerx-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"@glimmerx/helper": "^0.6.7",
"@glimmerx/modifier": "^0.6.7",
"@glimmerx/service": "^0.6.7",
"@glint/core": "^1.2.2",
"@glint/environment-glimmerx": "^1.2.2",
"@glint/core": "workspace:*",
"@glint/environment-glimmerx": "workspace:*",
"@types/qunit": "^2.9.1",
"babel-loader": "^8.1.0",
"clean-webpack-plugin": "^3.0.0",
Expand Down
3 changes: 3 additions & 0 deletions test-packages/ts-template-imports-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
},
"volta": {
"extends": "../../package.json"
},
"devDependencies": {
"@glint/environment-ember-loose": "workspace:*"
}
}
Loading
Loading