Skip to content

Add canonical remix export manifest#11392

Merged
mjackson merged 58 commits into
mainfrom
agents/json-structure-for-remix-exports
May 14, 2026
Merged

Add canonical remix export manifest#11392
mjackson merged 58 commits into
mainfrom
agents/json-structure-for-remix-exports

Conversation

@brophdawg11
Copy link
Copy Markdown
Contributor

@brophdawg11 brophdawg11 commented May 12, 2026

Closes #11384.

Rewrite remix/<pkg> exports to use canonical domain-oriented names via a manifest we maintain in the repo

  • packages/remix/manifest.json - new source of truth
  • scripts/utils/manifest.ts - shared utilities used by all three consumers (generate-remix, docs, and tests)
  • generate-remix and docs updated to respect the new canonical names
  • demos/ updated to use the new canonical names

The manifest is a complete mapping of every remix export we wish to generate - including both "legacy" exports and the new canonical exports. When we are ready to drop legacy exports we just delete them from the manifest.

@brophdawg11 brophdawg11 changed the title Add canonical remix export manifest (remix/manifest.json) Add canonical remix export manifest May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview Build Available

A preview build has been created for this PR. You can install it using:

pnpm install "remix-run/remix#preview/pr-11392&path:packages/remix"

This preview build will be updated automatically as you push new commits.

@brophdawg11 brophdawg11 force-pushed the agents/json-structure-for-remix-exports branch from 87d48ee to aad3c32 Compare May 12, 2026 16:49
@remix-run remix-run deleted a comment from remix-run-bot May 12, 2026
@brophdawg11 brophdawg11 reopened this May 12, 2026
brophdawg11 and others added 21 commits May 12, 2026 14:06
- Collapse 24 literal entries into 10 (4 patterns + 6 literals)
- Patterns use regex in value + $N capture refs in key, e.g.
    "remix/middleware/$1": "@remix-run/([a-z-]+)-middleware"
- Test: every pattern 1 workspace packagematches
- Test: every manifest value is a real export of its package
- Test: all exports of every referenced package are covered

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Load manifest.json at startup
- buildSpecifierToRemixPath() expands pattern entries against workspace
 canonical remix path
- In export entry generation, consult the map before falling back to the
  mechanical `remix/<pkg-short-name>` path
