Skip to content

Commit 8e80aa0

Browse files
committed
feat: rewrite package to ESM
- Convert source from CJS (export =, import = require) to ESM imports/exports - Inline is-windows and graceful-fs (trivial for Node >=22.13) - Replace util.promisify wrapping with direct fs.promises usage - Update tsconfig to module/moduleResolution "nodenext" - Add "type": "module" and "exports" field to package.json - Convert test files to ESM imports - Remove unused dependencies (graceful-fs, is-windows, cmd-extension, standard, mos)
1 parent 05e5558 commit 8e80aa0

8 files changed

Lines changed: 150 additions & 4278 deletions

File tree

package.json

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
"name": "@zkochan/cmd-shim",
33
"version": "8.0.1",
44
"description": "Used in pnpm for command line application support",
5+
"type": "module",
56
"author": {
67
"name": "Zoltan Kochan",
78
"email": "zoltan.kochan@gmail.com",
89
"url": "http://kochan.io"
910
},
11+
"exports": {
12+
".": "./index.js"
13+
},
1014
"scripts": {
1115
"clean": "tsc --build --clean",
1216
"build": "tsc --build --verbose --listEmittedFiles",
1317
"pretest:unit": "tsc --build test --verbose --listEmittedFiles",
14-
"test:unit": "jest",
15-
"test": "pnpm run build && standard && pnpm run test:unit && mos test",
16-
"md": "mos",
18+
"test:unit": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
19+
"test": "pnpm run build && pnpm run test:unit",
1720
"prepublishOnly": "pnpm run build"
1821
},
1922
"files": [
@@ -28,38 +31,22 @@
2831
},
2932
"license": "BSD-2-Clause",
3033
"dependencies": {
31-
"cmd-extension": "^1.0.2",
32-
"graceful-fs": "^4.2.11",
33-
"is-windows": "^1.0.2"
34+
"cmd-extension": "^1.0.2"
3435
},
3536
"devDependencies": {
36-
"@types/is-windows": "^1.0.2",
3737
"@types/jest": "^29.5.14",
3838
"@types/node": "^18.19.87",
3939
"jest": "^29.7.0",
4040
"memfs": "^3.5.3",
41-
"mock-fs": "^5.5.0",
42-
"mos": "^1.3.1",
43-
"mos-plugin-readme": "^1.0.4",
44-
"standard": "^14.3.4",
4541
"tempy": "^1.0.1",
4642
"typescript": "^4.9.5"
4743
},
4844
"engines": {
4945
"node": ">=22.13"
5046
},
51-
"mos": {
52-
"plugins": [
53-
"readme"
54-
]
55-
},
56-
"standard": {
57-
"env": {
58-
"jest": true
59-
}
60-
},
6147
"jest": {
62-
"testEnvironment": "node"
48+
"testEnvironment": "node",
49+
"transform": {}
6350
},
6451
"packageManager": "pnpm@11.0.0-beta.2"
6552
}

0 commit comments

Comments
 (0)