Skip to content

fix: respect JavaScript settings for scoped analysis roots - #81

Merged
lucasbraum merged 1 commit into
mainfrom
fix/scoped-javascript-roots
Oct 11, 2026
Merged

lucasbraum merged 1 commit into
mainfrom
fix/scoped-javascript-roots

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

What and why

uptide fix react --target 19.3.0 on medusajs/medusa at 146c46b0ad passed range preflight after #79, then crashed during usage analysis with Cannot read properties of undefined (reading 'escapedName').

Scoped rootFiles were added to ts-morph without respecting allowJs. The root workspace therefore retained a JavaScript syntax tree that TypeScript excluded from its program, leaving its property symbols unbound. Requesting the contextual type of an object passed to JSON.stringify in www/packages/docs-ui/scripts/generate-mermaid-icons.mjs:109 dereferenced one of those missing symbols. The installed compiler was TypeScript 5.9.3; the crash occurred within ts-morph's bundled 6.0.2, not a TS 7/tsgo mismatch.

Filter scoped JavaScript roots according to effective allowJs, including the checkJs default. Enabled JavaScript remains analyzed; compiler exceptions are not suppressed. Includes a patch changeset and is rebased onto main after #79.

How it was verified

  • The minimal fixture (JSON.stringify({ icons: {} })) failed with the same escapedName error before the fix for .js, .jsx, .mjs, and .cjs. It now checks disabled/enabled JavaScript, implicit checkJs, explicit allowJs: false, and preserved TypeScript usages.
  • pnpm lint and pnpm typecheck passed.
  • Full package suites: TMPDIR=/private/tmp pnpm -r test --maxWorkers=4 — 1,556 passed, 28 skipped (1,170 core + 386 CLI). Running directly preserves canonical TMPDIR; Turbo's environment filtering caused an unrelated macOS /var versus /private/var release-test failure in the first attempt.
  • Integration build passed. After corepack enable and yarn install --immutable, the original fix: preserve compatible workspace ranges and widen rejecting peers #79 revision plus this fix completed Medusa analysis, ran its baseline test command, and reached dependency installation. The run then exited 2 because Yarn 3.2.1 rejects yarn install --mode=skip-builds. That separate package-manager blocker remains; this does not claim a successful migration. The original Medusa checkout stayed clean and no Medusa PR was created. Assisted edits were disabled with --no-llm.

Checklist

  • Tests for the change (a bug fix starts with a failing test)
  • Lint, typecheck, and full package test suites pass (commands above)
  • README and docs reviewed; no changes needed to restore the existing compiler-setting behavior
  • Changeset added
  • No new dependency
  • No private code, names or paths in fixtures, tests or docs
  • The rules in CONTRIBUTING.md ("Rules that do not bend") still hold

@lucasbraum
lucasbraum merged commit ac01a01 into main Oct 11, 2026
8 checks passed
@lucasbraum
lucasbraum deleted the fix/scoped-javascript-roots branch October 11, 2026 23:51
@uptide-release uptide-release Bot mentioned this pull request Oct 11, 2026
lucasbraum pushed a commit that referenced this pull request Oct 12, 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]

### Patch Changes

- [#83](#83)
[`bda0b35`](bda0b35)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Find more of what
an upgrade breaks. Named checks now also compile the files that directly
import a package's importers when what they import depends on the
package, within a 20% memory budget relative to the same program's
estimate (the same files on every machine), so a test calling a wrapped
tool's `execute` is reported. Files the budget leaves out are named per
workspace in the check and fix summaries, `report.json` and the HTML
report. The `ai` pack flags `ToolLoopAgent`, `Agent` and
`ToolLoopAgentSettings` type arguments, whose third position is now the
runtime context, and finds renamed options inside spread objects, behind
`as`/`satisfies`, and in an agent's `stream`/`generate` calls. Breaking
recall: `ai` 36% → 82%, `zod` 71% → 74%, with no false positives.

- [#84](#84)
[`5c59257`](5c59257)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Yarn 2 and 3
lockfiles: follow dependency references written without the `npm:`
protocol, so a moved package's own subtree is recognized. `fix` no
longer rejects a new major that swaps its dependencies (for example
`cmdk` 0.2 → 1.0 replacing `@radix-ui/*` 1.0.0 with 1.1.x) as "changed
resolutions outside the dependency subtree", and importer resolutions in
these lockfiles are now compared too. Changes reached only from packages
that did not move are still rejected. The report lists each allowed
transitive change under the package that moved it.
  
A root `resolutions`, `overrides` or `pnpm.overrides` entry that pins a
package the upgrade moves now stops the run before the baseline and the
install, naming the entry, instead of failing after the install (on
medusa: 33 s instead of 11 min). With Yarn 2+, a moved package whose
range the plan rewrote is pinned to the exact planned version too (it
resolved the newest match before).
  
Temporary clones are removed on exit, including after a failed or
interrupted run. `--keep-temp` (or `--debug`, which also prints every
phase) keeps one; `--keep` still works as before.

- [#85](#85)
[`0af3fed`](0af3fed)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Fix a 0.7.4
regression: when a workspace declares the upgraded package both in
`peerDependencies` and in `dependencies` or `devDependencies`, the
widened peer range (for example `^18.3.1 || ^19.0.0`) replaced the
installable range in the install and in the check that follows it. With
Yarn it is no lockfile descriptor, so the check read an old copy and
`fix` stopped with "Requested [email protected], but … resolved 17.0.2". Peer
ranges are now only validated and widened in the manifest:
`dependencies`, `devDependencies` and `optionalDependencies` alone feed
the install, `yarn set resolution` and the check.

- [#86](#86)
[`191c89e`](191c89e)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Fix `uptide pr
--yes` opening a ready-for-review pull request when `--draft` is
omitted. New pull requests now default to drafts, matching `fix --pr
--yes` and the migration report's instructions.

- [#81](#81)
[`ac01a01`](ac01a01)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Respect the
repository's JavaScript compiler setting when selecting scoped analysis
roots. This prevents an `escapedName` crash during upgrades in mixed
TypeScript/JavaScript monorepos while preserving analysis of enabled
JavaScript files.

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