Skip to content

Commit 7d2a608

Browse files
committed
build(npm): fix Commitizen ES Module errors
Commitizen is currently generating errors due to ES Module/CommonJS incompatibilities described by the following GitHub issue: conventional-changelog/commitlint#3842 This change implements the temporary workaround described by the issue. Change-Id: Idb74a3366bf046a0c9bac83380de904c5c059087 Signed-off-by: Chris Kay <[email protected]>
1 parent 7944421 commit 7d2a608

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.cz-adapter.cjs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/*
2+
* Copyright (c) 2024, Arm Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: BSD-3-Clause
5+
*/
6+
7+
/*
8+
* A workaround for:
9+
*
10+
* https://github.com/conventional-changelog/commitlint/issues/3949
11+
*/
12+
13+
exports.prompter = async (inquirerIns, commit) => {
14+
; (await import('@commitlint/cz-commitlint')).prompter(inquirerIns, commit)
15+
}

.cz.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"path": "@commitlint/cz-commitlint"
2+
"path": "./.cz-adapter.cjs"
33
}

0 commit comments

Comments
 (0)