Skip to content

Commit b6fba03

Browse files
committed
ci: fix
1 parent fbced21 commit b6fba03

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

packages/plugin/script/publish.ts

100644100755
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@ import { $ } from "bun"
88
await $`bun tsc`
99

1010
const 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))
1312
for (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

2221
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
2322

@@ -27,3 +26,4 @@ if (snapshot) {
2726
if (!snapshot) {
2827
await $`bun publish --access public`.cwd("./dist")
2928
}
29+
await Bun.write("package.json", JSON.stringify(original, null, 2))

packages/sdk/js/script/publish.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,22 @@ import { $ } from "bun"
88
await import("./build")
99

1010
const 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))
1312
for (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+
2121
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
2222

2323
if (snapshot) {
24-
await $`bun publish --tag snapshot`.cwd("./dist")
24+
await $`bun publish --tag snapshot --access public`.cwd("./dist")
2525
}
2626
if (!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))

0 commit comments

Comments
 (0)