@absolutejs/absolute 0.19.0-beta.1043 → 0.19.0-beta.1044
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/dist/angular/browser.js +10358 -0
- package/dist/angular/browser.js.map +260 -0
- package/dist/angular/components/constants.js +101 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +58 -0
- package/dist/angular/components/core/streamingSlotRegistry.js +114 -0
- package/dist/angular/components/defer-slot-payload.js +6 -0
- package/dist/angular/components/defer-slot-templates.directive.js +44 -0
- package/dist/angular/components/defer-slot.component.js +152 -0
- package/dist/angular/components/image.component.js +202 -0
- package/dist/angular/components/index.js +4 -0
- package/dist/angular/components/stream-slot.component.js +102 -0
- package/dist/angular/hmrPreserveCore.ts +188 -0
- package/dist/angular/index.js +15793 -0
- package/dist/angular/index.js.map +299 -0
- package/dist/angular/server.js +6357 -0
- package/dist/angular/server.js.map +61 -0
- package/dist/build.js +27484 -0
- package/dist/build.js.map +146 -0
- package/dist/cli/config/client.js +527 -0
- package/dist/cli/config/server.js +37130 -0
- package/dist/cli/htmx/htmx.min.js +1 -0
- package/dist/cli/index.js +180130 -0
- package/dist/client/index.js +1267 -0
- package/dist/client/index.js.map +31 -0
- package/dist/core/streamingSlotRegistrar.js +138 -0
- package/dist/core/streamingSlotRegistrar.js.map +10 -0
- package/dist/core/streamingSlotRegistry.js +194 -0
- package/dist/core/streamingSlotRegistry.js.map +11 -0
- package/dist/dev/client/constants.ts +26 -0
- package/dist/dev/client/cssUtils.ts +311 -0
- package/dist/dev/client/domDiff.ts +226 -0
- package/dist/dev/client/domState.ts +423 -0
- package/dist/dev/client/domTracker.ts +61 -0
- package/dist/dev/client/errorOverlay.ts +445 -0
- package/dist/dev/client/frameworkDetect.ts +63 -0
- package/dist/dev/client/handlers/angularHmrShim.ts +88 -0
- package/dist/dev/client/handlers/angularRemount.ts +362 -0
- package/dist/dev/client/handlers/angularRemountWiring.ts +52 -0
- package/dist/dev/client/handlers/html.ts +364 -0
- package/dist/dev/client/handlers/htmx.ts +278 -0
- package/dist/dev/client/handlers/react.ts +108 -0
- package/dist/dev/client/handlers/rebuild.ts +153 -0
- package/dist/dev/client/handlers/svelte.ts +334 -0
- package/dist/dev/client/handlers/vue.ts +292 -0
- package/dist/dev/client/headPatch.ts +233 -0
- package/dist/dev/client/hmrClient.ts +352 -0
- package/dist/dev/client/hmrState.ts +14 -0
- package/dist/dev/client/hmrToast.ts +150 -0
- package/dist/dev/client/moduleVersions.ts +62 -0
- package/dist/dev/client/reactRefreshSetup.ts +31 -0
- package/dist/dev/client/vendor/lview/lViewOps.ts +196 -0
- package/dist/dev/client/vendor/lview/slotConstants.ts +44 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.d.ts +12 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.js +313 -0
- package/dist/image-client/imageClient.js +69 -0
- package/dist/index.js +36383 -0
- package/dist/index.js.map +320 -0
- package/dist/islands/browser.js +259 -0
- package/dist/islands/browser.js.map +15 -0
- package/dist/islands/index.js +2415 -0
- package/dist/islands/index.js.map +37 -0
- package/dist/react/browser.js +374 -0
- package/dist/react/browser.js.map +19 -0
- package/dist/react/components/browser/index.js +467 -0
- package/dist/react/components/index.js +684 -0
- package/dist/react/components/index.js.map +18 -0
- package/dist/react/hooks/index.js +285 -0
- package/dist/react/hooks/index.js.map +14 -0
- package/dist/react/index.js +4258 -0
- package/dist/react/index.js.map +56 -0
- package/dist/react/jsxDevRuntimeCompat.js +90 -0
- package/dist/react/jsxDevRuntimeCompat.js.map +10 -0
- package/dist/react/router/browser.js +95 -0
- package/dist/react/router/browser.js.map +10 -0
- package/dist/react/router/index.js +95 -0
- package/dist/react/router/index.js.map +10 -0
- package/dist/react/server.js +1895 -0
- package/dist/react/server.js.map +26 -0
- package/dist/src/angular/Island.browser.d.ts +34 -0
- package/dist/src/angular/Island.d.ts +29 -0
- package/dist/src/angular/angularDeps.d.ts +2 -0
- package/dist/src/angular/angularPatch.d.ts +1 -0
- package/dist/src/angular/animationProviders.d.ts +2 -0
- package/dist/src/angular/browser.d.ts +14 -0
- package/dist/src/angular/components/constants.d.ts +96 -0
- package/dist/src/angular/components/defer-slot-payload.d.ts +7 -0
- package/dist/src/angular/components/defer-slot-templates.directive.d.ts +21 -0
- package/dist/src/angular/components/defer-slot.component.d.ts +29 -0
- package/dist/src/angular/components/image.component.d.ts +42 -0
- package/dist/src/angular/components/index.d.ts +4 -0
- package/dist/src/angular/components/stream-slot.component.d.ts +20 -0
- package/dist/src/angular/composables/index.d.ts +6 -0
- package/dist/src/angular/composables/usePageContext.d.ts +16 -0
- package/dist/src/angular/composables/useResource.d.ts +57 -0
- package/dist/src/angular/composables/useSubscription.d.ts +33 -0
- package/dist/src/angular/composables/useTimers.d.ts +18 -0
- package/dist/src/angular/createIsland.browser.d.ts +2 -0
- package/dist/src/angular/createIsland.d.ts +2 -0
- package/dist/src/angular/deterministicEnv.d.ts +26 -0
- package/dist/src/angular/hmrPreserveCore.d.ts +21 -0
- package/dist/src/angular/httpTransferCache.d.ts +12 -0
- package/dist/src/angular/index.d.ts +14 -0
- package/dist/src/angular/injectorPatch.d.ts +1 -0
- package/dist/src/angular/islandStore.d.ts +9 -0
- package/dist/src/angular/islands.d.ts +4 -0
- package/dist/src/angular/lowerDeferSyntax.d.ts +18 -0
- package/dist/src/angular/lowerServerIslands.d.ts +1 -0
- package/dist/src/angular/pageHandler.d.ts +48 -0
- package/dist/src/angular/pendingTask.d.ts +1 -0
- package/dist/src/angular/preserveAcrossHmr.d.ts +12 -0
- package/dist/src/angular/renderIsland.d.ts +2 -0
- package/dist/src/angular/requestProviders.d.ts +5 -0
- package/dist/src/angular/resolveAngularPackage.d.ts +19 -0
- package/dist/src/angular/routerRedirectProviders.d.ts +6 -0
- package/dist/src/angular/server.d.ts +4 -0
- package/dist/src/angular/ssrRender.d.ts +13 -0
- package/dist/src/angular/ssrSanitizer.d.ts +3 -0
- package/dist/src/angular/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/build/angularLinkerPlugin.d.ts +29 -0
- package/dist/src/build/buildAngularVendor.d.ts +40 -0
- package/dist/src/build/buildDepVendor.d.ts +2 -0
- package/dist/src/build/buildEmberVendor.d.ts +24 -0
- package/dist/src/build/buildReactVendor.d.ts +8 -0
- package/dist/src/build/buildSvelteVendor.d.ts +6 -0
- package/dist/src/build/buildVueVendor.d.ts +6 -0
- package/dist/src/build/chainInlineSourcemaps.d.ts +13 -0
- package/dist/src/build/compileAngular.d.ts +40 -0
- package/dist/src/build/compileEmber.d.ts +43 -0
- package/dist/src/build/compileSvelte.d.ts +14 -0
- package/dist/src/build/compileTailwind.d.ts +5 -0
- package/dist/src/build/compileVue.d.ts +22 -0
- package/dist/src/build/externalAssetPlugin.d.ts +2 -0
- package/dist/src/build/generateManifest.d.ts +2 -0
- package/dist/src/build/generateReactIndexes.d.ts +2 -0
- package/dist/src/build/htmlScriptHMRPlugin.d.ts +13 -0
- package/dist/src/build/index.d.ts +2 -0
- package/dist/src/build/islandEntries.d.ts +32 -0
- package/dist/src/build/islandRegistryTransform.d.ts +17 -0
- package/dist/src/build/nativeRewrite.d.ts +5 -0
- package/dist/src/build/optimizeHtmlImages.d.ts +2 -0
- package/dist/src/build/outputLogs.d.ts +1 -0
- package/dist/src/build/parseAngularConfigImports.d.ts +9 -0
- package/dist/src/build/parseVueSpaRoutes.d.ts +20 -0
- package/dist/src/build/resolvePackageImport.d.ts +9 -0
- package/dist/src/build/rewriteImports.d.ts +8 -0
- package/dist/src/build/rewriteImportsPlugin.d.ts +48 -0
- package/dist/src/build/rewriteReactImports.d.ts +7 -0
- package/dist/src/build/runAngularHandlerScan.d.ts +7 -0
- package/dist/src/build/scanAngularHandlerCalls.d.ts +13 -0
- package/dist/src/build/scanAngularPageRoutes.d.ts +10 -0
- package/dist/src/build/scanConventions.d.ts +5 -0
- package/dist/src/build/scanCssEntryPoints.d.ts +1 -0
- package/dist/src/build/scanEntryPoints.d.ts +1 -0
- package/dist/src/build/scanRouteRegistrations.d.ts +23 -0
- package/dist/src/build/scanVueSsrOnlyPages.d.ts +6 -0
- package/dist/src/build/staticIslandPages.d.ts +9 -0
- package/dist/src/build/stylePreprocessor.d.ts +26 -0
- package/dist/src/build/tailwindCompiler.d.ts +8 -0
- package/dist/src/build/updateAssetPaths.d.ts +1 -0
- package/dist/src/build/vendorEntrySource.d.ts +1 -0
- package/dist/src/build/verifyAngularCoreUniqueness.d.ts +2 -0
- package/dist/src/build/vueAutoRouterTransform.d.ts +1 -0
- package/dist/src/build/wrapHTMLScript.d.ts +17 -0
- package/dist/src/build.d.ts +2 -0
- package/dist/src/cli/add/dependencies.d.ts +12 -0
- package/dist/src/cli/cache.d.ts +15 -0
- package/dist/src/cli/config/absolute/AbsoluteConfigPanel.d.ts +6 -0
- package/dist/src/cli/config/absolute/editAbsoluteConfig.d.ts +5 -0
- package/dist/src/cli/config/absolute/resolveAbsoluteConfig.d.ts +14 -0
- package/dist/src/cli/config/client.d.ts +1 -0
- package/dist/src/cli/config/configCert.d.ts +12 -0
- package/dist/src/cli/config/eslint/EslintPanel.d.ts +6 -0
- package/dist/src/cli/config/eslint/configAst.d.ts +18 -0
- package/dist/src/cli/config/eslint/editConfigRule.d.ts +6 -0
- package/dist/src/cli/config/eslint/eslintStyles.d.ts +1 -0
- package/dist/src/cli/config/eslint/resolveConfig.d.ts +3 -0
- package/dist/src/cli/config/eslint/serializeValue.d.ts +9 -0
- package/dist/src/cli/config/guards.d.ts +4 -0
- package/dist/src/cli/config/packageJson/PackageJsonPanel.d.ts +6 -0
- package/dist/src/cli/config/packageJson/editPackageJson.d.ts +9 -0
- package/dist/src/cli/config/packageJson/resolvePackageJson.d.ts +9 -0
- package/dist/src/cli/config/page/ConfigShell.d.ts +6 -0
- package/dist/src/cli/config/page/FieldEditor.d.ts +9 -0
- package/dist/src/cli/config/page/PanelHost.d.ts +6 -0
- package/dist/src/cli/config/page/configStyles.d.ts +1 -0
- package/dist/src/cli/config/panels.d.ts +7 -0
- package/dist/src/cli/config/prettier/PrettierPanel.d.ts +6 -0
- package/dist/src/cli/config/prettier/editPrettier.d.ts +5 -0
- package/dist/src/cli/config/prettier/resolvePrettier.d.ts +11 -0
- package/dist/src/cli/config/schema/fromJsonSchema.d.ts +3 -0
- package/dist/src/cli/config/schema/fromType.d.ts +2 -0
- package/dist/src/cli/config/schema/serialize.d.ts +1 -0
- package/dist/src/cli/config/server.d.ts +298 -0
- package/dist/src/cli/config/tsconfig/TsconfigPanel.d.ts +6 -0
- package/dist/src/cli/config/tsconfig/editTsconfig.d.ts +5 -0
- package/dist/src/cli/config/tsconfig/resolveTsconfig.d.ts +8 -0
- package/dist/src/cli/config/tsconfig/tsconfigStyles.d.ts +1 -0
- package/dist/src/cli/discoverInstances.d.ts +5 -0
- package/dist/src/cli/generate/componentTemplates.d.ts +7 -0
- package/dist/src/cli/generate/context.d.ts +30 -0
- package/dist/src/cli/generate/cssStrategy.d.ts +20 -0
- package/dist/src/cli/generate/frameworkKey.d.ts +3 -0
- package/dist/src/cli/generate/frameworks.d.ts +40 -0
- package/dist/src/cli/generate/generateApi.d.ts +3 -0
- package/dist/src/cli/generate/generateComponent.d.ts +4 -0
- package/dist/src/cli/generate/generatePage.d.ts +4 -0
- package/dist/src/cli/generate/naming.d.ts +5 -0
- package/dist/src/cli/generate/navData.d.ts +10 -0
- package/dist/src/cli/generate/outcome.d.ts +17 -0
- package/dist/src/cli/generate/pageTemplates.d.ts +11 -0
- package/dist/src/cli/generate/routeWiring.d.ts +40 -0
- package/dist/src/cli/generate/staticNav.d.ts +5 -0
- package/dist/src/cli/heapDiff.d.ts +1 -0
- package/dist/src/cli/htmx/install.d.ts +6 -0
- package/dist/src/cli/index.d.ts +2 -0
- package/dist/src/cli/inspectData.d.ts +12 -0
- package/dist/src/cli/inspectTui.d.ts +1 -0
- package/dist/src/cli/instanceStatus.d.ts +22 -0
- package/dist/src/cli/interactive.d.ts +2 -0
- package/dist/src/cli/psTui.d.ts +1 -0
- package/dist/src/cli/scripts/add.d.ts +1 -0
- package/dist/src/cli/scripts/analyze.d.ts +1 -0
- package/dist/src/cli/scripts/api.d.ts +1 -0
- package/dist/src/cli/scripts/build.d.ts +1 -0
- package/dist/src/cli/scripts/compile.d.ts +2 -0
- package/dist/src/cli/scripts/dev.d.ts +1 -0
- package/dist/src/cli/scripts/doctor.d.ts +1 -0
- package/dist/src/cli/scripts/env.d.ts +7 -0
- package/dist/src/cli/scripts/eslint.d.ts +16 -0
- package/dist/src/cli/scripts/generate.d.ts +1 -0
- package/dist/src/cli/scripts/htmx.d.ts +1 -0
- package/dist/src/cli/scripts/info.d.ts +1 -0
- package/dist/src/cli/scripts/inspect.d.ts +1 -0
- package/dist/src/cli/scripts/islands.d.ts +1 -0
- package/dist/src/cli/scripts/logs.d.ts +1 -0
- package/dist/src/cli/scripts/ls.d.ts +1 -0
- package/dist/src/cli/scripts/mem.d.ts +1 -0
- package/dist/src/cli/scripts/prettier.d.ts +3 -0
- package/dist/src/cli/scripts/ps.d.ts +1 -0
- package/dist/src/cli/scripts/remove.d.ts +1 -0
- package/dist/src/cli/scripts/routes.d.ts +1 -0
- package/dist/src/cli/scripts/start.d.ts +1 -0
- package/dist/src/cli/scripts/telemetry.d.ts +5 -0
- package/dist/src/cli/scripts/tunnelRelay.d.ts +9 -0
- package/dist/src/cli/scripts/typecheck.d.ts +1 -0
- package/dist/src/cli/scripts/workspace.d.ts +11 -0
- package/dist/src/cli/telemetryEvent.d.ts +1 -0
- package/dist/src/cli/tuiPrimitives.d.ts +14 -0
- package/dist/src/cli/utils.d.ts +15 -0
- package/dist/src/cli/workspaceTui.d.ts +44 -0
- package/dist/src/client/hydrators/react.d.ts +3 -0
- package/dist/src/client/hydrators/svelte.d.ts +2 -0
- package/dist/src/client/hydrators/vue.d.ts +2 -0
- package/dist/src/client/index.d.ts +4 -0
- package/dist/src/client/islandResolver.d.ts +2 -0
- package/dist/src/client/islandRuntime.d.ts +9 -0
- package/dist/src/client/islandStore.d.ts +22 -0
- package/dist/src/client/preserveIslandMarkup.d.ts +16 -0
- package/dist/src/client/streamSwap.d.ts +1 -0
- package/dist/src/constants.d.ts +96 -0
- package/dist/src/core/angularServerModule.d.ts +1 -0
- package/dist/src/core/build.d.ts +14 -0
- package/dist/src/core/currentIslandRegistry.d.ts +7 -0
- package/dist/src/core/devBuild.d.ts +23 -0
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +4 -0
- package/dist/src/core/devVendorPaths.d.ts +17 -0
- package/dist/src/core/index.d.ts +7 -0
- package/dist/src/core/islandManifest.d.ts +3 -0
- package/dist/src/core/islandMarkupAttributes.d.ts +12 -0
- package/dist/src/core/islandPageContext.d.ts +12 -0
- package/dist/src/core/islandSsr.d.ts +6 -0
- package/dist/src/core/islands.d.ts +16 -0
- package/dist/src/core/loadIslandRegistry.d.ts +1 -0
- package/dist/src/core/lookup.d.ts +1 -0
- package/dist/src/core/normalizeIslandProps.d.ts +15 -0
- package/dist/src/core/pageHandlers.d.ts +5 -0
- package/dist/src/core/prepare.d.ts +417 -0
- package/dist/src/core/prerender.d.ts +31 -0
- package/dist/src/core/renderIslandMarkup.d.ts +13 -0
- package/dist/src/core/responseEnhancers.d.ts +10 -0
- package/dist/src/core/staticStreaming.d.ts +25 -0
- package/dist/src/core/streamingSlotRegistrar.d.ts +16 -0
- package/dist/src/core/streamingSlotRegistry.d.ts +2 -0
- package/dist/src/core/streamingSlotWarningScope.d.ts +4 -0
- package/dist/src/core/svelteServerModule.d.ts +1 -0
- package/dist/src/core/vueServerModule.d.ts +1 -0
- package/dist/src/core/wrapPageHandlerWithStreamingSlots.d.ts +2 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +58 -0
- package/dist/src/dev/angular/hmrCompiler.d.ts +2 -0
- package/dist/src/dev/angular/hmrImportGenerator.d.ts +3 -0
- package/dist/src/dev/angular/hmrInjectionPlugin.d.ts +8 -0
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +16 -0
- package/dist/src/dev/angular/vendor/translator/api/ast_factory.d.ts +363 -0
- package/dist/src/dev/angular/vendor/translator/api/import_generator.d.ts +49 -0
- package/dist/src/dev/angular/vendor/translator/context.d.ts +18 -0
- package/dist/src/dev/angular/vendor/translator/translator.d.ts +75 -0
- package/dist/src/dev/angular/vendor/translator/ts_util.d.ts +12 -0
- package/dist/src/dev/angular/vendor/translator/typescript_ast_factory.d.ts +66 -0
- package/dist/src/dev/angular/vendor/translator/typescript_translator.d.ts +13 -0
- package/dist/src/dev/assetStore.d.ts +8 -0
- package/dist/src/dev/buildHMRClient.d.ts +1 -0
- package/dist/src/dev/clientManager.d.ts +33 -0
- package/dist/src/dev/configResolver.d.ts +16 -0
- package/dist/src/dev/dependencyGraph.d.ts +10 -0
- package/dist/src/dev/devCert.d.ts +11 -0
- package/dist/src/dev/fileHashTracker.d.ts +2 -0
- package/dist/src/dev/fileWatcher.d.ts +4 -0
- package/dist/src/dev/moduleMapper.d.ts +27 -0
- package/dist/src/dev/moduleServer.d.ts +24 -0
- package/dist/src/dev/moduleVersionTracker.d.ts +7 -0
- package/dist/src/dev/pathUtils.d.ts +8 -0
- package/dist/src/dev/reactComponentClassifier.d.ts +2 -0
- package/dist/src/dev/rebuildTrigger.d.ts +11 -0
- package/dist/src/dev/requestInspector.d.ts +43 -0
- package/dist/src/dev/serverEntryWatcher.d.ts +5 -0
- package/dist/src/dev/simpleHTMLHMR.d.ts +4 -0
- package/dist/src/dev/simpleHTMXHMR.d.ts +4 -0
- package/dist/src/dev/transformCache.d.ts +22 -0
- package/dist/src/dev/tunnel/client.d.ts +20 -0
- package/dist/src/dev/tunnel/protocol.d.ts +85 -0
- package/dist/src/dev/tunnel/relay.d.ts +28 -0
- package/dist/src/dev/webSocket.d.ts +9 -0
- package/dist/src/ember/browser.d.ts +24 -0
- package/dist/src/ember/index.d.ts +2 -0
- package/dist/src/ember/pageHandler.d.ts +35 -0
- package/dist/src/ember/server.d.ts +2 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/islands/browser.d.ts +3 -0
- package/dist/src/islands/index.d.ts +3 -0
- package/dist/src/islands/pageMetadata.d.ts +13 -0
- package/dist/src/islands/sourceMetadata.d.ts +10 -0
- package/dist/src/plugins/devtoolsJson.d.ts +58 -0
- package/dist/src/plugins/hmr.d.ts +163 -0
- package/dist/src/plugins/imageOptimizer.d.ts +67 -0
- package/dist/src/plugins/index.d.ts +3 -0
- package/dist/src/plugins/networking.d.ts +2 -0
- package/dist/src/plugins/pageRouter.d.ts +1 -0
- package/dist/src/react/Island.browser.d.ts +2 -0
- package/dist/src/react/Island.d.ts +2 -0
- package/dist/src/react/bridgeInternals.d.ts +1 -0
- package/dist/src/react/browser.d.ts +3 -0
- package/dist/src/react/components/Head.d.ts +2 -0
- package/dist/src/react/components/Image.d.ts +2 -0
- package/dist/src/react/components/JsonLd.d.ts +4 -0
- package/dist/src/react/components/StreamSlot.browser.d.ts +10 -0
- package/dist/src/react/components/StreamSlot.d.ts +10 -0
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +22 -0
- package/dist/src/react/components/SuspenseSlot.d.ts +37 -0
- package/dist/src/react/components/browser/index.d.ts +5 -0
- package/dist/src/react/components/index.d.ts +5 -0
- package/dist/src/react/createIsland.browser.d.ts +2 -0
- package/dist/src/react/createIsland.d.ts +2 -0
- package/dist/src/react/hooks/index.d.ts +3 -0
- package/dist/src/react/hooks/useIslandStore.d.ts +3 -0
- package/dist/src/react/hooks/useMediaQuery.d.ts +7 -0
- package/dist/src/react/index.d.ts +4 -0
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +8 -0
- package/dist/src/react/pageHandler.d.ts +25 -0
- package/dist/src/react/router/UniversalRouter.d.ts +43 -0
- package/dist/src/react/router/browser.d.ts +2 -0
- package/dist/src/react/router/index.d.ts +2 -0
- package/dist/src/react/server.d.ts +1 -0
- package/dist/src/react/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/svelte/browser.d.ts +4 -0
- package/dist/src/svelte/createIsland.browser.d.ts +2 -0
- package/dist/src/svelte/createIsland.d.ts +2 -0
- package/dist/src/svelte/index.d.ts +6 -0
- package/dist/src/svelte/islandStore.d.ts +5 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +4 -0
- package/dist/src/svelte/lowerIslandSyntax.d.ts +4 -0
- package/dist/src/svelte/pageHandler.d.ts +28 -0
- package/dist/src/svelte/renderIsland.d.ts +2 -0
- package/dist/src/svelte/renderToPipeableStream.d.ts +12 -0
- package/dist/src/svelte/renderToReadableStream.d.ts +14 -0
- package/dist/src/svelte/renderToString.d.ts +9 -0
- package/dist/src/svelte/resolveIslandHtml.browser.d.ts +2 -0
- package/dist/src/svelte/resolveIslandHtml.d.ts +2 -0
- package/dist/src/svelte/router/browser.d.ts +4 -0
- package/dist/src/svelte/router/goto.d.ts +15 -0
- package/dist/src/svelte/router/hashMode.d.ts +16 -0
- package/dist/src/svelte/router/index.d.ts +4 -0
- package/dist/src/svelte/router/matchPath.d.ts +30 -0
- package/dist/src/svelte/router/page.svelte.d.ts +15 -0
- package/dist/src/svelte/router/prefetchCache.d.ts +17 -0
- package/dist/src/svelte/router/pushState.d.ts +13 -0
- package/dist/src/svelte/router/viewTransitions.d.ts +6 -0
- package/dist/src/svelte/server.d.ts +1 -0
- package/dist/src/svelte/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/utils/buildDirectoryLock.d.ts +28 -0
- package/dist/src/utils/cleanStaleOutputs.d.ts +1 -0
- package/dist/src/utils/cleanup.d.ts +9 -0
- package/dist/src/utils/commonAncestor.d.ts +1 -0
- package/dist/src/utils/defineConfig.d.ts +39 -0
- package/dist/src/utils/defineConvention.d.ts +3 -0
- package/dist/src/utils/defineEnv.d.ts +10 -0
- package/dist/src/utils/escapeScriptContent.d.ts +1 -0
- package/dist/src/utils/formatBytes.d.ts +2 -0
- package/dist/src/utils/generateHeadElement.d.ts +4 -0
- package/dist/src/utils/generateSitemap.d.ts +21 -0
- package/dist/src/utils/generatedDir.d.ts +3 -0
- package/dist/src/utils/getDurationString.d.ts +1 -0
- package/dist/src/utils/getEnv.d.ts +1 -0
- package/dist/src/utils/imageClient.d.ts +13 -0
- package/dist/src/utils/imageProcessing.d.ts +33 -0
- package/dist/src/utils/index.d.ts +11 -0
- package/dist/src/utils/inlinePageCss.d.ts +2 -0
- package/dist/src/utils/instanceRegistry.d.ts +13 -0
- package/dist/src/utils/jsonLd.d.ts +3 -0
- package/dist/src/utils/loadConfig.d.ts +55 -0
- package/dist/src/utils/logger.d.ts +56 -0
- package/dist/src/utils/networking.d.ts +2 -0
- package/dist/src/utils/normalizePath.d.ts +9 -0
- package/dist/src/utils/portScan.d.ts +22 -0
- package/dist/src/utils/projectRoot.d.ts +17 -0
- package/dist/src/utils/registerClientScript.d.ts +36 -0
- package/dist/src/utils/resolveConvention.d.ts +10 -0
- package/dist/src/utils/resolveDevPort.d.ts +24 -0
- package/dist/src/utils/runtimeMode.d.ts +3 -0
- package/dist/src/utils/spaRouteCss.d.ts +4 -0
- package/dist/src/utils/spaRouteTypes.d.ts +25 -0
- package/dist/src/utils/ssrErrorPage.d.ts +1 -0
- package/dist/src/utils/startupBanner.d.ts +10 -0
- package/dist/src/utils/startupTimings.d.ts +7 -0
- package/dist/src/utils/streamingSlotMetricSink.d.ts +18 -0
- package/dist/src/utils/streamingSlots.d.ts +76 -0
- package/dist/src/utils/stringModifiers.d.ts +3 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -0
- package/dist/src/utils/validateSafePath.d.ts +1 -0
- package/dist/src/vue/Island.browser.d.ts +37 -0
- package/dist/src/vue/Island.d.ts +36 -0
- package/dist/src/vue/browser.d.ts +6 -0
- package/dist/src/vue/components/Image.d.ts +74 -0
- package/dist/src/vue/components/StreamSlot.d.ts +22 -0
- package/dist/src/vue/components/SuspenseSlot.d.ts +26 -0
- package/dist/src/vue/components/index.d.ts +3 -0
- package/dist/src/vue/createIsland.browser.d.ts +13 -0
- package/dist/src/vue/createIsland.d.ts +13 -0
- package/dist/src/vue/defineVuePage.d.ts +6 -0
- package/dist/src/vue/index.d.ts +9 -0
- package/dist/src/vue/pageHandler.d.ts +45 -0
- package/dist/src/vue/routerRedirectProviders.d.ts +45 -0
- package/dist/src/vue/server.d.ts +2 -0
- package/dist/src/vue/staticAnalyzeSpaRoutes.d.ts +7 -0
- package/dist/src/vue/useIslandStore.d.ts +3 -0
- package/dist/svelte/browser.js +309 -0
- package/dist/svelte/browser.js.map +19 -0
- package/dist/svelte/components/AwaitSlot.svelte +39 -0
- package/dist/svelte/components/AwaitSlot.svelte.d.ts +2 -0
- package/dist/svelte/components/Head.svelte +144 -0
- package/dist/svelte/components/Head.svelte.d.ts +2 -0
- package/dist/svelte/components/Image.svelte +164 -0
- package/dist/svelte/components/Image.svelte.d.ts +5 -0
- package/dist/svelte/components/Island.svelte +71 -0
- package/dist/svelte/components/Island.svelte.d.ts +5 -0
- package/dist/svelte/components/JsonLd.svelte +21 -0
- package/dist/svelte/components/JsonLd.svelte.d.ts +2 -0
- package/dist/svelte/components/StreamSlot.svelte +41 -0
- package/dist/svelte/components/StreamSlot.svelte.d.ts +2 -0
- package/dist/svelte/index.js +4371 -0
- package/dist/svelte/index.js.map +60 -0
- package/dist/svelte/router/Link.svelte +124 -0
- package/dist/svelte/router/Link.svelte.d.ts +21 -0
- package/dist/svelte/router/Route.svelte +54 -0
- package/dist/svelte/router/Route.svelte.d.ts +13 -0
- package/dist/svelte/router/Router.svelte +189 -0
- package/dist/svelte/router/Router.svelte.d.ts +16 -0
- package/dist/svelte/router/browser.ts +14 -0
- package/dist/svelte/router/goto.ts +89 -0
- package/dist/svelte/router/hashMode.ts +31 -0
- package/dist/svelte/router/index.ts +23 -0
- package/dist/svelte/router/matchPath.ts +136 -0
- package/dist/svelte/router/page.d.ts +15 -0
- package/dist/svelte/router/page.js +27 -0
- package/dist/svelte/router/prefetchCache.ts +85 -0
- package/dist/svelte/router/pushState.ts +35 -0
- package/dist/svelte/router/viewTransitions.ts +35 -0
- package/dist/svelte/server.js +2996 -0
- package/dist/svelte/server.js.map +33 -0
- package/dist/types/absoluteConfig.d.ts +22 -0
- package/dist/types/angular.d.ts +43 -0
- package/dist/types/build.d.ts +245 -0
- package/dist/types/cli.d.ts +74 -0
- package/dist/types/client.d.ts +70 -0
- package/dist/types/config.d.ts +50 -0
- package/dist/types/conventions.d.ts +26 -0
- package/dist/types/ember.d.ts +39 -0
- package/dist/types/env.d.ts +2 -0
- package/dist/types/eslintConfig.d.ts +68 -0
- package/dist/types/globals.d.ts +163 -0
- package/dist/types/image.d.ts +77 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/island.d.ts +52 -0
- package/dist/types/jsonLd.d.ts +300 -0
- package/dist/types/mediaQuery.d.ts +9 -0
- package/dist/types/messages.d.ts +152 -0
- package/dist/types/metadata.d.ts +51 -0
- package/dist/types/packageJson.d.ts +74 -0
- package/dist/types/packageJsonPanel.d.ts +29 -0
- package/dist/types/prettier.d.ts +26 -0
- package/dist/types/react.d.ts +2 -0
- package/dist/types/sitemap.d.ts +24 -0
- package/dist/types/style-module-shim.d.ts +29 -0
- package/dist/types/svelte.d.ts +2 -0
- package/dist/types/svelteRouter.d.ts +65 -0
- package/dist/types/svelteRouter.ts +91 -0
- package/dist/types/telemetry.d.ts +15 -0
- package/dist/types/tool.d.ts +11 -0
- package/dist/types/tsconfig.d.ts +31 -0
- package/dist/types/typeGuards.d.ts +2 -0
- package/dist/types/userAgentTypes.d.ts +2 -0
- package/dist/types/vue.d.ts +56 -0
- package/dist/types/websocket.d.ts +6 -0
- package/dist/vue/browser.js +512 -0
- package/dist/vue/browser.js.map +22 -0
- package/dist/vue/components/Image.js +264 -0
- package/dist/vue/components/Image.js.map +12 -0
- package/dist/vue/components/index.js +571 -0
- package/dist/vue/components/index.js.map +15 -0
- package/dist/vue/index.js +5238 -0
- package/dist/vue/index.js.map +69 -0
- package/dist/vue/server.js +2251 -0
- package/dist/vue/server.js.map +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
import type {} from '../../types/globals';
|
|
2
|
+
/* AbsoluteJS Error Overlay - branded, per-framework, modern styling */
|
|
3
|
+
|
|
4
|
+
import type { ErrorOverlayOptions } from '../../types/client';
|
|
5
|
+
import { OVERLAY_FADE_DURATION_MS } from './constants';
|
|
6
|
+
|
|
7
|
+
let errorOverlayElement: HTMLDivElement | null = null;
|
|
8
|
+
let currentOverlayKind: 'compilation' | 'runtime' | null = null;
|
|
9
|
+
// Runtime errors accumulate so a second uncaught error in the same tick
|
|
10
|
+
// doesn't silently replace the first — the overlay shows nav buttons and
|
|
11
|
+
// a "N of M" badge so you can step through them.
|
|
12
|
+
const runtimeErrors: ErrorOverlayOptions[] = [];
|
|
13
|
+
let activeRuntimeIndex = 0;
|
|
14
|
+
let pendingCompilationOpts: ErrorOverlayOptions | null = null;
|
|
15
|
+
// Tracks which queue renderOverlay should pull from. Driven by
|
|
16
|
+
// showErrorOverlay BEFORE renderOverlay runs so the choice is unambiguous
|
|
17
|
+
// (currentOverlayKind reflects what's currently mounted, not what's queued).
|
|
18
|
+
let activeMode: 'runtime' | 'compilation' | null = null;
|
|
19
|
+
|
|
20
|
+
const frameworkLabels: Record<string, string> = {
|
|
21
|
+
angular: 'Angular',
|
|
22
|
+
assets: 'Assets',
|
|
23
|
+
html: 'HTML',
|
|
24
|
+
htmx: 'HTMX',
|
|
25
|
+
react: 'React',
|
|
26
|
+
svelte: 'Svelte',
|
|
27
|
+
unknown: 'Unknown',
|
|
28
|
+
vue: 'Vue'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const frameworkColors: Record<string, string> = {
|
|
32
|
+
angular: '#dd0031',
|
|
33
|
+
assets: '#563d7c',
|
|
34
|
+
html: '#e34c26',
|
|
35
|
+
htmx: '#1a365d',
|
|
36
|
+
react: '#61dafb',
|
|
37
|
+
svelte: '#ff3e00',
|
|
38
|
+
unknown: '#94a3b8',
|
|
39
|
+
vue: '#42b883'
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const removeOverlayElement = () => {
|
|
43
|
+
if (errorOverlayElement && errorOverlayElement.parentNode) {
|
|
44
|
+
errorOverlayElement.parentNode.removeChild(errorOverlayElement);
|
|
45
|
+
}
|
|
46
|
+
errorOverlayElement = null;
|
|
47
|
+
currentOverlayKind = null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const hideErrorOverlay = () => {
|
|
51
|
+
const elm = errorOverlayElement;
|
|
52
|
+
// Clearing on dismiss — if more errors arrive after this they get a
|
|
53
|
+
// fresh overlay, otherwise stale entries accumulate forever.
|
|
54
|
+
runtimeErrors.length = 0;
|
|
55
|
+
activeRuntimeIndex = 0;
|
|
56
|
+
pendingCompilationOpts = null;
|
|
57
|
+
activeMode = null;
|
|
58
|
+
if (!elm || !elm.parentNode) {
|
|
59
|
+
removeOverlayElement();
|
|
60
|
+
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
elm.style.transition = 'opacity 150ms ease-out';
|
|
64
|
+
elm.style.opacity = '0';
|
|
65
|
+
errorOverlayElement = null;
|
|
66
|
+
currentOverlayKind = null;
|
|
67
|
+
setTimeout(() => {
|
|
68
|
+
if (elm.parentNode) elm.parentNode.removeChild(elm);
|
|
69
|
+
}, OVERLAY_FADE_DURATION_MS);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const isRuntimeErrorOverlay = () => currentOverlayKind === 'runtime';
|
|
73
|
+
|
|
74
|
+
const sectionLabelStyle =
|
|
75
|
+
'font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px;';
|
|
76
|
+
const codeBlockStyle =
|
|
77
|
+
'margin:0;padding:14px 18px;background:rgba(15,23,42,0.8);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:12.5px;line-height:1.55;overflow-x:auto;white-space:pre;font-family:inherit;';
|
|
78
|
+
|
|
79
|
+
const buildLocationSection = (
|
|
80
|
+
file: string | undefined,
|
|
81
|
+
line: number | undefined,
|
|
82
|
+
column: number | undefined,
|
|
83
|
+
lineText: string | undefined
|
|
84
|
+
) => {
|
|
85
|
+
if (!file && line === undefined && column === undefined && !lineText) {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const locSection = document.createElement('div');
|
|
90
|
+
locSection.style.cssText = 'margin-bottom:20px;';
|
|
91
|
+
|
|
92
|
+
const locLabel = document.createElement('div');
|
|
93
|
+
locLabel.style.cssText = sectionLabelStyle;
|
|
94
|
+
locLabel.textContent = 'Where';
|
|
95
|
+
locSection.appendChild(locLabel);
|
|
96
|
+
|
|
97
|
+
const locParts: string[] = [];
|
|
98
|
+
if (file) locParts.push(file);
|
|
99
|
+
if (line !== undefined) locParts.push(String(line));
|
|
100
|
+
if (column !== undefined) locParts.push(String(column));
|
|
101
|
+
const loc = locParts.join(':') || 'Unknown location';
|
|
102
|
+
|
|
103
|
+
const locEl = document.createElement('div');
|
|
104
|
+
locEl.style.cssText =
|
|
105
|
+
'padding:12px 18px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px;word-break:break-all;';
|
|
106
|
+
locEl.textContent = loc;
|
|
107
|
+
locSection.appendChild(locEl);
|
|
108
|
+
|
|
109
|
+
if (lineText) {
|
|
110
|
+
const codeBlock = document.createElement('pre');
|
|
111
|
+
codeBlock.style.cssText = `${codeBlockStyle }margin-top:8px;`;
|
|
112
|
+
codeBlock.textContent = lineText;
|
|
113
|
+
locSection.appendChild(codeBlock);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return locSection;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Strip the leading `${ErrorName}: ${message}` line from a stack if it just
|
|
120
|
+
// repeats what's already shown in the "What went wrong" panel — keeps the
|
|
121
|
+
// stack panel focused on frames.
|
|
122
|
+
const cleanStack = (message: string, stack: string) => {
|
|
123
|
+
const firstNewline = stack.indexOf('\n');
|
|
124
|
+
if (firstNewline === -1) return stack;
|
|
125
|
+
const head = stack.slice(0, firstNewline).trim();
|
|
126
|
+
if (head === message || head.endsWith(`: ${message}`)) {
|
|
127
|
+
return stack.slice(firstNewline + 1).replace(/^\n+/, '');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return stack;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const buildStackSection = (stack: string | undefined, message: string) => {
|
|
134
|
+
if (!stack) return null;
|
|
135
|
+
const cleaned = cleanStack(message, stack);
|
|
136
|
+
if (!cleaned.trim()) return null;
|
|
137
|
+
const section = document.createElement('div');
|
|
138
|
+
section.style.cssText = 'margin-bottom:20px;';
|
|
139
|
+
const label = document.createElement('div');
|
|
140
|
+
label.style.cssText = sectionLabelStyle;
|
|
141
|
+
label.textContent = 'Stack';
|
|
142
|
+
section.appendChild(label);
|
|
143
|
+
const pre = document.createElement('pre');
|
|
144
|
+
pre.style.cssText = `${codeBlockStyle }max-height:300px;overflow-y:auto;`;
|
|
145
|
+
pre.textContent = cleaned;
|
|
146
|
+
section.appendChild(pre);
|
|
147
|
+
|
|
148
|
+
return section;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// Reads the live document for every <script src> currently mounted.
|
|
152
|
+
// Most useful diagnostic for "I'm seeing a chunk hash that no longer
|
|
153
|
+
// exists on disk" — confirms which bundle the browser actually loaded.
|
|
154
|
+
const collectLoadedScripts = () => {
|
|
155
|
+
const scripts = Array.from(document.querySelectorAll('script[src]'));
|
|
156
|
+
const urls: string[] = [];
|
|
157
|
+
for (const script of scripts) {
|
|
158
|
+
const {src} = (script as HTMLScriptElement);
|
|
159
|
+
if (!src) continue;
|
|
160
|
+
// Filter to JS we serve — vendor chunks, generated indexes, root
|
|
161
|
+
// chunk-XXX.js outputs. Skip user-pasted CDN scripts and the like.
|
|
162
|
+
if (
|
|
163
|
+
src.includes('/vendor/') ||
|
|
164
|
+
src.includes('/generated/') ||
|
|
165
|
+
/\/chunk-[a-z0-9]+\.js(\?|$)/i.test(src) ||
|
|
166
|
+
src.includes('/_src_indexes/')
|
|
167
|
+
) {
|
|
168
|
+
urls.push(src);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return urls;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
const buildDiagnosticsSection = () => {
|
|
176
|
+
const section = document.createElement('div');
|
|
177
|
+
section.style.cssText = 'margin-bottom:20px;';
|
|
178
|
+
const label = document.createElement('div');
|
|
179
|
+
label.style.cssText = sectionLabelStyle;
|
|
180
|
+
label.textContent = 'Diagnostics';
|
|
181
|
+
section.appendChild(label);
|
|
182
|
+
|
|
183
|
+
const lines: string[] = [];
|
|
184
|
+
lines.push(`Page URL: ${window.location.href}`);
|
|
185
|
+
const ua = navigator.userAgent;
|
|
186
|
+
lines.push(`User agent: ${ua}`);
|
|
187
|
+
const scripts = collectLoadedScripts();
|
|
188
|
+
if (scripts.length > 0) {
|
|
189
|
+
lines.push('');
|
|
190
|
+
lines.push(`Loaded chunks (${scripts.length}):`);
|
|
191
|
+
for (const url of scripts) {
|
|
192
|
+
// Strip origin so the chunk hash is the focal point.
|
|
193
|
+
lines.push(` ${url.replace(window.location.origin, '') || url}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const pre = document.createElement('pre');
|
|
198
|
+
pre.style.cssText = `${codeBlockStyle }max-height:200px;overflow-y:auto;`;
|
|
199
|
+
pre.textContent = lines.join('\n');
|
|
200
|
+
section.appendChild(pre);
|
|
201
|
+
|
|
202
|
+
return section;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const buildErrorMessageSection = (message: string) => {
|
|
206
|
+
const errorSection = document.createElement('div');
|
|
207
|
+
errorSection.style.cssText = 'margin-bottom:20px;';
|
|
208
|
+
const errorLabel = document.createElement('div');
|
|
209
|
+
errorLabel.style.cssText = sectionLabelStyle;
|
|
210
|
+
errorLabel.textContent = 'What went wrong';
|
|
211
|
+
errorSection.appendChild(errorLabel);
|
|
212
|
+
const msgEl = document.createElement('pre');
|
|
213
|
+
msgEl.style.cssText =
|
|
214
|
+
'margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5;font-family:inherit;';
|
|
215
|
+
msgEl.textContent = message;
|
|
216
|
+
errorSection.appendChild(msgEl);
|
|
217
|
+
|
|
218
|
+
return errorSection;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const formatErrorForCopy = (opts: ErrorOverlayOptions) => {
|
|
222
|
+
const lines: string[] = [];
|
|
223
|
+
lines.push(
|
|
224
|
+
`# ${opts.kind === 'runtime' ? 'Runtime' : 'Compilation'} error`
|
|
225
|
+
);
|
|
226
|
+
if (opts.framework) lines.push(`Framework: ${opts.framework}`);
|
|
227
|
+
lines.push('');
|
|
228
|
+
lines.push('## Message');
|
|
229
|
+
lines.push(opts.message || '(no message)');
|
|
230
|
+
if (opts.file || opts.line !== undefined) {
|
|
231
|
+
lines.push('');
|
|
232
|
+
lines.push('## Where');
|
|
233
|
+
const locParts: string[] = [];
|
|
234
|
+
if (opts.file) locParts.push(opts.file);
|
|
235
|
+
if (opts.line !== undefined) locParts.push(String(opts.line));
|
|
236
|
+
if (opts.column !== undefined) locParts.push(String(opts.column));
|
|
237
|
+
lines.push(locParts.join(':'));
|
|
238
|
+
if (opts.lineText) {
|
|
239
|
+
lines.push('');
|
|
240
|
+
lines.push(opts.lineText);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (opts.stack) {
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push('## Stack');
|
|
246
|
+
lines.push(cleanStack(opts.message || '', opts.stack));
|
|
247
|
+
}
|
|
248
|
+
lines.push('');
|
|
249
|
+
lines.push('## Diagnostics');
|
|
250
|
+
lines.push(`Page URL: ${window.location.href}`);
|
|
251
|
+
lines.push(`User agent: ${navigator.userAgent}`);
|
|
252
|
+
const scripts = collectLoadedScripts();
|
|
253
|
+
if (scripts.length > 0) {
|
|
254
|
+
lines.push('');
|
|
255
|
+
lines.push(`Loaded chunks (${scripts.length}):`);
|
|
256
|
+
for (const url of scripts) {
|
|
257
|
+
lines.push(` ${url.replace(window.location.origin, '') || url}`);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return lines.join('\n');
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
const renderOverlay = () => {
|
|
265
|
+
const opts =
|
|
266
|
+
activeMode === 'runtime'
|
|
267
|
+
? runtimeErrors[activeRuntimeIndex]
|
|
268
|
+
: pendingCompilationOpts;
|
|
269
|
+
if (!opts) return;
|
|
270
|
+
const message = opts.message || 'Build failed';
|
|
271
|
+
const { file, line, column, lineText, stack } = opts;
|
|
272
|
+
const framework = (opts.framework || 'unknown').toLowerCase();
|
|
273
|
+
const frameworkLabel = frameworkLabels[framework] || framework;
|
|
274
|
+
const accent = frameworkColors[framework] || '#94a3b8';
|
|
275
|
+
|
|
276
|
+
removeOverlayElement();
|
|
277
|
+
currentOverlayKind = opts.kind || 'compilation';
|
|
278
|
+
|
|
279
|
+
const overlay = document.createElement('div');
|
|
280
|
+
overlay.id = 'absolutejs-error-overlay';
|
|
281
|
+
overlay.setAttribute('data-hmr-overlay', 'true');
|
|
282
|
+
overlay.style.cssText =
|
|
283
|
+
'position:fixed;inset:0;z-index:2147483647;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);backdrop-filter:blur(12px);color:#e2e8f0;font-family:"JetBrains Mono","Fira Code",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;overflow:auto;padding:32px;box-sizing:border-box;display:flex;align-items:flex-start;justify-content:center;';
|
|
284
|
+
|
|
285
|
+
const card = document.createElement('div');
|
|
286
|
+
card.style.cssText =
|
|
287
|
+
'max-width:780px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden;';
|
|
288
|
+
|
|
289
|
+
const header = document.createElement('div');
|
|
290
|
+
header.style.cssText =
|
|
291
|
+
'display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4);';
|
|
292
|
+
header.innerHTML = `<div style="display:flex;align-items:center;gap:12px;"><span style="font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em;">AbsoluteJS</span><span style="padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${
|
|
293
|
+
accent
|
|
294
|
+
};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2);">${
|
|
295
|
+
frameworkLabel
|
|
296
|
+
}</span></div><span style="color:#94a3b8;font-size:13px;font-weight:500;">${
|
|
297
|
+
opts.kind === 'runtime' ? 'Runtime Error' : 'Compilation Error'
|
|
298
|
+
}</span>`;
|
|
299
|
+
card.appendChild(header);
|
|
300
|
+
|
|
301
|
+
const content = document.createElement('div');
|
|
302
|
+
content.style.cssText = 'padding:24px;';
|
|
303
|
+
|
|
304
|
+
// Multi-error nav: visible only when more than one runtime error has
|
|
305
|
+
// fired since the last dismiss. Compilation errors always replace, so
|
|
306
|
+
// they never need this row.
|
|
307
|
+
if (activeMode === 'runtime' && runtimeErrors.length > 1) {
|
|
308
|
+
const navRow = document.createElement('div');
|
|
309
|
+
navRow.style.cssText =
|
|
310
|
+
'display:flex;align-items:center;gap:12px;margin-bottom:20px;padding:10px 14px;background:rgba(71,85,105,0.25);border-radius:10px;border:1px solid rgba(71,85,105,0.4);';
|
|
311
|
+
const prev = document.createElement('button');
|
|
312
|
+
prev.textContent = '◀';
|
|
313
|
+
prev.style.cssText =
|
|
314
|
+
'padding:4px 10px;background:rgba(15,23,42,0.6);color:#cbd5e1;border:1px solid rgba(71,85,105,0.6);border-radius:6px;font-size:13px;cursor:pointer;font-family:inherit;';
|
|
315
|
+
prev.disabled = activeRuntimeIndex === 0;
|
|
316
|
+
if (prev.disabled) prev.style.opacity = '0.4';
|
|
317
|
+
prev.onclick = () => {
|
|
318
|
+
if (activeRuntimeIndex > 0) {
|
|
319
|
+
activeRuntimeIndex -= 1;
|
|
320
|
+
renderOverlay();
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
const next = document.createElement('button');
|
|
324
|
+
next.textContent = '▶';
|
|
325
|
+
next.style.cssText = prev.style.cssText;
|
|
326
|
+
next.disabled = activeRuntimeIndex >= runtimeErrors.length - 1;
|
|
327
|
+
if (next.disabled) next.style.opacity = '0.4';
|
|
328
|
+
next.onclick = () => {
|
|
329
|
+
if (activeRuntimeIndex < runtimeErrors.length - 1) {
|
|
330
|
+
activeRuntimeIndex += 1;
|
|
331
|
+
renderOverlay();
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
const counter = document.createElement('span');
|
|
335
|
+
counter.style.cssText = 'color:#cbd5e1;font-size:13px;';
|
|
336
|
+
counter.textContent = `Error ${activeRuntimeIndex + 1} of ${runtimeErrors.length}`;
|
|
337
|
+
navRow.appendChild(prev);
|
|
338
|
+
navRow.appendChild(next);
|
|
339
|
+
navRow.appendChild(counter);
|
|
340
|
+
content.appendChild(navRow);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
content.appendChild(buildErrorMessageSection(message));
|
|
344
|
+
const locSection = buildLocationSection(file, line, column, lineText);
|
|
345
|
+
if (locSection) content.appendChild(locSection);
|
|
346
|
+
const stackSection = buildStackSection(stack, message);
|
|
347
|
+
if (stackSection) content.appendChild(stackSection);
|
|
348
|
+
if (activeMode === 'runtime') {
|
|
349
|
+
content.appendChild(buildDiagnosticsSection());
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
const footer = document.createElement('div');
|
|
353
|
+
footer.style.cssText =
|
|
354
|
+
'display:flex;justify-content:flex-end;gap:10px;padding-top:8px;';
|
|
355
|
+
|
|
356
|
+
const copy = document.createElement('button');
|
|
357
|
+
copy.textContent = 'Copy';
|
|
358
|
+
copy.style.cssText =
|
|
359
|
+
'padding:10px 16px;background:rgba(71,85,105,0.4);color:#e2e8f0;border:1px solid rgba(71,85,105,0.6);border-radius:10px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:opacity 0.15s,transform 0.15s;';
|
|
360
|
+
copy.onmouseover = () => {
|
|
361
|
+
copy.style.opacity = '0.85';
|
|
362
|
+
};
|
|
363
|
+
copy.onmouseout = () => {
|
|
364
|
+
copy.style.opacity = '1';
|
|
365
|
+
};
|
|
366
|
+
copy.onclick = async () => {
|
|
367
|
+
const text = formatErrorForCopy(opts);
|
|
368
|
+
try {
|
|
369
|
+
await navigator.clipboard.writeText(text);
|
|
370
|
+
copy.textContent = 'Copied';
|
|
371
|
+
setTimeout(() => {
|
|
372
|
+
copy.textContent = 'Copy';
|
|
373
|
+
}, 1500);
|
|
374
|
+
} catch {
|
|
375
|
+
// Clipboard API requires a user gesture + permissions; fall back
|
|
376
|
+
// to a textarea + execCommand so the button still does something.
|
|
377
|
+
const ta = document.createElement('textarea');
|
|
378
|
+
ta.value = text;
|
|
379
|
+
ta.style.position = 'fixed';
|
|
380
|
+
ta.style.opacity = '0';
|
|
381
|
+
document.body.appendChild(ta);
|
|
382
|
+
ta.select();
|
|
383
|
+
try {
|
|
384
|
+
document.execCommand('copy');
|
|
385
|
+
copy.textContent = 'Copied';
|
|
386
|
+
setTimeout(() => {
|
|
387
|
+
copy.textContent = 'Copy';
|
|
388
|
+
}, 1500);
|
|
389
|
+
} catch {
|
|
390
|
+
copy.textContent = 'Copy failed';
|
|
391
|
+
}
|
|
392
|
+
document.body.removeChild(ta);
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
footer.appendChild(copy);
|
|
396
|
+
|
|
397
|
+
const dismiss = document.createElement('button');
|
|
398
|
+
dismiss.textContent = 'Dismiss';
|
|
399
|
+
dismiss.style.cssText = `padding:10px 20px;background:${
|
|
400
|
+
accent
|
|
401
|
+
};color:#fff;border:none;border-radius:10px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;box-shadow:0 2px 8px rgba(0,0,0,0.2);transition:opacity 0.15s,transform 0.15s;`;
|
|
402
|
+
dismiss.onmouseover = () => {
|
|
403
|
+
dismiss.style.opacity = '0.9';
|
|
404
|
+
dismiss.style.transform = 'translateY(-1px)';
|
|
405
|
+
};
|
|
406
|
+
dismiss.onmouseout = () => {
|
|
407
|
+
dismiss.style.opacity = '1';
|
|
408
|
+
dismiss.style.transform = 'translateY(0)';
|
|
409
|
+
};
|
|
410
|
+
dismiss.onclick = hideErrorOverlay;
|
|
411
|
+
footer.appendChild(dismiss);
|
|
412
|
+
content.appendChild(footer);
|
|
413
|
+
card.appendChild(content);
|
|
414
|
+
overlay.appendChild(card);
|
|
415
|
+
if (!document.body) return;
|
|
416
|
+
document.body.appendChild(overlay);
|
|
417
|
+
errorOverlayElement = overlay;
|
|
418
|
+
};
|
|
419
|
+
|
|
420
|
+
export const showErrorOverlay = (opts: ErrorOverlayOptions) => {
|
|
421
|
+
const kind = opts.kind || 'compilation';
|
|
422
|
+
activeMode = kind;
|
|
423
|
+
if (kind === 'runtime') {
|
|
424
|
+
// Suppress duplicates — Angular and other frameworks often re-throw
|
|
425
|
+
// the same error from multiple async boundaries (zone, scheduler,
|
|
426
|
+
// resolver). Identifying by message+stack catches the common case
|
|
427
|
+
// without needing structured equality.
|
|
428
|
+
const sig = `${opts.message ?? ''}::${opts.stack ?? ''}`;
|
|
429
|
+
const isDup = runtimeErrors.some(
|
|
430
|
+
(prev) => `${prev.message ?? ''}::${prev.stack ?? ''}` === sig
|
|
431
|
+
);
|
|
432
|
+
if (!isDup) {
|
|
433
|
+
runtimeErrors.push(opts);
|
|
434
|
+
activeRuntimeIndex = runtimeErrors.length - 1;
|
|
435
|
+
}
|
|
436
|
+
} else {
|
|
437
|
+
pendingCompilationOpts = opts;
|
|
438
|
+
// Compilation errors are global build state — reset runtime queue
|
|
439
|
+
// since old runtime errors from before the build attempt aren't
|
|
440
|
+
// actionable anymore.
|
|
441
|
+
runtimeErrors.length = 0;
|
|
442
|
+
activeRuntimeIndex = 0;
|
|
443
|
+
}
|
|
444
|
+
renderOverlay();
|
|
445
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type {} from '../../types/globals';
|
|
2
|
+
/* Framework detection and manifest lookup utilities */
|
|
3
|
+
|
|
4
|
+
export const detectCurrentFramework = () => {
|
|
5
|
+
if (window.__HMR_FRAMEWORK__) return window.__HMR_FRAMEWORK__;
|
|
6
|
+
if (window.__REACT_ROOT__) return 'react';
|
|
7
|
+
const path = window.location.pathname;
|
|
8
|
+
if (path === '/vue' || path.startsWith('/vue/')) return 'vue';
|
|
9
|
+
if (path === '/svelte' || path.startsWith('/svelte/')) return 'svelte';
|
|
10
|
+
if (path === '/angular' || path.startsWith('/angular/')) return 'angular';
|
|
11
|
+
if (path === '/htmx' || path.startsWith('/htmx/')) return 'htmx';
|
|
12
|
+
if (path === '/html' || path.startsWith('/html/')) return 'html';
|
|
13
|
+
if (path === '/react' || path.startsWith('/react/')) return 'react';
|
|
14
|
+
|
|
15
|
+
return null;
|
|
16
|
+
};
|
|
17
|
+
export const findIndexPath = (
|
|
18
|
+
manifest: Record<string, string> | undefined,
|
|
19
|
+
sourceFile: string | undefined,
|
|
20
|
+
framework: string
|
|
21
|
+
) => {
|
|
22
|
+
if (!manifest) return null;
|
|
23
|
+
|
|
24
|
+
if (sourceFile) {
|
|
25
|
+
const componentName = getComponentNameFromPath(sourceFile);
|
|
26
|
+
const indexKey = componentName ? `${componentName}Index` : null;
|
|
27
|
+
if (indexKey && manifest[indexKey]) {
|
|
28
|
+
return manifest[indexKey];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const frameworkPatterns: Record<string, RegExp> = {
|
|
33
|
+
angular: /angular/i,
|
|
34
|
+
react: /react/i,
|
|
35
|
+
svelte: /svelte/i,
|
|
36
|
+
vue: /vue/i
|
|
37
|
+
};
|
|
38
|
+
const pattern = frameworkPatterns[framework];
|
|
39
|
+
|
|
40
|
+
for (const key in manifest) {
|
|
41
|
+
const value = manifest[key];
|
|
42
|
+
if (
|
|
43
|
+
key.endsWith('Index') &&
|
|
44
|
+
value &&
|
|
45
|
+
(!pattern || pattern.test(key) || value.includes(`/${framework}/`))
|
|
46
|
+
) {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
|
+
export const getComponentNameFromPath = (filePath: string) => {
|
|
54
|
+
if (!filePath) return null;
|
|
55
|
+
const parts = filePath.replace(/\\/g, '/').split('/');
|
|
56
|
+
const fileName = parts[parts.length - 1] || '';
|
|
57
|
+
const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|html)$/, '');
|
|
58
|
+
|
|
59
|
+
return baseName
|
|
60
|
+
.split(/[-_]/)
|
|
61
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
62
|
+
.join('');
|
|
63
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type {} from '../../../types/globals';
|
|
2
|
+
/* `globalThis.__angularHmr` runtime shim.
|
|
3
|
+
*
|
|
4
|
+
* The HMR injection plugin
|
|
5
|
+
* (`src/dev/angular/hmrInjectionPlugin.ts`) appends per-component
|
|
6
|
+
* `__ng_hmr_load` blocks that subscribe via
|
|
7
|
+
* `globalThis.__angularHmr.on('angular:component-update', cb)`.
|
|
8
|
+
* This file installs that bus.
|
|
9
|
+
*
|
|
10
|
+
* It must run before any component chunk does — the injected blocks
|
|
11
|
+
* `if (… && globalThis.__angularHmr.on)` no-op if the shim isn't
|
|
12
|
+
* defined yet, so a registration would silently miss. We keep the
|
|
13
|
+
* shim setup synchronous + at module scope so it's installed during
|
|
14
|
+
* `hmrClient.ts`'s import-evaluation pass, before page chunks load. */
|
|
15
|
+
|
|
16
|
+
export type AngularHmrEvent =
|
|
17
|
+
| 'angular:component-update'
|
|
18
|
+
| 'angular:component-remount';
|
|
19
|
+
export type AngularComponentUpdate = {
|
|
20
|
+
id: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
};
|
|
23
|
+
export type AngularHmrListener = (data: AngularComponentUpdate) => void;
|
|
24
|
+
|
|
25
|
+
type AngularHmrBus = {
|
|
26
|
+
on(event: AngularHmrEvent, cb: AngularHmrListener): void;
|
|
27
|
+
off(event: AngularHmrEvent, cb: AngularHmrListener): void;
|
|
28
|
+
dispatch(event: AngularHmrEvent, data: AngularComponentUpdate): void;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
declare global {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- Window augmentation requires interface merging
|
|
33
|
+
interface Window {
|
|
34
|
+
__angularHmr?: AngularHmrBus;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var __angularHmr: AngularHmrBus | undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const installAngularHmrShim = () => {
|
|
41
|
+
const listeners = new Map<AngularHmrEvent, Set<AngularHmrListener>>();
|
|
42
|
+
|
|
43
|
+
const bus: AngularHmrBus = {
|
|
44
|
+
dispatch(event, data) {
|
|
45
|
+
const set = listeners.get(event);
|
|
46
|
+
if (!set) return;
|
|
47
|
+
// Snapshot before iterating — handlers could remove themselves.
|
|
48
|
+
for (const cb of [...set]) {
|
|
49
|
+
try {
|
|
50
|
+
cb(data);
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error(
|
|
53
|
+
'[absolutejs] angular HMR listener threw',
|
|
54
|
+
err
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
off(event, cb) {
|
|
60
|
+
listeners.get(event)?.delete(cb);
|
|
61
|
+
},
|
|
62
|
+
on(event, cb) {
|
|
63
|
+
let set = listeners.get(event);
|
|
64
|
+
if (!set) {
|
|
65
|
+
set = new Set();
|
|
66
|
+
listeners.set(event, set);
|
|
67
|
+
}
|
|
68
|
+
set.add(cb);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return bus;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
if (typeof globalThis !== 'undefined' && !globalThis.__angularHmr) {
|
|
76
|
+
globalThis.__angularHmr = installAngularHmrShim();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const dispatchAngularComponentRemount = (
|
|
80
|
+
data: AngularComponentUpdate
|
|
81
|
+
) => {
|
|
82
|
+
globalThis.__angularHmr?.dispatch('angular:component-remount', data);
|
|
83
|
+
};
|
|
84
|
+
export const dispatchAngularComponentUpdate = (
|
|
85
|
+
data: AngularComponentUpdate
|
|
86
|
+
) => {
|
|
87
|
+
globalThis.__angularHmr?.dispatch('angular:component-update', data);
|
|
88
|
+
};
|