@lomray/vite-ssr-boost 8.0.0-beta.1 → 8.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/adapters/body.d.ts +1 -1
- package/adapters/body.js +1 -1
- package/adapters/body.js.map +1 -1
- package/adapters/compression.d.ts +5 -5
- package/adapters/compression.js +1 -1
- package/adapters/compression.js.map +1 -1
- package/adapters/edge.d.ts +5 -5
- package/adapters/edge.js.map +1 -1
- package/adapters/express/create-request.d.ts +2 -2
- package/adapters/express/create-request.js.map +1 -1
- package/adapters/express/entry.d.ts +17 -19
- package/adapters/express/entry.js.map +1 -1
- package/adapters/express/prepare-server.d.ts +7 -25
- package/adapters/express/prepare-server.js +1 -1
- package/adapters/express/prepare-server.js.map +1 -1
- package/adapters/express/render.d.ts +14 -15
- package/adapters/express/render.js +1 -1
- package/adapters/express/render.js.map +1 -1
- package/adapters/express/server.d.ts +5 -6
- package/adapters/express/server.js +1 -1
- package/adapters/express/server.js.map +1 -1
- package/adapters/express.d.ts +5 -5
- package/adapters/express.js.map +1 -1
- package/adapters/fastify.d.ts +5 -5
- package/adapters/fastify.js +1 -1
- package/adapters/fastify.js.map +1 -1
- package/adapters/hono.d.ts +2 -2
- package/adapters/hono.js.map +1 -1
- package/adapters/node.d.ts +6 -5
- package/adapters/node.js.map +1 -1
- package/browser/entry.d.ts +9 -9
- package/browser/entry.js +1 -1
- package/browser/entry.js.map +1 -1
- package/cli/build.d.ts +2 -2
- package/cli/build.js.map +1 -1
- package/cli/helpers/keyboard-input.d.ts +1 -1
- package/cli/helpers/keyboard-input.js +1 -1
- package/cli/helpers/keyboard-input.js.map +1 -1
- package/cli/helpers/vite-reset-cache.d.ts +1 -1
- package/cli/helpers/vite-reset-cache.js.map +1 -1
- package/cli/interfaces/actions.d.ts +8 -9
- package/cli/run-amplify-build.d.ts +1 -1
- package/cli/run-amplify-build.js.map +1 -1
- package/cli/run-dev.d.ts +3 -4
- package/cli/run-dev.js.map +1 -1
- package/cli/run-docker-build.d.ts +2 -2
- package/cli/run-docker-build.js.map +1 -1
- package/cli/run-prod.d.ts +4 -5
- package/cli/run-prod.js.map +1 -1
- package/cli/run-serverless.d.ts +2 -2
- package/cli/run-serverless.js.map +1 -1
- package/cli/run-vercel-build.d.ts +1 -1
- package/cli/run-vercel-build.js.map +1 -1
- package/cli.js +1 -1
- package/cli.js.map +1 -1
- package/components/navigate.d.ts +3 -3
- package/components/navigate.js.map +1 -1
- package/components/only-client.d.ts +2 -2
- package/components/only-client.js +1 -1
- package/components/only-client.js.map +1 -1
- package/components/render-client.d.ts +4 -4
- package/components/render-client.js +1 -1
- package/components/render-client.js.map +1 -1
- package/components/response-status.d.ts +2 -2
- package/components/response-status.js.map +1 -1
- package/components/scroll-to-top.d.ts +2 -2
- package/components/scroll-to-top.js +1 -1
- package/components/scroll-to-top.js.map +1 -1
- package/components/with-suspense.d.ts +3 -3
- package/components/with-suspense.js.map +1 -1
- package/constants/cli-actions.d.ts +1 -1
- package/constants/cli-actions.js.map +1 -1
- package/constants/cli-context.d.ts +4 -5
- package/constants/cli-context.js.map +1 -1
- package/constants/cli-name.d.ts +1 -1
- package/constants/cli-name.js.map +1 -1
- package/constants/cli-shortcuts.d.ts +2 -2
- package/constants/cli-shortcuts.js +1 -1
- package/constants/cli-shortcuts.js.map +1 -1
- package/constants/common.js.map +1 -1
- package/constants/plugin-name.d.ts +1 -1
- package/constants/plugin-name.js.map +1 -1
- package/constants/stream-error.d.ts +1 -1
- package/constants/stream-error.js.map +1 -1
- package/context/server.d.ts +3 -4
- package/context/server.js.map +1 -1
- package/core/compose-html.d.ts +2 -2
- package/core/compose-html.js.map +1 -1
- package/core/early-hints.d.ts +2 -2
- package/core/early-hints.js.map +1 -1
- package/core/handler.d.ts +3 -3
- package/core/handler.js.map +1 -1
- package/core/head-response.d.ts +1 -1
- package/core/head-response.js.map +1 -1
- package/core/headers.d.ts +3 -4
- package/core/headers.js +1 -1
- package/core/headers.js.map +1 -1
- package/core/render.d.ts +13 -13
- package/core/render.js +1 -1
- package/core/render.js.map +1 -1
- package/core/transform-html.d.ts +1 -1
- package/core/transform-html.js.map +1 -1
- package/core/types.d.ts +2 -3
- package/edge/render-to-stream.d.ts +2 -2
- package/edge/render-to-stream.js +1 -1
- package/edge/render-to-stream.js.map +1 -1
- package/helpers/build-custom-state.d.ts +1 -1
- package/helpers/build-custom-state.js +1 -1
- package/helpers/build-custom-state.js.map +1 -1
- package/helpers/build-router-state.d.ts +2 -2
- package/helpers/build-router-state.js.map +1 -1
- package/helpers/create-focus-only.d.ts +3 -3
- package/helpers/create-focus-only.js.map +1 -1
- package/helpers/dev-marker.d.ts +1 -1
- package/helpers/dev-marker.js.map +1 -1
- package/helpers/get-server-state.d.ts +1 -1
- package/helpers/get-server-state.js.map +1 -1
- package/helpers/html-escape.d.ts +1 -1
- package/helpers/html-escape.js +1 -1
- package/helpers/html-escape.js.map +1 -1
- package/helpers/import-route.d.ts +7 -7
- package/helpers/import-route.js +1 -1
- package/helpers/import-route.js.map +1 -1
- package/helpers/is-route-file.d.ts +1 -1
- package/helpers/is-route-file.js.map +1 -1
- package/helpers/obtain-stream-error.d.ts +3 -3
- package/helpers/obtain-stream-error.js.map +1 -1
- package/helpers/plugin-config.d.ts +5 -5
- package/helpers/plugin-config.js +1 -1
- package/helpers/plugin-config.js.map +1 -1
- package/helpers/print-server-info.d.ts +3 -4
- package/helpers/print-server-info.js +1 -1
- package/helpers/print-server-info.js.map +1 -1
- package/helpers/print-server-urls.d.ts +2 -2
- package/helpers/print-server-urls.js +1 -1
- package/helpers/print-server-urls.js.map +1 -1
- package/helpers/process-stop.d.ts +1 -1
- package/helpers/process-stop.js.map +1 -1
- package/helpers/resolve-server-urls.d.ts +3 -4
- package/helpers/resolve-server-urls.js +1 -1
- package/helpers/resolve-server-urls.js.map +1 -1
- package/helpers/serialize-errors.d.ts +2 -2
- package/helpers/serialize-errors.js.map +1 -1
- package/helpers/vite-aliases.d.ts +2 -2
- package/helpers/vite-aliases.js +1 -1
- package/helpers/vite-aliases.js.map +1 -1
- package/interfaces/fc-route.d.ts +4 -4
- package/interfaces/fc-route.js.map +1 -1
- package/interfaces/fc.d.ts +3 -4
- package/interfaces/route-object.d.ts +6 -6
- package/node/compress-response.d.ts +2 -2
- package/node/compress-response.js +1 -1
- package/node/compress-response.js.map +1 -1
- package/node/create-headers.d.ts +1 -1
- package/node/create-headers.js.map +1 -1
- package/node/create-request.d.ts +2 -2
- package/node/create-request.js.map +1 -1
- package/node/http.d.ts +4 -6
- package/node/render-to-stream.d.ts +2 -2
- package/node/render-to-stream.js +1 -1
- package/node/render-to-stream.js.map +1 -1
- package/node/request-signal.d.ts +2 -2
- package/node/request-signal.js.map +1 -1
- package/node/split-link-header.d.ts +1 -1
- package/node/split-link-header.js.map +1 -1
- package/node/write-early-hints.d.ts +2 -2
- package/node/write-early-hints.js.map +1 -1
- package/node/write-fetch-response.d.ts +3 -2
- package/node/write-fetch-response.js +1 -1
- package/node/write-fetch-response.js.map +1 -1
- package/package.json +52 -32
- package/plugin.d.ts +7 -7
- package/plugin.js.map +1 -1
- package/plugins/create-spa-index.d.ts +3 -3
- package/plugins/create-spa-index.js.map +1 -1
- package/plugins/handle-custom-entrypoint.d.ts +4 -4
- package/plugins/handle-custom-entrypoint.js +1 -1
- package/plugins/handle-custom-entrypoint.js.map +1 -1
- package/plugins/make-aliases.d.ts +3 -3
- package/plugins/make-aliases.js +1 -1
- package/plugins/make-aliases.js.map +1 -1
- package/plugins/normalize-route.d.ts +3 -3
- package/plugins/normalize-route.js.map +1 -1
- package/services/build.d.ts +5 -51
- package/services/build.js +1 -1
- package/services/build.js.map +1 -1
- package/services/logger.d.ts +2 -30
- package/services/logger.js.map +1 -1
- package/services/parse-routes.d.ts +5 -42
- package/services/parse-routes.js +1 -1
- package/services/parse-routes.js.map +1 -1
- package/services/path-normalize.d.ts +3 -18
- package/services/path-normalize.js +1 -1
- package/services/path-normalize.js.map +1 -1
- package/services/server-api.d.ts +1 -7
- package/services/server-api.js.map +1 -1
- package/services/server-config.d.ts +4 -48
- package/services/server-config.js +1 -1
- package/services/server-config.js.map +1 -1
- package/services/ssr-manifest.d.ts +6 -63
- package/services/ssr-manifest.js +1 -1
- package/services/ssr-manifest.js.map +1 -1
- package/workflow/Dockerfile +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StaticHandlerContext } from 'react-router';
|
|
1
|
+
import type { StaticHandlerContext } from 'react-router';
|
|
2
2
|
/**
|
|
3
3
|
* Build router state
|
|
4
4
|
*/
|
|
5
5
|
declare function buildRouterState(context: StaticHandlerContext): string;
|
|
6
|
-
export
|
|
6
|
+
export default buildRouterState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-router-state.js","sources":["../../src/helpers/build-router-state.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"build-router-state.js","sources":["../../src/helpers/build-router-state.ts"],"sourcesContent":[null],"names":["buildRouterState","context","loaderData","actionData","errors","routerState","serializeErrors","htmlEscape","JSON","stringify"],"mappings":"qEAOA,SAASA,EAAiBC,GACxB,MAAMC,WAAEA,EAAUC,WAAEA,EAAUC,OAAEA,GAAWH,EACrCI,EAAc,CAClBH,aACAC,aACAC,OAAQE,EAAgBF,IAI1B,MAAO,iEAFMG,EAAWC,KAAKC,UAAUD,KAAKC,UAAUJ,kBAGxD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IBuildParams } from
|
|
1
|
+
import type { IBuildParams } from '../services/build.js';
|
|
2
2
|
/**
|
|
3
3
|
* Small focus only helper to provide simple and useful methods to detect focus state
|
|
4
4
|
*/
|
|
5
|
-
declare const createFocusOnly: (focus: IBuildParams[
|
|
5
|
+
declare const createFocusOnly: (focus: IBuildParams["focusOnly"]) => {
|
|
6
6
|
isOnlyClient: () => boolean;
|
|
7
7
|
isClient: () => boolean;
|
|
8
8
|
isServer: () => boolean;
|
|
9
9
|
isEntrypoint: () => boolean;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export default createFocusOnly;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-focus-only.js","sources":["../../src/helpers/create-focus-only.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"create-focus-only.js","sources":["../../src/helpers/create-focus-only.ts"],"sourcesContent":[null],"names":["createFocusOnly","focus","isOnlyClient","isClient","includes","isServer","isEntrypoint"],"mappings":"AAKA,MAAMA,EAAmBC,IAAgC,CACvDC,aAAc,IAAgB,WAAVD,EACpBE,SAAU,IAAM,CAAC,MAAO,MAAO,UAAUC,SAASH,GAClDI,SAAU,IAAM,CAAC,MAAO,MAAO,UAAUD,SAASH,GAClDK,aAAc,IAAM,CAAC,MAAO,cAAcF,SAASH"}
|
package/helpers/dev-marker.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-marker.js","sources":["../../src/helpers/dev-marker.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"dev-marker.js","sources":["../../src/helpers/dev-marker.ts"],"sourcesContent":[null],"names":["getMarkerFile","root","withFile","filter","Boolean","join","createDevMarker","isProd","build","buildConf","buildRoot","path","resolve","outDir","devMarkerPath","devMarker","fs","existsSync","rmSync","mkdirSync","recursive","writeFileSync"],"mappings":"gDAIA,MAAMA,EAAgB,CAACC,EAAcC,GAAW,IAC9C,CAACD,EAAM,SAAUC,GAAY,QAAQC,OAAOC,SAASC,KAAK,KAOtDC,EAAkB,CAACC,GAAmBN,OAAMO,MAAOC,MACvD,MAAMC,EAAYC,EAAKC,QAAQX,EAAMQ,EAAUI,QACzCC,EAAgBd,EAAcU,GAAW,GACzCK,EAAYf,EAAcU,GAE3BH,EAMMS,EAAGC,WAAWF,IACvBC,EAAGE,OAAOH,IANLC,EAAGC,WAAWH,IACjBE,EAAGG,UAAUL,EAAe,CAAEM,WAAW,IAG3CJ,EAAGK,cAAcN,EAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-server-state.js","sources":["../../src/helpers/get-server-state.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"get-server-state.js","sources":["../../src/helpers/get-server-state.ts"],"sourcesContent":[null],"names":["getServerState","name","shouldRemove","data","window"],"mappings":"AAGA,MAAMA,EAAiB,CAA2BC,EAAcC,GAAe,KAC7E,MAAMC,EAAQC,OAA4BH,GAM1C,OAJIC,GAAgBC,UACVC,OAA4BH,GAG9BE,GAAQ,CAAA"}
|
package/helpers/html-escape.d.ts
CHANGED
package/helpers/html-escape.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const u={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},e=/[&><\u2028\u2029]/g,a=a=>a.replace(e,
|
|
1
|
+
const u={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},e=/[&><\u2028\u2029]/g,a=a=>a.replace(e,e=>u[e]);export{a as default};
|
|
2
2
|
//# sourceMappingURL=html-escape.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-escape.js","sources":["../../src/helpers/html-escape.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"html-escape.js","sources":["../../src/helpers/html-escape.ts"],"sourcesContent":[null],"names":["ESCAPE_LOOKUP","ESCAPE_REGEX","htmlEscape","str","replace","match"],"mappings":"AAAA,MAAMA,EAA6C,CACjD,IAAK,UACL,IAAK,UACL,IAAK,UACL,SAAU,UACV,SAAU,WAENC,EAAe,qBAMfC,EAAcC,GACXA,EAAIC,QAAQH,EAAeI,GAAUL,EAAcK"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { IndexRouteObject, NonIndexRouteObject } from 'react-router';
|
|
2
|
-
import { FCCRoute, FCRoute } from
|
|
3
|
-
import { TOnlyClientProp } from
|
|
4
|
-
type IDynamicRoute = () => Promise<{
|
|
1
|
+
import type { IndexRouteObject, NonIndexRouteObject } from 'react-router';
|
|
2
|
+
import type { FCCRoute, FCRoute } from '../interfaces/fc-route.js';
|
|
3
|
+
import type { TOnlyClientProp } from '../interfaces/route-object.js';
|
|
4
|
+
export type IDynamicRoute = () => Promise<{
|
|
5
5
|
default: FCRoute | FCCRoute<any>;
|
|
6
6
|
}>;
|
|
7
|
-
type ImmutableRouteKey = 'lazy' | 'caseSensitive' | 'path' | 'id' | 'index' | 'children';
|
|
8
|
-
type IAsyncRoute = {
|
|
7
|
+
export type ImmutableRouteKey = 'lazy' | 'caseSensitive' | 'path' | 'id' | 'index' | 'children';
|
|
8
|
+
export type IAsyncRoute = {
|
|
9
9
|
pathId?: string;
|
|
10
10
|
} & (Omit<IndexRouteObject, ImmutableRouteKey> | Omit<NonIndexRouteObject, ImmutableRouteKey>);
|
|
11
11
|
/**
|
|
12
12
|
* Import dynamic route
|
|
13
13
|
*/
|
|
14
14
|
declare const importRoute: (route: IDynamicRoute, onlyClient?: TOnlyClientProp) => (() => Promise<IAsyncRoute>);
|
|
15
|
-
export
|
|
15
|
+
export default importRoute;
|
package/helpers/import-route.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{isValidElement as o}from"react";import n from"../components/render-client.js";import t from"../components/with-suspense.js";import{IS_SERVER as e}from"../constants/common.js";import{keys as m}from"../interfaces/fc-route.js";const p=(p,r)=>async()=>{const s=(n=>o(n)?{element:n}:"function"!=typeof n&&"object"!=typeof n||null===n?{Component:null}:{Component:n})(r);if(r&&e)return s;const c=await p();if("Component"in c){const o=r?n(c.Component,s):c.Component;return{...c,Component:o}}const f=c.default,i={Component:f};return m.forEach(
|
|
1
|
+
import{isValidElement as o}from"react";import n from"../components/render-client.js";import t from"../components/with-suspense.js";import{IS_SERVER as e}from"../constants/common.js";import{keys as m}from"../interfaces/fc-route.js";const p=(p,r)=>async()=>{const s=(n=>o(n)?{element:n}:"function"!=typeof n&&"object"!=typeof n||null===n?{Component:null}:{Component:n})(r);if(r&&e)return s;const c=await p();if("Component"in c){const o=r?n(c.Component,s):c.Component;return{...c,Component:o}}const f=c.default,i={Component:f};return m.forEach(o=>{f[o]&&(i[o]=f[o])}),f.Suspense&&(i.Component=t(f,f.Suspense)),r&&(i.Component=n(i.Component,s)),i};export{p as default};
|
|
2
2
|
//# sourceMappingURL=import-route.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-route.js","sources":["../../src/helpers/import-route.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"import-route.js","sources":["../../src/helpers/import-route.ts"],"sourcesContent":[null],"names":["importRoute","route","onlyClient","async","Fallback","isValidElement","element","Component","getFallback","IS_SERVER","resolved","renderClient","default","result","keys","forEach","key","Suspense","withSuspense"],"mappings":"uOAqBA,MAiBMA,EAAc,CAClBC,EACAC,IAEOC,UACL,MAAMC,EAtBU,CAClBA,GAEIC,EAAeD,GACV,CAAEE,QAASF,GAGK,mBAAbA,GAA+C,iBAAbA,GAAuC,OAAbA,EAIjE,CAAEG,UAAW,MAHX,CAAEA,UAAWH,GAcHI,CAAYN,GAE7B,GAAIA,GAAcO,EAChB,OAAOL,EAGT,MAAMM,QAAiBT,IAGvB,GAAI,cAAeS,EAAU,CAC3B,MAAMH,EAAYL,EACdS,EAAaD,EAASH,UAAsCH,GAC5DM,EAASH,UAEb,MAAO,IAAKG,EAAUH,YACxB,CAEA,MAAMA,EAAYG,EAASE,QACrBC,EAAsB,CAAEN,aAiB9B,OAfAO,EAAKC,QAASC,IACRT,EAAUS,KAEZH,EAAOG,GAAOT,EAAUS,MAIxBT,EAAUU,WACZJ,EAAON,UAAYW,EAAaX,EAAWA,EAAUU,WAGnDf,IACFW,EAAON,UAAYI,EAAaE,EAAON,UAAsCH,IAGxES"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-route-file.js","sources":["../../src/helpers/is-route-file.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"is-route-file.js","sources":["../../src/helpers/is-route-file.ts"],"sourcesContent":[null],"names":["isRoutesFile","code","test"],"mappings":"AAGA,MAAMA,EAAgBC,GACpB,+FAA+FC,KAC7FD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import StreamError from
|
|
2
|
-
interface IObtainStreamErrorOut {
|
|
1
|
+
import StreamError from '../constants/stream-error.js';
|
|
2
|
+
export interface IObtainStreamErrorOut {
|
|
3
3
|
code: StreamError;
|
|
4
4
|
message: string;
|
|
5
5
|
original: unknown;
|
|
@@ -8,4 +8,4 @@ interface IObtainStreamErrorOut {
|
|
|
8
8
|
* Get react stream error
|
|
9
9
|
*/
|
|
10
10
|
declare const obtainStreamError: (err: unknown) => IObtainStreamErrorOut;
|
|
11
|
-
export
|
|
11
|
+
export default obtainStreamError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obtain-stream-error.js","sources":["../../src/helpers/obtain-stream-error.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"obtain-stream-error.js","sources":["../../src/helpers/obtain-stream-error.ts"],"sourcesContent":[null],"names":["obtainStreamError","err","message","replace","name","code","StreamError","RenderAborted","original","RenderSkip","Unknown"],"mappings":"4CAWA,MAAMA,EAAqBC,IACzB,MAAMC,GAAYD,GAAeC,SAAW,YAAYC,QAAQ,UAAW,IAE3E,MAC2B,eAAxBF,GAAeG,MACJ,2DAAZF,EAEO,CACLG,KAAMC,EAAYC,cAClBL,UACAM,SAAUP,GAES,yCAAZC,EACF,CACLG,KAAMC,EAAYG,WAClBP,UACAM,SAAUP,GAIP,CACLI,KAAMC,EAAYI,QAClBR,QAASA,GAAW,gBACpBM,SAAUP"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ResolvedConfig } from 'vite';
|
|
2
|
-
import CliActions from
|
|
3
|
-
import { IPluginOptions } from
|
|
4
|
-
interface IPluginConfig extends Required<IPluginOptions> {
|
|
1
|
+
import type { ResolvedConfig } from 'vite';
|
|
2
|
+
import type CliActions from '../constants/cli-actions.js';
|
|
3
|
+
import type { IPluginOptions } from '../plugin.js';
|
|
4
|
+
export interface IPluginConfig extends Required<IPluginOptions> {
|
|
5
5
|
pluginPath: string;
|
|
6
6
|
action: CliActions;
|
|
7
7
|
isDev: boolean;
|
|
@@ -10,4 +10,4 @@ interface IPluginConfig extends Required<IPluginOptions> {
|
|
|
10
10
|
* Get plugin config from vite config
|
|
11
11
|
*/
|
|
12
12
|
declare function getPluginConfig(viteConfig: ResolvedConfig): IPluginConfig;
|
|
13
|
-
export
|
|
13
|
+
export default getPluginConfig;
|
package/helpers/plugin-config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import n from"../constants/plugin-name.js";function t(t){const o=t.plugins.find(
|
|
1
|
+
import n from"../constants/plugin-name.js";function t(t){const o=t.plugins.find(t=>t.name===n),i=o?.pluginOptions;if(!i)throw new Error(`Failed to get to plugin config. Make sure you add the plugin '${n}' to the VITE config.`);return i}export{t as default};
|
|
2
2
|
//# sourceMappingURL=plugin-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-config.js","sources":["../../src/helpers/plugin-config.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"plugin-config.js","sources":["../../src/helpers/plugin-config.ts"],"sourcesContent":[null],"names":["getPluginConfig","viteConfig","pluginConfig","plugins","find","plugin","name","PLUGIN_NAME","pluginOptions","Error"],"mappings":"2CAcA,SAASA,EAAgBC,GACvB,MAAMC,EAAeD,EAAWE,QAAQC,KACrCC,GAAWA,EAAOC,OAASC,GAExBC,EAAgBN,GAAcM,cAEpC,IAAKA,EACH,MAAM,IAAIC,MACR,iEAAiEF,0BAIrE,OAAOC,CACT"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import ServerConfig from "../services/server-config.js";
|
|
1
|
+
import type { Server } from 'node:net';
|
|
2
|
+
import type ServerConfig from '../services/server-config.js';
|
|
4
3
|
interface IPrintServerInfoParams {
|
|
5
4
|
version?: string;
|
|
6
5
|
server?: Server;
|
|
@@ -9,4 +8,4 @@ interface IPrintServerInfoParams {
|
|
|
9
8
|
* Print server info
|
|
10
9
|
*/
|
|
11
10
|
declare function printServerInfo(config: ServerConfig, { server, version }?: IPrintServerInfoParams): Promise<void>;
|
|
12
|
-
export
|
|
11
|
+
export default printServerInfo;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"node:fs";import{performance as o}from"node:perf_hooks";import r from"chalk";import s from"../constants/cli-actions.js";import t from"../constants/cli-name.js";import{getMarkerFile as i}from"./dev-marker.js";import n from"./print-server-urls.js";import m from"./resolve-server-urls.js";async function a(a,{server:d,version:l="unknown"}={}){const{action:p}=a.getPluginConfig()??{},{isProd:f,host:c,root:g,isSPA:v}=a.getParams(),h=i(g),u=a.getLogger(),w=global.viteBoostStartTime??o.now(),b=r.dim(`ready in ${r.reset(r.bold(Math.ceil(o.now()-w)))} ms`);u.info(`\n ${r.green(`${r.bold(t.toUpperCase())} v${l}`)} ${b}\n`,{clear:!u.hasWarned});const S=a.getVite()?.config,$=!S?.mode&&!e.existsSync(h),j=d?await m(d,{host:c,isHttps:Boolean(S?.server.https),rawBase:S?.rawBase}):null,P=S?.mode||$?a.mode:`production ${r.red("NODE_ENV=development")}`,k=v?"SPA":"SSR";if(u.info(r.dim(r.green(" ➜"))+r.dim(" Mode: ")+r.blue(P)),u.info(r.dim(r.green(" ➜"))+r.dim(" Type: ")+r.blue(k)),f)j&&n(j,
|
|
1
|
+
import e from"node:fs";import{performance as o}from"node:perf_hooks";import r from"chalk";import s from"../constants/cli-actions.js";import t from"../constants/cli-name.js";import{getMarkerFile as i}from"./dev-marker.js";import n from"./print-server-urls.js";import m from"./resolve-server-urls.js";async function a(a,{server:d,version:l="unknown"}={}){const{action:p}=a.getPluginConfig()??{},{isProd:f,host:c,root:g,isSPA:v}=a.getParams(),h=i(g),u=a.getLogger(),w=global.viteBoostStartTime??o.now(),b=r.dim(`ready in ${r.reset(r.bold(Math.ceil(o.now()-w)))} ms`);u.info(`\n ${r.green(`${r.bold(t.toUpperCase())} v${l}`)} ${b}\n`,{clear:!u.hasWarned});const S=a.getVite()?.config,$=!S?.mode&&!e.existsSync(h),j=d?await m(d,{host:c,isHttps:Boolean(S?.server.https),rawBase:S?.rawBase}):null,P=S?.mode||$?a.mode:`production ${r.red("NODE_ENV=development")}`,k=v?"SPA":"SSR";if(u.info(r.dim(r.green(" ➜"))+r.dim(" Mode: ")+r.blue(P)),u.info(r.dim(r.green(" ➜"))+r.dim(" Type: ")+r.blue(k)),f)j&&n(j,e=>u.info(e));else{const e=a.getVite();e.resolvedUrls=j,e.printUrls()}p===s.dev&&u.info(r.dim(r.green(" ➜"))+r.dim(" press ")+r.bold("h")+r.dim(" to show help"))}export{a as default};
|
|
2
2
|
//# sourceMappingURL=print-server-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-server-info.js","sources":["../../src/helpers/print-server-info.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"print-server-info.js","sources":["../../src/helpers/print-server-info.ts"],"sourcesContent":[null],"names":["async","printServerInfo","config","server","version","action","getPluginConfig","isProd","host","root","isSPA","getParams","devMarker","getMarkerFile","Logger","getLogger","perfStart","global","viteBoostStartTime","performance","now","startupDurationString","chalk","dim","reset","bold","Math","ceil","info","green","cliName","toUpperCase","clear","hasWarned","viteConfig","getVite","isProdBuild","mode","fs","existsSync","resolvedUrls","resolveServerUrls","isHttps","Boolean","https","rawBase","red","type","blue","printServerUrls","msg","vite","printUrls","CliActions","dev"],"mappings":"2SAoBAA,eAAeC,EACbC,GACAC,OAAEA,EAAMC,QAAEA,EAAU,WAAsC,IAE1D,MAAMC,OAAEA,GAAWH,EAAOI,mBAAqB,CAAA,GACzCC,OAAEA,EAAMC,KAAEA,EAAIC,KAAEA,EAAIC,MAAEA,GAAUR,EAAOS,YACvCC,EAAYC,EAAcJ,GAE1BK,EAASZ,EAAOa,YAChBC,EAAYC,OAAOC,oBAAsBC,EAAYC,MACrDC,EAAwBC,EAAMC,IAClC,YAAYD,EAAME,MAAMF,EAAMG,KAAKC,KAAKC,KAAKR,EAAYC,MAAQJ,WAGnEF,EAAOc,KACL,OAAON,EAAMO,MACX,GAAGP,EAAMG,KAAKK,EAAQC,mBAAmB3B,SACrCiB,MACN,CAAEW,OAAQlB,EAAOmB,YAGnB,MAAMC,EAAkEhC,EAAOiC,WAAWjC,OACpFkC,GAAeF,GAAYG,OAASC,EAAGC,WAAW3B,GAClD4B,EAAerC,QACXsC,EAAkBtC,EAAQ,CAC9BK,OACAkC,QAASC,QAAQT,GAAY/B,OAAOyC,OACpCC,QAASX,GAAYW,UAEvB,KACER,EACJH,GAAYG,MAAQD,EAChBlC,EAAOmC,KACP,cAAcf,EAAMwB,IAAI,0BACxBC,EAAOrC,EAAQ,MAAQ,MAK7B,GAHAI,EAAOc,KAAKN,EAAMC,IAAID,EAAMO,MAAM,QAAUP,EAAMC,IAAI,eAAiBD,EAAM0B,KAAKX,IAClFvB,EAAOc,KAAKN,EAAMC,IAAID,EAAMO,MAAM,QAAUP,EAAMC,IAAI,eAAiBD,EAAM0B,KAAKD,IAE7ExC,EAKMiC,GACTS,EAAgBT,EAAeU,GAAQpC,EAAOc,KAAKsB,QANxC,CACX,MAAMC,EAAOjD,EAAOiC,UAEpBgB,EAAKX,aAAeA,EACpBW,EAAKC,WACP,CAII/C,IAAWgD,EAAWC,KACxBxC,EAAOc,KACLN,EAAMC,IAAID,EAAMO,MAAM,QACpBP,EAAMC,IAAI,YACVD,EAAMG,KAAK,KACXH,EAAMC,IAAI,iBAGlB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Logger, ResolvedServerUrls } from 'vite';
|
|
1
|
+
import type { Logger, ResolvedServerUrls } from 'vite';
|
|
2
2
|
/**
|
|
3
3
|
* Print server urls
|
|
4
4
|
* @see https://github.com/vitejs/vite/blob/711dd807610b39538e9955970145d52e4ca1d8c0/packages/vite/src/node/logger.ts#LL142C1-L162C2
|
|
5
5
|
* vite not export this function
|
|
6
6
|
*/
|
|
7
7
|
declare function printServerUrls(urls: ResolvedServerUrls, info: Logger['info']): void;
|
|
8
|
-
export
|
|
8
|
+
export default printServerUrls;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import o from"chalk";function e(e,n){const r=e=>o.cyan(e.replace(/:(\d+)\//,(
|
|
1
|
+
import o from"chalk";function e(e,n){const r=e=>o.cyan(e.replace(/:(\d+)\//,(e,n)=>`:${o.bold(n)}/`));for(const c of e.local)n(` ${o.green("➜")} ${o.bold("Local")}: ${r(c)}`);for(const c of e.network)n(` ${o.green("➜")} ${o.bold("Network")}: ${r(c)}`);n("\n")}export{e as default};
|
|
2
2
|
//# sourceMappingURL=print-server-urls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"print-server-urls.js","sources":["../../src/helpers/print-server-urls.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"print-server-urls.js","sources":["../../src/helpers/print-server-urls.ts"],"sourcesContent":[null],"names":["printServerUrls","urls","info","colorUrl","url","chalk","cyan","replace","_","port","bold","local","green","network"],"mappings":"qBAQA,SAASA,EAAgBC,EAA0BC,GACjD,MAAMC,EAAYC,GAChBC,EAAMC,KAAKF,EAAIG,QAAQ,WAAY,CAACC,EAAGC,IAAS,IAAIJ,EAAMK,KAAKD,QACjE,IAAK,MAAML,KAAOH,EAAKU,MACrBT,EAAK,KAAKG,EAAMO,MAAM,SAASP,EAAMK,KAAK,eAAeP,EAASC,MAEpE,IAAK,MAAMA,KAAOH,EAAKY,QACrBX,EAAK,KAAKG,EAAMO,MAAM,SAASP,EAAMK,KAAK,eAAeP,EAASC,MAGpEF,EAAK,KACP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-stop.js","sources":["../../src/helpers/process-stop.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"process-stop.js","sources":["../../src/helpers/process-stop.ts"],"sourcesContent":[null],"names":["processStop","code","isOnlyError","console","error","process","exit"],"mappings":"4BAKA,MAAMA,EAAc,CAACC,EAA+B,EAAGC,GAAc,KACnE,IAAIA,GAAyB,IAATD,GAAuB,OAATA,EAIlC,MAAoB,iBAATA,GACTE,QAAQC,MAAMH,GAEPI,EAAQC,KAAK,SAGtBD,EAAQC,KAAc,OAATL,EAAgB,EAAIA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { ResolvedServerUrls } from 'vite';
|
|
1
|
+
import type { Server } from 'node:net';
|
|
2
|
+
import type { ResolvedServerUrls } from 'vite';
|
|
4
3
|
interface IResolveServerUrlsOptions {
|
|
5
4
|
host: string;
|
|
6
5
|
isHttps?: boolean;
|
|
@@ -12,4 +11,4 @@ interface IResolveServerUrlsOptions {
|
|
|
12
11
|
* vite not export this function
|
|
13
12
|
*/
|
|
14
13
|
declare function resolveServerUrls(server: Server, options: IResolveServerUrlsOptions): Promise<ResolvedServerUrls>;
|
|
15
|
-
export
|
|
14
|
+
export default resolveServerUrls;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{promises as s}from"node:dns";import o from"node:os";const t=new Set(["localhost","127.0.0.1","::1","0000:0000:0000:0000:0000:0000:0000:0001"]),a=new Set(["0.0.0.0","::","0000:0000:0000:0000:0000:0000:0000:0000"]);async function e(o){let t;t=void 0===o||!1===o?"localhost":!0===o?void 0:o;let e=void 0===t||a.has(t)?"localhost":t;if("localhost"===t){const o=await async function(){const[o,t]=await Promise.all([s.lookup("localhost"),s.lookup("localhost",{verbatim:!0})]);return o.family===t.family&&o.address===t.address?void 0:o.address}();o&&(e=o)}return{host:t,name:e}}async function l(s,l){const n=s.address();if("object"!=typeof(r=n)||!Boolean(r?.address))return{local:[],network:[]};var r;const{host:c,isHttps:d,rawBase:i}=l,h=[],f=[],u=await e(c),p=d?"https":"http",{port:m}=n,$="./"!==i&&""!==i&&i?i:"/";if(void 0===u.host||a.has(u.host))Object.values(o.networkInterfaces()).flatMap(
|
|
1
|
+
import{promises as s}from"node:dns";import o from"node:os";const t=new Set(["localhost","127.0.0.1","::1","0000:0000:0000:0000:0000:0000:0000:0001"]),a=new Set(["0.0.0.0","::","0000:0000:0000:0000:0000:0000:0000:0000"]);async function e(o){let t;t=void 0===o||!1===o?"localhost":!0===o?void 0:o;let e=void 0===t||a.has(t)?"localhost":t;if("localhost"===t){const o=await async function(){const[o,t]=await Promise.all([s.lookup("localhost"),s.lookup("localhost",{verbatim:!0})]);return o.family===t.family&&o.address===t.address?void 0:o.address}();o&&(e=o)}return{host:t,name:e}}async function l(s,l){const n=s.address();if("object"!=typeof(r=n)||!Boolean(r?.address))return{local:[],network:[]};var r;const{host:c,isHttps:d,rawBase:i}=l,h=[],f=[],u=await e(c),p=d?"https":"http",{port:m}=n,$="./"!==i&&""!==i&&i?i:"/";if(void 0===u.host||a.has(u.host))Object.values(o.networkInterfaces()).flatMap(s=>s??[]).filter(s=>s&&s.address&&("IPv4"===s.family||4===s.family)).forEach(s=>{let o=s.address.replace("127.0.0.1",u.name);o.includes(":")&&(o=`[${o}]`);const t=`${p}://${o}:${m}${$}`;s.address.includes("127.0.0.1")?h.push(t):f.push(t)});else{let s=u.name;s.includes(":")&&(s=`[${s}]`);const o=`${p}://${s}:${m}${$}`;t.has(u.host)?h.push(o):f.push(o)}return{local:h,network:f}}export{l as default};
|
|
2
2
|
//# sourceMappingURL=resolve-server-urls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-server-urls.js","sources":["../../src/helpers/resolve-server-urls.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"resolve-server-urls.js","sources":["../../src/helpers/resolve-server-urls.ts"],"sourcesContent":[null],"names":["loopbackHosts","Set","wildcardHosts","async","resolveHostname","optionsHost","host","undefined","name","has","localhostAddr","nodeResult","dnsResult","Promise","all","dns","lookup","verbatim","family","address","getLocalhostAddressIfDiffersFromDNS","resolveServerUrls","server","options","x","Boolean","local","network","isHttps","rawBase","hostname","protocol","port","base","Object","values","os","networkInterfaces","flatMap","nInterface","filter","detail","forEach","resultHost","replace","includes","url","push","hostnameName","addressUrl"],"mappings":"2DAUA,MAAMA,EAAgB,IAAIC,IAAI,CAC5B,YACA,YACA,MACA,4CAGIC,EAAgB,IAAID,IAAI,CAAC,UAAW,KAAM,4CAoBhDE,eAAeC,EAAgBC,GAC7B,IAAIC,EAIFA,OAFkBC,IAAhBF,IAA6C,IAAhBA,EAExB,aACkB,IAAhBA,OAEFE,EAEAF,EAIT,IAAIG,OAAgBD,IAATD,GAAsBJ,EAAcO,IAAIH,GAAQ,YAAcA,EAEzE,GAAa,cAATA,EAAsB,CAExB,MAAMI,QAjCVP,iBACE,MAAOQ,EAAYC,SAAmBC,QAAQC,IAAI,CAChDC,EAAIC,OAAO,aACXD,EAAIC,OAAO,YAAa,CAAEC,UAAU,MAItC,OAFeN,EAAWO,SAAWN,EAAUM,QAAUP,EAAWQ,UAAYP,EAAUO,aAE1EZ,EAAYI,EAAWQ,OACzC,CAyBgCC,GAExBV,IACFF,EAAOE,EAEX,CAEA,MAAO,CAAEJ,OAAME,OACjB,CAaAL,eAAekB,EACbC,EACAC,GAEA,MAAMJ,EAAUG,EAAOH,UAKvB,GAFgB,iBADOK,EAGJL,KAFSM,QAAQD,GAAGL,SAGrC,MAAO,CAAEO,MAAO,GAAIC,QAAS,IAJT,IAACH,EAOvB,MAAMlB,KAAEA,EAAIsB,QAAEA,EAAOC,QAAEA,GAAYN,EAE7BG,EAAkB,GAClBC,EAAoB,GACpBG,QAAiB1B,EAAgBE,GACjCyB,EAAWH,EAAU,QAAU,QAC/BI,KAAEA,GAASb,EACXc,EAAmB,OAAZJ,GAAgC,KAAZA,GAAmBA,EAAgBA,EAAN,IAE9D,QAAsBtB,IAAlBuB,EAASxB,MAAuBJ,EAAcO,IAAIqB,EAASxB,MAgB7D4B,OAAOC,OAAOC,EAAGC,qBACdC,QAASC,GAAeA,GAAc,IACtCC,OACEC,GACCA,GACAA,EAAOtB,UACY,SAAlBsB,EAAOvB,QAEY,IAAlBuB,EAAOvB,SAEZwB,QAASD,IACR,IAAIE,EAAaF,EAAOtB,QAAQyB,QAAQ,YAAad,EAAStB,MAG1DmC,EAAWE,SAAS,OACtBF,EAAa,IAAIA,MAGnB,MAAMG,EAAM,GAAGf,OAAcY,KAAcX,IAAOC,IAE9CQ,EAAOtB,QAAQ0B,SAAS,aAC1BnB,EAAMqB,KAAKD,GAEXnB,EAAQoB,KAAKD,SAvCiD,CACpE,IAAIE,EAAelB,EAAStB,KAGxBwC,EAAaH,SAAS,OACxBG,EAAe,IAAIA,MAGrB,MAAMC,EAAa,GAAGlB,OAAciB,KAAgBhB,IAAOC,IAEvDjC,EAAcS,IAAIqB,EAASxB,MAC7BoB,EAAMqB,KAAKE,GAEXtB,EAAQoB,KAAKE,EAEjB,CA6BA,MAAO,CAAEvB,QAAOC,UAClB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { StaticHandlerContext } from 'react-router';
|
|
1
|
+
import type { StaticHandlerContext } from 'react-router';
|
|
2
2
|
/**
|
|
3
3
|
* Serialize react router errors
|
|
4
4
|
* @see https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/server.tsx#LL166C1-L188C2
|
|
5
5
|
* https://github.com/remix-run/react-router/blob/main/LICENSE.md
|
|
6
6
|
*/
|
|
7
7
|
declare function serializeErrors(errors: StaticHandlerContext['errors']): StaticHandlerContext['errors'];
|
|
8
|
-
export
|
|
8
|
+
export default serializeErrors;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize-errors.js","sources":["../../src/helpers/serialize-errors.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"serialize-errors.js","sources":["../../src/helpers/serialize-errors.ts"],"sourcesContent":[null],"names":["serializeErrors","errors","entries","Object","serialized","key","val","isRouteErrorResponse","__type","Error","message"],"mappings":"oDAQA,SAASA,EAAgBC,GACvB,IAAKA,EACH,OAAO,KAGT,MAAMC,EAAUC,OAAOD,QAAQD,GACzBG,EAA6C,CAAA,EACnD,IAAK,MAAOC,EAAKC,KAAQJ,EAGnBK,EAAqBD,GACvBF,EAAWC,GAAO,IAAKC,EAAKE,OAAQ,sBAC3BF,aAAeG,MAExBL,EAAWC,GAAO,CAChBK,QAASJ,EAAII,QACbF,OAAQ,SAGVJ,EAAWC,GAAOC,EAItB,OAAOF,CACT"}
|
package/helpers/vite-aliases.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{fileURLToPath as e,URL as r,pathToFileURL as t}from"node:url";const a=e=>e.replace("./","/").replace(/([^:]\/)\/+/g,"$1"),o=(o,p="")=>o.map((
|
|
1
|
+
import{fileURLToPath as e,URL as r,pathToFileURL as t}from"node:url";const a=e=>e.replace("./","/").replace(/([^:]\/)\/+/g,"$1"),o=(o,p="")=>o.map(([o,l])=>({find:o,replacement:e(new r(t(`${p}${a(l)}`).toString(),import.meta.url))}));export{o as default};
|
|
2
2
|
//# sourceMappingURL=vite-aliases.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-aliases.js","sources":["../../src/helpers/vite-aliases.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"vite-aliases.js","sources":["../../src/helpers/vite-aliases.ts"],"sourcesContent":[null],"names":["cleanupPath","path","replace","viteAliases","aliases","root","map","find","replacement","fileURLToPath","URL","pathToFileURL","toString","url"],"mappings":"qEAGA,MAAMA,EAAeC,GAAiBA,EAAKC,QAAQ,KAAM,KAAKA,QAAQ,eAAgB,MAKhFC,EAAc,CAACC,EAA6BC,EAAO,KACvDD,EAAQE,IAAI,EAAEC,EAAMN,MAAK,CACvBM,OACAC,YAAaC,EACX,IAAIC,EAAIC,EAAc,GAAGN,IAAOL,EAAYC,MAASW,uBAAwBC"}
|
package/interfaces/fc-route.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
import { RouteObject } from 'react-router';
|
|
3
|
-
import { IRequestContext } from
|
|
4
|
-
import { FCC } from
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import type { RouteObject } from 'react-router';
|
|
3
|
+
import type { IRequestContext } from '../adapters/express/render.js';
|
|
4
|
+
import type { FCC } from './fc.js';
|
|
5
5
|
declare module 'react-router' {
|
|
6
6
|
interface LoaderFunctionArgs {
|
|
7
7
|
context?: IRequestContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fc-route.js","sources":["../../src/interfaces/fc-route.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"fc-route.js","sources":["../../src/interfaces/fc-route.ts"],"sourcesContent":[null],"names":["keys"],"mappings":"AAiBA,MAAMA,EAAO,CAAC,SAAU,SAAU,gBAAiB"}
|
package/interfaces/fc.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
type FCC<T extends Record<string, any>> = FC<PropsWithChildren<T>>;
|
|
3
|
-
type FCAny<T extends Record<string, any>> = FC<T> | FCC<T>;
|
|
4
|
-
export { FCC, FCAny };
|
|
1
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
2
|
+
export type FCC<T extends Record<string, any>> = FC<PropsWithChildren<T>>;
|
|
3
|
+
export type FCAny<T extends Record<string, any>> = FC<T> | FCC<T>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { RouteObject, LazyRouteFunction, RouterInit } from 'react-router';
|
|
2
|
-
import { IDynamicRoute } from
|
|
1
|
+
import type { RouteObject, LazyRouteFunction, RouterInit } from 'react-router';
|
|
2
|
+
import type { IDynamicRoute } from '../helpers/import-route.js';
|
|
3
3
|
type LazyRoute = LazyRouteFunction<RouterInit['routes'][number]>;
|
|
4
|
-
type TOnlyClientProp = RouteObject['Component'] | RouteObject['element'];
|
|
5
|
-
type TRouteObjectNR = Omit<RouteObject, 'lazy' | 'children'> & {
|
|
4
|
+
export type TOnlyClientProp = RouteObject['Component'] | RouteObject['element'];
|
|
5
|
+
export type TRouteObjectNR = Omit<RouteObject, 'lazy' | 'children'> & {
|
|
6
6
|
lazy?: IDynamicRoute | LazyRoute;
|
|
7
7
|
onlyClient?: TOnlyClientProp;
|
|
8
8
|
children?: TRouteObject[];
|
|
9
9
|
};
|
|
10
|
-
type TRouteObject = (Omit<RouteObject, 'lazy'> & {
|
|
10
|
+
export type TRouteObject = (Omit<RouteObject, 'lazy'> & {
|
|
11
11
|
lazy: LazyRoute;
|
|
12
12
|
}) | TRouteObjectNR;
|
|
13
|
-
export {
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TCompression } from
|
|
1
|
+
import type { TCompression } from '../adapters/compression.js';
|
|
2
2
|
/**
|
|
3
3
|
* Flush each compressed chunk so browsers can render the shell while React is suspended.
|
|
4
4
|
*/
|
|
5
5
|
declare const compressNodeResponse: (request: Request, response: Response, compression?: TCompression) => Response;
|
|
6
|
-
export
|
|
6
|
+
export default compressNodeResponse;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Writable as e,Readable as r}from"node:stream";import{constants as t,createGzip as a,createDeflate as o}from"node:zlib";import s from"../adapters/compression.js";const i=(i,m,b)=>s(i,m,b,
|
|
1
|
+
import{Writable as e,Readable as r}from"node:stream";import{constants as t,createGzip as a,createDeflate as o}from"node:zlib";import s from"../adapters/compression.js";const i=(i,m,b)=>s(i,m,b,s=>{const i=("gzip"===s?a:o)({flush:t.Z_SYNC_FLUSH});return{readable:r.toWeb(i,{strategy:{highWaterMark:i.readableHighWaterMark,size:e=>e.byteLength}}),writable:e.toWeb(i)}});export{i as default};
|
|
2
2
|
//# sourceMappingURL=compress-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress-response.js","sources":["../../src/node/compress-response.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"compress-response.js","sources":["../../src/node/compress-response.ts"],"sourcesContent":[null],"names":["compressNodeResponse","request","response","compression","compressResponse","format","stream","createGzip","createDeflate","flush","constants","Z_SYNC_FLUSH","readable","Readable","toWeb","strategy","highWaterMark","readableHighWaterMark","size","chunk","byteLength","writable","Writable"],"mappings":"wKAQA,MAAMA,EAAuB,CAC3BC,EACAC,EACAC,IAEAC,EAAiBH,EAASC,EAAUC,EAAcE,IAChD,MACMC,GADoB,SAAXD,EAAoBE,EAAaC,GAC1B,CAAEC,MAAOC,EAAUC,eAEzC,MAAO,CACLC,SAAUC,EAASC,MAAMR,EAAQ,CAC/BS,SAAU,CACRC,cAAeV,EAAOW,sBACtBC,KAAOC,GAAsBA,EAAMC,cAGvCC,SAAUC,EAASR,MAAMR"}
|
package/node/create-headers.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ type TNodeHeaders = Record<string, string | string[] | number | undefined>;
|
|
|
3
3
|
* Convert Node headers to Fetch headers, excluding HTTP/2 pseudo-headers.
|
|
4
4
|
*/
|
|
5
5
|
declare const createHeaders: (values: TNodeHeaders) => Headers;
|
|
6
|
-
export
|
|
6
|
+
export default createHeaders;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-headers.js","sources":["../../src/node/create-headers.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"create-headers.js","sources":["../../src/node/create-headers.ts"],"sourcesContent":[null],"names":["createHeaders","values","headers","Headers","name","value","Object","entries","startsWith","undefined","Array","isArray","item","append","set","String"],"mappings":"AAKA,MAAMA,EAAiBC,IACrB,MAAMC,EAAU,IAAIC,QAEpB,IAAK,MAAOC,EAAMC,KAAUC,OAAOC,QAAQN,GACzC,IAAIG,EAAKI,WAAW,WAAkBC,IAAVJ,EAI5B,GAAIK,MAAMC,QAAQN,GAChB,IAAK,MAAMO,KAAQP,EACjBH,EAAQW,OAAOT,EAAMQ,QAGvBV,EAAQY,IAAIV,EAAuB,iBAAVC,EAAqBU,OAAOV,GAASA,GAIlE,OAAOH"}
|
package/node/create-request.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TIncomingMessage } from
|
|
1
|
+
import type { TIncomingMessage } from './http.js';
|
|
2
2
|
interface ICreateRequestOptions {
|
|
3
3
|
body?: BodyInit | null;
|
|
4
4
|
origin?: string;
|
|
@@ -10,4 +10,4 @@ interface ICreateRequestOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
declare const createRequest: (req: TIncomingMessage, options?: ICreateRequestOptions) => Request;
|
|
12
12
|
export type { ICreateRequestOptions };
|
|
13
|
-
export
|
|
13
|
+
export default createRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-request.js","sources":["../../src/node/create-request.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"create-request.js","sources":["../../src/node/create-request.ts"],"sourcesContent":[null],"names":["createRequest","req","options","body","origin","signal","headers","createHeaders","protocol","socket","encrypted","authority","host","get","requestOrigin","URL","target","url","startsWith","init","method","delete","FormData","duplex","Request"],"mappings":"mCAaA,MAAMA,EAAgB,CAACC,EAAuBC,EAAiC,MAC7E,MAAMC,KAAEA,EAAIC,OAAEA,EAAMC,OAAEA,GAAWH,EAC3BI,EAAUC,EAAcN,EAAIK,SAC5BE,EACJP,EAAIQ,QAAU,cAAeR,EAAIQ,QAAUR,EAAIQ,OAAOC,UAAY,QAAU,OACxEC,EAAYV,EAAIK,QAAQ,cACxBM,EAAON,EAAQO,IAAI,UAAiC,iBAAdF,EAAyBA,EAAY,MAC3EG,EAAgB,IAAIC,IAAIX,GAAU,GAAGI,OAAcI,KAAQR,OAC3DY,EAASd,EAAQe,KAAOhB,EAAIgB,KAAO,IAKnCA,EAAM,IAAIF,IAAIC,EAAOE,WAAW,KAAOJ,EAAgBE,EAASA,EAAQF,GACxEK,EAA0C,CAC9Cb,UACAc,OAAQnB,EAAImB,OACZf,UAsBF,MAnBmB,QAAfJ,EAAImB,QAAmC,SAAfnB,EAAImB,SAC1B,SAAUlB,GACZI,EAAQe,OAAO,kBAEXlB,aAAgBmB,UAIlBhB,EAAQe,OAAO,gBAGjBF,EAAKhB,KAAOA,GAEZgB,EAAKhB,KAAOF,EAGdkB,EAAKI,OAAS,QAGT,IAAIC,QAAQP,EAAKE"}
|
package/node/http.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type
|
|
5
|
-
type TServerResponse = ServerResponse | Http2ServerResponse;
|
|
6
|
-
export { TIncomingMessage, TServerResponse };
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
2
|
+
import type { Http2ServerRequest, Http2ServerResponse } from 'node:http2';
|
|
3
|
+
export type TIncomingMessage = IncomingMessage | Http2ServerRequest;
|
|
4
|
+
export type TServerResponse = ServerResponse | Http2ServerResponse;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TRenderToStream } from
|
|
1
|
+
import type { TRenderToStream } from '../core/render.js';
|
|
2
2
|
/**
|
|
3
3
|
* Adapt React pipeable rendering to Fetch streams with byte-based backpressure.
|
|
4
4
|
*/
|
|
5
5
|
declare const renderToStream: TRenderToStream;
|
|
6
|
-
export
|
|
6
|
+
export default renderToStream;
|
package/node/render-to-stream.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{PassThrough as r,Readable as e}from"node:stream";import{renderToPipeableStream as t}from"react-dom/server";const o=(o,n)=>{const a=new r,s=e.toWeb(a,{strategy:{highWaterMark:a.readableHighWaterMark,size:r=>r.byteLength}});let i,l,c,d;const g=new Promise((
|
|
1
|
+
import{PassThrough as r,Readable as e}from"node:stream";import{renderToPipeableStream as t}from"react-dom/server";const o=(o,n)=>{const a=new r,s=e.toWeb(a,{strategy:{highWaterMark:a.readableHighWaterMark,size:r=>r.byteLength}});let i,l,c,d;const g=new Promise((r,e)=>{i=e,c=r}),h=new Promise((r,e)=>{l=e,d=r});g.catch(()=>{}),h.catch(()=>{});let m=!1,b=!1;const E=t(o,{onAllReady:c,onError:n.onError,onShellError:r=>{const e=r instanceof Error?r:new Error(String(r));m=!0,i(e),l(e)},onShellReady:()=>{m=!0,d()}}),f=r=>{if(!b){if(b=!0,!m){m=!0;const e=r instanceof Error?r:new Error("string"==typeof r?r:"Render aborted");l(e),i(e)}E.abort(r)}},y=()=>f(n.signal.reason),p=()=>n.signal.removeEventListener("abort",y);n.signal.aborted?y():n.signal.addEventListener("abort",y,{once:!0}),g.then(p,p);let w=!1;return{allReady:g,abort:f,shellReady:h,start:()=>{w||(w=!0,E.pipe(a))},stream:s}};export{o as default};
|
|
2
2
|
//# sourceMappingURL=render-to-stream.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-to-stream.js","sources":["../../src/node/render-to-stream.ts"],"sourcesContent":[
|
|
1
|
+
{"version":3,"file":"render-to-stream.js","sources":["../../src/node/render-to-stream.ts"],"sourcesContent":[null],"names":["renderToStream","node","options","destination","PassThrough","stream","Readable","toWeb","strategy","highWaterMark","readableHighWaterMark","size","chunk","byteLength","rejectAll","rejectShell","resolveAll","resolveShell","allReady","Promise","resolve","reject","shellReady","catch","hasShellSettled","hasAborted","rendered","renderToPipeableStream","onAllReady","onError","onShellError","error","shellError","Error","String","onShellReady","abort","reason","onAbort","signal","cleanup","removeEventListener","aborted","addEventListener","once","then","hasStarted","start","pipe"],"mappings":"kHAOA,MAAMA,EAAkC,CAACC,EAAMC,KAC7C,MAAMC,EAAc,IAAIC,EAClBC,EAASC,EAASC,MAAMJ,EAAa,CACzCK,SAAU,CACRC,cAAeN,EAAYO,sBAK3BC,KAAOC,GAAsBA,EAAMC,cAGvC,IAAIC,EACAC,EACAC,EACAC,EAKJ,MAAMC,EAAW,IAAIC,QAAc,CAACC,EAASC,KAC3CP,EAAYO,EACZL,EAAaI,IAMTE,EAAa,IAAIH,QAAc,CAACC,EAASC,KAC7CN,EAAcM,EACdJ,EAAeG,IAGZF,EAASK,MAAM,QACfD,EAAWC,MAAM,QAEtB,IAAIC,GAAkB,EAClBC,GAAa,EACjB,MAAMC,EAAWC,EAAuB1B,EAAM,CAC5C2B,WAAYZ,EACZa,QAAS3B,EAAQ2B,QAKjBC,aAAeC,IACb,MAAMC,EAAaD,aAAiBE,MAAQF,EAAQ,IAAIE,MAAMC,OAAOH,IAErEP,GAAkB,EAClBV,EAAUkB,GACVjB,EAAYiB,IAMdG,aAAc,KACZX,GAAkB,EAClBP,OAOEmB,EAASC,IACb,IAAIZ,EAAJ,CASA,GALAA,GAAa,GAKRD,EAAiB,CACpBA,GAAkB,EAClB,MACMO,EAAQM,aAAkBJ,MAAQI,EAAS,IAAIJ,MADnB,iBAAXI,EAAsBA,EAAS,kBAGtDtB,EAAYgB,GACZjB,EAAUiB,EACZ,CAEAL,EAASU,MAAMC,EAhBf,GAsBIC,EAAU,IAAYF,EAAMlC,EAAQqC,OAAOF,QAK3CG,EAAU,IAAYtC,EAAQqC,OAAOE,oBAAoB,QAASH,GAEpEpC,EAAQqC,OAAOG,QACjBJ,IAEApC,EAAQqC,OAAOI,iBAAiB,QAASL,EAAS,CAAEM,MAAM,IAGvD1B,EAAS2B,KAAKL,EAASA,GAC5B,IAAIM,GAAa,EAEjB,MAAO,CACL5B,WACAkB,QACAd,aAKAyB,MAAO,KACAD,IACHA,GAAa,EACbpB,EAASsB,KAAK7C,KAGlBE"}
|