Skip to content

fix(onboarding): a pure uptide/onboarding that loads in ESM and browser bundles - #94

Merged
lucasbraum merged 1 commit into
mainfrom
fix/onboarding-entry
Oct 13, 2026
Merged

lucasbraum merged 1 commit into
mainfrom
fix/onboarding-entry

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

The published uptide/onboarding (0.8.0) breaks consumers in two ways. Both reproduce against the published tarball:

  • Plain Node ESM, Vitest and Turbopack: Error: Dynamic require of "process" is not supported. The entry inlined yaml's CommonJS build, which calls require("process") inside an ES module.
  • A browser bundle (esbuild, platform: 'browser'): Could not resolve "fs" and Could not resolve "path". loadUptideConfig and snapshotFromDisk imported them at the top level.

What changes

  • yaml is not bundled. It is now a dependencies entry of uptide and is external in tsup.onboarding.config.ts. It is the package's only runtime dependency; the command line still inlines everything.
  • uptide/onboarding is pure: schema, types, validate, render, generateOnboarding and repoFacts from in-memory facts, and WORKFLOW_PATH. It reaches no file system and no Node globals:
    • parseUptideConfig's size check uses TextEncoder instead of Buffer;
    • globRegExp and keyLike move to pure modules (glob.ts, llm/types.ts), re-exported from where they were, so no other importer changes.
  • New uptide/onboarding/node holds loadUptideConfig and snapshotFromDisk. The two entries share one chunk. Core's own entries mirror this (@uptide/core/onboarding/node), and @uptide/core still exports everything, so the CLI is untouched.
  • New CI smoke test, pnpm smoke:onboarding, on Node 20 and 22. It installs the packed tarball with npm into an empty type: module app. There it imports both entries under plain Node ESM and generates the files, then bundles uptide/onboarding with esbuild for the browser. The bundle must reach no Node builtin, and it is run once to prove it works. Both checks fail against 0.8.0 and pass here.
  • onboarding-export.test.ts now checks each output file. The pure entry may import only yaml, and the node entry only fs, path and yaml. Neither may use Buffer or require(. The bundle stays within a smaller size budget (120 KB; it went from 238 KB in 0.8.0 to 73 KB without yaml).

Breaking (minor changeset): code that imported loadUptideConfig or snapshotFromDisk from uptide/onboarding must import them from uptide/onboarding/node.

Once this is released, uptide-app can drop patches/[email protected] and the fs alias in next.config.ts.

Verified

  • pnpm typecheck, pnpm test (CLI 414, core 1,290 passed / 32 skipped), pnpm lint, pnpm docs:links, pnpm public:check
  • pnpm smoke:onboarding passes locally on Node 22, in about 9s.

🤖 Generated with Claude Code

…er bundles

The published entry inlined yaml, whose CommonJS build calls
require("process") inside an ES module (fails under Node ESM, Vitest,
Turbopack), and imported fs/path at the top level.

- yaml is a dependency of uptide and external in the onboarding build.
- uptide/onboarding is pure: no fs, path or Node globals (Buffer.byteLength
  becomes TextEncoder). globRegExp and keyLike move to pure modules, re-
  exported from where they were.
- loadUptideConfig and snapshotFromDisk move to uptide/onboarding/node.
- pnpm smoke:onboarding, in CI on Node 20 and 22: the packed tarball,
  installed with npm, imported under plain Node ESM, and bundled by esbuild
  for the browser with no Node builtin reached. Both fail against 0.8.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum marked this pull request as ready for review October 13, 2026 02:52
@lucasbraum
lucasbraum merged commit 5f54bad into main Oct 13, 2026
10 checks passed
@lucasbraum
lucasbraum deleted the fix/onboarding-entry branch October 13, 2026 02:52
@uptide-release uptide-release Bot mentioned this pull request Oct 13, 2026
lucasbraum added a commit that referenced this pull request Oct 13, 2026
… loadUptideConfig

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
lucasbraum pushed a commit that referenced this pull request Oct 13, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## [email protected]

### Minor Changes

- [#93](#93)
[`765de77`](765de77)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `uptide fix
<package>` with Anthropic selected runs assisted fixes as one Claude
Agent SDK session in the temporary clone, covering the package's manual
sites and their rule knowledge, gated once at the end of the session. It
is the default when `@anthropic-ai/claude-agent-sdk`, an optional peer
that is never bundled, is installed next to Uptide; without it, the
patch executor runs and the output says what to install. Use `--agent
patch` to opt out; other providers keep the patch executor. See
`docs/decisions/0016-agent-sdk-executor.md`.
  
Stripe period helpers accept both endpoint payload shapes, and both
executors share the same period knowledge.

- [#94](#94)
[`5f54bad`](5f54bad)
Thanks [@lucasbraum](https://github.com/lucasbraum)! -
`uptide/onboarding` loads where it broke: under plain Node ESM, Vitest
and Turbopack, and in a browser bundle. It no longer inlines `yaml` (its
CommonJS build called `require("process")` inside an ES module); `yaml`
is now a dependency of the package. The entry is pure, with no file
system and no Node globals: `loadUptideConfig` and `snapshotFromDisk`
move to `uptide/onboarding/node` (breaking for code that imported them
from `uptide/onboarding`). The command line is unchanged.

- [#92](#92)
[`b21a911`](b21a911)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - The Uptide
Action: `action.yml` at the root of this repository now runs Uptide in a
repository's own GitHub Actions (`mode: list | check | fix`, `package`,
`config`, `anthropic-api-key`, `app-url`). It builds the engine of its
own pinned commit, migrates with `--agent sdk` by default, and opens
draft pull requests with a short-lived installation token of the Uptide
GitHub App, obtained for the job's OIDC token, so those pull requests
run the repository's CI. Each run writes an `uptide.run/v1` report to
the job summary and sends it to the Uptide app; a failed upload is a
warning. It replaces the earlier Renovate/Dependabot pull-request
checker that lived at the same path; workflows pinned to an earlier
commit keep running that one.
  
New `uptide/report` export: the `uptide.run/v1` types, its JSON Schema
(also `uptide/report/schema.json`), a validator and the summary
renderer. The report holds no source code, diffs, snippets or
environment values: paths, line numbers, symbol names and counts only.
  
`uptide init` and the "Add Uptide" pull request now write `permissions:
contents: read, id-token: write`; the Action pushes with the Uptide
GitHub App's token instead of `GITHUB_TOKEN`.

### Patch Changes

- [#96](#96)
[`b9c1d71`](b9c1d71)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Assisted fixes
group two sites of one file into one task only when their fix is in the
same place: the same repository declarations behind each compiler error,
or none. Two React 19 `RefObject<T | null>` errors in one file whose
prop types live in two components were sent as one task that could edit
only the first component, and both stayed manual (a regression in
0.8.0).

Co-authored-by: uptide-release[bot] <338861287+uptide-release[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