@absolutejs/absolute 0.19.0-beta.999 → 0.20.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -13
- package/README.md +48 -2
- package/dist/angular/browser.js +82 -77
- package/dist/angular/browser.js.map +11 -11
- package/dist/angular/components/constants.js +43 -0
- package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
- package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
- package/dist/angular/hmrPreserveCore.ts +132 -134
- package/dist/angular/index.js +1719 -844
- package/dist/angular/index.js.map +34 -26
- package/dist/angular/server.js +1620 -768
- package/dist/angular/server.js.map +28 -20
- package/dist/build.js +4935 -2593
- package/dist/build.js.map +72 -57
- package/dist/cli/config/client.js +578 -0
- package/dist/cli/config/server.js +39587 -0
- package/dist/cli/htmx/htmx.min.js +1 -0
- package/dist/cli/index.js +16828 -3511
- package/dist/client/index.js +49 -46
- package/dist/client/index.js.map +12 -12
- package/dist/core/streamingSlotRegistrar.js +1 -19
- package/dist/core/streamingSlotRegistrar.js.map +2 -2
- package/dist/core/streamingSlotRegistry.js +1 -19
- package/dist/core/streamingSlotRegistry.js.map +2 -2
- package/dist/dev/client/cssUtils.ts +98 -41
- package/dist/dev/client/domState.ts +2 -0
- package/dist/dev/client/errorOverlay.ts +14 -13
- package/dist/dev/client/handlers/angularHmrShim.ts +20 -20
- package/dist/dev/client/handlers/angularRemount.ts +74 -55
- package/dist/dev/client/handlers/angularRemountWiring.ts +1 -2
- package/dist/dev/client/handlers/html.ts +144 -41
- package/dist/dev/client/handlers/htmx.ts +43 -8
- package/dist/dev/client/handlers/react.ts +114 -32
- package/dist/dev/client/handlers/rebuild.ts +28 -8
- package/dist/dev/client/handlers/svelte.ts +92 -51
- package/dist/dev/client/handlers/vue.ts +36 -45
- package/dist/dev/client/hmrClient.ts +101 -26
- package/dist/dev/client/hmrTiming.ts +141 -0
- package/dist/dev/client/hmrToast.ts +22 -24
- package/dist/dev/client/reactRefreshSetup.ts +4 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.d.ts +12 -0
- package/dist/dev/client/vendor/reactRefreshRuntime.js +313 -0
- package/dist/dev/serverBootstrap.js +45 -0
- package/dist/index.js +7153 -3224
- package/dist/index.js.map +118 -86
- package/dist/islands/browser.js +1 -19
- package/dist/islands/browser.js.map +3 -3
- package/dist/islands/index.js +709 -120
- package/dist/islands/index.js.map +18 -13
- package/dist/mobile/browser.js +428 -0
- package/dist/mobile/browser.js.map +12 -0
- package/dist/mobile/index.js +3058 -0
- package/dist/mobile/index.js.map +35 -0
- package/dist/react/browser.js +13 -62
- package/dist/react/browser.js.map +5 -6
- package/dist/react/components/browser/index.js +23 -13
- package/dist/react/components/index.js +30 -34
- package/dist/react/components/index.js.map +8 -7
- package/dist/react/hooks/index.js +1 -19
- package/dist/react/hooks/index.js.map +3 -3
- package/dist/react/index.js +1643 -679
- package/dist/react/index.js.map +29 -20
- package/dist/react/jsxDevRuntimeCompat.js +22 -20
- package/dist/react/jsxDevRuntimeCompat.js.map +5 -4
- package/dist/react/jsxRuntimeCompat.js +90 -0
- package/dist/react/jsxRuntimeCompat.js.map +10 -0
- package/dist/react/router/browser.js +77 -0
- package/dist/react/router/browser.js.map +10 -0
- package/dist/react/router/index.js +77 -0
- package/dist/react/router/index.js.map +10 -0
- package/dist/react/server.js +950 -565
- package/dist/react/server.js.map +16 -11
- package/dist/src/angular/components/constants.d.ts +21 -0
- package/dist/src/angular/hmrPreserveCore.d.ts +7 -20
- package/dist/src/angular/islands.d.ts +1 -1
- package/dist/src/angular/pageHandler.d.ts +2 -0
- package/dist/src/angular/ssrRender.d.ts +4 -1
- package/dist/src/build/bunStringRawUnicodePlugin.d.ts +12 -0
- package/dist/src/build/chainInlineSourcemaps.d.ts +1 -0
- package/dist/src/build/compileAngular.d.ts +5 -7
- package/dist/src/build/compileSvelte.d.ts +3 -0
- package/dist/src/build/compileVue.d.ts +3 -1
- package/dist/src/build/generateReactIndexes.d.ts +1 -0
- package/dist/src/build/islandRegistryTransform.d.ts +17 -0
- package/dist/src/build/maskLiterals.d.ts +28 -0
- package/dist/src/build/parseVueSpaRoutes.d.ts +5 -0
- package/dist/src/build/resolveBuildMode.d.ts +7 -0
- package/dist/src/build/serverExternals.d.ts +14 -0
- package/dist/src/build/spaSideManifests.d.ts +16 -0
- package/dist/src/build/tailwindCompiler.d.ts +0 -1
- package/dist/src/cli/add/dependencies.d.ts +13 -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 +19 -0
- package/dist/src/cli/config/auth/AuthPanel.d.ts +6 -0
- package/dist/src/cli/config/auth/authCatalog.d.ts +10 -0
- package/dist/src/cli/config/auth/authScaffolds.d.ts +16 -0
- package/dist/src/cli/config/auth/editAuthConfig.d.ts +5 -0
- package/dist/src/cli/config/auth/resolveAuthSettings.d.ts +14 -0
- package/dist/src/cli/config/auth/resolveAuthState.d.ts +2 -0
- package/dist/src/cli/config/auth/scaffoldAuthFeature.d.ts +6 -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/integrations/IntegrationsPanel.d.ts +6 -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 +8 -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 +1 -0
- package/dist/src/cli/config/schema/serialize.d.ts +1 -0
- package/dist/src/cli/config/server.d.ts +527 -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/elysiaOpenApiTypeboxPlugin.d.ts +8 -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/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/integrations/addPlugin.d.ts +8 -0
- package/dist/src/cli/integrations/catalog.d.ts +20 -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 -1
- package/dist/src/cli/scripts/db.d.ts +20 -0
- package/dist/src/cli/scripts/dev.d.ts +5 -1
- 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 +37 -2
- package/dist/src/cli/scripts/eslintChunked.d.ts +37 -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/inspect.d.ts +1 -0
- package/dist/src/cli/scripts/islands.d.ts +1 -0
- package/dist/src/cli/scripts/lintProof.d.ts +42 -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/mobile.d.ts +1 -0
- package/dist/src/cli/scripts/prettier.d.ts +2 -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 +6 -1
- package/dist/src/cli/scripts/tunnelRelay.d.ts +9 -0
- package/dist/src/cli/scripts/workspace.d.ts +3 -1
- package/dist/src/cli/serverBundleExternals.d.ts +2 -0
- package/dist/src/cli/tuiPrimitives.d.ts +14 -0
- package/dist/src/cli/typeGraphCoherence.d.ts +32 -0
- package/dist/src/cli/utils.d.ts +3 -1
- package/dist/src/cli/workspaceTui.d.ts +2 -1
- package/dist/src/client/hydrators/react.d.ts +1 -1
- package/dist/src/client/hydrators/svelte.d.ts +1 -1
- package/dist/src/client/hydrators/vue.d.ts +1 -1
- package/dist/src/client/islandStore.d.ts +3 -3
- package/dist/src/client/preserveIslandMarkup.d.ts +4 -1
- package/dist/src/constants.d.ts +21 -0
- package/dist/src/core/angularServerModule.d.ts +1 -0
- package/dist/src/core/build.d.ts +11 -3
- package/dist/src/core/devRouteRegistrationCallsite.d.ts +1 -5
- package/dist/src/core/index.d.ts +1 -0
- package/dist/src/core/pageResponseCache.d.ts +23 -0
- package/dist/src/core/prepare.d.ts +192 -154
- package/dist/src/core/requestContext.d.ts +18 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +5 -3
- package/dist/src/dev/angular/hmrCompiler.d.ts +1 -1
- package/dist/src/dev/angular/resolveOwningComponents.d.ts +1 -1
- package/dist/src/dev/clientManager.d.ts +10 -1
- package/dist/src/dev/configResolver.d.ts +2 -0
- package/dist/src/dev/moduleMapper.d.ts +1 -1
- package/dist/src/dev/moduleServer.d.ts +2 -1
- package/dist/src/dev/pathUtils.d.ts +1 -1
- package/dist/src/dev/reactComponentClassifier.d.ts +1 -1
- package/dist/src/dev/rebuildTrigger.d.ts +4 -0
- package/dist/src/dev/requestInspector.d.ts +31 -0
- package/dist/src/dev/serverBootstrap.d.ts +1 -0
- package/dist/src/dev/serverEntryWatcher.d.ts +3 -3
- 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 +1 -1
- package/dist/src/mobile/androidConformance.d.ts +42 -0
- package/dist/src/mobile/androidEmulatorController.d.ts +99 -0
- package/dist/src/mobile/androidNativeWatcher.d.ts +19 -0
- package/dist/src/mobile/androidRelease.d.ts +47 -0
- package/dist/src/mobile/androidWebView.d.ts +46 -0
- package/dist/src/mobile/artifactStore.d.ts +47 -0
- package/dist/src/mobile/associationFiles.d.ts +49 -0
- package/dist/src/mobile/browser.d.ts +2 -0
- package/dist/src/mobile/buildMetadata.d.ts +10 -0
- package/dist/src/mobile/buildPipeline.d.ts +8 -0
- package/dist/src/mobile/buildRelease.d.ts +24 -0
- package/dist/src/mobile/capacitorBundle.d.ts +28 -0
- package/dist/src/mobile/capacitorProject.d.ts +9 -0
- package/dist/src/mobile/client.d.ts +35 -0
- package/dist/src/mobile/compatibilityDispatcher.d.ts +26 -0
- package/dist/src/mobile/config.d.ts +16 -0
- package/dist/src/mobile/emulatorDoctor.d.ts +25 -0
- package/dist/src/mobile/emulatorInstaller.d.ts +41 -0
- package/dist/src/mobile/index.d.ts +19 -0
- package/dist/src/mobile/materializedBundle.d.ts +36 -0
- package/dist/src/mobile/nativeDeepLinks.d.ts +5 -0
- package/dist/src/mobile/pageProtocol.d.ts +89 -0
- package/dist/src/mobile/producerContext.d.ts +4 -0
- package/dist/src/mobile/producerContextState.d.ts +10 -0
- package/dist/src/mobile/releaseArtifact.d.ts +75 -0
- package/dist/src/mobile/releaseDoctor.d.ts +13 -0
- package/dist/src/mobile/routeMatcher.d.ts +3 -0
- package/dist/src/mobile/routeMetadataTransform.d.ts +13 -0
- package/dist/src/mobile/shellBootstrap.d.ts +1 -0
- package/dist/src/mobile/transport.d.ts +31 -0
- package/dist/src/plugins/devtoolsJson.d.ts +6 -47
- package/dist/src/plugins/hmr.d.ts +22 -96
- package/dist/src/plugins/imageOptimizer.d.ts +150 -62
- package/dist/src/plugins/networking.d.ts +2 -2
- package/dist/src/plugins/openApiPlugin.d.ts +4 -0
- package/dist/src/plugins/telemetryPlugin.d.ts +36 -0
- package/dist/src/react/browser.d.ts +0 -2
- package/dist/src/react/hooks/useMediaQuery.d.ts +1 -1
- package/dist/src/react/index.d.ts +0 -2
- package/dist/src/react/jsxDevRuntimeCompat.d.ts +1 -1
- package/dist/src/react/jsxRuntimeCompat.d.ts +7 -0
- package/dist/src/react/pageHandler.d.ts +8 -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/svelte/pageHandler.d.ts +5 -0
- package/dist/src/svelte/router/hashMode.d.ts +1 -6
- package/dist/src/svelte/router/matchPath.d.ts +4 -24
- package/dist/src/svelte/router/page.svelte.d.ts +1 -10
- package/dist/src/svelte/router/prefetchCache.d.ts +2 -6
- package/dist/src/utils/cleanup.d.ts +1 -0
- package/dist/src/utils/defineConvention.d.ts +2 -2
- package/dist/src/utils/defineEnv.d.ts +4 -4
- package/dist/src/utils/formatBytes.d.ts +2 -0
- package/dist/src/utils/generatedDir.d.ts +1 -1
- package/dist/src/utils/iconVersion.d.ts +5 -0
- package/dist/src/utils/imageProcessing.d.ts +1 -1
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/inlinePageCss.d.ts +9 -0
- package/dist/src/utils/instanceRegistry.d.ts +13 -0
- package/dist/src/utils/isTestSourcePath.d.ts +1 -0
- package/dist/src/utils/jsonLd.d.ts +1 -1
- package/dist/src/utils/loadConfig.d.ts +11 -3
- package/dist/src/utils/logger.d.ts +2 -0
- package/dist/src/utils/portScan.d.ts +22 -0
- package/dist/src/utils/projectRoot.d.ts +17 -0
- package/dist/src/utils/resolveConvention.d.ts +1 -1
- package/dist/src/utils/resolveDevPort.d.ts +4 -1
- package/dist/src/utils/runtimeMode.d.ts +1 -1
- package/dist/src/utils/spaRouteCss.d.ts +10 -0
- package/dist/src/utils/spaRouteManifest.d.ts +8 -0
- package/dist/src/utils/stripStringsAndComments.d.ts +18 -0
- package/dist/src/utils/userAgentFunctions.d.ts +1 -1
- package/dist/src/utils/vueCompiler.d.ts +1 -0
- package/dist/src/vue/components/Image.d.ts +2 -2
- package/dist/src/vue/defineVuePage.d.ts +1 -11
- package/dist/src/vue/index.d.ts +3 -0
- package/dist/src/vue/pageHandler.d.ts +5 -0
- package/dist/src/vue/resolveGeneratedVueModulePath.d.ts +1 -0
- package/dist/src/vue/teleports.d.ts +2 -0
- package/dist/src/vue/useResource.d.ts +65 -0
- package/dist/svelte/browser.js +1 -19
- package/dist/svelte/browser.js.map +3 -3
- package/dist/svelte/components/Head.svelte +7 -1
- package/dist/svelte/index.js +1281 -543
- package/dist/svelte/index.js.map +27 -19
- package/dist/svelte/router/Link.svelte.d.ts +3 -3
- package/dist/svelte/router/Route.svelte.d.ts +5 -5
- package/dist/svelte/router/Router.svelte.d.ts +3 -3
- package/dist/svelte/router/hashMode.ts +6 -12
- package/dist/svelte/router/matchPath.ts +44 -61
- package/dist/svelte/router/page.d.ts +1 -10
- package/dist/svelte/router/page.js +6 -6
- package/dist/svelte/router/prefetchCache.ts +21 -23
- package/dist/svelte/router/viewTransitions.ts +22 -12
- package/dist/svelte/server.js +697 -565
- package/dist/svelte/server.js.map +14 -11
- package/dist/types/absoluteConfig.d.ts +22 -0
- package/dist/types/angular.d.ts +4 -1
- package/dist/types/authPanel.d.ts +62 -0
- package/dist/types/build.d.ts +116 -0
- package/dist/types/cli.d.ts +57 -0
- package/dist/types/config.d.ts +52 -0
- package/dist/types/eslintConfig.d.ts +68 -0
- package/dist/types/globals.d.ts +31 -10
- package/dist/types/image.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/integrationsPanel.d.ts +29 -0
- package/dist/types/messages.d.ts +12 -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/tsconfig.d.ts +31 -0
- package/dist/types/vue.d.ts +13 -15
- package/dist/vue/browser.js +14 -36
- package/dist/vue/browser.js.map +5 -5
- package/dist/vue/components/Image.js +3 -20
- package/dist/vue/components/Image.js.map +3 -3
- package/dist/vue/components/index.js +3 -20
- package/dist/vue/components/index.js.map +3 -3
- package/dist/vue/index.js +1573 -620
- package/dist/vue/index.js.map +34 -22
- package/dist/vue/server.js +800 -520
- package/dist/vue/server.js.map +17 -11
- package/package.json +145 -68
- package/dist/src/react/UniversalRouter.d.ts +0 -12
|
@@ -15,34 +15,32 @@ const CONTAINER_ID = '__abs_hmr_toast_container__';
|
|
|
15
15
|
const VISIBLE_DURATION_MS = 2500;
|
|
16
16
|
const FADE_MS = 220;
|
|
17
17
|
|
|
18
|
-
const ensureContainer = ()
|
|
19
|
-
const existing = document.getElementById(
|
|
20
|
-
|
|
21
|
-
) as HTMLDivElement | null;
|
|
22
|
-
if (existing) return existing;
|
|
18
|
+
const ensureContainer = () => {
|
|
19
|
+
const existing = document.getElementById(CONTAINER_ID);
|
|
20
|
+
if (existing instanceof HTMLDivElement) return existing;
|
|
23
21
|
|
|
24
22
|
const container = document.createElement('div');
|
|
25
23
|
container.id = CONTAINER_ID;
|
|
26
24
|
Object.assign(container.style, {
|
|
27
|
-
position: 'fixed',
|
|
28
25
|
bottom: '16px',
|
|
29
|
-
right: '16px',
|
|
30
26
|
display: 'flex',
|
|
31
27
|
flexDirection: 'column',
|
|
32
|
-
gap: '8px',
|
|
33
|
-
zIndex: '2147483646',
|
|
34
|
-
pointerEvents: 'none',
|
|
35
28
|
fontFamily:
|
|
36
29
|
'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
|
|
37
30
|
fontSize: '12px',
|
|
38
|
-
|
|
31
|
+
gap: '8px',
|
|
32
|
+
maxWidth: '420px',
|
|
33
|
+
pointerEvents: 'none',
|
|
34
|
+
position: 'fixed',
|
|
35
|
+
right: '16px',
|
|
36
|
+
zIndex: '2147483646'
|
|
39
37
|
});
|
|
40
38
|
document.body.appendChild(container);
|
|
41
39
|
|
|
42
40
|
return container;
|
|
43
41
|
};
|
|
44
42
|
|
|
45
|
-
const accentForType = (updateType: string | undefined)
|
|
43
|
+
const accentForType = (updateType: string | undefined) => {
|
|
46
44
|
switch (updateType) {
|
|
47
45
|
case 'route':
|
|
48
46
|
return '#1d4ed8';
|
|
@@ -72,27 +70,27 @@ export const showHmrToast = ({
|
|
|
72
70
|
const accent = accentForType(updateType);
|
|
73
71
|
Object.assign(toast.style, {
|
|
74
72
|
background: 'rgba(15, 17, 22, 0.94)',
|
|
75
|
-
color: '#f8fafc',
|
|
76
73
|
borderLeft: `3px solid ${accent}`,
|
|
77
|
-
padding: '8px 12px',
|
|
78
74
|
borderRadius: '6px',
|
|
79
75
|
boxShadow: '0 6px 24px rgba(0, 0, 0, 0.35)',
|
|
76
|
+
color: '#f8fafc',
|
|
77
|
+
maxWidth: '420px',
|
|
80
78
|
opacity: '0',
|
|
81
|
-
transform: 'translateY(6px)',
|
|
82
|
-
transition: `opacity ${FADE_MS}ms ease, transform ${FADE_MS}ms ease`,
|
|
83
|
-
pointerEvents: 'auto',
|
|
84
|
-
whiteSpace: 'nowrap',
|
|
85
79
|
overflow: 'hidden',
|
|
80
|
+
padding: '8px 12px',
|
|
81
|
+
pointerEvents: 'auto',
|
|
86
82
|
textOverflow: 'ellipsis',
|
|
87
|
-
|
|
83
|
+
transform: 'translateY(6px)',
|
|
84
|
+
transition: `opacity ${FADE_MS}ms ease, transform ${FADE_MS}ms ease`,
|
|
85
|
+
whiteSpace: 'nowrap'
|
|
88
86
|
});
|
|
89
87
|
|
|
90
88
|
const label = document.createElement('div');
|
|
91
89
|
Object.assign(label.style, {
|
|
92
90
|
color: accent,
|
|
93
91
|
fontWeight: '600',
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
letterSpacing: '0.02em',
|
|
93
|
+
marginBottom: '2px'
|
|
96
94
|
});
|
|
97
95
|
label.textContent = `HMR reboot — ${updateType ?? 'unknown'}`;
|
|
98
96
|
toast.appendChild(label);
|
|
@@ -110,11 +108,11 @@ export const showHmrToast = ({
|
|
|
110
108
|
const path = document.createElement('div');
|
|
111
109
|
Object.assign(path.style, {
|
|
112
110
|
color: '#64748b',
|
|
113
|
-
marginTop: '2px',
|
|
114
111
|
fontSize: '11px',
|
|
115
|
-
|
|
112
|
+
marginTop: '2px',
|
|
116
113
|
overflow: 'hidden',
|
|
117
|
-
textOverflow: 'ellipsis'
|
|
114
|
+
textOverflow: 'ellipsis',
|
|
115
|
+
whiteSpace: 'nowrap'
|
|
118
116
|
});
|
|
119
117
|
// Format like the server logger does: relative + leading slash.
|
|
120
118
|
const cwdLike = editSourceFile.replace(/^.*?(\/src\/|\/pages\/)/, '$1');
|
|
@@ -8,6 +8,10 @@ import type {} from '../../types/globals';
|
|
|
8
8
|
is preserved so new component registrations feed into the SAME RefreshRuntime
|
|
9
9
|
instance that owns the current React tree. */
|
|
10
10
|
|
|
11
|
+
// Bare specifier (not the relative ./vendor path) so the React client build
|
|
12
|
+
// externalizes it and rewrites it to the same /react/vendor/react-refresh_runtime.js
|
|
13
|
+
// URL that Fast Refresh-instrumented components import — one shared runtime
|
|
14
|
+
// instance across this setup module and every component chunk.
|
|
11
15
|
import * as RefreshRuntime from 'react-refresh/runtime';
|
|
12
16
|
|
|
13
17
|
if (!window.$RefreshRuntime$) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type {} from '../../../types/globals';
|
|
2
|
+
/* Typed surface for the vendored react-refresh runtime bundle
|
|
3
|
+
* (reactRefreshRuntime.js). Colocated with the vendored artifact, mirroring
|
|
4
|
+
* the vendor/lview pattern. Only the members the framework actually uses are
|
|
5
|
+
* declared. */
|
|
6
|
+
|
|
7
|
+
export const createSignatureFunctionForTransform: () => (
|
|
8
|
+
type: unknown
|
|
9
|
+
) => unknown;
|
|
10
|
+
export const injectIntoGlobalHook: (win: Window) => void;
|
|
11
|
+
export const performReactRefresh: () => void;
|
|
12
|
+
export const register: (type: unknown, id: string) => void;
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
/* VENDORED: react-refresh@0.18.0 runtime (react-refresh/runtime), bundled to
|
|
3
|
+
* browser ESM with NODE_ENV="development". Dev-HMR only; never shipped to a
|
|
4
|
+
* client bundle. Regenerate with: bun run scripts/vendorReactRefresh.ts */
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
function __accessProp(key) {
|
|
11
|
+
return this[key];
|
|
12
|
+
}
|
|
13
|
+
var __toESMCache_node;
|
|
14
|
+
var __toESMCache_esm;
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => {
|
|
16
|
+
var canCache = mod != null && typeof mod === "object";
|
|
17
|
+
if (canCache) {
|
|
18
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
19
|
+
var cached = cache.get(mod);
|
|
20
|
+
if (cached)
|
|
21
|
+
return cached;
|
|
22
|
+
}
|
|
23
|
+
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
24
|
+
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
25
|
+
for (let key of __getOwnPropNames(mod))
|
|
26
|
+
if (!__hasOwnProp.call(to, key))
|
|
27
|
+
__defProp(to, key, {
|
|
28
|
+
get: __accessProp.bind(mod, key),
|
|
29
|
+
enumerable: true
|
|
30
|
+
});
|
|
31
|
+
if (canCache)
|
|
32
|
+
cache.set(mod, to);
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
36
|
+
|
|
37
|
+
// node_modules/react-refresh/cjs/react-refresh-runtime.development.js
|
|
38
|
+
var require_react_refresh_runtime_development = __commonJS((exports) => {
|
|
39
|
+
(function() {
|
|
40
|
+
function computeFullKey(signature) {
|
|
41
|
+
if (signature.fullKey !== null)
|
|
42
|
+
return signature.fullKey;
|
|
43
|
+
var fullKey = signature.ownKey;
|
|
44
|
+
try {
|
|
45
|
+
var hooks = signature.getCustomHooks();
|
|
46
|
+
} catch (err) {
|
|
47
|
+
return signature.forceReset = true, signature.fullKey = fullKey;
|
|
48
|
+
}
|
|
49
|
+
for (var i = 0;i < hooks.length; i++) {
|
|
50
|
+
var hook = hooks[i];
|
|
51
|
+
if (typeof hook !== "function")
|
|
52
|
+
return signature.forceReset = true, signature.fullKey = fullKey;
|
|
53
|
+
hook = allSignaturesByType.get(hook);
|
|
54
|
+
if (hook !== undefined) {
|
|
55
|
+
var nestedHookKey = computeFullKey(hook);
|
|
56
|
+
hook.forceReset && (signature.forceReset = true);
|
|
57
|
+
fullKey += `
|
|
58
|
+
---
|
|
59
|
+
` + nestedHookKey;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return signature.fullKey = fullKey;
|
|
63
|
+
}
|
|
64
|
+
function resolveFamily(type) {
|
|
65
|
+
return updatedFamiliesByType.get(type);
|
|
66
|
+
}
|
|
67
|
+
function cloneMap(map) {
|
|
68
|
+
var clone = new Map;
|
|
69
|
+
map.forEach(function(value, key) {
|
|
70
|
+
clone.set(key, value);
|
|
71
|
+
});
|
|
72
|
+
return clone;
|
|
73
|
+
}
|
|
74
|
+
function cloneSet(set) {
|
|
75
|
+
var clone = new Set;
|
|
76
|
+
set.forEach(function(value) {
|
|
77
|
+
clone.add(value);
|
|
78
|
+
});
|
|
79
|
+
return clone;
|
|
80
|
+
}
|
|
81
|
+
function getProperty(object, property) {
|
|
82
|
+
try {
|
|
83
|
+
return object[property];
|
|
84
|
+
} catch (err) {}
|
|
85
|
+
}
|
|
86
|
+
function register(type, id) {
|
|
87
|
+
if (!(type === null || typeof type !== "function" && typeof type !== "object" || allFamiliesByType.has(type))) {
|
|
88
|
+
var family = allFamiliesByID.get(id);
|
|
89
|
+
family === undefined ? (family = { current: type }, allFamiliesByID.set(id, family)) : pendingUpdates.push([family, type]);
|
|
90
|
+
allFamiliesByType.set(type, family);
|
|
91
|
+
if (typeof type === "object" && type !== null)
|
|
92
|
+
switch (getProperty(type, "$$typeof")) {
|
|
93
|
+
case REACT_FORWARD_REF_TYPE:
|
|
94
|
+
register(type.render, id + "$render");
|
|
95
|
+
break;
|
|
96
|
+
case REACT_MEMO_TYPE:
|
|
97
|
+
register(type.type, id + "$type");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function setSignature(type, key) {
|
|
102
|
+
var forceReset = 2 < arguments.length && arguments[2] !== undefined ? arguments[2] : false, getCustomHooks = 3 < arguments.length ? arguments[3] : undefined;
|
|
103
|
+
allSignaturesByType.has(type) || allSignaturesByType.set(type, {
|
|
104
|
+
forceReset,
|
|
105
|
+
ownKey: key,
|
|
106
|
+
fullKey: null,
|
|
107
|
+
getCustomHooks: getCustomHooks || function() {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
if (typeof type === "object" && type !== null)
|
|
112
|
+
switch (getProperty(type, "$$typeof")) {
|
|
113
|
+
case REACT_FORWARD_REF_TYPE:
|
|
114
|
+
setSignature(type.render, key, forceReset, getCustomHooks);
|
|
115
|
+
break;
|
|
116
|
+
case REACT_MEMO_TYPE:
|
|
117
|
+
setSignature(type.type, key, forceReset, getCustomHooks);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function collectCustomHooksForSignature(type) {
|
|
121
|
+
type = allSignaturesByType.get(type);
|
|
122
|
+
type !== undefined && computeFullKey(type);
|
|
123
|
+
}
|
|
124
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_MEMO_TYPE = Symbol.for("react.memo"), PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map, allFamiliesByID = new Map, allFamiliesByType = new PossiblyWeakMap, allSignaturesByType = new PossiblyWeakMap, updatedFamiliesByType = new PossiblyWeakMap, pendingUpdates = [], helpersByRendererID = new Map, helpersByRoot = new Map, mountedRoots = new Set, failedRoots = new Set, rootElements = typeof WeakMap === "function" ? new WeakMap : null, isPerformingRefresh = false;
|
|
125
|
+
exports._getMountedRootCount = function() {
|
|
126
|
+
return mountedRoots.size;
|
|
127
|
+
};
|
|
128
|
+
exports.collectCustomHooksForSignature = collectCustomHooksForSignature;
|
|
129
|
+
exports.createSignatureFunctionForTransform = function() {
|
|
130
|
+
var savedType, hasCustomHooks, didCollectHooks = false;
|
|
131
|
+
return function(type, key, forceReset, getCustomHooks) {
|
|
132
|
+
if (typeof key === "string")
|
|
133
|
+
return savedType || (savedType = type, hasCustomHooks = typeof getCustomHooks === "function"), type == null || typeof type !== "function" && typeof type !== "object" || setSignature(type, key, forceReset, getCustomHooks), type;
|
|
134
|
+
!didCollectHooks && hasCustomHooks && (didCollectHooks = true, collectCustomHooksForSignature(savedType));
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
exports.getFamilyByID = function(id) {
|
|
138
|
+
return allFamiliesByID.get(id);
|
|
139
|
+
};
|
|
140
|
+
exports.getFamilyByType = function(type) {
|
|
141
|
+
return allFamiliesByType.get(type);
|
|
142
|
+
};
|
|
143
|
+
exports.hasUnrecoverableErrors = function() {
|
|
144
|
+
return false;
|
|
145
|
+
};
|
|
146
|
+
exports.injectIntoGlobalHook = function(globalObject) {
|
|
147
|
+
var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
148
|
+
if (hook === undefined) {
|
|
149
|
+
var nextID = 0;
|
|
150
|
+
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
|
|
151
|
+
renderers: new Map,
|
|
152
|
+
supportsFiber: true,
|
|
153
|
+
inject: function() {
|
|
154
|
+
return nextID++;
|
|
155
|
+
},
|
|
156
|
+
onScheduleFiberRoot: function() {},
|
|
157
|
+
onCommitFiberRoot: function() {},
|
|
158
|
+
onCommitFiberUnmount: function() {}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (hook.isDisabled)
|
|
162
|
+
console.warn("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.");
|
|
163
|
+
else {
|
|
164
|
+
var oldInject = hook.inject;
|
|
165
|
+
hook.inject = function(injected) {
|
|
166
|
+
var id = oldInject.apply(this, arguments);
|
|
167
|
+
typeof injected.scheduleRefresh === "function" && typeof injected.setRefreshHandler === "function" && helpersByRendererID.set(id, injected);
|
|
168
|
+
return id;
|
|
169
|
+
};
|
|
170
|
+
hook.renderers.forEach(function(injected, id) {
|
|
171
|
+
typeof injected.scheduleRefresh === "function" && typeof injected.setRefreshHandler === "function" && helpersByRendererID.set(id, injected);
|
|
172
|
+
});
|
|
173
|
+
var oldOnCommitFiberRoot = hook.onCommitFiberRoot, oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function() {};
|
|
174
|
+
hook.onScheduleFiberRoot = function(id, root, children) {
|
|
175
|
+
isPerformingRefresh || (failedRoots.delete(root), rootElements !== null && rootElements.set(root, children));
|
|
176
|
+
return oldOnScheduleFiberRoot.apply(this, arguments);
|
|
177
|
+
};
|
|
178
|
+
hook.onCommitFiberRoot = function(id, root, maybePriorityLevel, didError) {
|
|
179
|
+
var helpers = helpersByRendererID.get(id);
|
|
180
|
+
if (helpers !== undefined) {
|
|
181
|
+
helpersByRoot.set(root, helpers);
|
|
182
|
+
helpers = root.current;
|
|
183
|
+
var alternate = helpers.alternate;
|
|
184
|
+
alternate !== null ? (alternate = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root), helpers = helpers.memoizedState != null && helpers.memoizedState.element != null, !alternate && helpers ? (mountedRoots.add(root), failedRoots.delete(root)) : alternate && helpers || (alternate && !helpers ? (mountedRoots.delete(root), didError ? failedRoots.add(root) : helpersByRoot.delete(root)) : alternate || helpers || didError && failedRoots.add(root))) : mountedRoots.add(root);
|
|
185
|
+
}
|
|
186
|
+
return oldOnCommitFiberRoot.apply(this, arguments);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
exports.isLikelyComponentType = function(type) {
|
|
191
|
+
switch (typeof type) {
|
|
192
|
+
case "function":
|
|
193
|
+
if (type.prototype != null) {
|
|
194
|
+
if (type.prototype.isReactComponent)
|
|
195
|
+
return true;
|
|
196
|
+
var ownNames = Object.getOwnPropertyNames(type.prototype);
|
|
197
|
+
if (1 < ownNames.length || ownNames[0] !== "constructor" || type.prototype.__proto__ !== Object.prototype)
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
type = type.name || type.displayName;
|
|
201
|
+
return typeof type === "string" && /^[A-Z]/.test(type);
|
|
202
|
+
case "object":
|
|
203
|
+
if (type != null)
|
|
204
|
+
switch (getProperty(type, "$$typeof")) {
|
|
205
|
+
case REACT_FORWARD_REF_TYPE:
|
|
206
|
+
case REACT_MEMO_TYPE:
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
default:
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
exports.performReactRefresh = function() {
|
|
215
|
+
if (pendingUpdates.length === 0 || isPerformingRefresh)
|
|
216
|
+
return null;
|
|
217
|
+
isPerformingRefresh = true;
|
|
218
|
+
try {
|
|
219
|
+
var staleFamilies = new Set, updatedFamilies = new Set, updates = pendingUpdates;
|
|
220
|
+
pendingUpdates = [];
|
|
221
|
+
updates.forEach(function(_ref) {
|
|
222
|
+
var family = _ref[0];
|
|
223
|
+
_ref = _ref[1];
|
|
224
|
+
var prevType = family.current;
|
|
225
|
+
updatedFamiliesByType.set(prevType, family);
|
|
226
|
+
updatedFamiliesByType.set(_ref, family);
|
|
227
|
+
family.current = _ref;
|
|
228
|
+
prevType.prototype && prevType.prototype.isReactComponent || _ref.prototype && _ref.prototype.isReactComponent ? _ref = false : (prevType = allSignaturesByType.get(prevType), _ref = allSignaturesByType.get(_ref), _ref = prevType === undefined && _ref === undefined || prevType !== undefined && _ref !== undefined && computeFullKey(prevType) === computeFullKey(_ref) && !_ref.forceReset ? true : false);
|
|
229
|
+
_ref ? updatedFamilies.add(family) : staleFamilies.add(family);
|
|
230
|
+
});
|
|
231
|
+
var update = {
|
|
232
|
+
updatedFamilies,
|
|
233
|
+
staleFamilies
|
|
234
|
+
};
|
|
235
|
+
helpersByRendererID.forEach(function(helpers) {
|
|
236
|
+
helpers.setRefreshHandler(resolveFamily);
|
|
237
|
+
});
|
|
238
|
+
var didError = false, firstError = null, failedRootsSnapshot = cloneSet(failedRoots), mountedRootsSnapshot = cloneSet(mountedRoots), helpersByRootSnapshot = cloneMap(helpersByRoot);
|
|
239
|
+
failedRootsSnapshot.forEach(function(root) {
|
|
240
|
+
var helpers = helpersByRootSnapshot.get(root);
|
|
241
|
+
if (helpers === undefined)
|
|
242
|
+
throw Error("Could not find helpers for a root. This is a bug in React Refresh.");
|
|
243
|
+
failedRoots.has(root);
|
|
244
|
+
if (rootElements !== null && rootElements.has(root)) {
|
|
245
|
+
var element = rootElements.get(root);
|
|
246
|
+
try {
|
|
247
|
+
helpers.scheduleRoot(root, element);
|
|
248
|
+
} catch (err) {
|
|
249
|
+
didError || (didError = true, firstError = err);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
mountedRootsSnapshot.forEach(function(root) {
|
|
254
|
+
var helpers = helpersByRootSnapshot.get(root);
|
|
255
|
+
if (helpers === undefined)
|
|
256
|
+
throw Error("Could not find helpers for a root. This is a bug in React Refresh.");
|
|
257
|
+
mountedRoots.has(root);
|
|
258
|
+
try {
|
|
259
|
+
helpers.scheduleRefresh(root, update);
|
|
260
|
+
} catch (err) {
|
|
261
|
+
didError || (didError = true, firstError = err);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
if (didError)
|
|
265
|
+
throw firstError;
|
|
266
|
+
return update;
|
|
267
|
+
} finally {
|
|
268
|
+
isPerformingRefresh = false;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
exports.register = register;
|
|
272
|
+
exports.setSignature = setSignature;
|
|
273
|
+
})();
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// node_modules/react-refresh/runtime.js
|
|
277
|
+
var require_runtime = __commonJS((exports, module) => {
|
|
278
|
+
var react_refresh_runtime_development = __toESM(require_react_refresh_runtime_development());
|
|
279
|
+
if (false) {} else {
|
|
280
|
+
module.exports = react_refresh_runtime_development;
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// .vendor_react_refresh_tmp/entry.ts
|
|
285
|
+
var import_runtime = __toESM(require_runtime(), 1);
|
|
286
|
+
var import_runtime2 = __toESM(require_runtime(), 1);
|
|
287
|
+
var export_setSignature = import_runtime.setSignature;
|
|
288
|
+
var export_register = import_runtime.register;
|
|
289
|
+
var export_performReactRefresh = import_runtime.performReactRefresh;
|
|
290
|
+
var export_isLikelyComponentType = import_runtime.isLikelyComponentType;
|
|
291
|
+
var export_injectIntoGlobalHook = import_runtime.injectIntoGlobalHook;
|
|
292
|
+
var export_hasUnrecoverableErrors = import_runtime.hasUnrecoverableErrors;
|
|
293
|
+
var export_getFamilyByType = import_runtime.getFamilyByType;
|
|
294
|
+
var export_getFamilyByID = import_runtime.getFamilyByID;
|
|
295
|
+
var export_default = import_runtime2.default;
|
|
296
|
+
var export_createSignatureFunctionForTransform = import_runtime.createSignatureFunctionForTransform;
|
|
297
|
+
var export_collectCustomHooksForSignature = import_runtime.collectCustomHooksForSignature;
|
|
298
|
+
var export__getMountedRootCount = import_runtime._getMountedRootCount;
|
|
299
|
+
|
|
300
|
+
export {
|
|
301
|
+
export_setSignature as setSignature,
|
|
302
|
+
export_register as register,
|
|
303
|
+
export_performReactRefresh as performReactRefresh,
|
|
304
|
+
export_isLikelyComponentType as isLikelyComponentType,
|
|
305
|
+
export_injectIntoGlobalHook as injectIntoGlobalHook,
|
|
306
|
+
export_hasUnrecoverableErrors as hasUnrecoverableErrors,
|
|
307
|
+
export_getFamilyByType as getFamilyByType,
|
|
308
|
+
export_getFamilyByID as getFamilyByID,
|
|
309
|
+
export_default as default,
|
|
310
|
+
export_createSignatureFunctionForTransform as createSignatureFunctionForTransform,
|
|
311
|
+
export_collectCustomHooksForSignature as collectCustomHooksForSignature,
|
|
312
|
+
export__getMountedRootCount as _getMountedRootCount
|
|
313
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/dev/serverBootstrap.ts
|
|
3
|
+
import { copyFileSync, existsSync, readdirSync, unlinkSync } from "fs";
|
|
4
|
+
import { dirname, extname, join, resolve } from "path";
|
|
5
|
+
var originalEntry = process.env.ABSOLUTE_SERVER_ENTRY;
|
|
6
|
+
if (!originalEntry) {
|
|
7
|
+
throw new Error("ABSOLUTE_SERVER_ENTRY is required by the AbsoluteJS dev bootstrap");
|
|
8
|
+
}
|
|
9
|
+
var entryPath = resolve(originalEntry);
|
|
10
|
+
if (!existsSync(entryPath)) {
|
|
11
|
+
throw new Error(`AbsoluteJS server entry does not exist: ${entryPath}`);
|
|
12
|
+
}
|
|
13
|
+
var entryDir = dirname(entryPath);
|
|
14
|
+
var entryExtension = extname(entryPath) || ".ts";
|
|
15
|
+
var copyPrefix = ".absolutejs-hmr-";
|
|
16
|
+
var removeEntryCopy = (path) => {
|
|
17
|
+
try {
|
|
18
|
+
unlinkSync(path);
|
|
19
|
+
} catch {}
|
|
20
|
+
};
|
|
21
|
+
var isHotReevaluation = globalThis.__absoluteEntryCopies !== undefined;
|
|
22
|
+
if (!isHotReevaluation) {
|
|
23
|
+
for (const name of readdirSync(entryDir)) {
|
|
24
|
+
if (!name.startsWith(copyPrefix) || !name.endsWith(entryExtension)) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
removeEntryCopy(join(entryDir, name));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
var bootstrapSequence = (globalThis.__absoluteEntryBootstrapSequence ?? 0) + 1;
|
|
31
|
+
globalThis.__absoluteEntryBootstrapSequence = bootstrapSequence;
|
|
32
|
+
var bootstrapCopy = join(entryDir, `${copyPrefix}${process.pid}-bootstrap-${bootstrapSequence}${entryExtension}`);
|
|
33
|
+
copyFileSync(entryPath, bootstrapCopy);
|
|
34
|
+
var entryCopies = globalThis.__absoluteEntryCopies ?? new Set;
|
|
35
|
+
entryCopies.add(bootstrapCopy);
|
|
36
|
+
globalThis.__absoluteEntryCopies = entryCopies;
|
|
37
|
+
if (!globalThis.__absoluteEntryCleanupRegistered) {
|
|
38
|
+
globalThis.__absoluteEntryCleanupRegistered = true;
|
|
39
|
+
process.on("exit", () => {
|
|
40
|
+
for (const path of entryCopies) {
|
|
41
|
+
removeEntryCopy(path);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
await import(bootstrapCopy);
|