Skip to content

chore: yarn to pnpm #334

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

Merged
merged 8 commits into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
5 changes: 5 additions & 0 deletions .changeset/lazy-walls-reflect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte-eslint-parser": minor
---

Drop Node 12 support
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "yarn install",
"postCreateCommand": "pnpm install",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = {
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-implicit-globals": "off",
"no-void": ["error", { allowAsStatement: true }],
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why suddenly ESLint error occurs but I needed to add this.

},
},
{
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/GHPages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- uses: actions/setup-node@v3
Copy link
Member

Choose a reason for hiding this comment

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

I think pnpm/action-setup is necessary.

Suggested change
- uses: actions/setup-node@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't do this perfectly😇
fixed!
92a644b

- name: Install And Build
run: |+
yarn install
yarn build
pnpm install
pnpm run build
cd explorer-v2
yarn install
yarn pre-build
yarn build
pnpm install
pnpm run pre-build
pnpm run build
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
Expand Down
38 changes: 22 additions & 16 deletions .github/workflows/NodeCI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,77 +11,82 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- name: Install Packages
run: yarn install
run: pnpm install
- name: Lint
run: yarn lint
run: pnpm run lint
- name: Build
run: yarn build
run: pnpm run build
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 17.x, 18.x, 19.x]
node-version: [14.x, 16.x, 17.x, 18.x, 19.x]
Copy link
Member Author

Choose a reason for hiding this comment

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

I dropped Node 12 because pnpm 7 doesn't support it.
Can we do this?

Copy link
Member

Choose a reason for hiding this comment

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

How about creating a test-for-node12 job and using pnpm v6?

  test-for-node12:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: pnpm/action-setup@v2
        with:
          version: 6.35.1

If it still doesn't work, let's drop support for node v12.
Since this package is still at 0.x, I believe it can contain breaking changes in minor versions.

steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install Packages
run: yarn install --ignore-engines
run: pnpm install
- name: Test
run: yarn test
run: pnpm run test
test-for-ts-eslint-v4:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install @typescript-eslint v4
run: |+
yarn add -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7 --ignore-engines
pnpm install -D @typescript-eslint/parser@4 @typescript-eslint/eslint-plugin@4 eslint@7
rm -rf node_modules
- name: Install Packages
run: yarn install --ignore-engines
run: pnpm install
- name: Test
run: yarn test
run: pnpm run test
test-for-eslint-v7:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install eslint v7
run: |+
yarn add -D eslint@7 --ignore-engines
pnpm install -D eslint@7
rm -rf node_modules
- name: Install Packages
run: yarn install --ignore-engines
run: pnpm install
- name: Test
run: yarn test
run: pnpm run test
update-fixtures:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Packages
run: yarn install --ignore-engines
run: pnpm install
- name: Update fixtures
run: yarn update-fixtures
run: pnpm run update-fixtures
- name: Check changes
run: |
git add --all && \
Expand All @@ -90,11 +95,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- name: Install Packages
run: yarn install --ignore-engines
run: pnpm install
- name: Test
run: yarn cover
run: pnpm run cover
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ jobs:
node-version: 16

- name: Install Dependencies
run: yarn
run: pnpm install
Copy link
Member

Choose a reason for hiding this comment

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

I think pnpm/action-setup is necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't do this perfectly😇
fixed!
92a644b


- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
version: yarn version:ci
version: pnpm run version:ci
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
publish: pnpm run release
commit: "chore: release svelte-eslint-parser"
title: "chore: release svelte-eslint-parser"
env:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ dist
.tern-port

