catalyst-core 0.2.0-beta.3 → 0.3.0-beta.2
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/globals.d.ts +7 -0
- package/dist/index.jsx +8 -0
- package/dist/logger.js +74 -3
- package/dist/native/androidProject/app/build.gradle.kts +45 -4
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt +86 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/BridgeUtils.kt +8 -0
- package/dist/native/androidProject/app/src/main/java/io/yourname/androidproject/utils/FrameworkServerUtils.kt +173 -13
- package/dist/native/androidProject/settings.gradle.kts +10 -0
- package/dist/native/androidSetup.js +300 -8
- package/dist/native/bridge/WebBridge.js +481 -59
- package/dist/native/bridge/constants/NativeInterfaces.js +304 -45
- package/dist/native/bridge/errors.js +250 -26
- package/dist/native/bridge/hooks/index.js +132 -1
- package/dist/native/bridge/hooks/useAI.js +94 -0
- 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 +406 -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 +296 -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 +450 -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 +498 -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 +176 -17
- package/mcp_v2/lib/helpers.js +10 -0
- package/mcp_v2/mcp.js +40 -8
- package/mcp_v2/package.json +1 -0
- package/mcp_v2/tools/build.js +161 -37
- 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
|
@@ -170,15 +170,63 @@
|
|
|
170
170
|
{
|
|
171
171
|
"section": "build_system",
|
|
172
172
|
"title": "iOS Build Pipeline",
|
|
173
|
-
"content": "
|
|
173
|
+
"content": "npm run buildApp:ios generates ConfigConstants.swift and plugin metadata from WEBVIEW_CONFIG, syncs selected public/ios assets into the package-owned Xcode project, detects a physical device or launches a simulator, cleans Xcode artifacts, compiles with the Debug configuration, and installs and launches the .app. It does not bundle the full Catalyst web client and does not create an App Store archive. The generated project is located under the resolved catalyst-core package at dist/native/iosnativeWebView/iosnativeWebView.xcodeproj.",
|
|
174
174
|
"layer": "Build",
|
|
175
175
|
"source": "static",
|
|
176
|
-
"tags": ["ios", "build"]
|
|
176
|
+
"tags": ["ios", "build", "buildApp:ios", "debug", "xcode"],
|
|
177
|
+
"github_files": [
|
|
178
|
+
"packages/catalyst-core/src/native/buildAppIos.js",
|
|
179
|
+
"packages/catalyst-core/src/native/buildIos/build.js"
|
|
180
|
+
]
|
|
177
181
|
},
|
|
178
182
|
{
|
|
179
183
|
"section": "build_system",
|
|
180
|
-
"title": "
|
|
181
|
-
"content": "
|
|
184
|
+
"title": "Catalyst iOS Production Release Flow (0.2.x and 0.3.x)",
|
|
185
|
+
"content": "Catalyst 0.2.x and 0.3.x use the same iOS production-release flow: (1) deploy the production web application and verify its HTTPS URL, (2) finalize WEBVIEW_CONFIG, bundle ID, app version/build, plugins, permissions, capabilities, icons, splash assets, access-control rules, and privacy declarations, (3) run npm run buildApp:ios from the consuming app root to prepare the package-owned native project and perform its Debug build, (4) open the resolved catalyst-core package's dist/native/iosnativeWebView/iosnativeWebView.xcodeproj, (5) confirm the iosnativeWebView scheme's Archive action uses Release, configure Release signing and capabilities, choose a generic iOS device destination, and run Product -> Archive, (6) Validate App and upload with Distribute App -> TestFlight & App Store, then (7) finish TestFlight testing, App Store Connect metadata, build selection, and App Review submission. buildApp:ios does not create the final App Store artifact.",
|
|
186
|
+
"layer": "Build",
|
|
187
|
+
"source": "static",
|
|
188
|
+
"tags": [
|
|
189
|
+
"ios",
|
|
190
|
+
"release",
|
|
191
|
+
"production",
|
|
192
|
+
"0.2.x",
|
|
193
|
+
"0.3.x",
|
|
194
|
+
"buildApp:ios",
|
|
195
|
+
"xcode",
|
|
196
|
+
"archive",
|
|
197
|
+
"app-store",
|
|
198
|
+
"testflight"
|
|
199
|
+
],
|
|
200
|
+
"github_files": [
|
|
201
|
+
"docs/content/08-Deployment/03-iOS-Production-Release.md",
|
|
202
|
+
"packages/catalyst-core/src/native/iosnativeWebView/iosnativeWebView.xcodeproj/xcshareddata/xcschemes/iosnativeWebView.xcscheme"
|
|
203
|
+
]
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"section": "build_system",
|
|
207
|
+
"title": "Generated iOS Project Signing and Persistence",
|
|
208
|
+
"content": "The generated Xcode project is package-owned state. Its shared xcconfig is regenerated with development-oriented code-signing defaults, and the bundled push entitlement can use aps-environment=development. Before an App Store archive, review the Release team, distribution signing, provisioning, capabilities, and entitlements in Xcode. Run the final npm run buildApp:ios before release-only Xcode changes: later Catalyst generation, package upgrades, or dependency installation can replace or regenerate native config constants, shared Xcode configuration, plist and entitlement content, generated plugin code/resources, selected project-file entries, and assets. Do not treat manual edits inside the generated project as durable app configuration.",
|
|
209
|
+
"layer": "Build",
|
|
210
|
+
"source": "static",
|
|
211
|
+
"tags": [
|
|
212
|
+
"ios",
|
|
213
|
+
"release",
|
|
214
|
+
"signing",
|
|
215
|
+
"provisioning",
|
|
216
|
+
"entitlements",
|
|
217
|
+
"push-notifications",
|
|
218
|
+
"generated-project",
|
|
219
|
+
"regeneration"
|
|
220
|
+
],
|
|
221
|
+
"github_files": [
|
|
222
|
+
"packages/catalyst-core/src/native/buildIos/config.js",
|
|
223
|
+
"packages/catalyst-core/src/native/iosnativeWebView/iosnativeWebView/iosnativeWebView.entitlements"
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"section": "build_system",
|
|
228
|
+
"title": "Legacy 0.2.x Build NPM Scripts",
|
|
229
|
+
"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 apps. buildApp:android \u2014 Android native app build. buildApp:ios \u2014 iOS native project preparation and Debug build. buildApp:android:release \u2014 Android release build. setupEmulator \u2014 sets up both emulators. setupEmulator:android \u2014 sets up Android AVD. setupEmulator:ios \u2014 sets up iOS simulator. There is no separate buildApp:ios:release flow: run buildApp:ios, then create the production archive from the generated Xcode project's Release Archive action. NOTE: build:android / build:android:release / build:ios do NOT exist in catalyst \u2014 common mistake. Missing any script = that npm run command fails.",
|
|
182
230
|
"layer": "Build",
|
|
183
231
|
"source": "static",
|
|
184
232
|
"tags": ["build", "scripts", "package.json", "native"]
|
|
@@ -434,7 +482,7 @@
|
|
|
434
482
|
{
|
|
435
483
|
"section": "config_structure",
|
|
436
484
|
"title": "WEBVIEW_CONFIG Required Fields",
|
|
437
|
-
"content": "WEBVIEW_CONFIG field reference (from buildAppAndroid.js + buildAppIos.js source):\n\nTOP-LEVEL (both platforms):\n- port (string, required) \u2014 web server port e.g. \"3005\"\n- LOCAL_IP (string, required) \u2014 machine LAN IP e.g. \"192.168.0.11\". NOT localhost \u2014 emulator cannot resolve it\n- appInfo (string, required) \u2014 build identifier e.g. \"android-5Feb2026-v2.1.0\". Missing = iOS build breaks\n- useHttps (boolean, optional) \u2014 default false\n- cachePattern (string, optional) \u2014 comma-separated globs e.g. \"*.css\"\n- accessControl.enabled (boolean, optional) \u2014 default false\n- accessControl.allowedUrls (array, required if enabled) \u2014 URL patterns\n\nANDROID (WEBVIEW_CONFIG.android):\n- sdkPath (string, REQUIRED) \u2014 abs path to Android SDK. Build exits immediately without it\n- emulatorName (string, REQUIRED for debug) \u2014 AVD name. Run: emulator -list-avds\n- appName (string, optional) \u2014 default \"Catalyst Application\"\n- packageName (string, optional) \u2014 e.g. com.company.app. Derived from appName if missing\n- buildType (string, optional) \u2014 \"debug\" or \"release\". Default \"debug\"\n- keystore or keystoreConfig (required for release buildType only)\n- buildOptimisation (boolean, optional) \u2014 default false\n- cachePattern (string, optional)\n\nIOS (WEBVIEW_CONFIG.ios):\n- appBundleId (string, optional) \u2014 default \"com.debug.webview\". Must set for distribution\n- appName (string, optional) \u2014 default \"Catalyst Application\"\n- simulatorName (string, optional) \u2014 auto-detected if missing. e.g. \"iPhone 17 Pro\"\n- buildType (string, optional
|
|
485
|
+
"content": "WEBVIEW_CONFIG field reference (from buildAppAndroid.js + buildAppIos.js source):\n\nTOP-LEVEL (both platforms):\n- port (string, required) \u2014 web server port e.g. \"3005\"\n- LOCAL_IP (string, required) \u2014 machine LAN IP e.g. \"192.168.0.11\". NOT localhost \u2014 emulator cannot resolve it\n- appInfo (string, required) \u2014 build identifier e.g. \"android-5Feb2026-v2.1.0\". Missing = iOS build breaks\n- useHttps (boolean, optional) \u2014 default false\n- cachePattern (string, optional) \u2014 comma-separated globs e.g. \"*.css\"\n- accessControl.enabled (boolean, optional) \u2014 default false\n- accessControl.allowedUrls (array, required if enabled) \u2014 URL patterns\n\nANDROID (WEBVIEW_CONFIG.android):\n- sdkPath (string, REQUIRED) \u2014 abs path to Android SDK. Build exits immediately without it\n- emulatorName (string, REQUIRED for debug) \u2014 AVD name. Run: emulator -list-avds\n- appName (string, optional) \u2014 default \"Catalyst Application\"\n- packageName (string, optional) \u2014 e.g. com.company.app. Derived from appName if missing\n- buildType (string, optional) \u2014 \"debug\" or \"release\". Default \"debug\"\n- keystore or keystoreConfig (required for release buildType only)\n- buildOptimisation (boolean, optional) \u2014 default false\n- cachePattern (string, optional)\n\nIOS (WEBVIEW_CONFIG.ios):\n- appBundleId (string, optional) \u2014 default \"com.debug.webview\". Must set for distribution\n- appName (string, optional) \u2014 default \"Catalyst Application\"\n- simulatorName (string, optional) \u2014 auto-detected if missing. e.g. \"iPhone 17 Pro\"\n- buildType (string, optional) \u2014 may label copied Debug output but does not select the Xcode build configuration or create an App Store archive\n- deviceUDID (string, optional) \u2014 physical device builds only\n- developmentTeam (string, required if deviceUDID set) \u2014 Apple Developer Team ID\n- cachePattern (string, optional)\n\nFor iOS production, run buildApp:ios to prepare the generated project, then archive the iosnativeWebView scheme using its Release Archive action in Xcode.",
|
|
438
486
|
"layer": "Config",
|
|
439
487
|
"source": "static",
|
|
440
488
|
"tags": ["config", "WEBVIEW_CONFIG", "android", "ios", "required", "fields"]
|
|
@@ -457,7 +505,7 @@
|
|
|
457
505
|
},
|
|
458
506
|
{
|
|
459
507
|
"section": "routing",
|
|
460
|
-
"title": "Catalyst Routing Stack",
|
|
508
|
+
"title": "Legacy 0.2.x Catalyst Routing Stack",
|
|
461
509
|
"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
510
|
"layer": "Runtime",
|
|
463
511
|
"source": "static",
|
|
@@ -473,7 +521,7 @@
|
|
|
473
521
|
},
|
|
474
522
|
{
|
|
475
523
|
"section": "routing",
|
|
476
|
-
"title": "RouterDataProvider Setup",
|
|
524
|
+
"title": "Legacy 0.2.x RouterDataProvider Setup",
|
|
477
525
|
"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
526
|
"layer": "Runtime",
|
|
479
527
|
"source": "static",
|
|
@@ -481,7 +529,7 @@
|
|
|
481
529
|
},
|
|
482
530
|
{
|
|
483
531
|
"section": "routing",
|
|
484
|
-
"title": "App Shell with Outlet",
|
|
532
|
+
"title": "Legacy 0.2.x App Shell with Outlet",
|
|
485
533
|
"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
534
|
"layer": "Component",
|
|
487
535
|
"source": "static",
|
|
@@ -505,7 +553,7 @@
|
|
|
505
553
|
},
|
|
506
554
|
{
|
|
507
555
|
"section": "data_fetching",
|
|
508
|
-
"title": "useCurrentRouteData Hook",
|
|
556
|
+
"title": "Legacy 0.2.x useCurrentRouteData Hook",
|
|
509
557
|
"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
558
|
"layer": "Runtime",
|
|
511
559
|
"source": "static",
|
|
@@ -553,7 +601,7 @@
|
|
|
553
601
|
},
|
|
554
602
|
{
|
|
555
603
|
"section": "server_structure",
|
|
556
|
-
"title": "Client Entry Files",
|
|
604
|
+
"title": "Legacy 0.2.x Client Entry Files",
|
|
557
605
|
"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
606
|
"layer": "Build",
|
|
559
607
|
"source": "static",
|
|
@@ -854,7 +902,7 @@
|
|
|
854
902
|
},
|
|
855
903
|
{
|
|
856
904
|
"section": "config_structure",
|
|
857
|
-
"title": "Migration Phase 0 \u2014 Bare Minimum to Boot App (No Bridge)",
|
|
905
|
+
"title": "Legacy 0.2.x Migration Phase 0 \u2014 Bare Minimum to Boot App (No Bridge)",
|
|
858
906
|
"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
907
|
"layer": "Config",
|
|
860
908
|
"source": "static",
|
|
@@ -937,7 +985,7 @@
|
|
|
937
985
|
},
|
|
938
986
|
{
|
|
939
987
|
"section": "build_system",
|
|
940
|
-
"title": "Webpack Customization via webpackConfig.js",
|
|
988
|
+
"title": "Legacy 0.2.x Webpack Customization via webpackConfig.js",
|
|
941
989
|
"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
990
|
"layer": "Build",
|
|
943
991
|
"source": "static",
|
|
@@ -961,7 +1009,7 @@
|
|
|
961
1009
|
},
|
|
962
1010
|
{
|
|
963
1011
|
"section": "build_system",
|
|
964
|
-
"title": "React Compiler (opt-in via webpackConfig.js)",
|
|
1012
|
+
"title": "Legacy 0.2.x React Compiler (opt-in via webpackConfig.js)",
|
|
965
1013
|
"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
1014
|
"layer": "Build",
|
|
967
1015
|
"source": "static",
|
|
@@ -978,7 +1026,7 @@
|
|
|
978
1026
|
},
|
|
979
1027
|
{
|
|
980
1028
|
"section": "build_system",
|
|
981
|
-
"title": "CLI Commands and Package Scripts",
|
|
1029
|
+
"title": "Legacy 0.2.x CLI Commands and Package Scripts",
|
|
982
1030
|
"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
1031
|
"layer": "Build",
|
|
984
1032
|
"source": "static",
|
|
@@ -1000,7 +1048,7 @@
|
|
|
1000
1048
|
},
|
|
1001
1049
|
{
|
|
1002
1050
|
"section": "framework_identity",
|
|
1003
|
-
"title": "Project File Conventions and Structure",
|
|
1051
|
+
"title": "Legacy 0.2.x Project File Conventions and Structure",
|
|
1004
1052
|
"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
1053
|
"layer": "Framework",
|
|
1006
1054
|
"source": "static",
|
|
@@ -1111,7 +1159,7 @@
|
|
|
1111
1159
|
},
|
|
1112
1160
|
{
|
|
1113
1161
|
"section": "seo_metadata",
|
|
1114
|
-
"title": "Server-Side Meta Tags \u2014 setMetaData()",
|
|
1162
|
+
"title": "Legacy 0.2.x Server-Side Meta Tags \u2014 setMetaData()",
|
|
1115
1163
|
"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
1164
|
"layer": "Component",
|
|
1117
1165
|
"source": "static",
|
|
@@ -1130,7 +1178,7 @@
|
|
|
1130
1178
|
},
|
|
1131
1179
|
{
|
|
1132
1180
|
"section": "seo_metadata",
|
|
1133
|
-
"title": "Client-Side Meta Updates \u2014 MetaTag + custom document",
|
|
1181
|
+
"title": "Legacy 0.2.x Client-Side Meta Updates \u2014 MetaTag + custom document",
|
|
1134
1182
|
"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
1183
|
"layer": "Component",
|
|
1136
1184
|
"source": "static",
|
|
@@ -1170,5 +1218,116 @@
|
|
|
1170
1218
|
"layer": "Config",
|
|
1171
1219
|
"source": "extracted:src/native/androidProject/app/src/main/java/io/yourname/androidproject/NativeBridge.kt",
|
|
1172
1220
|
"tags": ["config", "googleSignIn", "android", "oauth", "sign-in"]
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
"section": "framework_identity",
|
|
1224
|
+
"title": "Catalyst Runtime Generations",
|
|
1225
|
+
"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.",
|
|
1226
|
+
"layer": "Framework",
|
|
1227
|
+
"source": "static",
|
|
1228
|
+
"tags": ["versions", "0.2.x", "0.3.x", "migration", "webpack", "vite"],
|
|
1229
|
+
"github_files": ["packages/catalyst-core/package.json", "packages/catalyst-core/src/index.jsx"]
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
"section": "build_system",
|
|
1233
|
+
"title": "Catalyst 0.3.x Vite Build Runtime",
|
|
1234
|
+
"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.",
|
|
1235
|
+
"layer": "Build",
|
|
1236
|
+
"source": "static",
|
|
1237
|
+
"tags": ["0.3.x", "vite", "build", "ssr", "client", "server"],
|
|
1238
|
+
"github_files": [
|
|
1239
|
+
"packages/catalyst-core/src/scripts/start.js",
|
|
1240
|
+
"packages/catalyst-core/src/scripts/build.js",
|
|
1241
|
+
"packages/catalyst-core/src/scripts/serve.js",
|
|
1242
|
+
"packages/catalyst-core/src/vite/vite.config.client.js",
|
|
1243
|
+
"packages/catalyst-core/src/vite/vite.config.server.js"
|
|
1244
|
+
]
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
"section": "build_system",
|
|
1248
|
+
"title": "Catalyst 0.3.x CLI Commands",
|
|
1249
|
+
"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.",
|
|
1250
|
+
"layer": "Build",
|
|
1251
|
+
"source": "static",
|
|
1252
|
+
"tags": ["0.3.x", "cli", "start", "build", "serve", "native"],
|
|
1253
|
+
"github_files": ["packages/catalyst-core/bin/catalyst.js"]
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"section": "build_system",
|
|
1257
|
+
"title": "Catalyst 0.3.x Custom Vite Plugins",
|
|
1258
|
+
"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.",
|
|
1259
|
+
"layer": "Config",
|
|
1260
|
+
"source": "static",
|
|
1261
|
+
"tags": ["0.3.x", "vite", "plugins", "buildConfig", "webpackConfig", "compatibility"],
|
|
1262
|
+
"github_files": [
|
|
1263
|
+
"packages/catalyst-core/src/vite/loadCustomViteConfig.js",
|
|
1264
|
+
"packages/catalyst-core/src/vite/vite.config.client.js",
|
|
1265
|
+
"packages/catalyst-core/src/vite/vite.config.server.js"
|
|
1266
|
+
]
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
"section": "routing",
|
|
1270
|
+
"title": "Catalyst 0.3.x Integrated Router",
|
|
1271
|
+
"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.",
|
|
1272
|
+
"layer": "Runtime",
|
|
1273
|
+
"source": "static",
|
|
1274
|
+
"tags": ["0.3.x", "router", "react-router", "RouterDataProvider", "migration"],
|
|
1275
|
+
"github_files": [
|
|
1276
|
+
"packages/catalyst-core/src/index.jsx",
|
|
1277
|
+
"packages/catalyst-core/src/web-router/components/RouterDataProvider.jsx"
|
|
1278
|
+
]
|
|
1279
|
+
},
|
|
1280
|
+
{
|
|
1281
|
+
"section": "code_splitting",
|
|
1282
|
+
"title": "Catalyst 0.3.x split and hydrationReady",
|
|
1283
|
+
"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.",
|
|
1284
|
+
"layer": "Runtime",
|
|
1285
|
+
"source": "static",
|
|
1286
|
+
"tags": ["0.3.x", "split", "hydrationReady", "suspense", "vite", "ssr"],
|
|
1287
|
+
"github_files": [
|
|
1288
|
+
"packages/catalyst-core/src/web-router/components/Split.jsx",
|
|
1289
|
+
"packages/catalyst-core/src/vite/inject-cache-key-plugin.js"
|
|
1290
|
+
]
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"section": "dependencies",
|
|
1294
|
+
"title": "Catalyst 0.3.x React Runtime Contract",
|
|
1295
|
+
"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.",
|
|
1296
|
+
"layer": "Build",
|
|
1297
|
+
"source": "static",
|
|
1298
|
+
"tags": ["0.3.x", "react", "react-dom", "19.0.0", "dependencies"],
|
|
1299
|
+
"github_files": [
|
|
1300
|
+
"packages/catalyst-core/package.json",
|
|
1301
|
+
"packages/create-catalyst-app/templates/none-js/package.json"
|
|
1302
|
+
]
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
"section": "build_system",
|
|
1306
|
+
"title": "Catalyst 0.3.x Offline Route Build Contract",
|
|
1307
|
+
"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.",
|
|
1308
|
+
"layer": "Runtime",
|
|
1309
|
+
"source": "static",
|
|
1310
|
+
"tags": ["0.3.x", "offline", "service-worker", "manifest", "build", "serve"],
|
|
1311
|
+
"github_files": [
|
|
1312
|
+
"packages/catalyst-core/src/scripts/generateOfflineManifest.js",
|
|
1313
|
+
"packages/catalyst-core/src/offline/registerServiceWorker.js",
|
|
1314
|
+
"packages/catalyst-core/src/offline/catalyst-sw.js"
|
|
1315
|
+
]
|
|
1316
|
+
},
|
|
1317
|
+
{
|
|
1318
|
+
"section": "known_errors",
|
|
1319
|
+
"title": "Catalyst 0.3.x Mixed Package Install",
|
|
1320
|
+
"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.",
|
|
1321
|
+
"layer": "Build",
|
|
1322
|
+
"source": "static",
|
|
1323
|
+
"tags": ["known-error", "0.3.x", "package", "exports", "bin", "local-testing"]
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"section": "known_errors",
|
|
1327
|
+
"title": "Offline Route Falls Back During catalyst start",
|
|
1328
|
+
"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.",
|
|
1329
|
+
"layer": "Runtime",
|
|
1330
|
+
"source": "static",
|
|
1331
|
+
"tags": ["known-error", "0.3.x", "offline", "start", "build", "serve"]
|
|
1173
1332
|
}
|
|
1174
1333
|
]
|
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
|
@@ -62,21 +62,53 @@ if (projectInfo.notInstalled) {
|
|
|
62
62
|
process.exit(1)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
const dbMissing = !fs.existsSync(DB_PATH)
|
|
66
|
+
const dbEmpty = !dbMissing && fs.statSync(DB_PATH).size === 0
|
|
67
|
+
|
|
68
|
+
if (dbMissing || dbEmpty) {
|
|
69
|
+
try {
|
|
70
|
+
require("./setup")
|
|
71
|
+
} catch (setupErr) {
|
|
72
|
+
process.stderr.write(
|
|
73
|
+
JSON.stringify({
|
|
74
|
+
jsonrpc: "2.0",
|
|
75
|
+
error: {
|
|
76
|
+
code: -32000,
|
|
77
|
+
message: `context.db ${dbEmpty ? "is empty" : "not found"} at ${DB_PATH}. Auto-setup failed: ${setupErr.message}. Run manually: node ${path.join(MCP_DIR, "setup.js")}`,
|
|
78
|
+
},
|
|
79
|
+
id: null,
|
|
80
|
+
}) + "\n"
|
|
81
|
+
)
|
|
82
|
+
// process.exit(1) instead of exitCode+return: this is top-level script code
|
|
83
|
+
// (not inside a function), and ESLint here rejects top-level return even
|
|
84
|
+
// though Node's CommonJS wrapper allows it. Matches the exit pattern used
|
|
85
|
+
// by the other startup-validation failures above (L49, L62).
|
|
86
|
+
process.exit(1)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let db
|
|
91
|
+
try {
|
|
92
|
+
db = new Database(DB_PATH, { readonly: false })
|
|
93
|
+
} catch (e) {
|
|
94
|
+
const isVersionMismatch =
|
|
95
|
+
e.code === "ERR_DLOPEN_FAILED" ||
|
|
96
|
+
e.message.includes("compiled against a different Node.js version") ||
|
|
97
|
+
e.message.includes("NODE_MODULE_VERSION")
|
|
66
98
|
process.stderr.write(
|
|
67
99
|
JSON.stringify({
|
|
68
100
|
jsonrpc: "2.0",
|
|
69
101
|
error: {
|
|
70
102
|
code: -32000,
|
|
71
|
-
message:
|
|
103
|
+
message: isVersionMismatch
|
|
104
|
+
? `Native module mismatch for Node ${process.version}. Run: npm rebuild better-sqlite3`
|
|
105
|
+
: `Failed to open context.db: ${e.message}`,
|
|
72
106
|
},
|
|
73
107
|
id: null,
|
|
74
108
|
}) + "\n"
|
|
75
109
|
)
|
|
76
110
|
process.exit(1)
|
|
77
111
|
}
|
|
78
|
-
|
|
79
|
-
const db = new Database(DB_PATH, { readonly: false })
|
|
80
112
|
const CONVERSION_TASKS = JSON.parse(fs.readFileSync(TASKS_PATH, "utf8"))
|
|
81
113
|
|
|
82
114
|
// ── Module init ───────────────────────────────────────────────────────────────
|
|
@@ -103,7 +135,7 @@ const INTENT_PATTERNS = {
|
|
|
103
135
|
feedback:
|
|
104
136
|
/\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
137
|
debug: /error|fail|broken|not work|crash|issue|bug|why|wrong/i,
|
|
106
|
-
build: /build|compile|webpack|bundle|android|ios|platform/i,
|
|
138
|
+
build: /build|compile|webpack|vite|bundle|android|ios|platform/i,
|
|
107
139
|
sync: /sync|update.*doc|fetch.*doc|latest.*doc/i,
|
|
108
140
|
}
|
|
109
141
|
|
|
@@ -141,7 +173,7 @@ const TOOLS = [
|
|
|
141
173
|
{
|
|
142
174
|
name: "get_conversion_tasks",
|
|
143
175
|
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?',
|
|
176
|
+
"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
177
|
inputSchema: {
|
|
146
178
|
type: "object",
|
|
147
179
|
properties: {
|
|
@@ -166,7 +198,7 @@ const TOOLS = [
|
|
|
166
198
|
{
|
|
167
199
|
name: "get_conversion_status",
|
|
168
200
|
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?'.
|
|
201
|
+
"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
202
|
inputSchema: {
|
|
171
203
|
type: "object",
|
|
172
204
|
properties: {
|
|
@@ -224,7 +256,7 @@ const TOOLS = [
|
|
|
224
256
|
{
|
|
225
257
|
name: "get_build_flow",
|
|
226
258
|
description:
|
|
227
|
-
"Use when the developer asks about building, serving, or deploying
|
|
259
|
+
"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
260
|
inputSchema: {
|
|
229
261
|
type: "object",
|
|
230
262
|
properties: {
|