History

Merge pull request #284 from RhysSullivan/worktree-publish-execution-cli

feat(release): publish execution, cli, and kernel packages to npm

Rhys Sullivan committed 6 months ago

Commit 599ae332 parents 96dc18a 905973b35 files · +772 −66Browse files

Showing the changes to scripts (1 of 35 files). Show all

Unified · Split

scripts/publish-packages.ts+11−8
@@ -38,7 +38,12 @@ const PUBLISHED_SCOPE = "@executor-js"; · 37 unmodified lines
3838 * directory under `packages/plugins/` does not accidentally ship to npm.
3939 */
4040 const PUBLIC_PACKAGE_DIRS = [
41+ "packages/core/storage-core",
42+ "packages/kernel/core",
43+ "packages/kernel/runtime-quickjs",
4144 "packages/core/sdk",
45+ "packages/core/execution",
46+ "packages/core/cli",
4247 "packages/plugins/file-secrets",
4348 "packages/plugins/google-discovery",
4449 "packages/plugins/graphql",
@@ -267,13 +272,13 @@ const applyPublishConfig = async (pkgDir: string): Promise<() => Promise<void>> · 222 unmodified lines
267272
268273 const publishPackage = async (
269274 pkgDir: string,
270− channel: Channel,
271275 dryRun: boolean,
272276 publishable: ReadonlySet<string>,
273277 publishableVersions: ReadonlyMap<string, string>,
274278 ) => {
275279 const { name: internalName, version } = await readPackageMeta(pkgDir);
276280 const publishedName = internalName.replace(`${INTERNAL_SCOPE}/`, `${PUBLISHED_SCOPE}/`);
281+ const channel = resolveChannel(version);
277282
278283 if (!existsSync(join(pkgDir, "dist"))) {
279284 throw new Error(`Missing dist/ in ${pkgDir}. Did you run 'bun run build:packages'?`);
@@ -326,12 +331,10 @@ const publishPackage = async ( · 46 unmodified lines
326331 const main = async () => {
327332 const { dryRun } = parseArgs(process.argv.slice(2));
328333
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]" : ""}`);
335338
336339 await $`bun run build:packages`.cwd(repoRoot);
337340
@@ -351,7 +354,7 @@ const main = async () => { · 13 unmodified lines
351354 }
352355
353356 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);
355358 }
356359 };
357360