vinext 0.0.29 → 0.0.31
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/README.md +12 -6
- package/dist/build/prerender.d.ts +188 -0
- package/dist/build/prerender.js +675 -0
- package/dist/build/prerender.js.map +1 -0
- package/dist/build/report.d.ts +45 -46
- package/dist/build/report.js +247 -276
- package/dist/build/report.js.map +1 -1
- package/dist/build/run-prerender.d.ts +62 -0
- package/dist/build/run-prerender.js +183 -0
- package/dist/build/run-prerender.js.map +1 -0
- package/dist/build/server-manifest.d.ts +19 -0
- package/dist/build/server-manifest.js +29 -0
- package/dist/build/server-manifest.js.map +1 -0
- package/dist/build/static-export.d.ts +51 -66
- package/dist/build/static-export.js +51 -545
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.d.ts +26 -24
- package/dist/check.js +591 -567
- package/dist/check.js.map +1 -1
- package/dist/cli.d.ts +1 -15
- package/dist/cli.js +430 -491
- package/dist/cli.js.map +1 -1
- package/dist/client/entry.d.ts +1 -2
- package/dist/client/entry.js +49 -62
- package/dist/client/entry.js.map +1 -1
- package/dist/client/validate-module-path.d.ts +4 -1
- package/dist/client/validate-module-path.js +23 -28
- package/dist/client/validate-module-path.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +15 -20
- package/dist/client/vinext-next-data.js +0 -1
- package/dist/cloudflare/index.d.ts +3 -8
- package/dist/cloudflare/index.js +3 -8
- package/dist/cloudflare/kv-cache-handler.d.ts +95 -105
- package/dist/cloudflare/kv-cache-handler.js +354 -366
- package/dist/cloudflare/kv-cache-handler.js.map +1 -1
- package/dist/cloudflare/tpr.d.ts +36 -34
- package/dist/cloudflare/tpr.js +460 -603
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.d.ts +31 -40
- package/dist/config/config-matchers.js +727 -936
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/dotenv.d.ts +18 -11
- package/dist/config/dotenv.js +79 -84
- package/dist/config/dotenv.js.map +1 -1
- package/dist/config/next-config.d.ts +156 -146
- package/dist/config/next-config.js +374 -464
- package/dist/config/next-config.js.map +1 -1
- package/dist/deploy.d.ts +87 -96
- package/dist/deploy.js +490 -628
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +4 -1
- package/dist/entries/app-browser-entry.js +12 -8
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +33 -20
- package/dist/entries/app-rsc-entry.js +618 -343
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-ssr-entry.d.ts +9 -1
- package/dist/entries/app-ssr-entry.js +61 -28
- package/dist/entries/app-ssr-entry.js.map +1 -1
- package/dist/entries/pages-client-entry.d.ts +6 -2
- package/dist/entries/pages-client-entry.js +30 -33
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-entry-helpers.d.ts +5 -1
- package/dist/entries/pages-entry-helpers.js +17 -14
- package/dist/entries/pages-entry-helpers.js.map +1 -1
- package/dist/entries/pages-server-entry.d.ts +6 -2
- package/dist/entries/pages-server-entry.js +229 -207
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/index.d.ts +82 -62
- package/dist/index.js +2172 -3125
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +40 -37
- package/dist/init.js +201 -258
- package/dist/init.js.map +1 -1
- package/dist/plugins/async-hooks-stub.d.ts +7 -3
- package/dist/plugins/async-hooks-stub.js +39 -42
- package/dist/plugins/async-hooks-stub.js.map +1 -1
- package/dist/plugins/client-reference-dedup.d.ts +7 -3
- package/dist/plugins/client-reference-dedup.js +63 -88
- package/dist/plugins/client-reference-dedup.js.map +1 -1
- package/dist/routing/app-router.d.ts +100 -96
- package/dist/routing/app-router.js +563 -659
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.d.ts +18 -15
- package/dist/routing/file-matcher.js +65 -65
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.d.ts +23 -24
- package/dist/routing/pages-router.js +147 -172
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-trie.d.ts +23 -20
- package/dist/routing/route-trie.js +131 -151
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/route-validation.d.ts +5 -2
- package/dist/routing/route-validation.js +98 -130
- package/dist/routing/route-validation.js.map +1 -1
- package/dist/routing/utils.d.ts +10 -7
- package/dist/routing/utils.js +75 -111
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.d.ts +8 -13
- package/dist/server/api-handler.js +161 -193
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-router-entry.d.ts +6 -16
- package/dist/server/app-router-entry.js +26 -54
- package/dist/server/app-router-entry.js.map +1 -1
- package/dist/server/dev-module-runner.d.ts +11 -64
- package/dist/server/dev-module-runner.js +89 -101
- package/dist/server/dev-module-runner.js.map +1 -1
- package/dist/server/dev-origin-check.d.ts +12 -10
- package/dist/server/dev-origin-check.js +98 -108
- package/dist/server/dev-origin-check.js.map +1 -1
- package/dist/server/dev-server.d.ts +17 -13
- package/dist/server/dev-server.js +547 -874
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/html.d.ts +4 -1
- package/dist/server/html.js +25 -26
- package/dist/server/html.js.map +1 -1
- package/dist/server/image-optimization.d.ts +31 -28
- package/dist/server/image-optimization.js +183 -200
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/instrumentation.d.ts +25 -22
- package/dist/server/instrumentation.js +110 -122
- package/dist/server/instrumentation.js.map +1 -1
- package/dist/server/isr-cache.d.ts +16 -26
- package/dist/server/isr-cache.js +109 -126
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/metadata-routes.d.ts +85 -88
- package/dist/server/metadata-routes.js +277 -286
- package/dist/server/metadata-routes.js.map +1 -1
- package/dist/server/middleware-codegen.d.ts +7 -4
- package/dist/server/middleware-codegen.js +98 -65
- package/dist/server/middleware-codegen.js.map +1 -1
- package/dist/server/middleware-request-headers.d.ts +8 -6
- package/dist/server/middleware-request-headers.js +47 -65
- package/dist/server/middleware-request-headers.js.map +1 -1
- package/dist/server/middleware.d.ts +31 -47
- package/dist/server/middleware.js +276 -363
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/normalize-path.d.ts +4 -1
- package/dist/server/normalize-path.js +33 -47
- package/dist/server/normalize-path.js.map +1 -1
- package/dist/server/pages-i18n.d.ts +58 -0
- package/dist/server/pages-i18n.js +125 -0
- package/dist/server/pages-i18n.js.map +1 -0
- package/dist/server/prod-server.d.ts +19 -31
- package/dist/server/prod-server.js +714 -945
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/request-log.d.ts +18 -12
- package/dist/server/request-log.js +45 -52
- package/dist/server/request-log.js.map +1 -1
- package/dist/server/request-pipeline.d.ts +9 -17
- package/dist/server/request-pipeline.js +133 -184
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/worker-utils.d.ts +4 -1
- package/dist/server/worker-utils.js +31 -37
- package/dist/server/worker-utils.js.map +1 -1
- package/dist/shims/amp.d.ts +5 -2
- package/dist/shims/amp.js +19 -15
- package/dist/shims/amp.js.map +1 -1
- package/dist/shims/app.d.ts +8 -10
- package/dist/shims/app.js +0 -1
- package/dist/shims/cache-runtime.d.ts +21 -43
- package/dist/shims/cache-runtime.js +271 -405
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +131 -119
- package/dist/shims/cache.js +339 -418
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/client-only.d.ts +1 -18
- package/dist/shims/client-only.js +0 -17
- package/dist/shims/compat-router.d.ts +4 -1
- package/dist/shims/compat-router.js +23 -19
- package/dist/shims/compat-router.js.map +1 -1
- package/dist/shims/config.d.ts +7 -5
- package/dist/shims/config.js +16 -23
- package/dist/shims/config.js.map +1 -1
- package/dist/shims/constants.d.ts +119 -118
- package/dist/shims/constants.js +159 -165
- package/dist/shims/constants.js.map +1 -1
- package/dist/shims/document.d.ts +20 -16
- package/dist/shims/document.js +41 -22
- package/dist/shims/document.js.map +1 -1
- package/dist/shims/dynamic.d.ts +13 -22
- package/dist/shims/dynamic.js +122 -136
- package/dist/shims/dynamic.js.map +1 -1
- package/dist/shims/error-boundary.d.ts +22 -15
- package/dist/shims/error-boundary.js +81 -79
- package/dist/shims/error-boundary.js.map +1 -1
- package/dist/shims/error.d.ts +11 -12
- package/dist/shims/error.js +35 -39
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/fetch-cache.d.ts +26 -10
- package/dist/shims/fetch-cache.js +443 -586
- package/dist/shims/fetch-cache.js.map +1 -1
- package/dist/shims/font-google-base.d.ts +28 -26
- package/dist/shims/font-google-base.js +238 -325
- package/dist/shims/font-google-base.js.map +1 -1
- package/dist/shims/font-google.d.ts +3 -3
- package/dist/shims/font-google.generated.d.ts +1928 -1924
- package/dist/shims/font-google.generated.js +1928 -2133
- package/dist/shims/font-google.generated.js.map +1 -1
- package/dist/shims/font-google.js +3 -3
- package/dist/shims/font-local.d.ts +28 -26
- package/dist/shims/font-local.js +204 -260
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/form.d.ts +13 -27
- package/dist/shims/form.js +128 -180
- package/dist/shims/form.js.map +1 -1
- package/dist/shims/head-state.d.ts +9 -10
- package/dist/shims/head-state.js +25 -39
- package/dist/shims/head-state.js.map +1 -1
- package/dist/shims/head.d.ts +16 -18
- package/dist/shims/head.js +185 -153
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +84 -71
- package/dist/shims/headers.js +447 -583
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/i18n-context.d.ts +23 -0
- package/dist/shims/i18n-context.js +44 -0
- package/dist/shims/i18n-context.js.map +1 -0
- package/dist/shims/i18n-state.d.ts +14 -0
- package/dist/shims/i18n-state.js +45 -0
- package/dist/shims/i18n-state.js.map +1 -0
- package/dist/shims/image-config.d.ts +11 -8
- package/dist/shims/image-config.js +50 -83
- package/dist/shims/image-config.js.map +1 -1
- package/dist/shims/image.d.ts +37 -44
- package/dist/shims/image.js +284 -301
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/api-utils.d.ts +7 -4
- package/dist/shims/internal/api-utils.js +0 -6
- package/dist/shims/internal/app-router-context.d.ts +22 -17
- package/dist/shims/internal/app-router-context.js +17 -13
- package/dist/shims/internal/app-router-context.js.map +1 -1
- package/dist/shims/internal/cookies.d.ts +2 -9
- package/dist/shims/internal/cookies.js +2 -9
- package/dist/shims/internal/parse-cookie-header.d.ts +4 -1
- package/dist/shims/internal/parse-cookie-header.js +29 -29
- package/dist/shims/internal/parse-cookie-header.js.map +1 -1
- package/dist/shims/internal/router-context.d.ts +6 -1
- package/dist/shims/internal/router-context.js +11 -7
- package/dist/shims/internal/router-context.js.map +1 -1
- package/dist/shims/internal/utils.d.ts +40 -36
- package/dist/shims/internal/utils.js +24 -30
- package/dist/shims/internal/utils.js.map +1 -1
- package/dist/shims/internal/work-unit-async-storage.d.ts +6 -10
- package/dist/shims/internal/work-unit-async-storage.js +14 -11
- package/dist/shims/internal/work-unit-async-storage.js.map +1 -1
- package/dist/shims/layout-segment-context.d.ts +11 -14
- package/dist/shims/layout-segment-context.js +24 -23
- package/dist/shims/layout-segment-context.js.map +1 -1
- package/dist/shims/legacy-image.d.ts +39 -46
- package/dist/shims/legacy-image.js +47 -42
- package/dist/shims/legacy-image.js.map +1 -1
- package/dist/shims/link.d.ts +32 -36
- package/dist/shims/link.js +262 -382
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +210 -202
- package/dist/shims/metadata.js +545 -544
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation-state.d.ts +19 -13
- package/dist/shims/navigation-state.js +68 -58
- package/dist/shims/navigation-state.js.map +1 -1
- package/dist/shims/navigation.d.ts +59 -63
- package/dist/shims/navigation.js +508 -690
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/og.d.ts +2 -20
- package/dist/shims/og.js +2 -19
- package/dist/shims/readonly-url-search-params.d.ts +8 -5
- package/dist/shims/readonly-url-search-params.js +26 -22
- package/dist/shims/readonly-url-search-params.js.map +1 -1
- package/dist/shims/request-context.d.ts +8 -5
- package/dist/shims/request-context.js +50 -51
- package/dist/shims/request-context.js.map +1 -1
- package/dist/shims/request-state-types.d.ts +11 -0
- package/dist/shims/request-state-types.js +1 -0
- package/dist/shims/router-state.d.ts +15 -1
- package/dist/shims/router-state.js +34 -41
- package/dist/shims/router-state.js.map +1 -1
- package/dist/shims/router.d.ts +81 -81
- package/dist/shims/router.js +517 -543
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script.d.ts +39 -48
- package/dist/shims/script.js +107 -160
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server-only.d.ts +1 -19
- package/dist/shims/server-only.js +0 -18
- package/dist/shims/server.d.ts +175 -157
- package/dist/shims/server.js +462 -432
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/unified-request-context.d.ts +66 -0
- package/dist/shims/unified-request-context.js +98 -0
- package/dist/shims/unified-request-context.js.map +1 -0
- package/dist/shims/url-safety.d.ts +4 -1
- package/dist/shims/url-safety.js +15 -11
- package/dist/shims/url-safety.js.map +1 -1
- package/dist/shims/url-utils.d.ts +8 -5
- package/dist/shims/url-utils.js +62 -93
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/shims/web-vitals.d.ts +10 -8
- package/dist/shims/web-vitals.js +9 -15
- package/dist/shims/web-vitals.js.map +1 -1
- package/dist/utils/base-path.d.ts +5 -2
- package/dist/utils/base-path.js +21 -19
- package/dist/utils/base-path.js.map +1 -1
- package/dist/utils/domain-locale.d.ts +26 -0
- package/dist/utils/domain-locale.js +44 -0
- package/dist/utils/domain-locale.js.map +1 -0
- package/dist/utils/hash.d.ts +4 -1
- package/dist/utils/hash.js +19 -17
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/manifest-paths.d.ts +6 -3
- package/dist/utils/manifest-paths.js +15 -16
- package/dist/utils/manifest-paths.js.map +1 -1
- package/dist/utils/project.d.ts +13 -11
- package/dist/utils/project.js +169 -216
- package/dist/utils/project.js.map +1 -1
- package/dist/utils/query.d.ts +8 -6
- package/dist/utils/query.js +57 -67
- package/dist/utils/query.js.map +1 -1
- package/package.json +11 -10
- package/dist/build/report.d.ts.map +0 -1
- package/dist/build/static-export.d.ts.map +0 -1
- package/dist/check.d.ts.map +0 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/client/entry.d.ts.map +0 -1
- package/dist/client/validate-module-path.d.ts.map +0 -1
- package/dist/client/vinext-next-data.d.ts.map +0 -1
- package/dist/client/vinext-next-data.js.map +0 -1
- package/dist/cloudflare/index.d.ts.map +0 -1
- package/dist/cloudflare/index.js.map +0 -1
- package/dist/cloudflare/kv-cache-handler.d.ts.map +0 -1
- package/dist/cloudflare/tpr.d.ts.map +0 -1
- package/dist/config/config-matchers.d.ts.map +0 -1
- package/dist/config/dotenv.d.ts.map +0 -1
- package/dist/config/next-config.d.ts.map +0 -1
- package/dist/deploy.d.ts.map +0 -1
- package/dist/entries/app-browser-entry.d.ts.map +0 -1
- package/dist/entries/app-rsc-entry.d.ts.map +0 -1
- package/dist/entries/app-ssr-entry.d.ts.map +0 -1
- package/dist/entries/pages-client-entry.d.ts.map +0 -1
- package/dist/entries/pages-entry-helpers.d.ts.map +0 -1
- package/dist/entries/pages-server-entry.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/init.d.ts.map +0 -1
- package/dist/plugins/async-hooks-stub.d.ts.map +0 -1
- package/dist/plugins/client-reference-dedup.d.ts.map +0 -1
- package/dist/routing/app-router.d.ts.map +0 -1
- package/dist/routing/file-matcher.d.ts.map +0 -1
- package/dist/routing/pages-router.d.ts.map +0 -1
- package/dist/routing/route-trie.d.ts.map +0 -1
- package/dist/routing/route-validation.d.ts.map +0 -1
- package/dist/routing/utils.d.ts.map +0 -1
- package/dist/server/api-handler.d.ts.map +0 -1
- package/dist/server/app-router-entry.d.ts.map +0 -1
- package/dist/server/dev-module-runner.d.ts.map +0 -1
- package/dist/server/dev-origin-check.d.ts.map +0 -1
- package/dist/server/dev-server.d.ts.map +0 -1
- package/dist/server/html.d.ts.map +0 -1
- package/dist/server/image-optimization.d.ts.map +0 -1
- package/dist/server/instrumentation.d.ts.map +0 -1
- package/dist/server/isr-cache.d.ts.map +0 -1
- package/dist/server/metadata-routes.d.ts.map +0 -1
- package/dist/server/middleware-codegen.d.ts.map +0 -1
- package/dist/server/middleware-request-headers.d.ts.map +0 -1
- package/dist/server/middleware.d.ts.map +0 -1
- package/dist/server/normalize-path.d.ts.map +0 -1
- package/dist/server/prod-server.d.ts.map +0 -1
- package/dist/server/request-log.d.ts.map +0 -1
- package/dist/server/request-pipeline.d.ts.map +0 -1
- package/dist/server/worker-utils.d.ts.map +0 -1
- package/dist/shims/amp.d.ts.map +0 -1
- package/dist/shims/app.d.ts.map +0 -1
- package/dist/shims/app.js.map +0 -1
- package/dist/shims/cache-runtime.d.ts.map +0 -1
- package/dist/shims/cache.d.ts.map +0 -1
- package/dist/shims/client-only.d.ts.map +0 -1
- package/dist/shims/client-only.js.map +0 -1
- package/dist/shims/compat-router.d.ts.map +0 -1
- package/dist/shims/config.d.ts.map +0 -1
- package/dist/shims/constants.d.ts.map +0 -1
- package/dist/shims/document.d.ts.map +0 -1
- package/dist/shims/dynamic.d.ts.map +0 -1
- package/dist/shims/error-boundary.d.ts.map +0 -1
- package/dist/shims/error.d.ts.map +0 -1
- package/dist/shims/fetch-cache.d.ts.map +0 -1
- package/dist/shims/font-google-base.d.ts.map +0 -1
- package/dist/shims/font-google.d.ts.map +0 -1
- package/dist/shims/font-google.generated.d.ts.map +0 -1
- package/dist/shims/font-google.js.map +0 -1
- package/dist/shims/font-local.d.ts.map +0 -1
- package/dist/shims/form.d.ts.map +0 -1
- package/dist/shims/head-state.d.ts.map +0 -1
- package/dist/shims/head.d.ts.map +0 -1
- package/dist/shims/headers.d.ts.map +0 -1
- package/dist/shims/image-config.d.ts.map +0 -1
- package/dist/shims/image.d.ts.map +0 -1
- package/dist/shims/internal/api-utils.d.ts.map +0 -1
- package/dist/shims/internal/api-utils.js.map +0 -1
- package/dist/shims/internal/app-router-context.d.ts.map +0 -1
- package/dist/shims/internal/cookies.d.ts.map +0 -1
- package/dist/shims/internal/cookies.js.map +0 -1
- package/dist/shims/internal/parse-cookie-header.d.ts.map +0 -1
- package/dist/shims/internal/router-context.d.ts.map +0 -1
- package/dist/shims/internal/utils.d.ts.map +0 -1
- package/dist/shims/internal/work-unit-async-storage.d.ts.map +0 -1
- package/dist/shims/layout-segment-context.d.ts.map +0 -1
- package/dist/shims/legacy-image.d.ts.map +0 -1
- package/dist/shims/link.d.ts.map +0 -1
- package/dist/shims/metadata.d.ts.map +0 -1
- package/dist/shims/navigation-state.d.ts.map +0 -1
- package/dist/shims/navigation.d.ts.map +0 -1
- package/dist/shims/og.d.ts.map +0 -1
- package/dist/shims/og.js.map +0 -1
- package/dist/shims/readonly-url-search-params.d.ts.map +0 -1
- package/dist/shims/request-context.d.ts.map +0 -1
- package/dist/shims/router-state.d.ts.map +0 -1
- package/dist/shims/router.d.ts.map +0 -1
- package/dist/shims/script.d.ts.map +0 -1
- package/dist/shims/server-only.d.ts.map +0 -1
- package/dist/shims/server-only.js.map +0 -1
- package/dist/shims/server.d.ts.map +0 -1
- package/dist/shims/url-safety.d.ts.map +0 -1
- package/dist/shims/url-utils.d.ts.map +0 -1
- package/dist/shims/web-vitals.d.ts.map +0 -1
- package/dist/utils/base-path.d.ts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/manifest-paths.d.ts.map +0 -1
- package/dist/utils/project.d.ts.map +0 -1
- package/dist/utils/query.d.ts.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/shims/web-vitals.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* next/web-vitals shim
|
|
3
4
|
*
|
|
@@ -6,12 +7,12 @@
|
|
|
6
7
|
* Apps can use the web-vitals library directly instead.
|
|
7
8
|
*/
|
|
8
9
|
interface WebVitalsMetric {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
value: number;
|
|
13
|
+
rating?: "good" | "needs-improvement" | "poor";
|
|
14
|
+
delta: number;
|
|
15
|
+
navigationType?: "navigate" | "reload" | "back-forward" | "prerender";
|
|
15
16
|
}
|
|
16
17
|
type ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;
|
|
17
18
|
/**
|
|
@@ -19,6 +20,7 @@ type ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;
|
|
|
19
20
|
* No-op in our implementation — use the `web-vitals` library directly
|
|
20
21
|
* for production metrics collection.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
declare function useReportWebVitals(_callback: ReportWebVitalsCallback): void;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { type ReportWebVitalsCallback, type WebVitalsMetric, useReportWebVitals };
|
|
24
26
|
//# sourceMappingURL=web-vitals.d.ts.map
|
package/dist/shims/web-vitals.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
+
//#region src/shims/web-vitals.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* No-op in our implementation — use the `web-vitals` library directly
|
|
11
|
-
* for production metrics collection.
|
|
12
|
-
*/
|
|
13
|
-
export function useReportWebVitals(_callback) {
|
|
14
|
-
// No-op — apps should use the web-vitals library directly
|
|
15
|
-
// or their own analytics integration.
|
|
16
|
-
}
|
|
3
|
+
* Register a callback to receive Core Web Vitals metrics.
|
|
4
|
+
* No-op in our implementation — use the `web-vitals` library directly
|
|
5
|
+
* for production metrics collection.
|
|
6
|
+
*/
|
|
7
|
+
function useReportWebVitals(_callback) {}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { useReportWebVitals };
|
|
10
|
+
|
|
17
11
|
//# sourceMappingURL=web-vitals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-vitals.js","
|
|
1
|
+
{"version":3,"file":"web-vitals.js","names":[],"sources":["../../src/shims/web-vitals.ts"],"sourcesContent":["/**\n * next/web-vitals shim\n *\n * Provides useReportWebVitals() — a no-op hook for compatibility.\n * In real Next.js, this sends Core Web Vitals to an analytics endpoint.\n * Apps can use the web-vitals library directly instead.\n */\n\ninterface WebVitalsMetric {\n id: string;\n name: string;\n value: number;\n rating?: \"good\" | \"needs-improvement\" | \"poor\";\n delta: number;\n navigationType?: \"navigate\" | \"reload\" | \"back-forward\" | \"prerender\";\n}\n\ntype ReportWebVitalsCallback = (metric: WebVitalsMetric) => void;\n\n/**\n * Register a callback to receive Core Web Vitals metrics.\n * No-op in our implementation — use the `web-vitals` library directly\n * for production metrics collection.\n */\nexport function useReportWebVitals(_callback: ReportWebVitalsCallback): void {\n // No-op — apps should use the web-vitals library directly\n // or their own analytics integration.\n}\n\nexport type { WebVitalsMetric, ReportWebVitalsCallback };\n"],"mappings":";;;;;;AAwBA,SAAgB,mBAAmB,WAA0C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/base-path.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Shared basePath helpers.
|
|
3
4
|
*
|
|
@@ -8,10 +9,12 @@
|
|
|
8
9
|
/**
|
|
9
10
|
* Check whether a pathname is inside the configured basePath.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
declare function hasBasePath(pathname: string, basePath: string): boolean;
|
|
12
13
|
/**
|
|
13
14
|
* Strip the basePath prefix from a pathname when it matches on a segment
|
|
14
15
|
* boundary. Returns the original pathname when it is outside the basePath.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
declare function stripBasePath(pathname: string, basePath: string): string;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { hasBasePath, stripBasePath };
|
|
17
20
|
//# sourceMappingURL=base-path.d.ts.map
|
package/dist/utils/base-path.js
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
+
//#region src/utils/base-path.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
* Shared basePath helpers.
|
|
4
|
+
*
|
|
5
|
+
* Next.js only treats a pathname as being under basePath when it is an exact
|
|
6
|
+
* match ("/app") or starts with the basePath followed by a path separator
|
|
7
|
+
* ("/app/..."). Prefix-only matches like "/application" must be left intact.
|
|
8
|
+
*/
|
|
8
9
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return pathname === basePath || pathname.startsWith(basePath + "/");
|
|
10
|
+
* Check whether a pathname is inside the configured basePath.
|
|
11
|
+
*/
|
|
12
|
+
function hasBasePath(pathname, basePath) {
|
|
13
|
+
if (!basePath) return false;
|
|
14
|
+
return pathname === basePath || pathname.startsWith(basePath + "/");
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return pathname.slice(basePath.length) || "/";
|
|
17
|
+
* Strip the basePath prefix from a pathname when it matches on a segment
|
|
18
|
+
* boundary. Returns the original pathname when it is outside the basePath.
|
|
19
|
+
*/
|
|
20
|
+
function stripBasePath(pathname, basePath) {
|
|
21
|
+
if (!hasBasePath(pathname, basePath)) return pathname;
|
|
22
|
+
return pathname.slice(basePath.length) || "/";
|
|
24
23
|
}
|
|
24
|
+
//#endregion
|
|
25
|
+
export { hasBasePath, stripBasePath };
|
|
26
|
+
|
|
25
27
|
//# sourceMappingURL=base-path.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-path.js","
|
|
1
|
+
{"version":3,"file":"base-path.js","names":[],"sources":["../../src/utils/base-path.ts"],"sourcesContent":["/**\n * Shared basePath helpers.\n *\n * Next.js only treats a pathname as being under basePath when it is an exact\n * match (\"/app\") or starts with the basePath followed by a path separator\n * (\"/app/...\"). Prefix-only matches like \"/application\" must be left intact.\n */\n\n/**\n * Check whether a pathname is inside the configured basePath.\n */\nexport function hasBasePath(pathname: string, basePath: string): boolean {\n if (!basePath) return false;\n return pathname === basePath || pathname.startsWith(basePath + \"/\");\n}\n\n/**\n * Strip the basePath prefix from a pathname when it matches on a segment\n * boundary. Returns the original pathname when it is outside the basePath.\n */\nexport function stripBasePath(pathname: string, basePath: string): string {\n if (!hasBasePath(pathname, basePath)) return pathname;\n return pathname.slice(basePath.length) || \"/\";\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,YAAY,UAAkB,UAA2B;AACvE,KAAI,CAAC,SAAU,QAAO;AACtB,QAAO,aAAa,YAAY,SAAS,WAAW,WAAW,IAAI;;;;;;AAOrE,SAAgB,cAAc,UAAkB,UAA0B;AACxE,KAAI,CAAC,YAAY,UAAU,SAAS,CAAE,QAAO;AAC7C,QAAO,SAAS,MAAM,SAAS,OAAO,IAAI"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NextI18nConfig } from "../config/next-config.js";
|
|
2
|
+
|
|
3
|
+
//#region src/utils/domain-locale.d.ts
|
|
4
|
+
type DomainLocale = NonNullable<NextI18nConfig["domains"]>[number];
|
|
5
|
+
declare function normalizeDomainHostname(hostname: string | null | undefined): string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Match a configured domain either by hostname or locale.
|
|
8
|
+
* When both are provided, the checks intentionally use OR semantics so the
|
|
9
|
+
* same helper can cover Next.js's hostname lookup and preferred-locale lookup.
|
|
10
|
+
* If both are passed, the first domain matching either input wins, so callers
|
|
11
|
+
* should pass hostname or detectedLocale, not both.
|
|
12
|
+
*/
|
|
13
|
+
declare function detectDomainLocale(domainItems?: readonly DomainLocale[], hostname?: string, detectedLocale?: string): DomainLocale | undefined;
|
|
14
|
+
declare function addLocalePrefix(path: string, locale: string, localeDefault: string): string;
|
|
15
|
+
declare function getDomainLocaleUrl(url: string, locale: string, {
|
|
16
|
+
basePath,
|
|
17
|
+
currentHostname,
|
|
18
|
+
domainItems
|
|
19
|
+
}: {
|
|
20
|
+
basePath?: string;
|
|
21
|
+
currentHostname?: string | null;
|
|
22
|
+
domainItems?: readonly DomainLocale[];
|
|
23
|
+
}): string | undefined;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { DomainLocale, addLocalePrefix, detectDomainLocale, getDomainLocaleUrl, normalizeDomainHostname };
|
|
26
|
+
//# sourceMappingURL=domain-locale.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//#region src/utils/domain-locale.ts
|
|
2
|
+
function normalizeDomainHostname(hostname) {
|
|
3
|
+
if (!hostname) return void 0;
|
|
4
|
+
return hostname.split(",", 1)[0]?.trim().split(":", 1)[0]?.toLowerCase() || void 0;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Match a configured domain either by hostname or locale.
|
|
8
|
+
* When both are provided, the checks intentionally use OR semantics so the
|
|
9
|
+
* same helper can cover Next.js's hostname lookup and preferred-locale lookup.
|
|
10
|
+
* If both are passed, the first domain matching either input wins, so callers
|
|
11
|
+
* should pass hostname or detectedLocale, not both.
|
|
12
|
+
*/
|
|
13
|
+
function detectDomainLocale(domainItems, hostname, detectedLocale) {
|
|
14
|
+
if (!domainItems?.length) return void 0;
|
|
15
|
+
const normalizedHostname = normalizeDomainHostname(hostname);
|
|
16
|
+
const normalizedLocale = detectedLocale?.toLowerCase();
|
|
17
|
+
for (const item of domainItems) if (normalizedHostname === normalizeDomainHostname(item.domain) || normalizedLocale === item.defaultLocale.toLowerCase() || item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)) return item;
|
|
18
|
+
}
|
|
19
|
+
function addLocalePrefix(path, locale, localeDefault) {
|
|
20
|
+
const normalizedLocale = locale.toLowerCase();
|
|
21
|
+
if (normalizedLocale === localeDefault.toLowerCase()) return path;
|
|
22
|
+
const pathWithLeadingSlash = path.startsWith("/") ? path : `/${path}`;
|
|
23
|
+
const normalizedPathname = (pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash).toLowerCase();
|
|
24
|
+
const localePrefix = `/${normalizedLocale}`;
|
|
25
|
+
if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) return path.startsWith("/") ? path : pathWithLeadingSlash;
|
|
26
|
+
return `/${locale}${pathWithLeadingSlash}`;
|
|
27
|
+
}
|
|
28
|
+
function withBasePath(path, basePath = "") {
|
|
29
|
+
if (!basePath) return path;
|
|
30
|
+
return basePath + path;
|
|
31
|
+
}
|
|
32
|
+
function getDomainLocaleUrl(url, locale, { basePath, currentHostname, domainItems }) {
|
|
33
|
+
if (!domainItems?.length) return void 0;
|
|
34
|
+
const targetDomain = detectDomainLocale(domainItems, void 0, locale);
|
|
35
|
+
if (!targetDomain) return void 0;
|
|
36
|
+
const currentDomain = detectDomainLocale(domainItems, currentHostname ?? void 0);
|
|
37
|
+
const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);
|
|
38
|
+
if (currentDomain && normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)) return;
|
|
39
|
+
return `${`http${targetDomain.http ? "" : "s"}://`}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;
|
|
40
|
+
}
|
|
41
|
+
//#endregion
|
|
42
|
+
export { addLocalePrefix, detectDomainLocale, getDomainLocaleUrl, normalizeDomainHostname };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=domain-locale.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-locale.js","names":[],"sources":["../../src/utils/domain-locale.ts"],"sourcesContent":["import type { NextI18nConfig } from \"../config/next-config.js\";\n\nexport type DomainLocale = NonNullable<NextI18nConfig[\"domains\"]>[number];\n\nexport function normalizeDomainHostname(hostname: string | null | undefined): string | undefined {\n if (!hostname) return undefined;\n return hostname.split(\",\", 1)[0]?.trim().split(\":\", 1)[0]?.toLowerCase() || undefined;\n}\n\n/**\n * Match a configured domain either by hostname or locale.\n * When both are provided, the checks intentionally use OR semantics so the\n * same helper can cover Next.js's hostname lookup and preferred-locale lookup.\n * If both are passed, the first domain matching either input wins, so callers\n * should pass hostname or detectedLocale, not both.\n */\nexport function detectDomainLocale(\n domainItems?: readonly DomainLocale[],\n hostname?: string,\n detectedLocale?: string,\n): DomainLocale | undefined {\n if (!domainItems?.length) return undefined;\n\n const normalizedHostname = normalizeDomainHostname(hostname);\n const normalizedLocale = detectedLocale?.toLowerCase();\n\n for (const item of domainItems) {\n const domainHostname = normalizeDomainHostname(item.domain);\n if (\n normalizedHostname === domainHostname ||\n normalizedLocale === item.defaultLocale.toLowerCase() ||\n item.locales?.some((locale) => locale.toLowerCase() === normalizedLocale)\n ) {\n return item;\n }\n }\n\n return undefined;\n}\n\nexport function addLocalePrefix(path: string, locale: string, localeDefault: string): string {\n const normalizedLocale = locale.toLowerCase();\n if (normalizedLocale === localeDefault.toLowerCase()) return path;\n\n const pathWithLeadingSlash = path.startsWith(\"/\") ? path : `/${path}`;\n const pathname = pathWithLeadingSlash.split(/[?#]/, 1)[0] ?? pathWithLeadingSlash;\n const normalizedPathname = pathname.toLowerCase();\n const localePrefix = `/${normalizedLocale}`;\n\n if (normalizedPathname === localePrefix || normalizedPathname.startsWith(`${localePrefix}/`)) {\n return path.startsWith(\"/\") ? path : pathWithLeadingSlash;\n }\n\n return `/${locale}${pathWithLeadingSlash}`;\n}\n\nfunction withBasePath(path: string, basePath = \"\"): string {\n if (!basePath) return path;\n return basePath + path;\n}\n\nexport function getDomainLocaleUrl(\n url: string,\n locale: string,\n {\n basePath,\n currentHostname,\n domainItems,\n }: {\n basePath?: string;\n currentHostname?: string | null;\n domainItems?: readonly DomainLocale[];\n },\n): string | undefined {\n if (!domainItems?.length) return undefined;\n\n const targetDomain = detectDomainLocale(domainItems, undefined, locale);\n if (!targetDomain) return undefined;\n\n const currentDomain = detectDomainLocale(domainItems, currentHostname ?? undefined);\n const localizedPath = addLocalePrefix(url, locale, targetDomain.defaultLocale);\n\n if (\n currentDomain &&\n normalizeDomainHostname(currentDomain.domain) === normalizeDomainHostname(targetDomain.domain)\n ) {\n // Same-domain switches fall back to the caller's standard locale-prefix\n // logic. This relies on __VINEXT_DEFAULT_LOCALE__ matching the current\n // domain's defaultLocale, which the server entry keeps in sync.\n return undefined;\n }\n\n const scheme = `http${targetDomain.http ? \"\" : \"s\"}://`;\n return `${scheme}${targetDomain.domain}${withBasePath(localizedPath, basePath)}`;\n}\n"],"mappings":";AAIA,SAAgB,wBAAwB,UAAyD;AAC/F,KAAI,CAAC,SAAU,QAAO,KAAA;AACtB,QAAO,SAAS,MAAM,KAAK,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,CAAC,IAAI,aAAa,IAAI,KAAA;;;;;;;;;AAU9E,SAAgB,mBACd,aACA,UACA,gBAC0B;AAC1B,KAAI,CAAC,aAAa,OAAQ,QAAO,KAAA;CAEjC,MAAM,qBAAqB,wBAAwB,SAAS;CAC5D,MAAM,mBAAmB,gBAAgB,aAAa;AAEtD,MAAK,MAAM,QAAQ,YAEjB,KACE,uBAFqB,wBAAwB,KAAK,OAAO,IAGzD,qBAAqB,KAAK,cAAc,aAAa,IACrD,KAAK,SAAS,MAAM,WAAW,OAAO,aAAa,KAAK,iBAAiB,CAEzE,QAAO;;AAOb,SAAgB,gBAAgB,MAAc,QAAgB,eAA+B;CAC3F,MAAM,mBAAmB,OAAO,aAAa;AAC7C,KAAI,qBAAqB,cAAc,aAAa,CAAE,QAAO;CAE7D,MAAM,uBAAuB,KAAK,WAAW,IAAI,GAAG,OAAO,IAAI;CAE/D,MAAM,sBADW,qBAAqB,MAAM,QAAQ,EAAE,CAAC,MAAM,sBACzB,aAAa;CACjD,MAAM,eAAe,IAAI;AAEzB,KAAI,uBAAuB,gBAAgB,mBAAmB,WAAW,GAAG,aAAa,GAAG,CAC1F,QAAO,KAAK,WAAW,IAAI,GAAG,OAAO;AAGvC,QAAO,IAAI,SAAS;;AAGtB,SAAS,aAAa,MAAc,WAAW,IAAY;AACzD,KAAI,CAAC,SAAU,QAAO;AACtB,QAAO,WAAW;;AAGpB,SAAgB,mBACd,KACA,QACA,EACE,UACA,iBACA,eAMkB;AACpB,KAAI,CAAC,aAAa,OAAQ,QAAO,KAAA;CAEjC,MAAM,eAAe,mBAAmB,aAAa,KAAA,GAAW,OAAO;AACvE,KAAI,CAAC,aAAc,QAAO,KAAA;CAE1B,MAAM,gBAAgB,mBAAmB,aAAa,mBAAmB,KAAA,EAAU;CACnF,MAAM,gBAAgB,gBAAgB,KAAK,QAAQ,aAAa,cAAc;AAE9E,KACE,iBACA,wBAAwB,cAAc,OAAO,KAAK,wBAAwB,aAAa,OAAO,CAK9F;AAIF,QAAO,GADQ,OAAO,aAAa,OAAO,KAAK,IAAI,OAChC,aAAa,SAAS,aAAa,eAAe,SAAS"}
|
package/dist/utils/hash.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
//#region src/utils/hash.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).
|
|
3
4
|
* Used for deterministic key generation where collisions must be rare.
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
+
declare function fnv1a64(input: string): string;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { fnv1a64 };
|
|
6
9
|
//# sourceMappingURL=hash.d.ts.map
|
package/dist/utils/hash.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
//#region src/utils/hash.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
return h1.toString(36) + h2.toString(36);
|
|
3
|
+
* FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).
|
|
4
|
+
* Used for deterministic key generation where collisions must be rare.
|
|
5
|
+
*/
|
|
6
|
+
function fnv1a64(input) {
|
|
7
|
+
let h1 = 2166136261;
|
|
8
|
+
for (let i = 0; i < input.length; i++) {
|
|
9
|
+
h1 ^= input.charCodeAt(i);
|
|
10
|
+
h1 = h1 * 16777619 >>> 0;
|
|
11
|
+
}
|
|
12
|
+
let h2 = 84696351;
|
|
13
|
+
for (let i = 0; i < input.length; i++) {
|
|
14
|
+
h2 ^= input.charCodeAt(i);
|
|
15
|
+
h2 = h2 * 16777619 >>> 0;
|
|
16
|
+
}
|
|
17
|
+
return h1.toString(36) + h2.toString(36);
|
|
19
18
|
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { fnv1a64 };
|
|
21
|
+
|
|
20
22
|
//# sourceMappingURL=hash.js.map
|
package/dist/utils/hash.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","
|
|
1
|
+
{"version":3,"file":"hash.js","names":[],"sources":["../../src/utils/hash.ts"],"sourcesContent":["/**\n * FNV-1a hash producing a 64-bit result (two 32-bit rounds with different seeds).\n * Used for deterministic key generation where collisions must be rare.\n */\nexport function fnv1a64(input: string): string {\n // First 32-bit round with standard FNV offset basis\n let h1 = 0x811c9dc5;\n for (let i = 0; i < input.length; i++) {\n h1 ^= input.charCodeAt(i);\n h1 = (h1 * 0x01000193) >>> 0;\n }\n // Second 32-bit round with different seed\n let h2 = 0x050c5d1f;\n for (let i = 0; i < input.length; i++) {\n h2 ^= input.charCodeAt(i);\n h2 = (h2 * 0x01000193) >>> 0;\n }\n return h1.toString(36) + h2.toString(36);\n}\n"],"mappings":";;;;;AAIA,SAAgB,QAAQ,OAAuB;CAE7C,IAAI,KAAK;AACT,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,MAAM,WAAW,EAAE;AACzB,OAAM,KAAK,aAAgB;;CAG7B,IAAI,KAAK;AACT,MAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,MAAM,WAAW,EAAE;AACzB,OAAM,KAAK,aAAgB;;AAE7B,QAAO,GAAG,SAAS,GAAG,GAAG,GAAG,SAAS,GAAG"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
//#region src/utils/manifest-paths.d.ts
|
|
2
|
+
declare function normalizeManifestFile(file: string): string;
|
|
3
|
+
declare function manifestFileWithBase(file: string, base: string): string;
|
|
4
|
+
declare function manifestFilesWithBase(files: string[], base: string): string[];
|
|
5
|
+
//#endregion
|
|
6
|
+
export { manifestFileWithBase, manifestFilesWithBase, normalizeManifestFile };
|
|
4
7
|
//# sourceMappingURL=manifest-paths.d.ts.map
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/utils/manifest-paths.ts
|
|
2
|
+
function normalizeManifestFile(file) {
|
|
3
|
+
return file.startsWith("/") ? file.slice(1) : file;
|
|
3
4
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!normalizedBase)
|
|
12
|
-
return normalizedFile;
|
|
13
|
-
if (normalizedFile.startsWith(normalizedBase + "/"))
|
|
14
|
-
return normalizedFile;
|
|
15
|
-
return normalizedBase + "/" + normalizedFile;
|
|
5
|
+
function manifestFileWithBase(file, base) {
|
|
6
|
+
const normalizedFile = normalizeManifestFile(file);
|
|
7
|
+
if (!base || base === "/") return normalizedFile;
|
|
8
|
+
const normalizedBase = normalizeManifestFile(base).replace(/\/+$/, "");
|
|
9
|
+
if (!normalizedBase) return normalizedFile;
|
|
10
|
+
if (normalizedFile.startsWith(normalizedBase + "/")) return normalizedFile;
|
|
11
|
+
return normalizedBase + "/" + normalizedFile;
|
|
16
12
|
}
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function manifestFilesWithBase(files, base) {
|
|
14
|
+
return files.map((file) => manifestFileWithBase(file, base));
|
|
19
15
|
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { manifestFileWithBase, manifestFilesWithBase, normalizeManifestFile };
|
|
18
|
+
|
|
20
19
|
//# sourceMappingURL=manifest-paths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-paths.js","
|
|
1
|
+
{"version":3,"file":"manifest-paths.js","names":[],"sources":["../../src/utils/manifest-paths.ts"],"sourcesContent":["export function normalizeManifestFile(file: string): string {\n return file.startsWith(\"/\") ? file.slice(1) : file;\n}\n\nexport function manifestFileWithBase(file: string, base: string): string {\n const normalizedFile = normalizeManifestFile(file);\n if (!base || base === \"/\") return normalizedFile;\n\n // Vite's SSR manifest stores base-prefixed paths without a leading slash,\n // e.g. \"docs/assets/app.js\" for base \"/docs/\".\n const normalizedBase = normalizeManifestFile(base).replace(/\\/+$/, \"\");\n if (!normalizedBase) return normalizedFile;\n if (normalizedFile.startsWith(normalizedBase + \"/\")) return normalizedFile;\n return normalizedBase + \"/\" + normalizedFile;\n}\n\nexport function manifestFilesWithBase(files: string[], base: string): string[] {\n return files.map((file) => manifestFileWithBase(file, base));\n}\n"],"mappings":";AAAA,SAAgB,sBAAsB,MAAsB;AAC1D,QAAO,KAAK,WAAW,IAAI,GAAG,KAAK,MAAM,EAAE,GAAG;;AAGhD,SAAgB,qBAAqB,MAAc,MAAsB;CACvE,MAAM,iBAAiB,sBAAsB,KAAK;AAClD,KAAI,CAAC,QAAQ,SAAS,IAAK,QAAO;CAIlC,MAAM,iBAAiB,sBAAsB,KAAK,CAAC,QAAQ,QAAQ,GAAG;AACtE,KAAI,CAAC,eAAgB,QAAO;AAC5B,KAAI,eAAe,WAAW,iBAAiB,IAAI,CAAE,QAAO;AAC5D,QAAO,iBAAiB,MAAM;;AAGhC,SAAgB,sBAAsB,OAAiB,MAAwB;AAC7E,QAAO,MAAM,KAAK,SAAS,qBAAqB,MAAM,KAAK,CAAC"}
|
package/dist/utils/project.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/utils/project.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Shared project utilities — used by both `vinext init` and `vinext deploy`.
|
|
3
4
|
*
|
|
@@ -8,13 +9,13 @@
|
|
|
8
9
|
* Ensure package.json has "type": "module".
|
|
9
10
|
* Returns true if it was added (i.e. it wasn't already there).
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
+
declare function ensureESModule(root: string): boolean;
|
|
12
13
|
/**
|
|
13
14
|
* Rename CJS config files (that use `module.exports`) to .cjs
|
|
14
15
|
* to avoid breakage when "type": "module" is added.
|
|
15
16
|
* Returns array of [oldName, newName] pairs that were renamed.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
declare function renameCJSConfigs(root: string): Array<[string, string]>;
|
|
18
19
|
/**
|
|
19
20
|
* Ensure the project is configured for ESM before Vite loads vite.config.ts.
|
|
20
21
|
*
|
|
@@ -26,9 +27,9 @@ export declare function renameCJSConfigs(root: string): Array<[string, string]>;
|
|
|
26
27
|
*
|
|
27
28
|
* @returns Object describing what was changed, or null if nothing was done.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
declare function ensureViteConfigCompatibility(root: string): {
|
|
31
|
+
renamed: Array<[string, string]>;
|
|
32
|
+
addedTypeModule: boolean;
|
|
32
33
|
} | null;
|
|
33
34
|
type PackageManagerName = "pnpm" | "yarn" | "bun" | "npm";
|
|
34
35
|
/**
|
|
@@ -39,12 +40,12 @@ type PackageManagerName = "pnpm" | "yarn" | "bun" | "npm";
|
|
|
39
40
|
* 3) invoking CLI user agent (npm_config_user_agent)
|
|
40
41
|
* 4) npm fallback
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
declare function detectPackageManagerName(root: string, env?: Record<string, string | undefined>): PackageManagerName;
|
|
43
44
|
/**
|
|
44
45
|
* Detect which package manager install command to use.
|
|
45
46
|
* Returns the dev-install command string (e.g. "pnpm add -D").
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
declare function detectPackageManager(root: string): string;
|
|
48
49
|
/**
|
|
49
50
|
* Walk from `start` up to the filesystem root looking for a path inside
|
|
50
51
|
* node_modules. Returns the first absolute path found, or null.
|
|
@@ -56,14 +57,15 @@ export declare function detectPackageManager(root: string): string;
|
|
|
56
57
|
* @param subPath - Path relative to a node_modules dir, e.g. ".bin/wrangler"
|
|
57
58
|
* or "@cloudflare/vite-plugin"
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
declare function findInNodeModules(start: string, subPath: string): string | null;
|
|
60
61
|
/**
|
|
61
62
|
* Check if a vite.config file exists in the project root.
|
|
62
63
|
*/
|
|
63
|
-
|
|
64
|
+
declare function hasViteConfig(root: string): boolean;
|
|
64
65
|
/**
|
|
65
66
|
* Check if the project uses App Router (has an app/ directory).
|
|
66
67
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
declare function hasAppDir(root: string): boolean;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { detectPackageManager, detectPackageManagerName, ensureESModule, ensureViteConfigCompatibility, findInNodeModules, hasAppDir, hasViteConfig, renameCJSConfigs };
|
|
69
71
|
//# sourceMappingURL=project.d.ts.map
|