Skip to content

Commit

Permalink
[Project] Only ship ESM (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewtro authored Oct 29, 2024
1 parent f51a4fb commit 2d2e2c1
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 46 deletions.
11 changes: 11 additions & 0 deletions .changeset/quick-rice-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@blizzard-api/classic-wow': major
'@blizzard-api/client': major
'@blizzard-api/core': major
'@blizzard-api/d3': major
'@blizzard-api/hs': major
'@blizzard-api/sc2': major
'@blizzard-api/wow': major
---

This package now ships with ESM-only. If you need ESM and CJS you can use the previous major release that was a dual-release. Node v22 also ships with native interoperability between the two that you can utilise
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@
"typecheck": "tsc"
},
"lint-staged": {
"*.{ts,tsx,js,jsx,cjs,mjs,md,mdx,yaml,yml,json}": [
"*.{ts,tsx,js,jsx,mjs,md,mdx,yaml,yml,json}": [
"prettier --write"
],
"*.{ts,tsx,js,jsx,cjs,mjs}": [
"*.{ts,tsx,js,jsx,mjs}": [
"pnpm --silent lint:fix"
]
}
Expand Down
6 changes: 0 additions & 6 deletions packages/classic-wow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/classic-wow-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/classic-wow-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/client-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/client-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/core-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/core-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/d3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/d3-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/d3-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/hs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/hs-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/hs-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/sc2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/sc2-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/sc2-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
6 changes: 0 additions & 6 deletions packages/wow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"engines": {
"node": "^18.18 || >=20.9"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"import": {
"@blizzard-api/wow-local": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"@blizzard-api/wow-local": "./src/index.ts",
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default defineConfig(({ watch = false }) => ({
index: './src/index.ts',
},
external: [],
format: ['cjs', 'esm'],
format: 'esm',
outDir: 'dist',
sourcemap: true,
treeshake: true,
Expand Down
1 change: 0 additions & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default defineConfig({
//There's no reason to test the index files as they are just exporting what is already tested
'**/index.ts',
//Ignore the config files
'**/.eslintrc.cjs',
'**/.prettierrc.js',
'**/vitest.workspace.ts',
],
Expand Down

0 comments on commit 2d2e2c1

Please sign in to comment.