# repo
yarn.lock
/pnpm-lock.yaml
/lib
/.nyc_output
/coverage
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
package-lock=false
package-lock=false
enable-pre-post-scripts=true
3 changes: 2 additions & 1 deletion explorer-v2/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"]
}
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"funding": "https://github.com/sponsors/ota-meshi",
"license": "MIT",
"packageManager": "[email protected]",
"packageManager": "[email protected]",
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
Expand All @@ -25,25 +25,24 @@
"parser"
],
"scripts": {
"benchmark": "yarn ts benchmark/index.ts",
"build": "yarn build:meta && yarn build:tsc",
"build:meta": "yarn ts ./tools/update-meta.ts",
"benchmark": "pnpm run ts benchmark/index.ts",
"build": "pnpm run build:meta && pnpm run build:tsc",
"build:meta": "pnpm run ts ./tools/update-meta.ts",
"build:tsc": "tsc --project ./tsconfig.build.json",
"clean": "rimraf .nyc_output lib coverage",
"cover": "nyc --reporter=lcov yarn test",
"debug": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
"eslint-fix": "yarn lint --fix",
"eslint-playground": "eslint tests/fixtures --ext .svelte --config .eslintrc-for-playground.js --format codeframe",
"cover": "nyc --reporter=lcov pnpm run test",
"debug": "pnpm run mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
"eslint-fix": "pnpm run lint --fix",
"lint": "eslint . --ext .js,.ts,.json,.yaml,.yml,.svelte",
"mocha": "yarn ts ./node_modules/mocha/bin/mocha.js",
"prebuild": "yarn clean",
"prerelease": "yarn clean && yarn build",
"preversion": "yarn lint && yarn test",
"mocha": "pnpm run ts ./node_modules/mocha/bin/mocha.js",
"prebuild": "pnpm run clean",
"prerelease": "pnpm run clean && pnpm run build",
"preversion": "pnpm run lint && pnpm run test",
"release": "changeset publish",
"test": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
"test": "pnpm run mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
"ts": "node -r esbuild-register",
"update-fixtures": "yarn ts ./tools/update-fixtures.ts",
"version:ci": "env-cmd -e version-ci yarn build:meta && changeset version"
"update-fixtures": "pnpm run ts ./tools/update-fixtures.ts",
"version:ci": "env-cmd -e version-ci pnpm run build:meta && changeset version"
},
"peerDependencies": {
"svelte": "^3.37.0"
Expand All @@ -61,12 +60,14 @@
"devDependencies": {
"@changesets/changelog-github": "^0.4.6",
"@changesets/cli": "^2.24.2",
"@changesets/get-release-plan": "^3.0.0",
"@ota-meshi/eslint-plugin": "^0.13.0",
"@types/benchmark": "^2.1.1",
"@types/chai": "^4.3.0",
"@types/eslint": "^8.0.0",
"@types/eslint-scope": "^3.7.0",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/estree": "^1.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^18.11.0",
"@types/semver": "^7.3.9",
Expand All @@ -78,7 +79,7 @@
"esbuild": "^0.17.0",
"esbuild-register": "^3.3.3",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-json-schema-validator": "^4.0.0",
"eslint-plugin-jsonc": "^2.0.0",
Expand All @@ -88,17 +89,17 @@
"eslint-plugin-regexp": "^1.5.0",
"eslint-plugin-svelte": "^2.0.0",
"eslint-plugin-svelte3": "^4.0.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-plugin-yml": "^1.0.0",
"estree-walker": "^3.0.0",
"locate-character": "^2.0.5",
"magic-string": "^0.30.0",
"mocha": "^10.0.0",
"mocha-chai-jest-snapshot": "^1.1.3",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"prettier": "^2.8.0",
"prettier-plugin-pkg": "^0.17.0",
"prettier-plugin-svelte": "^2.5.0",
"prettier-plugin-svelte": "^2.10.0",
"rimraf": "^5.0.0",
"semver": "^7.3.5",
"string-replace-loader": "^3.0.3",
"svelte": "^3.57.0",
Expand Down
2 changes: 1 addition & 1 deletion src/meta.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "yarn build:meta"
// in order to update its content execute "pnpm run build:meta"
export const name = "svelte-eslint-parser" as const;
export const version = "0.28.0" as const;
2 changes: 1 addition & 1 deletion tools/update-meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async function main() {
`/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "yarn build:meta"
* in order to update its content execute "pnpm run build:meta"
*/
export const name = ${JSON.stringify(name)} as const;
export const version = ${JSON.stringify(await getVersion())} as const;
Expand Down