From 9cea6fdb7b1bf7cfc9a86e882e2742379b4b6aec Mon Sep 17 00:00:00 2001 From: Jiahao Guo Date: Mon, 11 Mar 2024 12:40:43 +0800 Subject: [PATCH] fix: add missing cjs entry in package (#3967) --- @commitlint/cz-commitlint/index.cjs | 4 ++++ @commitlint/cz-commitlint/package.json | 3 ++- @commitlint/cz-commitlint/src/index.cjs | 4 ---- 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 @commitlint/cz-commitlint/index.cjs delete mode 100644 @commitlint/cz-commitlint/src/index.cjs diff --git a/@commitlint/cz-commitlint/index.cjs b/@commitlint/cz-commitlint/index.cjs new file mode 100644 index 0000000000..df13ed9c83 --- /dev/null +++ b/@commitlint/cz-commitlint/index.cjs @@ -0,0 +1,4 @@ +/** @type {Awaited['prompter']} */ +exports.prompter = async (...args) => { + (await import('./lib/index.js')).prompter(...args); +}; diff --git a/@commitlint/cz-commitlint/package.json b/@commitlint/cz-commitlint/package.json index 72b9396d8d..b8d74a5da8 100644 --- a/@commitlint/cz-commitlint/package.json +++ b/@commitlint/cz-commitlint/package.json @@ -6,9 +6,10 @@ "main": "./lib/index.js", "exports": { "import": "./lib/index.js", - "require": "./lib/index.cjs" + "require": "./index.cjs" }, "files": [ + "index.cjs", "lib" ], "keywords": [ diff --git a/@commitlint/cz-commitlint/src/index.cjs b/@commitlint/cz-commitlint/src/index.cjs deleted file mode 100644 index d5e416c9c0..0000000000 --- a/@commitlint/cz-commitlint/src/index.cjs +++ /dev/null @@ -1,4 +0,0 @@ -/** @type {Awaited['prompter']} */ -exports.prompter = async (...args) => { - (await import('./index.js')).prompter(...args); -};