From 9b068b4c5ba776b502f06749f7dbdad288db5306 Mon Sep 17 00:00:00 2001 From: fisker Date: Sat, 1 Mar 2025 20:56:41 +0800 Subject: [PATCH 1/2] refactor: move CommonJS entry from `cjs/index.js` to `index.cjs` --- .gitignore | 2 +- eslint.config.js | 2 +- package.cjs.json | 1 - package.json | 8 ++++---- 4 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 package.cjs.json diff --git a/.gitignore b/.gitignore index e4249e1..bc6a0b8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules /.nyc_output -/cjs +/index.cjs /coverage \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index ff706f1..ea8730c 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -14,5 +14,5 @@ export default [ globals: { ...globals.builtin, ...globals.node }, }, }, - { ignores: ['cjs'] }, + { ignores: ['index.cjs'] }, ] diff --git a/package.cjs.json b/package.cjs.json deleted file mode 100644 index a3c15a7..0000000 --- a/package.cjs.json +++ /dev/null @@ -1 +0,0 @@ -{ "type": "commonjs" } diff --git a/package.json b/package.json index 27c1e8f..14d840b 100644 --- a/package.json +++ b/package.json @@ -26,21 +26,21 @@ }, "require": { "types": "./index.d.ts", - "default": "./cjs/index.js" + "default": "./index.cjs" } } }, "types": "index.d.ts", "bin": "cli.js", "files": [ - "cjs", "index.js", "index.d.ts", "cli.js", - "reporter.js" + "reporter.js", + "index.cjs" ], "scripts": { - "build": "esbuild index.js --bundle --platform=node --alias:git-hooks-list=./git-hooks-list_shim.cjs --outfile=./cjs/index.js && ncp package.cjs.json ./cjs/package.json", + "build": "esbuild index.js --bundle --platform=node --alias:git-hooks-list=./git-hooks-list_shim.cjs --outfile=./index.cjs", "fix": "eslint . --fix && prettier . --write && node cli.js \"package.json\"", "lint": "eslint . && prettier . \"!**/*.js\" --check && node cli.js \"package.json\" --check", "prepare": "husky install", From cf291f2f78f16d9dfb441d755331a545ee2ede95 Mon Sep 17 00:00:00 2001 From: fisker Date: Sat, 1 Mar 2025 20:57:46 +0800 Subject: [PATCH 2/2] style: add new line --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index bc6a0b8..f466831 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ node_modules /.nyc_output /index.cjs -/coverage \ No newline at end of file +/coverage