Skip to content

Commit 4a2ff38

Browse files
committed
fix: export esm and cjs
1 parent a45d1f4 commit 4a2ff38

36 files changed

+901
-260
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,14 @@
3838
"devDependencies": {
3939
"@abinnovision/commitlint-config": "^2.2.3",
4040
"@abinnovision/prettier-config": "^2.1.5",
41+
"@arethetypeswrong/core": "^0.18.2",
4142
"@commitlint/cli": "^20.4.2",
4243
"@vitest/coverage-v8": "^4.0.18",
4344
"concurrently": "^9.2.1",
4445
"husky": "^9.1.7",
4546
"lint-staged": "^16.3.3",
4647
"prettier": "^3.8.1",
48+
"publint": "^0.3.18",
4749
"rimraf": "^6.1.3",
4850
"sort-package-json": "^3.6.1",
4951
"turbo": "^2.8.17",

packages/e2e/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
{
22
"name": "@seljs/e2e",
3-
"license": "Apache-2.0",
43
"version": "0.0.0",
54
"private": true,
5+
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
88
"format:check": "prettier --check '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
99
"format:fix": "prettier --write '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
1010
"lint:check": "eslint '{{src,test}/**/*,*}.{t,j}s{,x}'",
1111
"lint:fix": "eslint '{{src,test}/**/*,*}.{t,j}s{,x}' --fix",
12-
"test-unit": "vitest run --config vitest.config.ts",
13-
"test-unit:watch": "vitest watch --config vitest.config.ts",
1412
"test-e2e": "vitest run --config test/e2e/vitest.config.ts",
15-
"test-e2e:watch": "vitest watch --config test/e2e/vitest.config.ts"
13+
"test-e2e:watch": "vitest watch --config test/e2e/vitest.config.ts",
14+
"test-unit": "vitest run --config vitest.config.ts",
15+
"test-unit:watch": "vitest watch --config vitest.config.ts"
1616
},
1717
"lint-staged": {
1818
"{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}": [

packages/fixtures/package.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
{
22
"name": "@seljs-internal/fixtures",
3-
"license": "Apache-2.0",
43
"version": "0.0.0",
54
"private": true,
5+
"license": "Apache-2.0",
66
"type": "module",
77
"exports": {
88
".": {
9-
"import": "./dist/index.js",
10-
"types": "./dist/index.d.ts"
9+
"import": {
10+
"types": "./dist/index.d.mts",
11+
"default": "./dist/index.mjs"
12+
},
13+
"require": {
14+
"types": "./dist/index.d.cts",
15+
"default": "./dist/index.cjs"
16+
}
1117
}
1218
},
13-
"main": "./dist/index.js",
14-
"types": "./dist/index.d.ts",
19+
"main": "./dist/index.cjs",
20+
"types": "./dist/index.d.cts",
1521
"files": [
1622
"dist"
1723
],
1824
"scripts": {
19-
"build": "tsc -p tsconfig.build.json",
25+
"build": "tsdown",
2026
"format:check": "prettier --check '{src/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
2127
"format:fix": "prettier --write '{src/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
2228
"lint:check": "eslint '{src/**/*,*}.{t,j}s{,x}'",
@@ -42,6 +48,7 @@
4248
"@seljs-internal/tsconfig": "workspace:^",
4349
"eslint": "^9.39.4",
4450
"prettier": "^3.8.1",
51+
"tsdown": "^0.21.3",
4552
"typescript": "^5.9.3",
4653
"vitest": "^4.0.18"
4754
}

packages/fixtures/tsconfig.build.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/fixtures/tsdown.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
attw: true,
5+
publint: true,
6+
unbundle: true,
7+
format: ["cjs", "esm"],
8+
clean: true,
9+
deps: { skipNodeModulesBundle: true },
10+
});

packages/sel-cel-lezer/package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
{
22
"name": "@seljs/cel-lezer",
33
"version": "1.0.0",
4+
"repository": {
5+
"url": "https://github.com/abinnovision/seljs"
6+
},
47
"license": "Apache-2.0",
58
"author": {
69
"name": "abi group GmbH",
710
"email": "info@abigroup.io",
811
"url": "https://abigroup.io/"
912
},
10-
"repository": {
11-
"url": "https://github.com/abinnovision/seljs"
12-
},
1313
"type": "module",
1414
"exports": {
1515
".": {
16-
"import": "./dist/index.js",
17-
"types": "./dist/index.d.ts"
16+
"import": {
17+
"types": "./dist/index.d.mts",
18+
"default": "./dist/index.mjs"
19+
},
20+
"require": {
21+
"types": "./dist/index.d.cts",
22+
"default": "./dist/index.cjs"
23+
}
1824
}
1925
},
20-
"main": "./dist/index.js",
21-
"types": "./dist/index.d.ts",
26+
"main": "./dist/index.cjs",
27+
"types": "./dist/index.d.cts",
2228
"files": [
2329
"dist",
2430
"LICENSE.md"
2531
],
2632
"scripts": {
27-
"build": "tsc -p tsconfig.build.json",
33+
"build": "tsdown",
2834
"format:check": "prettier --check '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
2935
"format:fix": "prettier --write '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
3036
"generate": "lezer-generator --typeScript -o src/parser.ts src/cel.grammar",
@@ -54,6 +60,7 @@
5460
"@seljs-internal/tsconfig": "workspace:^",
5561
"eslint": "^9.39.4",
5662
"prettier": "^3.8.1",
63+
"tsdown": "^0.21.3",
5764
"typescript": "^5.9.3",
5865
"vitest": "^4.0.18"
5966
},

packages/sel-cel-lezer/tsconfig.build.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
attw: true,
5+
publint: true,
6+
unbundle: true,
7+
format: ["cjs", "esm"],
8+
clean: true,
9+
deps: { skipNodeModulesBundle: true },
10+
});

packages/sel-checker/package.json

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
{
22
"name": "@seljs/checker",
33
"version": "1.0.0",
4-
"type": "module",
4+
"repository": {
5+
"url": "https://github.com/abinnovision/seljs"
6+
},
57
"license": "Apache-2.0",
68
"author": {
79
"name": "abi group GmbH",
810
"email": "info@abigroup.io",
911
"url": "https://abigroup.io/"
1012
},
11-
"repository": {
12-
"url": "https://github.com/abinnovision/seljs"
13-
},
13+
"type": "module",
1414
"exports": {
1515
".": {
16-
"import": "./dist/index.js",
17-
"types": "./dist/index.d.ts"
16+
"import": {
17+
"types": "./dist/index.d.mts",
18+
"default": "./dist/index.mjs"
19+
},
20+
"require": {
21+
"types": "./dist/index.d.cts",
22+
"default": "./dist/index.cjs"
23+
}
1824
}
1925
},
20-
"main": "./dist/index.js",
21-
"types": "./dist/index.d.ts",
26+
"main": "./dist/index.cjs",
27+
"types": "./dist/index.d.cts",
2228
"files": [
2329
"dist",
2430
"LICENSE.md"
2531
],
2632
"scripts": {
27-
"build": "tsc -p tsconfig.build.json",
33+
"build": "tsdown",
2834
"format:check": "prettier --check '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
2935
"format:fix": "prettier --write '{{src,test}/**/*,*}.{{t,j}s{,x},json{,5},md,y{,a}ml}'",
3036
"lint:check": "eslint '{{src,test}/**/*,*}.{t,j}s{,x}'",
@@ -49,20 +55,21 @@
4955
"@seljs/types": "workspace:*",
5056
"debug": "^4.4.3"
5157
},
52-
"peerDependencies": {
53-
"zod": "^4.0.0"
54-
},
5558
"devDependencies": {
5659
"@abinnovision/eslint-config-base": "^3.2.0",
5760
"@abinnovision/prettier-config": "^2.1.5",
5861
"@seljs-internal/tsconfig": "workspace:^",
5962
"@types/debug": "^4.1.12",
6063
"eslint": "^9.39.4",
6164
"prettier": "^3.8.1",
65+
"tsdown": "^0.21.3",
6266
"typescript": "^5.9.3",
6367
"vitest": "^4.0.18",
6468
"zod": "^4.3.6"
6569
},
70+
"peerDependencies": {
71+
"zod": "^4.0.0"
72+
},
6673
"publishConfig": {
6774
"npm": true,
6875
"npmAccess": "public"

packages/sel-checker/tsconfig.build.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)