Skip to content

feat(server): the npm package carries every package as a subpath, with its testing entry - #304

Merged
rami-hatoum merged 1 commit into
mainfrom
feat/the-npm-package-carries-every-package-as-a-subpath
Oct 23, 2026
Merged

rami-hatoum merged 1 commit into
mainfrom
feat/the-npm-package-carries-every-package-as-a-subpath

Conversation

@rami-hatoum

Copy link
Copy Markdown
Contributor

What this changes

The npm package @on.auto/runtime ships every workspace package's sources and runs the server from them, but a program that wanted to compose the core from the package could not: the packages' own names resolved only after the launcher's run-time links, no exports entry named a package, and the pack dropped every testing folder. The package is now a library as well as a server:

  • its package.json carries an exports map built from each package's own exports, 54 subpaths in all, the testing entries among them;
  • the testing folders of every package that names one are shipped, so a program's tests can use the fakes and the behaviour suites; the server's own testing and development folders stay out;
  • the npm README says how a program composes the core from the package, by subpath, with the one-line alias a bundler needs to resolve the packages' own names, its list written by the pack so it never goes stale;
  • the pack checks itself: it unpacks its result into a temporary program and imports every subpath on Node's own loader, with the alias as a resolve hook; and the server still starts from the pack as before.

The guide's sentence about what the package ships is made exact.

Tests

  • Every subpath imports from the packed result; with the alias removed, each fails on a package name, which is the problem this solves.
  • The pack's scan for undeclared imports reads imports inside template strings correctly, with a case for it.
  • The packed runtime runs the existing npx steps locally: version, key, health, a computation run, a workflow run, a stop.
  • pnpm check passes.

…h its testing entry

The npm package ships the sources of every workspace package under packages/<name>, and the
launcher links them to one another when it runs the server. A program that would compose the
core from the package could not: the packages' own names resolved only through those links, no
exports entry named a package, and the pack dropped every testing folder.

- The package.json of the pack exports each package as a subpath, such as ./ledger, its testing
  entry, ./ledger/testing, and each subpath a package names, such as ./ledger/sqlite3 and
  ./operations/shipped-files-on-disk: 54 subpaths, read from the exports of each package.
- A package that offers a testing entry ships its testing folders. The server offers none, so
  neither its testing folder nor its development sources ship. What the testing code imports
  and the package does not declare are the test tools a program's tests provide.
- The npm README says how a program composes the core: it imports by subpath and, where its
  bundler resolves the packages' own names, aliases each @on.auto/<name> to
  @on.auto/runtime/<name> in one line, with the names the pack writes into it.
- The pack checks itself: it unpacks the tarball into a program beside its dependencies, and a
  test on Node's own module loader imports each subpath, the packages' own names aliased as the
  README says. Without the alias every subpath fails on those names.
- The scan of what a shipped source imports no longer reads an import inside a template string
  as a statement, as the shipped testing code holds such strings.

The launcher is unchanged but for exporting the linking the check reuses, and the server starts
from the tarball as the package job of the CI runs it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@rami-hatoum
rami-hatoum merged commit caf2e36 into main Oct 23, 2026
20 checks passed
@rami-hatoum
rami-hatoum deleted the feat/the-npm-package-carries-every-package-as-a-subpath branch October 23, 2026 15:55
rami-hatoum pushed a commit that referenced this pull request Oct 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.18.0](v0.17.0...v0.18.0)
(2026-10-23)


### Features

* **identity:** keys from a key source, a person without an org acts in
their own, a key set given
([#301](#301))
([ca6f754](ca6f754))
* **server:** the npm package carries every package as a subpath, with
its testing entry
([#304](#304))
([caf2e36](caf2e36))


### Bug Fixes

* **coordination:** the workflow spec SDK compiles a validator on first
use, not when imported
([#308](#308))
([0dcd0df](0dcd0df))
* **workflow-host:** the follower notes each unreadable record, and a
first follow misses nothing
([#302](#302))
([7c5588c](7c5588c))
* **workflow-host:** the waiting measurement names the run of each
record it writes
([#299](#299))
([69ad59f](69ad59f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: beonautobot[bot] <298957281+beonautobot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant