feat(release): publish execution, cli, and kernel packages to npm
Showing the changes to scripts (1 of 35 files). Show all
Unified · Split
| @@ -38,7 +38,12 @@ const PUBLISHED_SCOPE = "@executor-js"; · 37 unmodified lines | ||
| 38 | 38 | * directory under `packages/plugins/` does not accidentally ship to npm. |
| 39 | 39 | */ |
| 40 | 40 | const PUBLIC_PACKAGE_DIRS = [ |
| 41 | + "packages/core/storage-core", | |
| 42 | + "packages/kernel/core", | |
| 43 | + "packages/kernel/runtime-quickjs", | |
| 41 | 44 | "packages/core/sdk", |
| 45 | + "packages/core/execution", | |
| 46 | + "packages/core/cli", | |
| 42 | 47 | "packages/plugins/file-secrets", |
| 43 | 48 | "packages/plugins/google-discovery", |
| 44 | 49 | "packages/plugins/graphql", |
| @@ -267,13 +272,13 @@ const applyPublishConfig = async (pkgDir: string): Promise<() => Promise<void>> · 222 unmodified lines | ||
| 267 | 272 | |
| 268 | 273 | const publishPackage = async ( |
| 269 | 274 | pkgDir: string, |
| 270 | − channel: Channel, | |
| 271 | 275 | dryRun: boolean, |
| 272 | 276 | publishable: ReadonlySet<string>, |
| 273 | 277 | publishableVersions: ReadonlyMap<string, string>, |
| 274 | 278 | ) => { |
| 275 | 279 | const { name: internalName, version } = await readPackageMeta(pkgDir); |
| 276 | 280 | const publishedName = internalName.replace(`${INTERNAL_SCOPE}/`, `${PUBLISHED_SCOPE}/`); |
| 281 | + const channel = resolveChannel(version); | |
| 277 | 282 | |
| 278 | 283 | if (!existsSync(join(pkgDir, "dist"))) { |
| 279 | 284 | throw new Error(`Missing dist/ in ${pkgDir}. Did you run 'bun run build:packages'?`); |
| @@ -326,12 +331,10 @@ const publishPackage = async ( · 46 unmodified lines | ||
| 326 | 331 | const main = async () => { |
| 327 | 332 | const { dryRun } = parseArgs(process.argv.slice(2)); |
| 328 | 333 | |
| 329 | − // Use the sdk package version as the source of truth for the channel. All | |
| 330 | − // published packages version together (they're not in the changeset ignore | |
| 331 | − // list), so they share a release channel. | |
| 332 | − const sdkMeta = await readPackageMeta(join(repoRoot, "packages/core/sdk")); | |
| 333 | − const channel = resolveChannel(sdkMeta.version); | |
| 334 | − console.log(`Publishing ${PUBLISHED_SCOPE} packages (${channel})${dryRun ? " [dry-run]" : ""}`); | |
| 334 | + // Each package's own version determines its dist-tag (pre-release versions | |
| 335 | + // with `-` publish to `beta`, everything else to `latest`). Packages are | |
| 336 | + // only skipped when their current version is already on npm. | |
| 337 | + console.log(`Publishing ${PUBLISHED_SCOPE} packages${dryRun ? " [dry-run]" : ""}`); | |
| 335 | 338 | |
| 336 | 339 | await $`bun run build:packages`.cwd(repoRoot); |
| 337 | 340 | |
| @@ -351,7 +354,7 @@ const main = async () => { · 13 unmodified lines | ||
| 351 | 354 | } |
| 352 | 355 | |
| 353 | 356 | for (const relDir of PUBLIC_PACKAGE_DIRS) { |
| 354 | − await publishPackage(join(repoRoot, relDir), channel, dryRun, publishable, publishableVersions); | |
| 357 | + await publishPackage(join(repoRoot, relDir), dryRun, publishable, publishableVersions); | |
| 355 | 358 | } |
| 356 | 359 | }; |
| 357 | 360 | |