-
Notifications
You must be signed in to change notification settings - Fork 4
chore: Upgrade from yarn classic (v1.22) to pnpm v10 #66
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
Changes from 28 commits
9be50a7
ae5450b
c16d4c6
a410946
464f69c
ba467d3
14384e1
a5aaef6
9d865b6
a0e7677
4f874fc
ef35b9d
5940b7d
7b1889d
dd9ce8b
e149125
b9aeec7
93e845f
e2cd9ae
8bcf805
420bb4a
a93972f
d689ce4
1629547
1fdab2a
0920b7b
58f900c
07a23fa
8154080
d542b77
53f93e6
6b99aed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,48 +16,57 @@ jobs: | |
| lint: | ||
| name: Lint | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| VOLTA_FEATURE_PNPM: 1 | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: volta-cli/action@v4 | ||
| - id: pnpm-cache-path | ||
| run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
| - uses: actions/cache@v4 | ||
| id: node-cache | ||
| with: | ||
| path: "**/node_modules" | ||
| key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }} | ||
| path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }} | ||
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| - name: Install Dependencies | ||
| if: steps.node-cache.outputs.cache-hit != 'true' | ||
| run: yarn --frozen-lockfile | ||
| run: pnpm install | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| - name: Lint Addon | ||
| working-directory: addon | ||
| run: yarn run lint | ||
| run: pnpm run lint | ||
| - name: Lint Test App | ||
| working-directory: test-app | ||
| run: yarn run lint | ||
| run: pnpm run lint | ||
| - name: Lint Docs App | ||
| working-directory: docs-app | ||
| run: yarn run lint | ||
| run: pnpm run lint | ||
|
|
||
| test-docs: | ||
| name: Test Docs | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| VOLTA_FEATURE_PNPM: 1 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: volta-cli/action@v4 | ||
| - id: pnpm-cache-path | ||
| run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: "**/node_modules" | ||
| key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }} | ||
| - run: yarn --frozen-lockfile | ||
| path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }} | ||
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| - name: Install Dependencies | ||
| run: pnpm install | ||
| - working-directory: addon | ||
| run: yarn run build | ||
| run: pnpm run build | ||
| - name: Run Tests | ||
| working-directory: docs-app | ||
| run: yarn run test | ||
| run: pnpm run test | ||
|
|
||
| test: | ||
| name: Run Ember Tests | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| VOLTA_FEATURE_PNPM: 1 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
|
|
@@ -74,15 +83,16 @@ jobs: | |
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: volta-cli/action@v4 | ||
| - id: pnpm-cache-path | ||
| run: echo "pnpm_cache_path=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | ||
| - uses: actions/cache@v4 | ||
| with: | ||
| path: "**/node_modules" | ||
| key: ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}-${{ matrix.ember-version }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-ci-yarn-${{ hashFiles('**/yarn.lock') }}- | ||
| - run: yarn --frozen-lockfile | ||
| path: ${{ steps.pnpm-cache-path.outputs.pnpm_cache_path }} | ||
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
| - name: Install Dependencies | ||
| run: pnpm install | ||
| - working-directory: addon | ||
| run: yarn run build | ||
| run: pnpm run build | ||
| - name: Run Tests | ||
| working-directory: test-app | ||
| run: ./node_modules/.bin/ember try:one ${{ matrix.ember-version }} --skip-cleanup | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,51 @@ | ||
| # How To Contribute | ||
|
|
||
| This repo is a monorepo, for additional instructions, refer to the package.json files in the workspaces, | ||
| or refer to the Github Workflow that runs CI. | ||
|
|
||
| ## Installation | ||
|
|
||
| * `git clone <repository-url>` | ||
| * `cd ember-json-viewer` | ||
| * `npm install` | ||
| - `git clone <repository-url>` | ||
| - `cd ember-json-viewer` | ||
| - `pnpm install` | ||
|
|
||
| ## Linting | ||
|
|
||
| * `npm run lint:hbs` | ||
| * `npm run lint:js` | ||
| * `npm run lint:js -- --fix` | ||
| Each workspace has a `lint` run-script. | ||
| You can run them all via: | ||
|
|
||
| ``` | ||
| pnpm --filter '*' lint | ||
| ``` | ||
|
|
||
| ## Running tests | ||
|
|
||
| * `ember test` – Runs the test suite on the current Ember version | ||
| * `ember test --server` – Runs the test suite in "watch mode" | ||
| * `ember try:each` – Runs the test suite against multiple Ember versions | ||
| In one terminal, start the addon build: | ||
|
|
||
| ``` | ||
| cd addon/ && pnpm start | ||
| ``` | ||
|
|
||
| In another terminal, start the test-app build: | ||
|
|
||
| ``` | ||
| cd test-app/ && pnpm start | ||
| ``` | ||
|
|
||
| Visit the tests in the browser at localhost:4200/tests. | ||
|
|
||
| Alternatively, run tests via CLI with: `cd test-app/ && pnpm test` | ||
|
|
||
| ## Running the docs application | ||
|
|
||
| Start the addon build in another terminal window: | ||
|
|
||
| ## Running the dummy application | ||
| ``` | ||
| cd addon/ && pnpm start | ||
| ``` | ||
|
|
||
| * `ember serve` | ||
| * Visit the dummy application at [http://localhost:4200](http://localhost:4200). | ||
| Then start the docs app: | ||
|
|
||
| For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). | ||
| ``` | ||
| cd docs-app/ && pnpm start | ||
| ``` |
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| /** | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to upgrade eslint 8 to 9 for the addon/ dir, copied with minor changes from test-app's eslint config |
||
| * Debugging: | ||
| * https://eslint.org/docs/latest/use/configure/debug | ||
| * ---------------------------------------------------- | ||
| * | ||
| * Print a file's calculated configuration | ||
| * | ||
| * npx eslint --print-config path/to/file.js | ||
| * | ||
| * Inspecting the config | ||
| * | ||
| * npx eslint --inspect-config | ||
| * | ||
| */ | ||
| import globals from "globals"; | ||
| import js from "@eslint/js"; | ||
|
|
||
| import ember from "eslint-plugin-ember/recommended"; | ||
| import prettier from "eslint-plugin-prettier/recommended"; | ||
| import n from "eslint-plugin-n"; | ||
|
|
||
| import babelParser from "@babel/eslint-parser"; | ||
|
|
||
| const esmParserOptions = { | ||
| ecmaFeatures: { modules: true }, | ||
| ecmaVersion: "latest", | ||
| requireConfigFile: false, | ||
| babelOptions: { | ||
| plugins: [ | ||
| ["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }], | ||
| ], | ||
| }, | ||
| }; | ||
|
|
||
| export default [ | ||
| js.configs.recommended, | ||
| prettier, | ||
| ember.configs.base, | ||
| ember.configs.gjs, | ||
| /** | ||
| * Ignores must be in their own object | ||
| * https://eslint.org/docs/latest/use/configure/ignore | ||
| */ | ||
| { | ||
| ignores: ["dist/", "node_modules/", "coverage/", "!**/.*"], | ||
| }, | ||
| /** | ||
| * https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options | ||
| */ | ||
| { | ||
| linterOptions: { | ||
| reportUnusedDisableDirectives: "error", | ||
| }, | ||
| }, | ||
| { | ||
| files: ["**/*.js"], | ||
| languageOptions: { | ||
| parser: babelParser, | ||
| }, | ||
| }, | ||
| { | ||
| files: ["**/*.{js,gjs}"], | ||
| languageOptions: { | ||
| parserOptions: esmParserOptions, | ||
| globals: { | ||
| ...globals.browser, | ||
| }, | ||
| }, | ||
| }, | ||
| /** | ||
| * CJS node files | ||
| */ | ||
| { | ||
| files: [ | ||
| "**/*.cjs", | ||
| "config/**/*.js", | ||
| "testem.js", | ||
| "testem*.js", | ||
| ".prettierrc.js", | ||
| ".stylelintrc.js", | ||
| ".template-lintrc.js", | ||
| "ember-cli-build.js", | ||
| "addon-main.js", | ||
| ], | ||
| plugins: { | ||
| n, | ||
| }, | ||
|
|
||
| languageOptions: { | ||
| sourceType: "script", | ||
| ecmaVersion: "latest", | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| }, | ||
| /** | ||
| * ESM node files | ||
| */ | ||
| { | ||
| files: ["**/*.mjs"], | ||
| plugins: { | ||
| n, | ||
| }, | ||
|
|
||
| languageOptions: { | ||
| sourceType: "module", | ||
| ecmaVersion: "latest", | ||
| parserOptions: esmParserOptions, | ||
| globals: { | ||
| ...globals.node, | ||
| }, | ||
| }, | ||
| }, | ||
| ]; | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets up node, using the node version from package.json#volta.node