Skip to content

Commit 8451201

Browse files
authored
chore: enable pnpm shellEmulator (#1438)
* chore: enable pnpm shellEmulator This fixes `pnpm build` on Windows. Otherwise, the string escapes in the `build` script are misinterpreted. After enabling `shellEmulator`, husky needed to be moved off npm. * fix: test-index should use parseArgs instead
1 parent da66683 commit 8451201

File tree

13 files changed

+60
-63
lines changed

13 files changed

+60
-63
lines changed

.husky/post-checkout

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npx run-if-changed
1+
run-if-changed

.husky/post-commit

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npx run-if-changed
1+
run-if-changed

.husky/post-merge

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npx run-if-changed
1+
run-if-changed

.husky/post-rewrite

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npx run-if-changed
1+
run-if-changed

.husky/pre-commit

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npx lint-staged
1+
lint-staged

.husky/pre-push

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
npm test && npm run build && npm run check-docs
1+
pnpm test && pnpm run build && pnpm run check-docs

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ can be ignored by being preceded by `/* c8 ignore next */` (including
6868
for warnings where the block is never passed over (i.e., the block is always
6969
entered)). If you want to test without coverage at all, you can use
7070
`pnpm test-no-cov`. To only test rules rather than other files, you
71-
can use `npm run test-index` (`pnpm` doesn't work with this script currently).
71+
can use `pnpm run test-index`.
7272

7373
To test specific rules, you can supply a comma-separated list with the `--rule`
7474
flag passed to `test-index`, e.g., for `check-examples` and `require-example`:
7575

76-
`npm run test-index --rule=check-examples,require-example`.
76+
`pnpm run test-index --rule=check-examples,require-example`.
7777

7878
You can further limit this by providing `--invalid` and/or `--valid` flags
7979
with a comma-separated list of 0-based indexes that you wish to include (also
8080
accepts negative offsets from the end, e.g., `-1` for the last item). For
8181
example, to check the first and third invalid tests of `check-examples`
8282
along with the second valid test, you can run:
8383

84-
`npm run test-index --rule=require-example --invalid=0,2 --valid=1`.
84+
`pnpm run test-index --rule=require-example --invalid=0,2 --valid=1`.
8585

8686
## Requirements for PRs
8787

package.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"c8": "^10.1.3",
5151
"camelcase": "^8.0.0",
5252
"chai": "^5.2.0",
53-
"cross-env": "^7.0.3",
5453
"decamelize": "^6.0.0",
5554
"eslint": "9.29.0",
5655
"eslint-config-canonical": "~44.9.5",
@@ -80,11 +79,7 @@
8079
],
8180
"license": "BSD-3-Clause",
8281
"lint-staged": {
83-
".eslintignore": [
84-
"npm run lint-fix",
85-
"git add ."
86-
],
87-
"*.js": "npm run lint-arg -- --fix"
82+
"*.js": "eslint --fix"
8883
},
8984
"type": "module",
9085
"main": "./dist/index.cjs",
@@ -140,25 +135,24 @@
140135
"url": "https://github.com/gajus/eslint-plugin-jsdoc/issues"
141136
},
142137
"run-if-changed": {
143-
"package-lock.json": "npm run install-offline"
138+
"package-lock.json": "pnpm run install-offline"
144139
},
145140
"scripts": {
146141
"tsc": "tsc",
147142
"tsc-build": "tsc -p tsconfig-prod.json",
148-
"build": "rimraf ./dist && cross-env NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build",
143+
"build": "rimraf ./dist && NODE_ENV=production babel ./src --out-file-extension .cjs --out-dir ./dist --copy-files --source-maps --ignore ./src/bin/*.js --no-copy-ignored && replace 'require\\(\"\\.(.*?)\\.[^.]*?\"\\)' 'require(\".$1.cjs\")' 'dist' -r --include=\"*.cjs\" && pnpm tsc-build",
149144
"check-docs": "babel-node ./src/bin/generateDocs.js --check",
150-
"create-docs": "npm run create-options && babel-node ./src/bin/generateDocs.js",
145+
"create-docs": "pnpm run create-options && babel-node ./src/bin/generateDocs.js",
151146
"create-rule": "babel-node ./src/bin/generateRule.js",
152147
"create-options": "node ./src/bin/generateOptions.mjs",
153148
"install-offline": "pnpm install --prefer-offline --no-audit",
154-
"lint": "npm run lint-arg -- .",
155-
"lint-arg": "eslint",
156-
"lint-fix": "npm run lint-arg -- --fix .",
149+
"lint": "eslint",
150+
"lint-fix": "eslint --fix",
157151
"prepare": "husky",
158-
"test-no-cov": "cross-env BABEL_ENV=test mocha",
159-
"test": "c8 npm run test-no-cov",
160-
"test-cov": "cross-env TIMING=1 c8 --reporter text npm run test-no-cov",
161-
"test-index": "npm run test-no-cov -- test/rules/index.js"
152+
"test-no-cov": "BABEL_ENV=test mocha",
153+
"test": "c8 pnpm run test-no-cov",
154+
"test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
155+
"test-index": "pnpm run test-no-cov test/rules/index.js"
162156
},
163157
"version": "1.0.0"
164158
}

pnpm-lock.yaml

Lines changed: 1 addition & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
ignoredBuiltDependencies:
22
- core-js
33
- core-js-pure
4+
5+
shellEmulator: true

0 commit comments

Comments
 (0)