File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -8,16 +8,15 @@ import { $ } from "bun"
88await $ `bun tsc`
99
1010const pkg = await import ( "../package.json" ) . then ( ( m ) => m . default )
11- // @ts -expect-error
12- delete pkg . devDependencies
11+ const original = JSON . parse ( JSON . stringify ( pkg ) )
1312for ( const [ key , value ] of Object . entries ( pkg . exports ) ) {
14- const file = value . replace ( "./src/" , "./" ) . replace ( ".ts" , "" )
13+ const file = value . replace ( "./src/" , "./dist/ " ) . replace ( ".ts" , "" )
1514 pkg . exports [ key ] = {
1615 import : file + ".js" ,
1716 types : file + ".d.ts" ,
1817 }
1918}
20- await Bun . write ( "./dist/ package.json" , JSON . stringify ( pkg , null , 2 ) )
19+ await Bun . write ( "package.json" , JSON . stringify ( pkg , null , 2 ) )
2120
2221const snapshot = process . env [ "OPENCODE_SNAPSHOT" ] === "true"
2322
@@ -27,3 +26,4 @@ if (snapshot) {
2726if ( ! snapshot ) {
2827 await $ `bun publish --access public` . cwd ( "./dist" )
2928}
29+ await Bun . write ( "package.json" , JSON . stringify ( original , null , 2 ) )
Original file line number Diff line number Diff line change @@ -8,21 +8,22 @@ import { $ } from "bun"
88await import ( "./build" )
99
1010const pkg = await import ( "../package.json" ) . then ( ( m ) => m . default )
11- // @ts -expect-error
12- delete pkg [ "devDependencies" ]
11+ const original = JSON . parse ( JSON . stringify ( pkg ) )
1312for ( const [ key , value ] of Object . entries ( pkg . exports ) ) {
14- const file = value . replace ( "./src/" , "./" ) . replace ( ".ts" , "" )
13+ const file = value . replace ( "./src/" , "./dist/ " ) . replace ( ".ts" , "" )
1514 pkg . exports [ key ] = {
1615 import : file + ".js" ,
1716 types : file + ".d.ts" ,
1817 }
1918}
20- await Bun . write ( "./dist/package.json" , JSON . stringify ( pkg , null , 2 ) )
19+ await Bun . write ( "package.json" , JSON . stringify ( pkg , null , 2 ) )
20+
2121const snapshot = process . env [ "OPENCODE_SNAPSHOT" ] === "true"
2222
2323if ( snapshot ) {
24- await $ `bun publish --tag snapshot` . cwd ( "./dist" )
24+ await $ `bun publish --tag snapshot --access public ` . cwd ( "./dist" )
2525}
2626if ( ! snapshot ) {
27- await $ `bun publish` . cwd ( "./dist" )
27+ await $ `bun publish --access public ` . cwd ( "./dist" )
2828}
29+ await Bun . write ( "package.json" , JSON . stringify ( original , null , 2 ) )
You can’t perform that action at this time.
0 commit comments