Skip to content

Commit

Permalink
chore: only build to CJS
Browse files Browse the repository at this point in the history
  • Loading branch information
blephy committed Jul 1, 2022
1 parent 755fafb commit 13ed043
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 43 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Check package.json library usage
run: yarn packagejson:check
- name: Spell checking with Cspell
run: yarn cspell:ci
- name: Lint codebase with Eslint
Expand Down
2 changes: 1 addition & 1 deletion lint-staged.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
"package.json": ['yarn packagejson:format', 'yarn packagejson:check'],
"package.json": ['yarn packagejson:format'],
"**/*.ts": () => ["tsc -p tsconfig.json --noEmit"],
"**/*.{ts,mts,cts,js,mjs,cjs}": (filenames) => `eslint -c .eslintrc.cjs ${filenames.join(" ")} --fix --cache`,
};
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
"access": "public",
"registry": " https://registry.npmjs.org"
},
"type": "module",
"main": "./lib/cjs/index.cjs",
"exports": {
".": {
"types": "./lib/types/index.d.ts",
"require": "./lib/cjs/index.cjs",
"import": "./lib/esm/index.js"
"default": "./lib/cjs/index.cjs"
}
},
"files": [
"/lib/**/*"
],
"types": "./lib/types/index.d.ts",
"scripts": {
"build": "yarn clean && yarn build:cjs && yarn build:esm",
"build:cjs": "tsc -b tsconfig.build.cjs.json && ./scripts/convert-to-cjs.sh",
"build": "yarn clean && yarn build:cjs",
"build:cjs": "tsc -b tsconfig.build.cjs.json",
"build:esm": "tsc -b tsconfig.build.esm.json",
"clean": "rm -rfv reports coverage build dist lib .eslintcache",
"commit": "cz",
Expand All @@ -43,7 +43,6 @@
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"packagejson:check": "package-check",
"packagejson:format": "prettier-package-json --write ./package.json",
"test": "yarn test:unit",
"test:mutation": "stryker run",
Expand All @@ -57,7 +56,6 @@
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@commitlint/cz-commitlint": "^17.0.0",
"@skypack/package-check": "^0.2.2",
"@stryker-mutator/core": "^6.0.2",
"@stryker-mutator/mocha-runner": "^6.0.2",
"@stryker-mutator/typescript-checker": "^6.0.2",
Expand Down
11 changes: 0 additions & 11 deletions scripts/convert-to-cjs.sh

This file was deleted.

4 changes: 2 additions & 2 deletions tsconfig.build.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"outDir": "./lib/cjs",
"target": "ES2015",
"module": "CommonJS",
"declaration": false,
"declarationMap": false
"declarationDir": "./lib/types",
"esModuleInterop": true
},
"include": ["./src/**/*"]
}
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"baseUrl": ".",
"declaration": true,
"declarationMap": true,
"declarationMap": false,
"removeComments": false,
"sourceMap": false,
"noEmit": false,
Expand Down
20 changes: 0 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1604,18 +1604,6 @@ __metadata:
languageName: node
linkType: hard

"@skypack/package-check@npm:^0.2.2":
version: 0.2.2
resolution: "@skypack/package-check@npm:0.2.2"
dependencies:
kleur: ^4.1.3
yargs-parser: ^20.2.3
bin:
package-check: index.bin.js
checksum: 7b35c331609b743815ba9d2a7d789e8157d5119ea167fe684cd9d95978892d01aac0e36db5ea8d54fc565e5f57f3732a9793c5c711d454ce9bf1581f34829e9f
languageName: node
linkType: hard

"@stryker-mutator/api@npm:6.0.2":
version: 6.0.2
resolution: "@stryker-mutator/api@npm:6.0.2"
Expand Down Expand Up @@ -5465,13 +5453,6 @@ __metadata:
languageName: node
linkType: hard

"kleur@npm:^4.1.3":
version: 4.1.4
resolution: "kleur@npm:4.1.4"
checksum: 7f6db36e378045dec14acd3cbf0b1e59130c09e984ee8b8ce56dd2d2257cfff90389c1e8f8b19bd09dd5d241080566a814b4ccd99fdcef91f59ef93ec33c8a44
languageName: node
linkType: hard

"levn@npm:^0.4.1":
version: 0.4.1
resolution: "levn@npm:0.4.1"
Expand Down Expand Up @@ -8705,7 +8686,6 @@ __metadata:
"@commitlint/cli": ^17.0.2
"@commitlint/config-conventional": ^17.0.2
"@commitlint/cz-commitlint": ^17.0.0
"@skypack/package-check": ^0.2.2
"@stryker-mutator/core": ^6.0.2
"@stryker-mutator/mocha-runner": ^6.0.2
"@stryker-mutator/typescript-checker": ^6.0.2
Expand Down

0 comments on commit 13ed043

Please sign in to comment.