feat!: module & commonjs in semantic-release

BREAKING CHANGE: support module, and commonjs types
This commit is contained in:
Ismo Vuorinen
2024-08-21 17:35:36 +03:00
parent e4aed31ef9
commit 57fbf1fd1f
4 changed files with 12 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
"node": ">= 18" "node": ">= 18"
}, },
"files": [ "files": [
"index.js", "index.cjs",
"scripts/*" "scripts/*"
], ],
"homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/semantic-release-config#readme", "homepage": "https://github.com/ivuorinen/base-configs/tree/main/packages/semantic-release-config#readme",
@@ -24,7 +24,13 @@
"ivuorinen" "ivuorinen"
], ],
"license": "MIT", "license": "MIT",
"main": "index.js", "type": "module",
"main": "index.cjs",
"module": "wrapper.mjs",
"exports": {
"import": "./wrapper.mjs",
"require": "./index.cjs"
},
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
}, },
@@ -33,7 +39,7 @@
"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": {
"@ivuorinen/config-checker": "^1.1.4", "@ivuorinen/config-checker": "^1.1.4",

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('release') const foundConfig = checkConfig('release')

View File

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