File tree Expand file tree Collapse file tree 4 files changed +20
-22
lines changed Expand file tree Collapse file tree 4 files changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ jobs:
20
20
with :
21
21
node-version : 20
22
22
23
+ - name : Set up Bun
24
+ uses : oven-sh/setup-bun@v2
25
+
23
26
- name : Install dependencies
24
27
run : npm install --no-lockfile
25
28
26
- - name : Run tests
27
- run : npm run test
28
-
29
29
- name : Build the project
30
- run : npm run build
30
+ run : bun run build
31
31
32
32
- name : Log in to npm
33
33
run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
Original file line number Diff line number Diff line change 1
1
const ESM = await Bun . build ( {
2
2
entrypoints : [ "./src/core/index.ts" , "./src/react/index.tsx" ] ,
3
- outdir : "./dist/esm " ,
3
+ outdir : "./dist" ,
4
4
target : "browser" ,
5
5
format : "esm" ,
6
6
external : [ "react" ] ,
7
7
sourcemap : "linked" ,
8
8
minify : true
9
9
} ) ;
10
10
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
+ // });
20
20
21
- if ( ! ESM . success || ! CJS . success ) {
21
+ if ( ! ESM . success ) {
22
22
console . error ( "Build failed" ) ;
23
- for ( const message of [ ...ESM . logs , ... CJS . logs ] ) {
23
+ for ( const message of [ ...ESM . logs ] ) {
24
24
// Bun will pretty print the message object
25
25
console . error ( message ) ;
26
26
}
Original file line number Diff line number Diff line change 39
39
"exports" : {
40
40
"." : {
41
41
"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"
44
43
},
45
44
"./react" : {
46
45
"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"
49
47
}
50
48
},
51
49
"scripts" : {
52
50
"build:library" : " bun ./build.ts" ,
53
51
"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"
55
53
},
56
54
"type" : " module" ,
57
55
"types" : " dist/core/index.d.ts"
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "outDir" : " dist/types " ,
3
+ "outDir" : " dist" ,
4
4
"emitDeclarationOnly" : true ,
5
5
"declaration" : true ,
6
6
"target" : " esnext" ,
You can’t perform that action at this time.
0 commit comments