Skip to content

docs: keep migration skill uncommitted and fix CJS types path - #120

Merged
chaitanyapotti merged 3 commits into
mainfrom
docs/migration-skill-consumer-guidance
Nov 4, 2026
Merged

chaitanyapotti merged 3 commits into
mainfrom
docs/migration-skill-consumer-guidance

Conversation

@chaitanyapotti

@chaitanyapotti chaitanyapotti commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

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-scripts version. The Vite+ types guidance also still told monorepos to copy declarations into the old dist/lib.cjs/types path.

Jira Link

N/A

Description

  • Tell consumers not to commit the migration skill; read it from node_modules (or a local non-committed Cursor copy).
  • Update the monorepo Vite+ guidance so types points at dist/lib.cjs/index.d.ts instead of copying into dist/lib.cjs/types.
  • Remove the outdated copy step from the sample vite.config.ts.

How has this been tested?

  • Reviewed the README and skill diffs for consistency with each other.
  • No runtime code changed; documentation-only verification.

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Docs / migration guidance only.

Checklist

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Note

Low Risk
Documentation and migration guidance only; no runtime or build code changes.

Overview
Migration skill: README and SKILL.md now tell consumers not to commit a Cursor copy of the migration skill—read it from node_modules (or keep a local copy out of git) so it stays aligned with the installed @toruslabs/torus-scripts version.

Vite+ CJS declarations: Monorepo guidance no longer recommends copying .d.ts into dist/lib.cjs/types. It documents that Vite+ emits CJS types at dist/lib.cjs/index.d.ts, that exports["."].types must be updated (TypeScript prefers that over top-level types), and removes the obsolete copy step from the sample vite.config.ts.

A patch changeset records the @toruslabs/torus-scripts doc update.

Reviewed by Cursor Bugbot for commit 938bf7d. Bugbot is set up for automated code reviews on this repo. Configure here.

Stop consumers from committing a stale skill copy, and point package types at Vite+'s actual declaration output instead of copying files.
@chaitanyapotti
chaitanyapotti requested a review from a team as a code owner November 4, 2026 08:17
Satisfy the release-notes check for the torus-scripts documentation updates.
@chaitanyapotti
chaitanyapotti requested a review from a team as a code owner November 4, 2026 08:20

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:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread packages/torus-scripts/README.md Resolved
TypeScript resolves exports types and ignores the top-level types field, so the old CJS declaration path must change in both places.
@chaitanyapotti
chaitanyapotti merged commit 6dc28b3 into main Nov 4, 2026
9 checks passed
@chaitanyapotti
chaitanyapotti deleted the docs/migration-skill-consumer-guidance branch November 4, 2026 08:47
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.

4 participants