Skip to content

Commit 882de7e

Browse files
authored
fix: build cjs and ems versions (COR-9094) (#13)
1 parent 5b04e12 commit 882de7e

File tree

6 files changed

+40
-15
lines changed

6 files changed

+40
-15
lines changed

libs/normal-store/package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,24 @@
1717
"license": "ISC",
1818
"author": "Tyler Han, Ben Teichman",
1919
"type": "module",
20-
"main": "build/index.js",
21-
"types": "build/index.d.ts",
20+
"exports": {
21+
".": {
22+
"types": "./build/cjs/index.d.ts",
23+
"import": "./build/esm/index.js",
24+
"default": "./build/cjs/index.js"
25+
}
26+
},
27+
"main": "build/cjs/index.js",
28+
"module": "build/esm/index.js",
29+
"types": "build/esm/index.d.ts",
2230
"files": [
2331
"build"
2432
],
2533
"scripts": {
2634
"build": "yarn g:turbo run build:cmd --filter=@voiceflow/normal-store...",
27-
"build:cmd": "yarn g:build:pkg",
35+
"build:cjs": "yarn g:build:pkg cjs",
36+
"build:cmd": "yarn g:run-p build:cjs build:esm",
37+
"build:esm": "yarn g:build:pkg esm",
2838
"clean": "yarn g:rimraf build",
2939
"lint": "yarn g:run-p -c lint:eslint lint:prettier",
3040
"lint:eslint": "yarn g:eslint",
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "./tsconfig.build.json",
4+
"compilerOptions": {
5+
"module": "commonjs",
6+
"outDir": "build/cjs"
7+
}
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"extends": "./tsconfig.build.json",
4+
"compilerOptions": {
5+
"module": "esnext",
6+
"outDir": "build/esm"
7+
},
8+
"tsc-alias": {
9+
"resolveFullPaths": true
10+
}
11+
}
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"extends": "./tsconfig.json",
4-
"compilerOptions": {
5-
"module": "esnext",
6-
"outDir": "build"
7-
},
84
"include": ["src"],
9-
"exclude": ["**/*.test.ts"],
10-
"tsc-alias": {
11-
"resolveFullPaths": true
12-
}
5+
"exclude": ["**/*.test.ts"]
136
}

libs/slate-serializer/package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
}
4242
},
4343
"main": "build/cjs/index.js",
44+
"module": "build/esm/index.js",
4445
"types": "build/esm/index.d.ts",
4546
"typesVersions": {
4647
"*": {
@@ -60,7 +61,9 @@
6061
],
6162
"scripts": {
6263
"build": "yarn g:turbo run build:cmd --filter=@voiceflow/slate-serializer...",
63-
"build:cmd": "yarn g:build:pkg",
64+
"build:cjs": "yarn g:build:pkg cjs",
65+
"build:cmd": "yarn g:run-p build:cjs build:esm",
66+
"build:esm": "yarn g:build:pkg esm",
6467
"clean": "yarn g:rimraf build",
6568
"lint": "yarn g:run-p -c lint:eslint lint:prettier",
6669
"lint:eslint": "yarn g:eslint",
@@ -72,18 +75,17 @@
7275
"test:types": "yarn g:tsc --noEmit",
7376
"test:unit": "yarn g:vitest run --coverage"
7477
},
75-
"dependencies": {
76-
"csstype": "3.2.3"
77-
},
7878
"devDependencies": {
7979
"@types/react": "18.2.4",
8080
"@voiceflow/dtos-interact": "1.17.1",
81+
"csstype": "3.2.3",
8182
"react": "18.2.0",
8283
"slate": "0.94.1",
8384
"zod": "3.22.4"
8485
},
8586
"peerDependencies": {
8687
"@voiceflow/dtos-interact": "^1.17.1",
88+
"csstype": "^3.2.3",
8789
"react": "^17.0.2",
8890
"slate": "^0.72.3",
8991
"zod": "^3"

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1916,6 +1916,7 @@ __metadata:
19161916
zod: 3.22.4
19171917
peerDependencies:
19181918
"@voiceflow/dtos-interact": ^1.17.1
1919+
csstype: ^3.2.3
19191920
react: ^17.0.2
19201921
slate: ^0.72.3
19211922
zod: ^3

0 commit comments

Comments
 (0)