Skip to content

Commit 925ce65

Browse files
committed
sync
1 parent 8a28d34 commit 925ce65

10 files changed

Lines changed: 43 additions & 44 deletions

File tree

packages/app/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"jsxImportSource": "solid-js",
77
"types": ["vite/client"],
88
"lib": ["DOM", "DOM.Iterable"],
9-
"customConditions": ["development"],
109
"paths": {
1110
"@/*": ["./src/*"]
1211
}

packages/opencode/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"extends": "@tsconfig/bun/tsconfig.json",
44
"compilerOptions": {
5-
"lib": ["ESNext", "DOM", "DOM.Iterable"],
6-
"customConditions": ["development"]
5+
"lib": ["ESNext", "DOM", "DOM.Iterable"]
76
}
87
}

packages/plugin/package.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@
88
"build": "tsc"
99
},
1010
"exports": {
11-
".": {
12-
"development": "./src/index.ts",
13-
"import": "./dist/index.js"
14-
},
15-
"./tool": {
16-
"development": "./src/tool.ts",
17-
"import": "./dist/tool.js"
18-
}
11+
".": "./src/index.ts",
12+
"./tool": "./src/tool.ts"
1913
},
2014
"files": [
2115
"dist"

packages/plugin/script/publish.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,24 @@ process.chdir(dir)
55

66
import { $ } from "bun"
77

8-
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
9-
108
await $`bun tsc`
119

10+
const pkg = await import("../package.json")
11+
for (const [key, value] of Object.entries(pkg.exports)) {
12+
const file = value.replace("./src/", "./").replace(".ts", "")
13+
// @ts-expect-error
14+
pkg.exports[key] = {
15+
import: file + ".js",
16+
types: file + ".d.ts",
17+
}
18+
}
19+
await Bun.write("./dist/package.json", JSON.stringify(pkg, null, 2))
20+
21+
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
22+
1223
if (snapshot) {
13-
await $`bun publish --tag snapshot --access public`
14-
await $`git checkout package.json`
24+
await $`bun publish --tag snapshot --access public`.cwd("./dist")
1525
}
1626
if (!snapshot) {
17-
await $`bun publish --access public`
27+
await $`bun publish --access public`.cwd("./dist")
1828
}

packages/plugin/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"module": "preserve",
77
"declaration": true,
88
"moduleResolution": "bundler",
9-
"lib": ["es2022", "dom", "dom.iterable"],
10-
"customConditions": ["development"]
9+
"lib": ["es2022", "dom", "dom.iterable"]
1110
},
1211
"include": ["src"]
1312
}

packages/sdk/js/package.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,12 @@
55
"type": "module",
66
"scripts": {
77
"typecheck": "tsc --noEmit",
8-
"build": "tsc"
8+
"build": "./script/build.ts"
99
},
1010
"exports": {
11-
".": {
12-
"development": "./src/index.ts",
13-
"import": "./dist/index.js",
14-
"types": "./dist/index.d.ts"
15-
},
16-
"./client": {
17-
"development": "./src/client.ts",
18-
"import": "./dist/client.js",
19-
"types": "./dist/client.d.ts"
20-
},
21-
"./server": {
22-
"development": "./src/server.ts",
23-
"import": "./dist/server.js",
24-
"types": "./dist/server.d.ts"
25-
}
11+
".": "./src/index.ts",
12+
"./client": "./src/client.ts",
13+
"./server": "./src/server.ts"
2614
},
2715
"files": [
2816
"dist"
@@ -34,5 +22,8 @@
3422
},
3523
"dependencies": {
3624
"@hey-api/openapi-ts": "0.81.0"
25+
},
26+
"publishConfig": {
27+
"directory": "dist"
3728
}
3829
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ await createClient({
3535
],
3636
})
3737
await $`bun prettier --write src/gen`
38+
await $`rm -rf dist`
39+
await $`bun tsc`

packages/sdk/js/script/publish.ts

100644100755
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@ process.chdir(dir)
55

66
import { $ } from "bun"
77

8-
await import("./generate")
9-
await $`rm -rf dist`
10-
await $`bun tsc`
8+
await import("./build")
119

10+
const pkg = await import("../package.json")
11+
for (const [key, value] of Object.entries(pkg.exports)) {
12+
const file = value.replace("./src/", "./").replace(".ts", "")
13+
// @ts-expect-error
14+
pkg.exports[key] = {
15+
import: file + ".js",
16+
types: file + ".d.ts",
17+
}
18+
}
19+
await Bun.write("./dist/package.json", JSON.stringify(pkg, null, 2))
1220
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
1321

1422
if (snapshot) {
15-
await $`bun publish --tag snapshot`
23+
await $`bun publish --tag snapshot`.cwd("./dist")
1624
}
1725
if (!snapshot) {
18-
await $`bun publish`
26+
await $`bun publish`.cwd("./dist")
1927
}

packages/sdk/js/tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"module": "nodenext",
77
"declaration": true,
88
"moduleResolution": "nodenext",
9-
"lib": ["es2022", "dom", "dom.iterable"],
10-
"customConditions": ["development"]
9+
"lib": ["es2022", "dom", "dom.iterable"]
1110
},
1211
"include": ["src"]
1312
}

tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
22
"$schema": "https://json.schemastore.org/tsconfig",
33
"extends": "@tsconfig/bun/tsconfig.json",
4-
"compilerOptions": {
5-
"customConditions": ["development"]
6-
}
4+
"compilerOptions": {}
75
}

0 commit comments

Comments
 (0)