ci(functions-compiler): add a manual npm publish workflow - #631
Merged
Merged
Conversation
The CLI's manual-publish.yml cannot be reused for @base44/functions-compiler. Most of it is CLI-specific — standalone binaries, the Homebrew tap, PostHog sourcemaps, the skills-repo dispatch, the GitHub Release that carries the tarballs — and every one of those steps would need an `if:` guard on a package input, in the one job that must not break. The two trains also tag differently: `v<version>` is the CLI's series, so this one tags `functions-compiler-v<version>`. Sharing the file would buy nothing anyway. npm trusted publishing keys a publisher on the repo *and* the workflow filename, so @base44/functions-compiler needs its own registry entry either way; a separate file makes that entry narrower — it can publish this package and nothing else. Two differences from the CLI workflow worth naming: - Nothing is stripped from package.json before publish. The CLI deletes devDependencies because everything is bundled; here esbuild, @deno/loader and zod are real runtime dependencies consumers install. - The job only builds and publishes. The packaging proof that hits the registry (scripts/verify-package.ts) stays in functions-compiler.yml, behind the Wix gateway, where it runs on every push to main — so this job still resolves nothing, which is what its gateway exemption rests on. Before the first run, a trusted publisher for @base44/functions-compiler must be registered on npmjs.com against this repo and this filename. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.15-pr.631.a8420c7Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.15-pr.631.a8420c7"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.15-pr.631.a8420c7"
}
}
Preview published to npm registry — try new features instantly! |
npm's trusted-publisher validation requires package.json's repository URL to match the GitHub repository the OIDC token comes from. packages/cli already declares it; this package did not, so the first publish would have failed the check with nothing in the workflow to explain why. `directory` points at the package inside the monorepo, which is also what makes the npm page link to the right subtree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
main has been red since #623 landed: it added src/version.ts pinned to 0.1.0 and the test that guards it, having branched before #628 bumped package.json to 0.1.1. Setting the literal to 0.1.1 is the whole of that fix. The publish workflow would have reintroduced the drift on every release. `npm version` rewrites package.json alone, and the literal cannot be read from package.json at run time — a host that bundles this module ships none beside it (that is what src/version.ts documents). So a release would have published a banner naming the previous version and left main red again. scripts/sync-version.ts rewrites the literal from package.json and throws if it matches nothing, because a silent no-op sed is precisely the failure being prevented. The workflow runs it between the bump and the build, and the release commit now carries both files. Bumping by hand runs the same script. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
netanelgilad
approved these changes
Sep 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Adds a manual npm publish workflow for
@base44/functions-compilerso the compiler package can be released independently of the CLI's own release train. The workflow bumps the version, syncs theCOMPILER_VERSIONliteral, buildslib/, publishes to npm via trusted publishing (OIDC — noNPM_TOKENin the repo), and pushes afunctions-compiler-v<version>tag plus release commit. It also fixes the version drift already onmain(package.jsonat0.1.1, the literal still at0.1.0) and adds async-version.tsscript so a release cannot forget the second file again.Related Issue
None
Type of Change
Changes Made
.github/workflows/functions-compiler-publish.yml(workflow_dispatchwithversion,npm_tag,dry_runinputs): installs with--frozen-lockfile, bumps withnpm version --no-workspaces(so the CLI is not bumped alongside), syncs the version literal, runsbun run buildinpackages/functions-compiler, publishes, then commits and pushes afunctions-compiler-v<version>tag. All actions are SHA-pinned and the job runs under a GitHub App token.id-token: write) instead of anNPM_TOKEN; the tag/commit step is skipped ondry_run. Compiler releases usefunctions-compiler-v*to stay clear of the CLI'sv*series.packages/functions-compiler/scripts/sync-version.ts: rewrites theCOMPILER_VERSIONliteral insrc/version.tsfrompackage.json, and throws (rather than silently no-opping) if the literal can't be found.src/version.tsto0.1.1—test/version.test.tsasserts the literal matchespackage.json, somainis currently red on it.repository(withdirectory: packages/functions-compiler) to the package manifest, which trusted publishing requires to match the publishing repo and which npm uses for provenance linking.PUBLISH_WORKFLOWSin.github/scripts/check_wix_proxy_steps.py, exempting it from the mandatory Wix gateway proxy — the gateway cannot carrynpm publish, matching the existing exemptions formanual-publish.ymlandpreview-publish.yml. The workflow header documents the tradeoff (--frozen-lockfileplusbunfig.toml'sminimumReleaseAge).packages/functions-compiler/README.md, including that the trusted publisher is keyed on the workflow filename, and that the tarball proof (scripts/verify-package.ts) still runs infunctions-compiler.ymlon every push tomain— so publish from a commit that went green there.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
test/version.test.tsalready covers the literal/package.jsoninvariant thatsync-version.tsmaintains, and the bump insrc/version.tsis what makes it pass again. Aworkflow_dispatchpublish workflow cannot be exercised from a PR branch — the first run should usedry_run: trueto validate the bump/build/pack path.@base44/functions-compilermust be registered on npmjs.com against this repo andfunctions-compiler-publish.yml. The entries formanual-publish.yml/preview-publish.ymldo not cover it, and publishing will fail without it.esbuild,@deno/loaderandzodstay as real runtime dependencies, so nothing is stripped frompackage.jsonbefore publish.docs/was not updated because this changes release plumbing, not architecture; the package-local README is the documented home for its release process.🤖 Generated by Claude | 2026-09-17 16:15 UTC | a8420c7