Skip to content

Commit d2cc0d9

Browse files
committed
Build include types
1 parent 338af34 commit d2cc0d9

File tree

4 files changed

+20
-22
lines changed

4 files changed

+20
-22
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
with:
2121
node-version: 20
2222

23+
- name: Set up Bun
24+
uses: oven-sh/setup-bun@v2
25+
2326
- name: Install dependencies
2427
run: npm install --no-lockfile
2528

26-
- name: Run tests
27-
run: npm run test
28-
2929
- name: Build the project
30-
run: npm run build
30+
run: bun run build
3131

3232
- name: Log in to npm
3333
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc

build.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
const ESM = await Bun.build({
22
entrypoints: ["./src/core/index.ts", "./src/react/index.tsx"],
3-
outdir: "./dist/esm",
3+
outdir: "./dist",
44
target: "browser",
55
format: "esm",
66
external: ["react"],
77
sourcemap: "linked",
88
minify: true
99
});
1010

11-
const CJS = await Bun.build({
12-
entrypoints: ["./src/core/index.ts", "./src/react/index.tsx"],
13-
outdir: "./dist/cjs",
14-
target: "browser",
15-
format: "cjs",
16-
external: ["react"],
17-
sourcemap: "linked",
18-
minify: true
19-
});
11+
// const CJS = await Bun.build({
12+
// entrypoints: ["./src/core/index.ts", "./src/react/index.tsx"],
13+
// outdir: "./dist",
14+
// target: "browser",
15+
// format: "cjs",
16+
// external: ["react"],
17+
// sourcemap: "linked",
18+
// minify: true
19+
// });
2020

21-
if (!ESM.success || !CJS.success) {
21+
if (!ESM.success) {
2222
console.error("Build failed");
23-
for (const message of [...ESM.logs, ...CJS.logs]) {
23+
for (const message of [...ESM.logs]) {
2424
// Bun will pretty print the message object
2525
console.error(message);
2626
}

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,17 @@
3939
"exports": {
4040
".": {
4141
"require": "./dist/cjs/core/index.js",
42-
"import": "./dist/esm/core/index.js",
43-
"types": "./dist/types/index.d.ts"
42+
"import": "./dist/esm/core/index.js"
4443
},
4544
"./react": {
4645
"require": "./dist/cjs/react/index.js",
47-
"import": "./dist/esm/react/index.js",
48-
"types": "./dist/types/index.d.ts"
46+
"import": "./dist/esm/react/index.js"
4947
}
5048
},
5149
"scripts": {
5250
"build:library": "bun ./build.ts",
5351
"build:types": "bunx tsc",
54-
"build": "bun build:library && bun build:types && cp -R ./src/types/* ./dist/types"
52+
"build": "bun build:library && bun build:types && cp -R ./src/types ./dist/types"
5553
},
5654
"type": "module",
5755
"types": "dist/core/index.d.ts"

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"outDir": "dist/types",
3+
"outDir": "dist",
44
"emitDeclarationOnly": true,
55
"declaration": true,
66
"target": "esnext",

0 commit comments

Comments
 (0)