Repository navigation
feat(core): add the light @tanstack/cms-core/definition entry and its Node load test - #24
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 494d132 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 59 minutes. View limit details
TanStack is on CodeRabbit Free, which includes PR summaries. Ask your admin to upgrade for code reviews.
|
jherr
force-pushed
the
cursor/explicit-roles-6828
branch
from
November 6, 2026 02:39
93a9a48 to
a3acc49
Compare
cursor
Bot
force-pushed
the
cursor/explicit-roles-6828
branch
from
November 6, 2026 02:57
a3acc49 to
8553f16
Compare
cursor
Bot
force-pushed
the
cursor/definition-entry-0c86
branch
from
November 6, 2026 02:57
c76a818 to
e126e12
Compare
jherr
force-pushed
the
cursor/definition-entry-0c86
branch
from
November 6, 2026 03:17
e126e12 to
2850c54
Compare
This was referenced Nov 6, 2026
Merged
cursor
Bot
force-pushed
the
cursor/definition-entry-0c86
branch
from
November 6, 2026 14:50
2850c54 to
1513928
Compare
jherr
force-pushed
the
cursor/definition-entry-0c86
branch
from
November 6, 2026 15:06
1513928 to
494d132
Compare
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.
Implements cms-refactor-plan.md § Phase 1e(i).
Merge chain: step 4 of 24. Base:
main. Merge it right after #23. The branch ismain3b4a112, then one commit for each PR before this one in the merge order, then this PR's own commit1513928(tree0f9c1e1).What
@tanstack/cms-core/definition.defineCmsDefinition({ collections, admin, plugins })returns a definition with derived, frozen accessors:adminBasePath(),collections(),pluginRoutes()androuteKeys().isCmsDefinition,CMS_ROUTE_KEYSand the route-key types.cms.definition.tsand its collection modules never import the package root.defineCollection,defineBlock,defineFieldType,definePlugin,seoField,assetField,redirectsCollection,isSafeRedirectTargetandisBuiltInFieldType.src/lib/authoring.ts, and the root re-exports the same functions. A test asserts they are identical.defineCms(definition, runtime)andcreateCms(definition, runtime)overloads. The runtime config isCmsConfigminuscollections,adminandplugins. Both forms go through the same plugin merging and validation, and a test asserts the resolved configs are equal.defineCms(config)is unchanged.Registeraccepts the definition.RegisteredCollectionName,RegisteredDocandRegisteredAdminBasePathinfer from it, plugin collections included. A separate tsc project checks this.CMS_ROUTE_KEYSis the single source of truth.cms-ui-reactkeys its route table by it, so a key missing on either side failstsc. Route output is unchanged.pnpm test:definitions(scripts/verify-definitions.ts), runs intest:prandtest:ci.cms.definition.tsin a plain Node process behind amodule.register()hook. The hook fails onreact,react-dom,.tsx/.jsxfiles,@tanstack/react-start,@tanstack/react-router, thecms-ui-reactroot,@tanstack/cms-core/serverand*.server.*files.--strictmakes it fail, and 1e(ii) turns that on.docs/api/cms-core.mdgets a "The CMS definition" section, marked as the recommended shape. The changeset is minor for cms-core and patch for cms-ui-react.No app, starter or example config is touched; 1e(ii) migrates them.
Breaking changes
None; this is additive.
Divergence from plan
collections()returns{ name }only. No collection declares a public prefix today, only an opaquepath(), sopublicPrefixwaits for locators in phase 3c.pluginRoutes()entries are{ plugin, route }. 1d needs the plugin name for its per-plugin generated route copies.@tanstack/cms-core/server.blockTypesstays in the runtime config.defineInterfaceCollectionstays root-only here. It needs the interface zod schemas and the cron parser. 1e(ii) exports it from/definitionas well.@tanstack/*packages to Node, and Node can't resolve extensionless imports in their.tssources. So every runtime import this entry reaches names its.tsfile, and a test guards that.How verified
pnpm test:prpasses except thecms-apioxlint error thatmainalready has.test:dts,test:dialects,test:definitionsandtest:scriptspass.node scripts/pack-consumer.mjstype-checks the new entry from the packed tarball. It then fails only on theformsLeadCaptureSkillerror thatmainalready has.dist/definition.js.Merge chain (local verification, CI down)
This PR's commits are squashed into one commit on the linear merge chain. That commit holds this PR's own changes, resolved against every PR before it, with the integration rehearsal's fixes for this PR applied. No conflicts.
The chain tip's tree is exactly the integration rehearsal plus #46 (
c4e6d7c), and the tip passes the full local suite. I simulated merging every PR in order, with a merge commit or a fast-forward at each step, and every step is clean. A plain squash of the next PR would conflict, because the squash commit isn't an ancestor of the next branch. To squash instead, first rebase the branch's one commit onto the newmain; that rebase is always clean.