feat!: module & commonjs in commitlint

BREAKING CHANGE: support module, and commonjs types
This commit is contained in:
Ismo Vuorinen
2024-08-21 17:37:06 +03:00
parent ca479deb20
commit 2de156e2c0
4 changed files with 14 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
{ {
"name": "@ivuorinen/commitlint-config", "name": "@ivuorinen/commitlint-config",
"version": "0.2.24", "version": "0.2.24",
"type": "module",
"description": "ivuorinen's shareable configuration for commitlint.", "description": "ivuorinen's shareable configuration for commitlint.",
"author": { "author": {
"name": "Ismo Vuorinen", "name": "Ismo Vuorinen",
@@ -12,8 +13,15 @@
"engines": { "engines": {
"node": ">= 18" "node": ">= 18"
}, },
"main": "index.cjs",
"module": "wrapper.mjs",
"exports": {
"import": "./wrapper.mjs",
"require": "./index.js"
},
"files": [ "files": [
"index.js", "index.cjs",
"wrapper.mjs",
"scripts/*" "scripts/*"
], ],
"homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/commitlint-config#readme", "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/commitlint-config#readme",
@@ -23,7 +31,6 @@
"config" "config"
], ],
"license": "MIT", "license": "MIT",
"main": "index.js",
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
@@ -32,14 +39,12 @@
"url": "https://github.com/ivuorinen/base-configs.git" "url": "https://github.com/ivuorinen/base-configs.git"
}, },
"scripts": { "scripts": {
"postinstall": "node scripts/postinstall.js" "postinstall": "node scripts/postinstall.cjs"
}, },
"dependencies": { "dependencies": {
"@commitlint/cli": "19.4.0", "@commitlint/cli": "19.4.0",
"@commitlint/config-conventional": "19.2.2", "@commitlint/config-conventional": "19.2.2",
"@ivuorinen/config-checker": "^1.1.4", "@ivuorinen/config-checker": "^1.1.4"
"@types/node": "*",
"typescript": ">=4"
}, },
"gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230" "gitHead": "23d15f15743fb59c1dbe658615ef2ed51c54d230"
} }

View File

@@ -2,6 +2,7 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
// noinspection NpmUsedModulesInstalled
const process = require('process') const process = require('process')
const checkConfig = require('@ivuorinen/config-checker') const checkConfig = require('@ivuorinen/config-checker')
const foundConfig = checkConfig('commitlint') const foundConfig = checkConfig('commitlint')

View File

@@ -0,0 +1,2 @@
import config from './index.cjs'
export default config