Repository navigation
docs: keep migration skill uncommitted and fix CJS types path - #120
Merged
Merged
Conversation
Stop consumers from committing a stale skill copy, and point package types at Vite+'s actual declaration output instead of copying files.
arch1995
approved these changes
Nov 4, 2026
Satisfy the release-notes check for the torus-scripts documentation updates.
lionellbriones
approved these changes
Nov 4, 2026
tuna1207
reviewed
Nov 4, 2026
|
|
||
| 1. Map Lerna's workspace, build order, version, and publish tasks before removing it. Run `vp migrate` once at the workspace root. Give each package its own `build` task. Use `vp run -r build` at the root, and verify dependency order and each package's output. Put `vp run` options before the task name, as in `vp run -r --fail-if-no-match build`. `vp run` forwards arguments after the task name to the task, and npm lifecycle scripts fail on unknown options with `EUNKNOWNCONFIG`. | ||
| 2. Preserve public package paths before changing their manifests. For packages that expose `dist/lib.esm/index.js`, `dist/lib.cjs/index.js`, and `dist/lib.cjs/types/index.d.ts`, use a consumer-owned `vite.config.ts` with explicit output directories. Adapt this pattern to the installed Vite+ version: | ||
| 2. Preserve public package paths before changing their manifests. For packages that expose `dist/lib.esm/index.js` and `dist/lib.cjs/index.js`, use a consumer-owned `vite.config.ts` with explicit output directories. Vite+ writes the CJS declarations to `dist/lib.cjs/index.d.ts`. If the old manifest pointed `types` at `dist/lib.cjs/types/index.d.ts`, change the `types` field to the new path. Do not copy the file back into the old folder. Adapt this pattern to the installed Vite+ version: |
Member
There was a problem hiding this comment.
exports still points at a file the build no longer writes.
@toruslabs/constants (and the other fetch-node-details packages) also has exports["."].types set to ./dist/lib.cjs/types/index.d.ts. TypeScript uses that exports path and ignores the top-level types field. After this migration the exports path is a file that vp pack does not emit, so import ... from "@toruslabs/constants" fails typechecking. @toruslabs/torus-embed has no exports, so the new sentence is enough there.
TypeScript resolves exports types and ignores the top-level types field, so the old CJS declaration path must change in both places.
tuna1207
approved these changes
Nov 4, 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.
Motivation and Context
Consumer projects were told to copy the migration skill into
.cursor/skills, which leads to a committed copy that drifts from the installed@toruslabs/torus-scriptsversion. The Vite+ types guidance also still told monorepos to copy declarations into the olddist/lib.cjs/typespath.Jira Link
N/A
Description
node_modules(or a local non-committed Cursor copy).typespoints atdist/lib.cjs/index.d.tsinstead of copying intodist/lib.cjs/types.copystep from the samplevite.config.ts.How has this been tested?
Screenshots (if appropriate)
N/A
Types of changes
Docs / migration guidance only.
Checklist
Note
Low Risk
Documentation and migration guidance only; no runtime or build code changes.
Overview
Migration skill: README and
SKILL.mdnow tell consumers not to commit a Cursor copy of the migration skill—read it fromnode_modules(or keep a local copy out of git) so it stays aligned with the installed@toruslabs/torus-scriptsversion.Vite+ CJS declarations: Monorepo guidance no longer recommends copying
.d.tsintodist/lib.cjs/types. It documents that Vite+ emits CJS types atdist/lib.cjs/index.d.ts, thatexports["."].typesmust be updated (TypeScript prefers that over top-leveltypes), and removes the obsoletecopystep from the samplevite.config.ts.A patch changeset records the
@toruslabs/torus-scriptsdoc update.Reviewed by Cursor Bugbot for commit 938bf7d. Bugbot is set up for automated code reviews on this repo. Configure here.