- Removes the hard-coded fetch-router/routes special-case (now manifest-driven)
- Generated exports now use canonical paths: remix/router, remix/routes,
  remix/middleware/*, remix/data-table/*, remix/session-storage/*, etc.
- Fix manifest.test.ts: use const for module-scope bindings (lint rule)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 remix/router
 remix/middleware/*
 remix/data-table/*
 remix/file-storage/*
 remix/session-storage/*
 remix/session-storage/*

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add docs/src/generate/manifest.ts: resolveRemixPath() helper that
  expands pattern entries and resolves @remix-run/* specifiers to their
  canonical remix/* import paths, with mechanical fallback
 remix/ rewrite
  with resolveRemixPath() in getApiFilePath()
- packages.ts: replace mechanical regex in getDocsPackageName() with
  resolveRemixPath()
- docs/src/server/prerender.ts, router.tsx: update remix/fetch-router
 remix/router

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- buildSpecifierToRemixPath(), readManifest(), readWorkspacePackageNames()
  all live in one place
- generate-remix.ts imports from there (removes local copy)
- docs/src/generate/manifest.ts builds the eager Map the same way,
  exposing resolveRemixPath() as a thin lookup wrapper
- manifest.test.ts uses the shared builder; removes expandPatternEntry()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The utility now returns the full 'remix/...' path so callers don't need
to prepend it manually.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All specifiers are @remix-run/pkg or @remix-run/pkg/subpath, so the
non-@ branch was dead code. Split on '/' and take the first two parts
as the package name, remainder as subpath.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sub-exports are always explicit manifest entries; no subpath fallback needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Consumers now pass packagesDir instead of a pre-scanned name list.
readWorkspacePackageNames is removed as a public export.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
buildSpecifierToRemixPath(packagesDir) is now the only call needed.
It reads packages/remix/manifest.json itself. readManifest removed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TypeDoc emits @remix-run/fetch-router.routes.Symbol as the full name for
symbols in the fetch-router/routes sub-export. getApiFilePath was mapping
 remix/router, leaving 'routes' as a namespace
segment in the path.

Fix: after shifting the package name, check if pkg + first namespace
segment is a more specific manifest entry. If so, consume that segment
and use the specific path (remix/routes) instead.

Also exports hasRemixPackage() predicate from manifest.ts for this check.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 remix/data-table/*
 remix/router
- Fix manifest.json middleware regex typo: missing opening bracket

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Update README files, skill docs, and demo docs across the repo:
 remix/router
 remix/middleware/*
 remix/data-table/*
 remix/file-storage/*
 remix/session-storage/*
 remix/session-storage/{cookie,fs,memory}

Skipped: docs/build/ (untracked generated output), .changes/ and
CHANGELOG.md (historical records).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add missing session-storage, data-table, and file-storage renames.
Organize by category for readability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
 router
 middleware/*
 data-table/*
 file-storage/s3
 session-storage/*

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@brophdawg11 brophdawg11 force-pushed the agents/json-structure-for-remix-exports branch from ca636dd to 9c5f0ff Compare May 12, 2026 18:15
@brophdawg11 brophdawg11 marked this pull request as ready for review May 12, 2026 18:16
brophdawg11 and others added 7 commits May 13, 2026 13:14
Legacy aliases cover old paths. The only intentional change file
for this PR is major.remix.update-exports.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Legacy alias entries carry the readmePath and clear it from canonical
entries, so READMEs land alongside the old mechanical export files
(e.g. cop-middleware/README.md) matching origin/main's structure.
Reduces PR diff noise.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The tags weren't surfacing in IDEs, so they added noise without benefit.
Renamed the field to legacyAliasOf to keep the intent clear.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Re-sort allExports after pushing legacy aliases so they're
interleaved with canonical exports rather than appended at the end.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread scripts/generate-remix.ts Outdated
brophdawg11 and others added 2 commits May 13, 2026 13:43
…ports

Stub files now use the sub-package name (e.g. fetch-router.ts) rather than
the canonical remix path name (e.g. router.ts). The package.json exports
field does the human-readable mapping:

  './router' -> './src/fetch-router.ts'
  './fetch-router' -> './src/fetch-router.ts'  (legacy alias, same stub)

This makes the mapping explicit and readable without needing to open any
generated file. Legacy aliases share stubs with their canonical counterparts
so no duplicate files are written.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Validates the new export structure end-to-end. Old mechanical paths
still work via legacy aliases but bookstore now uses the canonical ones:

  remix/fetch-router       -> remix/router
  remix/*-middleware       -> remix/middleware/*
  remix/data-table-sqlite  -> remix/data-table/sqlite
  remix/session/fs-storage -> remix/session-storage/fs
  ... (etc.)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread packages/remix/manifest.json Outdated
brophdawg11 and others added 13 commits May 14, 2026 13:39
…cyAliases

- Replace getRemixRunPackages() with scanPackages() + buildExportsFromManifest()
- Remove buildLegacyAliases() and legacyAliasOf field entirely
- All exports now driven by manifest.json entries (canonical first, legacy aliases after)
- isLegacyAlias() helper replaces legacyAliasPaths Set in change-file logic
- Remove buildSpecifierToRemixPath import from generate-remix.ts
- Update manifest.test.ts: replace pattern-matching test with format validation test

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Prefer non-1:1 mapping when 2 remix paths share a specifier.
Throw if 3+ paths map to the same specifier.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The remix package's sub-export discovery was creating sidebar entries for
legacy alias paths (e.g. remix/fetch-router/routes) in addition to the
canonical ones (remix/routes). Skip any remix umbrella sub-export whose
mechanical docs path doesn't match the canonical manifest path.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ckage skill

- Add test: 'every @remix-run/* workspace package is referenced in the manifest'
- Exclude @remix-run/cli (handled separately by generate-remix)
- Update add-package skill step 8 to document manifest.json update requirements

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
"remix/ui/test": "@remix-run/ui/test",
"remix/ui/theme": "@remix-run/ui/theme",

"_comment": "Legacy aliases: mechanical paths kept for backwards compatibility. Canonical entries above take precedence.",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

When we're ready to drop these we can just delete these items from the manifest

@mjackson mjackson merged commit 62ed2b6 into main May 14, 2026
27 checks passed
@mjackson mjackson deleted the agents/json-structure-for-remix-exports branch May 14, 2026 19:44
@github-actions
Copy link
Copy Markdown
Contributor

The preview branch preview/pr-11392 has been deleted now that this PR is merged/closed.

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.

Proposal: define canonical Remix import paths

3 participants