@@ -45,21 +45,6 @@ const ANNOTATIONS_FILE = path.join(FRAMEWORK_ROOT, 'docs', 'token-annotations.js
4545const OUT_DIR = path . join ( CONFIGURATOR_ROOT , 'src' , 'data' ) ;
4646const OUT = path . join ( OUT_DIR , 'api-index.generated.json' ) ;
4747
48- /**
49- * Read the framework's package version, used only as a display/sync stamp.
50- * Falls back to an empty string when the file is unavailable.
51- * @returns {string }
52- */
53- function readFrameworkVersion ( ) {
54- try {
55- const pkg = JSON . parse (
56- fs . readFileSync ( path . join ( FRAMEWORK_ROOT , 'package.json' ) , 'utf8' )
57- ) ;
58- return typeof pkg . version === 'string' ? pkg . version : '' ;
59- } catch {
60- return '' ;
61- }
62- }
6348
6449/**
6550 * Read the optional token-annotations.json overlay. Returns null if the file
@@ -180,7 +165,10 @@ function main() {
180165 _sync : {
181166 generatedBy : 'configurator/scripts/sync-api.mjs' ,
182167 source : path . relative ( FRAMEWORK_ROOT , SOURCE ) . split ( path . sep ) . join ( '/' ) ,
183- frameworkVersion : readFrameworkVersion ( ) ,
168+ // frameworkVersion is intentionally NOT stored here. It is injected at
169+ // Vite build time (vite.config.js `define.__SLASHED_VERSION__`) from the
170+ // root package.json, so it always matches the build and never needs a
171+ // separate sync step.
184172 // Content hash of the projected catalogue. Unlike a wall-clock stamp it
185173 // only changes when the tokens themselves change, so re-running the sync
186174 // produces no diff unless the framework API actually moved.
@@ -206,8 +194,7 @@ function main() {
206194
207195 console . log (
208196 `[configurator:sync] ${ path . relative ( FRAMEWORK_ROOT , OUT ) } ← ` +
209- `${ out . _sync . source } (${ tokens . length } tokens, framework ` +
210- `${ out . _sync . frameworkVersion || 'unknown' } )`
197+ `${ out . _sync . source } (${ tokens . length } tokens)`
211198 ) ;
212199}
213200
0 commit comments