catalyst-core 0.2.0-beta.3 → 0.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babel.native.config.cjs +8 -0
- package/bin/catalyst.js +49 -105
- package/changelog.md +8 -0
- package/dist/caching.js +1 -1
- package/dist/index.jsx +8 -0
- package/dist/logger.js +74 -3
- package/dist/native/androidSetup.js +300 -8
- package/dist/native/bridge/WebBridge.js +481 -59
- package/dist/native/bridge/constants/NativeInterfaces.js +290 -45
- package/dist/native/bridge/errors.js +250 -26
- package/dist/native/bridge/hooks/index.js +125 -1
- package/dist/native/bridge/hooks/useCamera.js +347 -9
- package/dist/native/bridge/hooks/useDataProtection.js +200 -2
- package/dist/native/bridge/hooks/useDeviceInfo.js +71 -2
- package/dist/native/bridge/hooks/useFilePicker.js +429 -2
- package/dist/native/bridge/hooks/useGoogleSignIn.js +81 -1
- package/dist/native/bridge/hooks/useHapticFeedback.js +196 -1
- package/dist/native/bridge/hooks/useIntent.js +95 -1
- package/dist/native/bridge/hooks/useNativeTransition.js +202 -27
- package/dist/native/bridge/hooks/useNetworkStatus.js +84 -3
- package/dist/native/bridge/hooks/useNotification.js +318 -2
- package/dist/native/bridge/hooks/useSafeArea.js +84 -2
- package/dist/native/bridge/hooks/useVideoStream.js +434 -6
- package/dist/native/bridge/hooks/utils.js +27 -1
- package/dist/native/bridge/hooks.js +16 -1
- package/dist/native/bridge/perf/collectors/ApiCollector.js +66 -3
- package/dist/native/bridge/perf/collectors/CacheCollector.js +186 -11
- package/dist/native/bridge/perf/collectors/HookCollector.js +141 -19
- package/dist/native/bridge/perf/collectors/InsightsCollector.js +481 -23
- package/dist/native/bridge/perf/collectors/InteractionCollector.js +245 -10
- package/dist/native/bridge/perf/collectors/KeyboardCollector.js +107 -8
- package/dist/native/bridge/perf/collectors/NavigationCollector.js +273 -32
- package/dist/native/bridge/perf/collectors/NetworkTimingCollector.js +178 -2
- package/dist/native/bridge/perf/collectors/RenderCollector.js +258 -14
- package/dist/native/bridge/perf/collectors/ScrollCollector.js +95 -9
- package/dist/native/bridge/perf/collectors/ThreadCollector.js +90 -6
- package/dist/native/bridge/perf/core/constants.js +103 -20
- package/dist/native/bridge/perf/core/measure.js +179 -30
- package/dist/native/bridge/perf/core/session.js +89 -23
- package/dist/native/bridge/perf/core/store.js +554 -1
- package/dist/native/bridge/perf/core/summary.js +174 -1
- package/dist/native/bridge/perf/core/traceExport.js +240 -1
- package/dist/native/bridge/perf/core/waterfalls.js +146 -1
- package/dist/native/bridge/perf/index.js +359 -38
- package/dist/native/bridge/safeArea.js +53 -5
- package/dist/native/bridge/standardizedHooks.js +595 -82
- package/dist/native/bridge/useBaseHook.js +274 -38
- package/dist/native/bridge/utils/CameraUtils.js +201 -56
- package/dist/native/bridge/utils/FileObjectConverter.js +129 -18
- package/dist/native/bridge/utils/NativeBridge.js +425 -141
- package/dist/native/buildAndroid/assets.js +510 -13
- package/dist/native/buildAndroid/build.js +296 -19
- package/dist/native/buildAndroid/config.js +87 -1
- package/dist/native/buildAndroid/index.js +374 -1
- package/dist/native/buildAppAndroid.js +34 -2
- package/dist/native/buildAppIos.js +62 -2
- package/dist/native/buildIos/assets.js +609 -8
- package/dist/native/buildIos/build.js +639 -20
- package/dist/native/buildIos/config.js +294 -12
- package/dist/native/buildIos/index.js +343 -6
- package/dist/native/buildIos/plugins.js +343 -16
- package/dist/native/internal-plugins/device-info-plugin/android/DeviceInfoPlugin.kt +43 -0
- package/dist/native/internal-plugins/device-info-plugin/ios/DeviceInfoPlugin.swift +28 -0
- package/dist/native/internal-plugins/device-info-plugin/manifest.json +19 -0
- package/dist/native/internalPluginUtils.js +232 -7
- package/dist/native/package.json +3 -0
- package/dist/native/plugin-bridge/PluginBridge.js +227 -1
- package/dist/native/pluginComposerAndroid.js +407 -23
- package/dist/native/pluginComposerIos.js +435 -11
- package/dist/native/renameAndroidProject.js +1094 -88
- package/dist/native/setupEmulatorIos.js +289 -22
- package/dist/native/setupServer.js +160 -19
- package/dist/native/terminalProgress.js +199 -11
- package/dist/native/utils.js +193 -15
- package/dist/offline/catalyst-sw.js +145 -1
- package/dist/offline/registerServiceWorker.js +33 -1
- package/dist/otel.js +375 -46
- package/dist/router/ClientRouter.js +14 -2
- package/dist/router/ServerRouter.js +9 -1
- package/dist/router.js +1 -1
- package/dist/scripts/build.js +112 -3
- package/dist/scripts/checkVersion.js +3 -1
- package/dist/scripts/cleanCache.js +30 -1
- package/dist/scripts/generateOfflineManifest.js +116 -1
- package/dist/scripts/loadEnvironmentVariables.js +32 -6
- package/dist/scripts/plugins.js +309 -1
- package/dist/scripts/preServerInit.js +13 -0
- package/dist/scripts/scriptUtils.js +54 -3
- package/dist/scripts/serve.js +51 -4
- package/dist/scripts/start.js +47 -10
- package/dist/scripts/validator.js +149 -1
- package/dist/sentry.cjs +127 -0
- package/dist/sentry.js +125 -5
- package/dist/server/expressServer.js +250 -5
- package/dist/server/manifestCache.js +36 -0
- package/dist/server/renderer/ChunkExtractor.js +144 -0
- package/dist/server/renderer/document/Body.jsx +59 -0
- package/dist/server/renderer/document/FastRefresh.jsx +20 -0
- package/dist/server/renderer/document/Head.jsx +60 -0
- package/dist/server/renderer/document/index.jsx +2 -0
- package/dist/server/renderer/extract.js +149 -31
- package/dist/server/renderer/handler.jsx +433 -0
- package/dist/server/renderer/index.js +8 -1
- package/dist/server/renderer/render.js +47 -0
- package/dist/server/utils/botDetectionMiddleware.js +29 -0
- package/dist/server/utils/cjsRequire.js +10 -0
- package/dist/server/utils/userAgentUtil.js +87 -9
- package/dist/server/utils/validator.js +164 -1
- package/dist/vite/FastRefresh.jsx +20 -0
- package/dist/vite/inject-cache-key-plugin.js +276 -0
- package/dist/vite/loadCustomViteConfig.js +22 -0
- package/dist/vite/manifest-categorization-plugin.js +455 -0
- package/dist/vite/node-loader.mjs +458 -0
- package/dist/vite/scssParams.js +21 -0
- package/dist/vite/vite.config.client.js +130 -0
- package/dist/vite/vite.config.js +422 -0
- package/dist/vite/vite.config.server.js +84 -0
- package/dist/web-router/components/MetaTag.jsx +34 -0
- package/dist/web-router/components/RouterDataProvider.jsx +332 -0
- package/dist/web-router/components/Split.jsx +200 -0
- package/dist/web-router/components/SplitInview.jsx +106 -0
- package/dist/web-router/components/SsrRequestContext.jsx +14 -0
- package/dist/web-router/context.jsx +12 -0
- package/dist/web-router/hooks.jsx +72 -0
- package/dist/web-router/types/components/MetaTag.d.ts +2 -0
- package/dist/web-router/types/components/RouterDataProvider.d.ts +95 -0
- package/dist/web-router/types/context.d.ts +14 -0
- package/dist/web-router/types/hooks.d.ts +1 -0
- package/dist/web-router/types/index.d.ts +3 -0
- package/dist/web-router/types/utils/metaDataUtils.d.ts +24 -0
- package/dist/web-router/utils/metaDataUtils.jsx +119 -0
- package/mcp_v2/conversion-tasks.json +35 -17
- package/mcp_v2/knowledge-base.json +124 -13
- package/mcp_v2/lib/helpers.js +10 -0
- package/mcp_v2/mcp.js +4 -4
- package/mcp_v2/package.json +1 -0
- package/mcp_v2/tools/build.js +116 -20
- package/mcp_v2/tools/conversion.js +106 -5
- package/mcp_v2/tools/tasks.js +18 -14
- package/package.json +35 -68
- package/babel.config.js +0 -32
- package/dist/index.js +0 -1
- package/dist/scripts/devBuild.js +0 -3
- package/dist/scripts/devServe.js +0 -3
- package/dist/scripts/loadScriptsBeforeServerStarts.js +0 -4
- package/dist/scripts/registerAliases.js +0 -6
- package/dist/server/renderer/document/Body.js +0 -11
- package/dist/server/renderer/document/Head.js +0 -9
- package/dist/server/renderer/document/index.js +0 -1
- package/dist/server/renderer/handler.js +0 -47
- package/dist/server/startServer.js +0 -57
- package/dist/webpack/babel-plugins/remove-client.plugin.js +0 -5
- package/dist/webpack/babel-plugins/remove-ssr.plugin.js +0 -5
- package/dist/webpack/babel.config.client.js +0 -1
- package/dist/webpack/babel.config.ssr.js +0 -1
- package/dist/webpack/base.babel.js +0 -7
- package/dist/webpack/development.client.babel.js +0 -10
- package/dist/webpack/production.client.babel.js +0 -4
- package/dist/webpack/production.ssr.babel.js +0 -8
- package/dist/webpack/scssParams.js +0 -9
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
},
|
|
178
178
|
{
|
|
179
179
|
"section": "build_system",
|
|
180
|
-
"title": "Build NPM Scripts",
|
|
180
|
+
"title": "Legacy 0.2.x Build NPM Scripts",
|
|
181
181
|
"content": "All catalyst npm scripts to add to package.json scripts block (each maps to: catalyst <scriptName>): devBuild \u2014 dev web build. devServe \u2014 dev server. buildApp \u2014 builds native app (both platforms). buildApp:android \u2014 Android native app build. buildApp:ios \u2014 iOS native app build. buildApp:android:release \u2014 Android release build. buildApp:ios:release \u2014 iOS release build. setupEmulator \u2014 sets up both emulators. setupEmulator:android \u2014 sets up Android AVD. setupEmulator:ios \u2014 sets up iOS simulator. NOTE: build:android / build:android:release / build:ios do NOT exist in catalyst \u2014 common mistake. The correct commands are buildApp:android and buildApp:ios. Missing any script = that npm run command fails.",
|
|
182
182
|
"layer": "Build",
|
|
183
183
|
"source": "static",
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
},
|
|
458
458
|
{
|
|
459
459
|
"section": "routing",
|
|
460
|
-
"title": "Catalyst Routing Stack",
|
|
460
|
+
"title": "Legacy 0.2.x Catalyst Routing Stack",
|
|
461
461
|
"content": "@tata1mg/router wraps React Router v6. Routes defined in src/js/routes/index.js as flat or nested array. RouterDataProvider in src/js/routes/utils.js wraps the entire app \u2014 required for data fetching to work. Without RouterDataProvider, serverFetcher/clientFetcher hooks silently return undefined.",
|
|
462
462
|
"layer": "Runtime",
|
|
463
463
|
"source": "static",
|
|
@@ -473,7 +473,7 @@
|
|
|
473
473
|
},
|
|
474
474
|
{
|
|
475
475
|
"section": "routing",
|
|
476
|
-
"title": "RouterDataProvider Setup",
|
|
476
|
+
"title": "Legacy 0.2.x RouterDataProvider Setup",
|
|
477
477
|
"content": "RouterDataProvider from @tata1mg/router wraps the app in src/js/routes/utils.js. Provides route-level data context to all child components. useCurrentRouteData() reads from this context. Missing RouterDataProvider = all useCurrentRouteData() calls return undefined, no error thrown.",
|
|
478
478
|
"layer": "Runtime",
|
|
479
479
|
"source": "static",
|
|
@@ -481,7 +481,7 @@
|
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
483
|
"section": "routing",
|
|
484
|
-
"title": "App Shell with Outlet",
|
|
484
|
+
"title": "Legacy 0.2.x App Shell with Outlet",
|
|
485
485
|
"content": "src/js/containers/App/index.js must render <Outlet /> from @tata1mg/router (not react-router-dom directly). Outlet renders the matched route component. Without Outlet, routing matches but nothing renders. App shell is also where global layout (nav, footer) lives.",
|
|
486
486
|
"layer": "Component",
|
|
487
487
|
"source": "static",
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
"section": "data_fetching",
|
|
508
|
-
"title": "useCurrentRouteData Hook",
|
|
508
|
+
"title": "Legacy 0.2.x useCurrentRouteData Hook",
|
|
509
509
|
"content": "import { useCurrentRouteData } from '@tata1mg/router'. Returns data resolved by serverFetcher/clientFetcher for the current route. Replaces all useState + useEffect data loading patterns. Available only inside RouterDataProvider tree. Returns undefined if RouterDataProvider missing.",
|
|
510
510
|
"layer": "Runtime",
|
|
511
511
|
"source": "static",
|
|
@@ -553,7 +553,7 @@
|
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
"section": "server_structure",
|
|
556
|
-
"title": "Client Entry Files",
|
|
556
|
+
"title": "Legacy 0.2.x Client Entry Files",
|
|
557
557
|
"content": "client/index.js hydrates SSR markup: import { hydrate } from '@tata1mg/router'; hydrate(<App />, document.getElementById('root')). client/styles.js imports global CSS: import '../src/styles/global.css'. Both files required. Missing client/index.js = blank page on web (no hydration). Missing client/styles.js = styles not bundled.",
|
|
558
558
|
"layer": "Build",
|
|
559
559
|
"source": "static",
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
},
|
|
855
855
|
{
|
|
856
856
|
"section": "config_structure",
|
|
857
|
-
"title": "Migration Phase 0 \u2014 Bare Minimum to Boot App (No Bridge)",
|
|
857
|
+
"title": "Legacy 0.2.x Migration Phase 0 \u2014 Bare Minimum to Boot App (No Bridge)",
|
|
858
858
|
"content": "Minimum steps to get a catalyst webview app running without any native bridge/hooks: (1) catalyst-core in package.json dependencies. (2) All native scripts in package.json scripts: buildApp:android, buildApp:ios, setupEmulator:android, setupEmulator:ios, devBuild, devServe. (3) config/config.json WEBVIEW_CONFIG with LOCAL_IP (not localhost), port, APPLICATION_UID, android block (appName, packageName, buildType, sdkPath, emulatorName), ios block (appName, appBundleId, simulatorName, buildType). (4) _moduleAliases correct in package.json \u2014 especially @api pointing to the right path. (5) accessControl.allowedUrls includes your API domains. App will load as a webview at this point \u2014 bridge features (camera, notifications, device info) will not work until Phase 2 (WebBridge init). This is the correct first milestone for any repo migration.",
|
|
859
859
|
"layer": "Config",
|
|
860
860
|
"source": "static",
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
},
|
|
938
938
|
{
|
|
939
939
|
"section": "build_system",
|
|
940
|
-
"title": "Webpack Customization via webpackConfig.js",
|
|
940
|
+
"title": "Legacy 0.2.x Webpack Customization via webpackConfig.js",
|
|
941
941
|
"content": "Every catalyst project has a webpackConfig.js at the project root. This is the ONLY supported way to customize webpack \u2014 do not modify catalyst-core internals.\n\nEXPORTED KEYS:\n- developmentPlugins[]: merged into dev client webpack (webpack-dev-server run)\n- ssrPlugins[]: merged into both dev SSR watcher and production SSR build\n- clientPlugins[]: merged into production client build\n- splitChunksConfig: object \u2014 replaces the default commonVendor+utilityVendor split chunk strategy entirely\n- transpileModules[]: array of package names to whitelist from nodeExternals in SSR builds (use for ESM-only deps that need transpilation)\n\nDEFAULT (from template): all arrays empty, no splitChunksConfig \u2014 uses catalyst-core defaults.\n\nREAL USAGE PATTERNS:\nmweb clientPlugins: HTMLWebpackPlugin (offline.html), InjectManifest/Workbox (service worker), RoutesManifestPlugin (routes manifest from src/js/routes/index.js), UploadAssetsPlugin (S3 upload of assets + build output post-build).\nmweb splitChunksConfig: custom commonVendor test regex, minChunks:2 on utilityVendor, minRemainingSize:20KB.\npsp-pfizer clientPlugins: dual CompressionPlugin (gzip + brotli for JS/CSS/HTML/SVG). splitChunksConfig only applied when NODE_ENV=production (conditional spread pattern).\n\nCSS MODULE RULES (base.babel.js, not overridable):\n- .scss under src/static/css/base and node_modules \u2192 global (no css-loader modules)\n- all other .scss \u2192 CSS Modules, localIdentName from catalystConfig.cssModulesIdentifierDev/Prod\n- SCSS globals injected via sass-loader additionalData: $font_url, $url_for (from scssParams.js)\n\nBASE CONFIG (src/webpack/base.babel.js) handles: JS/TS via babel-loader, SCSS, CSS, images (url-loader+img-loader), SVG (@svgr/webpack), fonts (url-loader+file-loader), HTML (html-loader).\nDefinePlugin exposes CLIENT_ENV_VARIABLES from config/config.json plus BUILD_OUTPUT_PATH, PUBLIC_STATIC_ASSET_PATH, PUBLIC_STATIC_ASSET_URL, SENTRY_CONFIG to client bundle.",
|
|
942
942
|
"layer": "Build",
|
|
943
943
|
"source": "static",
|
|
@@ -961,7 +961,7 @@
|
|
|
961
961
|
},
|
|
962
962
|
{
|
|
963
963
|
"section": "build_system",
|
|
964
|
-
"title": "React Compiler (opt-in via webpackConfig.js)",
|
|
964
|
+
"title": "Legacy 0.2.x React Compiler (opt-in via webpackConfig.js)",
|
|
965
965
|
"content": "React Compiler is opt-in. Disabled by default \u2014 no babel-plugin-react-compiler is added unless explicitly enabled.\n\nENABLE: Add reactCompiler key to webpackConfig.js:\n reactCompiler: true // uses default options: { target: '19' }\n reactCompiler: { target: '19' } // custom options object\n\nHOW IT WORKS: babel.config.client.js and babel.config.ssr.js both read customWebpackConfig.reactCompiler. If truthy, babel-plugin-react-compiler is added as a babel plugin to BOTH client and SSR builds. If the value is an object, it's passed as plugin options directly; otherwise defaults to { target: '19' }.\n\nPEER DEPS (already in catalyst-core, no install needed in app):\n- babel-plugin-react-compiler@^19.0.0-beta\n- react-compiler-runtime@^19.0.0-beta\n- eslint-plugin-react-compiler@^19.0.0-beta\n\nCURRENT USAGE: Neither mweb nor psp-pfizer enable React Compiler \u2014 both ship without the reactCompiler key.",
|
|
966
966
|
"layer": "Build",
|
|
967
967
|
"source": "static",
|
|
@@ -978,7 +978,7 @@
|
|
|
978
978
|
},
|
|
979
979
|
{
|
|
980
980
|
"section": "build_system",
|
|
981
|
-
"title": "CLI Commands and Package Scripts",
|
|
981
|
+
"title": "Legacy 0.2.x CLI Commands and Package Scripts",
|
|
982
982
|
"content": "The catalyst binary (bin/catalyst.js) is the sole entrypoint for all framework commands. Projects call it via npm scripts.\n\nWEB COMMANDS:\n- catalyst start -> dev mode: webpack-dev-server (HMR) + node server\n- catalyst build -> production webpack build (client + SSR)\n- catalyst serve -> start node server (after build)\n- catalyst devBuild -> production webpack build but assets served from local node server (IS_DEV_COMMAND=true)\n- catalyst devServe -> same as devBuild but with webpack watch mode\n\nNATIVE COMMANDS:\n- catalyst buildApp -> builds iOS + Android sequentially\n- catalyst buildApp:ios -> iOS app build only\n- catalyst buildApp:android -> Android app build only\n- catalyst setupEmulator -> sets up iOS + Android emulators sequentially\n- catalyst setupEmulator:ios -> iOS emulator setup only\n- catalyst setupEmulator:android -> Android emulator setup only\n\nINTERNALS:\n- Web commands resolve to dist/scripts/<command>.js (build.js, start.js, serve.js, devBuild.js, devServe.js)\n- Native commands resolve to dist/native/ (buildAppIos.js, buildAppAndroid.js, setupEmulatorIos.js, androidSetup.js)\n\nTYPICAL PROJECT package.json PATTERN:\n \"start\": \"catalyst start\"\n \"build\": \"export NODE_OPTIONS=\\\"--max-old-space-size=6020\\\" && catalyst build\"\n \"serve\": \"catalyst serve\"\n \"buildApp\": \"catalyst buildApp\"\n\nNOTE: serve:prod / serve:stag in project scripts are pm2-runtime commands \u2014 not catalyst CLI commands. These are project-level and not part of the framework.",
|
|
983
983
|
"layer": "Build",
|
|
984
984
|
"source": "static",
|
|
@@ -1000,7 +1000,7 @@
|
|
|
1000
1000
|
},
|
|
1001
1001
|
{
|
|
1002
1002
|
"section": "framework_identity",
|
|
1003
|
-
"title": "Project File Conventions and Structure",
|
|
1003
|
+
"title": "Legacy 0.2.x Project File Conventions and Structure",
|
|
1004
1004
|
"content": "Standard catalyst project layout:\n\nproject-root/\n\u251c\u2500\u2500 client/\n\u2502 \u251c\u2500\u2500 index.js <- webpack entry: hydrates React app (hydrateRoot + loadableReady)\n\u2502 \u2514\u2500\u2500 styles.js <- global CSS imports\n\u251c\u2500\u2500 server/\n\u2502 \u251c\u2500\u2500 index.js <- exports preServerInit() \u2014 runs before express starts (use for OTel, DB init, Sentry)\n\u2502 \u251c\u2500\u2500 server.js <- express server setup\n\u2502 \u2514\u2500\u2500 document.js <- HTML document shell (Head, Body)\n\u251c\u2500\u2500 src/\n\u2502 \u2514\u2500\u2500 js/\n\u2502 \u251c\u2500\u2500 pages/ <- route-level components, one folder per page\n\u2502 \u251c\u2500\u2500 containers/ <- data-connected components (mweb uses these as page-level too)\n\u2502 \u251c\u2500\u2500 components/ <- presentational/shared components\n\u2502 \u251c\u2500\u2500 layouts/ <- layout wrappers used as nested route parents\n\u2502 \u2514\u2500\u2500 routes/ <- index.js exports routes array; utils.js for route helpers\n\u2502 \u2514\u2500\u2500 static/\n\u2502 \u251c\u2500\u2500 css/base/ <- global SCSS \u2014 NOT CSS-moduled (applied globally)\n\u2502 \u2514\u2500\u2500 css/resources/ <- SCSS variables/mixins auto-injected into all CSS modules via sass-resources-loader\n\u251c\u2500\u2500 config/\n\u2502 \u2514\u2500\u2500 config.json <- app config: CLIENT_ENV_VARIABLES, WEBVIEW_CONFIG, ANALYZE_BUNDLE, etc.\n\u251c\u2500\u2500 api.js <- API layer (aliased as @api)\n\u251c\u2500\u2500 webpackConfig.js <- webpack customization hook\n\u2514\u2500\u2500 package.json <- _moduleAliases defines path aliases for webpack + node\n\nMODULE ALIASES (defined in package.json._moduleAliases, resolved by webpack and registerAliases.js):\n @api -> api.js\n @containers -> src/js/containers\n @server -> server\n @config -> config\n @css -> src/static/css\n @routes -> src/js/routes/\n\nKEY CONVENTIONS:\n- Pages use @loadable/component for code splitting. ssr:true enables SSR for that page; ssr:false serves fallback only.\n- client/index.js always uses hydrateRoot (not ReactDOM.render) wrapped in loadableReady.\n- server/index.js exports preServerInit() \u2014 the correct place for server-side init (OTel, Sentry, DB connections).\n- Routes in src/js/routes/index.js use nested structure: layout component as parent, pages as children.\n- Build output: build/public/ (client JS/CSS chunks), build/renderer/ (SSR handler.js + loadable-stats.json).\n- CSS co-located with components as .scss files (CSS Modules). Global styles go in src/static/css/base/.",
|
|
1005
1005
|
"layer": "Framework",
|
|
1006
1006
|
"source": "static",
|
|
@@ -1111,7 +1111,7 @@
|
|
|
1111
1111
|
},
|
|
1112
1112
|
{
|
|
1113
1113
|
"section": "seo_metadata",
|
|
1114
|
-
"title": "Server-Side Meta Tags \u2014 setMetaData()",
|
|
1114
|
+
"title": "Legacy 0.2.x Server-Side Meta Tags \u2014 setMetaData()",
|
|
1115
1115
|
"content": "Each page component can define a static `setMetaData` function that returns an array of JSX meta elements. These are collected server-side and injected into the HTML <head> before the page is streamed to the client.\n\nHOW IT WORKS:\n1. Route components define `Component.setMetaData = (fetcherData) => [...]`\n2. handler.js calls `getMetaData(allMatches, fetcherData)` from @tata1mg/router \u2014 collects setMetaData from all matched route components, passes fetcherData so tags can be dynamic.\n3. The resulting `allTags` array is passed to `renderMarkUp()` \u2192 `<Head metaTags={allTags} />`.\n4. `Head` renders them inside `<head>` before pageCss and preloadJSLinks.\n\nEXAMPLE (static title):\n```js\nHome.setMetaData = () => {\n return [<title key=\"title\">Home</title>]\n}\n```\n\nEXAMPLE (dynamic OG tags using fetcherData):\n```js\nBreedDetails.setMetaData = ({ params, data }) => [\n <title key=\"title\">{params.breed} \u2014 Dog Breeds</title>,\n <meta key=\"og:title\" property=\"og:title\" content={params.breed} />,\n <meta key=\"og:description\" property=\"og:description\" content={data?.message} />,\n]\n```\n\nNOTES:\n- Always add `key` prop to each tag (React list reconciliation).\n- fetcherData shape matches what `serverFetcher` returned for that route.\n- Tags from parent + child routes are merged \u2014 order follows route nesting.\n- `isBot` flag is passed to Head; use for bot-specific meta if needed.",
|
|
1116
1116
|
"layer": "Component",
|
|
1117
1117
|
"source": "static",
|
|
@@ -1130,7 +1130,7 @@
|
|
|
1130
1130
|
},
|
|
1131
1131
|
{
|
|
1132
1132
|
"section": "seo_metadata",
|
|
1133
|
-
"title": "Client-Side Meta Updates \u2014 MetaTag + custom document",
|
|
1133
|
+
"title": "Legacy 0.2.x Client-Side Meta Updates \u2014 MetaTag + custom document",
|
|
1134
1134
|
"content": "On the client side, meta tags are kept in sync across navigations via `<MetaTag />` from @tata1mg/router. For global head additions (fonts, preconnect, etc.), use the custom `server/document.js`.\n\nMETATAG COMPONENT (client SPA navigation):\n- Placed inside `RouterDataProvider` in `preparedRoutes` (src/js/routes/utils.js).\n- Automatically reads `setMetaData` from the newly matched route component and updates the DOM <head> on every client-side navigation.\n- No manual setup needed beyond adding `<MetaTag />` once in the route tree.\n\nCUSTOM DOCUMENT (server/document.js):\n- Optional file at `server/document.js` in the project root.\n- Receives all Head/Body props and lets you wrap or extend the default HTML shell.\n- Use for: global fonts, preconnect links, custom <html> attributes.\n\nEXAMPLE (server/document.js):\n```js\nimport React from 'react'\nimport { Head, Body } from 'catalyst-core'\n\nexport default function Document(props) {\n return (\n <html lang=\"en\">\n <Head {...props}>\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\n <link href=\"https://fonts.googleapis.com/css2?family=Poppins\" rel=\"stylesheet\" />\n </Head>\n <Body {...props} />\n </html>\n )\n}\n```\n\nWhen `Head` receives `children`, it renders them first, then `metaTags`, then pageCss, then preloadJSLinks \u2014 giving you full control over ordering.\n\nNOTES:\n- `MetaTag` is client-only; SSR uses `setMetaData` \u2192 `getMetaData` pipeline.\n- If no `server/document.js` is present, handler.js uses the default Head+Body layout.",
|
|
1135
1135
|
"layer": "Component",
|
|
1136
1136
|
"source": "static",
|
|
@@ -1170,5 +1170,116 @@
|
|
|
1170
1170
|
"layer": "Config",
|
|
1171
1171
|
"source": "extracted:src/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt",
|
|
1172
1172
|
"tags": ["config", "googleSignIn", "android", "oauth", "sign-in"]
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
"section": "framework_identity",
|
|
1176
|
+
"title": "Catalyst Runtime Generations",
|
|
1177
|
+
"content": "Always determine the installed catalyst-core version before giving web runtime guidance. Catalyst 0.2.x is the legacy webpack generation and uses @tata1mg/router plus @loadable/component. Catalyst 0.3.x, beginning with 0.3.0-beta.1, is the Vite/ESM generation: router APIs are exported by catalyst-core and split()/hydrationReady() replace loadable APIs. Do not combine instructions from the two generations. If no version can be detected, ask which version the project targets.",
|
|
1178
|
+
"layer": "Framework",
|
|
1179
|
+
"source": "static",
|
|
1180
|
+
"tags": ["versions", "0.2.x", "0.3.x", "migration", "webpack", "vite"],
|
|
1181
|
+
"github_files": ["packages/catalyst-core/package.json", "packages/catalyst-core/src/index.jsx"]
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
"section": "build_system",
|
|
1185
|
+
"title": "Catalyst 0.3.x Vite Build Runtime",
|
|
1186
|
+
"content": "Catalyst 0.3.x uses Vite for development, client production output, and SSR output. catalyst start runs Vite in middleware mode with SSR and Fast Refresh. catalyst build runs client and server builds in parallel. Client assets are emitted under build/client, the production renderer under build/server, and Vite manifests under build/.vite. catalyst serve loads the built server renderer. This replaces the Catalyst 0.2.x webpack, Babel-register, loadable-stats, and build/public assumptions.",
|
|
1187
|
+
"layer": "Build",
|
|
1188
|
+
"source": "static",
|
|
1189
|
+
"tags": ["0.3.x", "vite", "build", "ssr", "client", "server"],
|
|
1190
|
+
"github_files": [
|
|
1191
|
+
"packages/catalyst-core/src/scripts/start.js",
|
|
1192
|
+
"packages/catalyst-core/src/scripts/build.js",
|
|
1193
|
+
"packages/catalyst-core/src/scripts/serve.js",
|
|
1194
|
+
"packages/catalyst-core/src/vite/vite.config.client.js",
|
|
1195
|
+
"packages/catalyst-core/src/vite/vite.config.server.js"
|
|
1196
|
+
]
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
"section": "build_system",
|
|
1200
|
+
"title": "Catalyst 0.3.x CLI Commands",
|
|
1201
|
+
"content": "Current web commands are catalyst start, catalyst build, catalyst serve, and catalyst serve:inspect. devBuild and devServe are legacy 0.2.x commands and are not accepted by the 0.3.x CLI. Native commands remain buildApp, buildApp:ios, buildApp:android, setupEmulator, setupEmulator:ios, and setupEmulator:android.",
|
|
1202
|
+
"layer": "Build",
|
|
1203
|
+
"source": "static",
|
|
1204
|
+
"tags": ["0.3.x", "cli", "start", "build", "serve", "native"],
|
|
1205
|
+
"github_files": ["packages/catalyst-core/bin/catalyst.js"]
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
"section": "build_system",
|
|
1209
|
+
"title": "Catalyst 0.3.x Custom Vite Plugins",
|
|
1210
|
+
"content": "Applications can provide buildConfig.js exporting { clientPlugins: [], ssrPlugins: [] }. clientPlugins are appended to the production client Vite configuration and ssrPlugins to the SSR configuration. The legacy filename webpackConfig.js is temporarily recognized as a compatibility filename, but in a 0.3.x project its exported value follows the Vite plugin contract; webpack configure/merge callbacks are not supported by the Vite runtime.",
|
|
1211
|
+
"layer": "Config",
|
|
1212
|
+
"source": "static",
|
|
1213
|
+
"tags": ["0.3.x", "vite", "plugins", "buildConfig", "webpackConfig", "compatibility"],
|
|
1214
|
+
"github_files": [
|
|
1215
|
+
"packages/catalyst-core/src/vite/loadCustomViteConfig.js",
|
|
1216
|
+
"packages/catalyst-core/src/vite/vite.config.client.js",
|
|
1217
|
+
"packages/catalyst-core/src/vite/vite.config.server.js"
|
|
1218
|
+
]
|
|
1219
|
+
},
|
|
1220
|
+
{
|
|
1221
|
+
"section": "routing",
|
|
1222
|
+
"title": "Catalyst 0.3.x Integrated Router",
|
|
1223
|
+
"content": "Catalyst 0.3.x removes the @tata1mg/router package dependency. catalyst-core exports React Router APIs plus RouterDataProvider, MetaTag, routing data hooks, metadata utilities, split, and hydrationReady. Existing route arrays and preparedRoutes structure remain, but imports must move from @tata1mg/router to catalyst-core. Keeping both router packages can create duplicate runtime contracts and invalid React element errors.",
|
|
1224
|
+
"layer": "Runtime",
|
|
1225
|
+
"source": "static",
|
|
1226
|
+
"tags": ["0.3.x", "router", "react-router", "RouterDataProvider", "migration"],
|
|
1227
|
+
"github_files": [
|
|
1228
|
+
"packages/catalyst-core/src/index.jsx",
|
|
1229
|
+
"packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx"
|
|
1230
|
+
]
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
"section": "code_splitting",
|
|
1234
|
+
"title": "Catalyst 0.3.x split and hydrationReady",
|
|
1235
|
+
"content": "Use split(() => import('./Page'), options) from catalyst-core instead of @loadable/component. split supports SSR-aware lazy rendering, fallback, cache-key asset extraction, visibility loading, rootOptions, onVisible, and route component statics. Client hydration must await hydrationReady() before hydrateRoot so SSR-rendered split modules are synchronously available on the first client render. The Vite cache-key plugin injects source-based cache keys used by SSR asset extraction.",
|
|
1236
|
+
"layer": "Runtime",
|
|
1237
|
+
"source": "static",
|
|
1238
|
+
"tags": ["0.3.x", "split", "hydrationReady", "suspense", "vite", "ssr"],
|
|
1239
|
+
"github_files": [
|
|
1240
|
+
"packages/catalyst-core/src/web-router/components/Split.jsx",
|
|
1241
|
+
"packages/catalyst-core/src/vite/inject-cache-key-plugin.js"
|
|
1242
|
+
]
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
"section": "dependencies",
|
|
1246
|
+
"title": "Catalyst 0.3.x React Runtime Contract",
|
|
1247
|
+
"content": "Catalyst 0.3.x requires application dependencies react and react-dom to be pinned exactly to 19.0.0. Do not use caret or tilde ranges. Remove @tata1mg/router and @loadable/component. After upgrading, npm ls react react-dom should show one compatible React runtime; duplicate React 18/19 trees can cause invalid React child, invalid hook call, or hydration errors.",
|
|
1248
|
+
"layer": "Build",
|
|
1249
|
+
"source": "static",
|
|
1250
|
+
"tags": ["0.3.x", "react", "react-dom", "19.0.0", "dependencies"],
|
|
1251
|
+
"github_files": [
|
|
1252
|
+
"packages/catalyst-core/package.json",
|
|
1253
|
+
"packages/create-catalyst-app/templates/none-js/package.json"
|
|
1254
|
+
]
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
"section": "build_system",
|
|
1258
|
+
"title": "Catalyst 0.3.x Offline Route Build Contract",
|
|
1259
|
+
"content": "Route offline snapshots are a production feature. Mark routes with offline: true, then run catalyst build and catalyst serve. The build generates catalyst-offline-manifest.json and catalyst-sw.js at the build root and copies public/offline.html there when present. The browser service worker is not registered by catalyst start because development mode must not retain production caches. Native clients fetch the same root manifest URL but use native snapshot caches instead of the browser service worker.",
|
|
1260
|
+
"layer": "Runtime",
|
|
1261
|
+
"source": "static",
|
|
1262
|
+
"tags": ["0.3.x", "offline", "service-worker", "manifest", "build", "serve"],
|
|
1263
|
+
"github_files": [
|
|
1264
|
+
"packages/catalyst-core/src/scripts/generateOfflineManifest.js",
|
|
1265
|
+
"packages/catalyst-core/src/offline/registerServiceWorker.js",
|
|
1266
|
+
"packages/catalyst-core/src/offline/catalyst-sw.js"
|
|
1267
|
+
]
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
"section": "known_errors",
|
|
1271
|
+
"title": "Catalyst 0.3.x Mixed Package Install",
|
|
1272
|
+
"content": "Symptom: package exports, CLI commands, SSR loading, or application startup fail after copying a local catalyst-core build. Cause: only dist was replaced, leaving an old package.json and bin/catalyst.js around the new ESM output. Fix: replace dist, bin, and package.json together. These files are one package-facing contract in 0.3.x.",
|
|
1273
|
+
"layer": "Build",
|
|
1274
|
+
"source": "static",
|
|
1275
|
+
"tags": ["known-error", "0.3.x", "package", "exports", "bin", "local-testing"]
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
"section": "known_errors",
|
|
1279
|
+
"title": "Offline Route Falls Back During catalyst start",
|
|
1280
|
+
"content": "Symptom: an offline:true route shows offline.html or is not cached while testing with npm run start. Cause: catalyst start is development mode; it does not generate a fresh offline manifest and intentionally does not register the production service worker. Fix: run catalyst build after changing route metadata, then catalyst serve, visit the route online once, and test the exact URL offline.",
|
|
1281
|
+
"layer": "Runtime",
|
|
1282
|
+
"source": "static",
|
|
1283
|
+
"tags": ["known-error", "0.3.x", "offline", "start", "build", "serve"]
|
|
1173
1284
|
}
|
|
1174
1285
|
]
|
package/mcp_v2/lib/helpers.js
CHANGED
|
@@ -37,6 +37,14 @@ function versionOlderThan(a, b) {
|
|
|
37
37
|
return false
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
const VITE_RUNTIME_VERSION = "0.3.0-beta.1"
|
|
41
|
+
|
|
42
|
+
function catalystGeneration(version) {
|
|
43
|
+
const parsed = parseVersion(version)
|
|
44
|
+
if (!parsed) return "unknown"
|
|
45
|
+
return versionOlderThan(version, VITE_RUNTIME_VERSION) ? "legacy" : "current"
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
/**
|
|
41
49
|
* Walk up the directory tree looking for a package.json that depends on Catalyst,
|
|
42
50
|
* or the catalyst-core package source itself when developing this repo.
|
|
@@ -196,4 +204,6 @@ module.exports = {
|
|
|
196
204
|
makeProjectHelpers,
|
|
197
205
|
versionOlderThan,
|
|
198
206
|
parseVersion,
|
|
207
|
+
catalystGeneration,
|
|
208
|
+
VITE_RUNTIME_VERSION,
|
|
199
209
|
}
|
package/mcp_v2/mcp.js
CHANGED
|
@@ -103,7 +103,7 @@ const INTENT_PATTERNS = {
|
|
|
103
103
|
feedback:
|
|
104
104
|
/\b(issue|bug\s+report|report\s+(a\s+)?bug|open\s+(an?\s+)?issue|create\s+(an?\s+)?issue|raise\s+(an?\s+)?issue|discussion|discuss|feature\s+request|proposal|suggest)\b/i,
|
|
105
105
|
debug: /error|fail|broken|not work|crash|issue|bug|why|wrong/i,
|
|
106
|
-
build: /build|compile|webpack|bundle|android|ios|platform/i,
|
|
106
|
+
build: /build|compile|webpack|vite|bundle|android|ios|platform/i,
|
|
107
107
|
sync: /sync|update.*doc|fetch.*doc|latest.*doc/i,
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -141,7 +141,7 @@ const TOOLS = [
|
|
|
141
141
|
{
|
|
142
142
|
name: "get_conversion_tasks",
|
|
143
143
|
description:
|
|
144
|
-
"Use when the developer asks: 'what do I need to convert?', 'what's left to do?', 'show me pending tasks', 'what do I fix next?',
|
|
144
|
+
"Use when the developer asks: 'what do I need to convert?', 'what's left to do?', 'show me pending tasks', 'what do I fix next?', or asks to migrate between Catalyst versions. Detects the installed catalyst-core generation and keeps legacy 0.2.x webpack/router guidance separate from current 0.3.x Vite/integrated-router guidance.",
|
|
145
145
|
inputSchema: {
|
|
146
146
|
type: "object",
|
|
147
147
|
properties: {
|
|
@@ -166,7 +166,7 @@ const TOOLS = [
|
|
|
166
166
|
{
|
|
167
167
|
name: "get_conversion_status",
|
|
168
168
|
description:
|
|
169
|
-
"Use when the developer asks: 'how far along am I?', 'what have I completed?', 'show my conversion progress', 'what's done vs pending?'.
|
|
169
|
+
"Use when the developer asks: 'how far along am I?', 'what have I completed?', 'show my conversion progress', or 'what's done vs pending?'. Reports the detected Catalyst generation so 0.2.x and 0.3.x requirements are never mixed.",
|
|
170
170
|
inputSchema: {
|
|
171
171
|
type: "object",
|
|
172
172
|
properties: {
|
|
@@ -224,7 +224,7 @@ const TOOLS = [
|
|
|
224
224
|
{
|
|
225
225
|
name: "get_build_flow",
|
|
226
226
|
description:
|
|
227
|
-
"Use when the developer asks about building, serving, or deploying
|
|
227
|
+
"Use when the developer asks about building, serving, or deploying. Returns version-aware flows: webpack-era behavior for Catalyst 0.2.x and Vite client/server behavior for Catalyst 0.3.x+, plus project config warnings and related known errors.",
|
|
228
228
|
inputSchema: {
|
|
229
229
|
type: "object",
|
|
230
230
|
properties: {
|
package/mcp_v2/package.json
CHANGED
package/mcp_v2/tools/build.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict"
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const {
|
|
4
|
+
makeProjectHelpers,
|
|
5
|
+
findCatalystRoot,
|
|
6
|
+
catalystGeneration,
|
|
7
|
+
VITE_RUNTIME_VERSION,
|
|
8
|
+
} = require("../lib/helpers")
|
|
4
9
|
|
|
5
10
|
let _db
|
|
6
11
|
|
|
@@ -18,7 +23,7 @@ const MASTER_FLOWS = {
|
|
|
18
23
|
step: 1,
|
|
19
24
|
cmd: "catalyst start",
|
|
20
25
|
label: "Start dev server",
|
|
21
|
-
detail: "Starts
|
|
26
|
+
detail: "Starts the Vite middleware-mode development server and Catalyst SSR server on NODE_SERVER_PORT. Hot reload and React Fast Refresh are enabled.",
|
|
22
27
|
},
|
|
23
28
|
{
|
|
24
29
|
step: 2,
|
|
@@ -33,7 +38,7 @@ const MASTER_FLOWS = {
|
|
|
33
38
|
step: 1,
|
|
34
39
|
cmd: "catalyst build",
|
|
35
40
|
label: "Production build",
|
|
36
|
-
detail: "Runs
|
|
41
|
+
detail: "Runs parallel Vite client and SSR builds. Outputs client assets to build/client, the renderer to build/server, Vite manifests under build/.vite, and offline runtime files at the build root.",
|
|
37
42
|
},
|
|
38
43
|
{
|
|
39
44
|
step: 2,
|
|
@@ -48,7 +53,7 @@ const MASTER_FLOWS = {
|
|
|
48
53
|
step: 1,
|
|
49
54
|
cmd: "catalyst build",
|
|
50
55
|
label: "Build",
|
|
51
|
-
detail: "Production
|
|
56
|
+
detail: "Production Vite client and SSR build. Set BUILD_ENV=production in env or config.",
|
|
52
57
|
},
|
|
53
58
|
{
|
|
54
59
|
step: 2,
|
|
@@ -69,7 +74,7 @@ const MASTER_FLOWS = {
|
|
|
69
74
|
step: 1,
|
|
70
75
|
cmd: "catalyst build",
|
|
71
76
|
label: "Build",
|
|
72
|
-
detail: "Same
|
|
77
|
+
detail: "Same Vite build — staging is config-only, not a different build target.",
|
|
73
78
|
},
|
|
74
79
|
{
|
|
75
80
|
step: 2,
|
|
@@ -94,7 +99,7 @@ const MASTER_FLOWS = {
|
|
|
94
99
|
},
|
|
95
100
|
{
|
|
96
101
|
step: 3,
|
|
97
|
-
cmd: "npm run
|
|
102
|
+
cmd: "npm run buildApp:android",
|
|
98
103
|
label: "Android debug build",
|
|
99
104
|
detail: "Runs buildAppAndroid.js: validates ADB + emulator path from sdkPath, launches emulator (emulatorName), copies web assets to androidProject/, runs Gradle debug build, installs APK.",
|
|
100
105
|
},
|
|
@@ -123,11 +128,11 @@ const MASTER_FLOWS = {
|
|
|
123
128
|
step: 3,
|
|
124
129
|
cmd: "catalyst build",
|
|
125
130
|
label: "Build web assets",
|
|
126
|
-
detail: "Production
|
|
131
|
+
detail: "Production web build. Assets are consumed by the Android release build.",
|
|
127
132
|
},
|
|
128
133
|
{
|
|
129
134
|
step: 4,
|
|
130
|
-
cmd: "npm run
|
|
135
|
+
cmd: "npm run buildApp:android",
|
|
131
136
|
label: "Android release build",
|
|
132
137
|
detail: "Skips emulator validation. Runs Gradle release build. Calls buildAndroidAAB() — renames project, creates/verifies keystore, signs AAB. Output goes to ./deployment/.",
|
|
133
138
|
},
|
|
@@ -154,7 +159,7 @@ const MASTER_FLOWS = {
|
|
|
154
159
|
},
|
|
155
160
|
{
|
|
156
161
|
step: 3,
|
|
157
|
-
cmd: "npm run
|
|
162
|
+
cmd: "npm run buildApp:ios",
|
|
158
163
|
label: "iOS simulator build",
|
|
159
164
|
detail: "Runs buildAppIos.js: generates ConfigConstants.swift from config (bundleId, URL, port, protocol), launches simulator (simulatorName), cleans Xcode artifacts, compiles with xcodebuild, installs .app, launches.",
|
|
160
165
|
},
|
|
@@ -176,7 +181,7 @@ const MASTER_FLOWS = {
|
|
|
176
181
|
{ step: 2, cmd: "catalyst build", label: "Build web assets", detail: "Production build." },
|
|
177
182
|
{
|
|
178
183
|
step: 3,
|
|
179
|
-
cmd: "npm run
|
|
184
|
+
cmd: "npm run buildApp:ios",
|
|
180
185
|
label: "iOS release build",
|
|
181
186
|
detail: "Same script — build type is driven by WEBVIEW_CONFIG.ios.buildType. Generates ConfigConstants.swift with production URL and bundleId. Xcode compiles Release scheme.",
|
|
182
187
|
},
|
|
@@ -195,6 +200,47 @@ const MASTER_FLOWS = {
|
|
|
195
200
|
],
|
|
196
201
|
}
|
|
197
202
|
|
|
203
|
+
const LEGACY_WEB_FLOWS = {
|
|
204
|
+
web_dev: [
|
|
205
|
+
{
|
|
206
|
+
step: 1,
|
|
207
|
+
cmd: "catalyst start",
|
|
208
|
+
label: "Start legacy dev server",
|
|
209
|
+
detail: "Starts the Catalyst 0.2.x webpack development and SSR servers with hot reload.",
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
step: 2,
|
|
213
|
+
cmd: null,
|
|
214
|
+
label: "Browser / WebView loads",
|
|
215
|
+
detail: "The browser or native WebView loads the configured development origin.",
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
web_build: [
|
|
219
|
+
{
|
|
220
|
+
step: 1,
|
|
221
|
+
cmd: "catalyst build",
|
|
222
|
+
label: "Legacy production build",
|
|
223
|
+
detail: "Runs the Catalyst 0.2.x webpack build, including loadable metadata and SSR output.",
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
step: 2,
|
|
227
|
+
cmd: "catalyst serve",
|
|
228
|
+
label: "Serve legacy build",
|
|
229
|
+
detail: "Serves the webpack-era production output for smoke testing.",
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
web_prod: null,
|
|
233
|
+
web_staging: null,
|
|
234
|
+
}
|
|
235
|
+
LEGACY_WEB_FLOWS.web_prod = MASTER_FLOWS.web_prod.map((step) => ({
|
|
236
|
+
...step,
|
|
237
|
+
detail: step.detail.replace("Vite client and SSR", "legacy webpack"),
|
|
238
|
+
}))
|
|
239
|
+
LEGACY_WEB_FLOWS.web_staging = MASTER_FLOWS.web_staging.map((step) => ({
|
|
240
|
+
...step,
|
|
241
|
+
detail: step.detail.replace("Vite", "legacy webpack"),
|
|
242
|
+
}))
|
|
243
|
+
|
|
198
244
|
// ─── Architecture diagrams ───────────────────────────────────────────────────
|
|
199
245
|
|
|
200
246
|
const MASTER_DIAGRAMS = {
|
|
@@ -293,18 +339,18 @@ const MASTER_DIAGRAMS = {
|
|
|
293
339
|
layers: [
|
|
294
340
|
{
|
|
295
341
|
layer: "web",
|
|
296
|
-
label: "
|
|
297
|
-
detail: "Produces
|
|
342
|
+
label: "Vite (catalyst build)",
|
|
343
|
+
detail: "Runs client and SSR builds in parallel. Produces build/client, build/server, Vite manifests, categorized assets, and root offline runtime files.",
|
|
298
344
|
},
|
|
299
345
|
{
|
|
300
346
|
layer: "prepare",
|
|
301
347
|
label: "catalyst-core prepare",
|
|
302
|
-
detail: "
|
|
348
|
+
detail: "Copies the ESM web runtime into dist and Babel-compiles native/CommonJS compatibility outputs. Package metadata, bin, and dist form one package contract.",
|
|
303
349
|
},
|
|
304
350
|
{
|
|
305
351
|
layer: "copy",
|
|
306
352
|
label: "Dev copy workflow",
|
|
307
|
-
detail: "After prepare
|
|
353
|
+
detail: "After prepare, copy dist, bin, and package.json together. Copying only dist creates a mixed package with incompatible exports and CLI code.",
|
|
308
354
|
},
|
|
309
355
|
{
|
|
310
356
|
layer: "native",
|
|
@@ -316,12 +362,11 @@ const MASTER_DIAGRAMS = {
|
|
|
316
362
|
"[Framework dev] Edit catalyst-core/src/",
|
|
317
363
|
"→ npm run prepare (in catalyst-core)",
|
|
318
364
|
"→ dist/ updated",
|
|
319
|
-
"→
|
|
320
|
-
"→ Copy package.json → test-app/node_modules/catalyst-core/package.json",
|
|
365
|
+
"→ Replace test-app node_modules/catalyst-core dist + bin + package.json together",
|
|
321
366
|
"",
|
|
322
367
|
"[App build] In app project root:",
|
|
323
|
-
"→ catalyst build
|
|
324
|
-
"→ npm run
|
|
368
|
+
"→ catalyst build (Vite client + SSR output)",
|
|
369
|
+
"→ npm run buildApp:android / buildApp:ios",
|
|
325
370
|
"→ native build script reads WEBVIEW_CONFIG from config/config.json",
|
|
326
371
|
"→ copies build/ assets into native project",
|
|
327
372
|
"→ compiles native project (Gradle / xcodebuild)",
|
|
@@ -405,6 +450,33 @@ const MASTER_DIAGRAMS = {
|
|
|
405
450
|
},
|
|
406
451
|
}
|
|
407
452
|
|
|
453
|
+
const LEGACY_BUILD_PIPELINE = {
|
|
454
|
+
title: "Legacy Build Pipeline (Catalyst 0.2.x)",
|
|
455
|
+
description: "The webpack-era Catalyst build and native consumption flow.",
|
|
456
|
+
layers: [
|
|
457
|
+
{
|
|
458
|
+
layer: "web",
|
|
459
|
+
label: "Webpack",
|
|
460
|
+
detail: "Produces webpack client chunks, SSR output, and @loadable/component metadata.",
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
layer: "prepare",
|
|
464
|
+
label: "Babel prepare",
|
|
465
|
+
detail: "Compiles catalyst-core source into the legacy dist package.",
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
layer: "native",
|
|
469
|
+
label: "Native build",
|
|
470
|
+
detail: "buildApp:android and buildApp:ios consume the prepared web and native assets.",
|
|
471
|
+
},
|
|
472
|
+
],
|
|
473
|
+
flow: [
|
|
474
|
+
"catalyst build (webpack)",
|
|
475
|
+
"→ catalyst serve for production-style validation",
|
|
476
|
+
"→ npm run buildApp:android or npm run buildApp:ios",
|
|
477
|
+
],
|
|
478
|
+
}
|
|
479
|
+
|
|
408
480
|
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
409
481
|
|
|
410
482
|
function getProjectContext(root) {
|
|
@@ -464,6 +536,14 @@ function handle_get_build_flow({ platform, mode, symptom } = {}) {
|
|
|
464
536
|
}
|
|
465
537
|
|
|
466
538
|
const ctx = getProjectContext(catalystRoot.dir)
|
|
539
|
+
const installedVersion = catalystRoot.installedVersion || catalystRoot.catalystVersion
|
|
540
|
+
const generation = catalystGeneration(installedVersion)
|
|
541
|
+
if (generation === "unknown") {
|
|
542
|
+
return {
|
|
543
|
+
error: "catalyst_version_required",
|
|
544
|
+
message: `Unable to determine whether this project targets legacy 0.2.x or current ${VITE_RUNTIME_VERSION}+. Confirm the target version before applying build guidance.`,
|
|
545
|
+
}
|
|
546
|
+
}
|
|
467
547
|
const p = (platform || "web").toLowerCase()
|
|
468
548
|
const m = (mode || "dev").toLowerCase() // dev | build | production | staging | release
|
|
469
549
|
|
|
@@ -578,7 +658,11 @@ function handle_get_build_flow({ platform, mode, symptom } = {}) {
|
|
|
578
658
|
mode: flow_key,
|
|
579
659
|
project_root: catalystRoot.dir,
|
|
580
660
|
catalyst_version: catalystRoot.catalystVersion,
|
|
581
|
-
|
|
661
|
+
catalyst_generation: generation,
|
|
662
|
+
steps:
|
|
663
|
+
generation === "legacy" && LEGACY_WEB_FLOWS[flow_key]
|
|
664
|
+
? LEGACY_WEB_FLOWS[flow_key]
|
|
665
|
+
: MASTER_FLOWS[flow_key],
|
|
582
666
|
project_config: notes,
|
|
583
667
|
warnings: warnings.length ? warnings : undefined,
|
|
584
668
|
related_errors: related_errors.length ? related_errors : undefined,
|
|
@@ -594,6 +678,7 @@ function handle_get_architecture_diagram({ feature, symptom } = {}) {
|
|
|
594
678
|
}
|
|
595
679
|
|
|
596
680
|
const ctx = getProjectContext(catalystRoot.dir)
|
|
681
|
+
const generation = catalystGeneration(catalystRoot.installedVersion || catalystRoot.catalystVersion)
|
|
597
682
|
|
|
598
683
|
// Match feature to a diagram key
|
|
599
684
|
const f = (feature || "").toLowerCase()
|
|
@@ -625,7 +710,17 @@ function handle_get_architecture_diagram({ feature, symptom } = {}) {
|
|
|
625
710
|
}
|
|
626
711
|
}
|
|
627
712
|
|
|
628
|
-
|
|
713
|
+
if (diagram_key === "build_pipeline" && generation === "unknown") {
|
|
714
|
+
return {
|
|
715
|
+
error: "catalyst_version_required",
|
|
716
|
+
message: `Build architecture differs between legacy 0.2.x and current ${VITE_RUNTIME_VERSION}+. Confirm the target Catalyst version.`,
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
const diagram =
|
|
721
|
+
diagram_key === "build_pipeline" && generation === "legacy"
|
|
722
|
+
? LEGACY_BUILD_PIPELINE
|
|
723
|
+
: MASTER_DIAGRAMS[diagram_key]
|
|
629
724
|
|
|
630
725
|
// ── Annotate with project-specific context ────────────────────────────────
|
|
631
726
|
const project_context = []
|
|
@@ -671,6 +766,7 @@ function handle_get_architecture_diagram({ feature, symptom } = {}) {
|
|
|
671
766
|
|
|
672
767
|
return {
|
|
673
768
|
feature,
|
|
769
|
+
catalyst_generation: generation,
|
|
674
770
|
matched_diagram: diagram_key,
|
|
675
771
|
title: diagram.title,
|
|
676
772
|
description: diagram.description,
|