Skip to content

Commit

Permalink
build(npm): fix Commitizen ES Module errors
Browse files Browse the repository at this point in the history
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 <chris.kay@arm.com>
  • Loading branch information
CJKay committed Mar 7, 2024
1 parent 7944421 commit 7d2a608
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .cz-adapter.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/

/*
* A workaround for:
*
* https://github.com/conventional-changelog/commitlint/issues/3949
*/

exports.prompter = async (inquirerIns, commit) => {
; (await import('@commitlint/cz-commitlint')).prompter(inquirerIns, commit)
}
2 changes: 1 addition & 1 deletion .cz.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"path": "@commitlint/cz-commitlint"
"path": "./.cz-adapter.cjs"
}

0 comments on commit 7d2a608

Please sign in to comment.