ci: run reviews on the released xmd binary; publish packages to npm+JSR#82
Merged
Conversation
The PR-review and repo-analysis workflows ran the CLI from local source (`deno run cli/src/cli.ts`). Run them on the shipped artifact instead. The review documents eval-import `@executablemd/code-review-agent`. A `deno compile` binary can only resolve npm/jsr packages present in its compile-time graph — a package published to npm is NOT fetchable at runtime by the binary (fails with "Could not find constraint ... in the list of packages"). So the binary must bundle it: - release.yml + the `build` task compile with `--include packages/code-review-agent`. `@executablemd/core`/`runtime` already resolve because cli.ts imports them statically. - review.yml / repo-analysis.yml install the released binary via install.sh and run `xmd run ...`. `deno install` stays only to provide the `npx oxlint` toolchain the documents invoke. Separately, publish all @executablemd library packages to npm (primary) and JSR (secondary): - scripts/build-npm.ts builds each package with dnt, externalizing sibling @executablemd deps instead of inlining them. - publish-packages.yml builds + publishes in dependency order on the same `v*` tag that drives release.yml. - Versions bumped 0.1.0 -> 0.2.0.
|
Use function*/yield* with effection main(), @effectionx/fs for file ops, and until() for the dnt build + node:fs temp-dir/recursive-copy promises (the two ops @effectionx/fs lacks). No behavior change.
…oxlint, OIDC Addresses the plannotator review of this branch. Manifests are the source of truth: - Populate each package.json with real dependencies (workspace:* for internal siblings), description, and a bin for cli. - build-npm.ts takes a package dir and derives name/entryPoints/deps/description from deno.json + package.json (validated with zod — no `as` casts, per AGENTS.md rule 6); internal deps resolve to the sibling's own version. Drops the hardcoded package table and version constant. Self-provisioned oxlint (no deno/node in the review CI): - New .reviews/components/EnsureOxlint.md curls the standalone oxlint binary and the tsgolint npm tarball, wiring type-aware via OXLINT_TSGOLINT_PATH. - Doctor + the review/analysis docs call the provisioned oxlint instead of `npx oxlint`. review.yml and repo-analysis.yml drop setup-deno + deno install. Publishing: - publish-packages.yml uses Node 24 + OIDC trusted publishing (no NPM_TOKEN). - Orchestration moved into scripts/publish-packages.ts (Effection); publishable set and dependency order are derived from the manifests. - Documents that core/runtime/cli need --legacy-peer-deps until effection 4 is stable (effection prerelease vs @effectionx peer ranges). Also: AGENTS.md gains rules 6 (no `as`) and 7 (no braceless if); scripts comply.
Replace the single publish-packages.ts orchestration script with a GitHub job graph, per review feedback: - Add publish-one.yml (reusable, workflow_call: package/version/ref) that builds one package with dnt and publishes it to npm (OIDC) + JSR (best-effort), with a build retry to absorb sibling propagation. - publish-packages.yml fans out one publish-one call per package, ordered by `needs:` — leaves (durable-streams, runtime, code-review-agent) in parallel, then core, then cli. Each package is a separate, re-runnable workflow run. - Remove scripts/publish-packages.ts. Also restore cli/src/cli.ts to mode 644 (pnpm/bun install flips it to 755 via the new bin field; that mode change should not be committed).
…n't be provisioned Addresses the latest review. Generate the publish orchestrator from the manifests: - scripts/gen-publish-workflow.ts derives the publishable set + topological `needs:` graph from each member's deno.json/package.json and writes .github/workflows/publish-packages.yml (`deno task gen:publish-workflow`). - ci.yml regenerates it and `git diff --exit-code`s, failing with the command to run if the committed file is stale — so the workflow can't drift. Don't let oxlint provisioning fail silently: - EnsureOxlint uses `set -euo pipefail` and no longer swallows a failed download (curl -f + pipefail aborts the block instead of degrading). - review.yml and repo-analysis.yml assert the lint binaries exist after the run (xmd embeds a failed component as a comment but still exits 0), failing the job with a clear ::error:: if provisioning didn't happen.
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.
Motivation
The PR Review and Repo Analysis workflows run the
xmdCLI from localTypeScript source (
deno run cli/src/cli.ts). They now run on the shippedartifact — the released
xmdbinary — so CI exercises what users get.Separately, all
@executablemd/*library packages are published to npm(primary) and JSR (secondary).
Approach
A
deno compilebinary only resolves npm/jsr packages that were in itscompile-time graph (a runtime
importof an unbundled package fails withCould not find constraint … in the list of packages). So:release.ymland thebuildtaskcompile with
--include packages/code-review-agent; the review documents keepthe bare specifier and resolve it from the bundled source.
@executablemd/coreand
@executablemd/runtimealready bundle becausecli.tsimports them.review.ymlandrepo-analysis.ymlinstallxmdviainstall.shand run it — no deno/nodetoolchain. The lint step is self-provisioned by a new
EnsureOxlintcomponent that
curls the standaloneoxlintbinary and thetsgolintplatform tarball and wires
--type-awarethroughOXLINT_TSGOLINT_PATH.EnsureOxlintfails loudly on a failed download, and each workflow assertsthe binaries exist (xmd embeds a failed component as a comment but still
exits 0), failing the job otherwise.
scripts/build-npm.tsderives each npmpackage (name, entry points, dependencies, bin) from its
deno.json/package.jsonvia dnt; internal siblings resolve to their own versions andpublish as dependencies rather than inlining. Each
package.jsonnow declaresits real dependencies.
publish-one.ymlbuilds andpublishes one package to npm (OIDC) and JSR (best-effort).
publish-packages.ymlcalls it once per package, ordered byneeds:(leavesin parallel, then
core, thencli). That orchestrator is generated fromthe manifests by
scripts/gen-publish-workflow.ts(deno task gen:publish-workflow); CI regenerates it and fails if the committed copydrifts.
All package versions move to
0.2.0. Bundlingcore/componentsinto the binaryso
--component-dir core/componentsisn't needed is tracked separately in #83.Release prerequisites
review.ymlrequires a release built with--include; it goes green oncev0.2.0is tagged (the currentv0.1.0binary predates it, so this branch'sown
reviewcheck — an advisory job — is red until then).package pointing at this repo +
publish-one.yml. Link the@executablemdpackages on JSR. Consumers of
core/runtime/clineed--legacy-peer-depsuntil effection 4 is stable (its prerelease vs
@effectionx/*peer ranges).Scope confirmation
New abstractions (if any)
scripts/build-npm.ts— manifest-driven dnt build (consumed bypublish-one.ymland localdeno run).scripts/gen-publish-workflow.ts— generates the publish orchestrator fromthe manifests (consumed by the CI staleness check and
deno task)..reviews/components/EnsureOxlint.md— provisions oxlint/tsgolint (consumed byDoctor, reached by all four review/analysis documents)..github/workflows/publish-one.yml— reusable per-package publish (consumed byevery job in
publish-packages.yml).New dependencies (if any)
jsr:@deno/dnt(plus@std/fs,@std/path)scripts/; transpiles the Deno TS packages(
.ts-extension imports) into publishable npm packages with.d.tstypes.New tests (if any)
build + publish of all five packages in dependency order), and end-to-end
binary review runs (bundled review agent + live oxlint/tsgolint provisioning).