@bleedingdev/modern-js-runtime 3.2.0-ultramodern.0 → 3.2.0-ultramodern.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/dist/types/cache/index.d.ts +0 -1
- package/dist/types/cli/alias.d.ts +0 -7
- package/dist/types/cli/code.d.ts +0 -3
- package/dist/types/cli/constants.d.ts +0 -9
- package/dist/types/cli/entry.d.ts +0 -2
- package/dist/types/cli/index.d.ts +0 -11
- package/dist/types/cli/ssr/index.d.ts +0 -6
- package/dist/types/cli/ssr/loadable-bundler-plugin.d.ts +0 -31
- package/dist/types/cli/ssr/mode.d.ts +0 -15
- package/dist/types/cli/template.d.ts +0 -50
- package/dist/types/cli/template.server.d.ts +0 -20
- package/dist/types/common.d.ts +0 -8
- package/dist/types/core/browser/hydrate.d.ts +0 -5
- package/dist/types/core/browser/index.d.ts +0 -9
- package/dist/types/core/browser/withCallback.d.ts +0 -5
- package/dist/types/core/compat/hooks.d.ts +0 -4
- package/dist/types/core/compat/index.d.ts +0 -2
- package/dist/types/core/compat/requestContext.d.ts +0 -5
- package/dist/types/core/config.d.ts +0 -6
- package/dist/types/core/constants.d.ts +0 -6
- package/dist/types/core/context/index.d.ts +0 -50
- package/dist/types/core/context/monitors/default.d.ts +0 -2
- package/dist/types/core/context/monitors/index.d.ts +0 -1
- package/dist/types/core/context/monitors/index.server.d.ts +0 -2
- package/dist/types/core/context/request/index.d.ts +0 -1
- package/dist/types/core/context/request/index.server.d.ts +0 -1
- package/dist/types/core/context/response/index.d.ts +0 -4
- package/dist/types/core/context/response/index.server.d.ts +0 -7
- package/dist/types/core/context/runtime.d.ts +0 -42
- package/dist/types/core/context/serverPayload/index.d.ts +0 -4
- package/dist/types/core/context/serverPayload/index.server.d.ts +0 -31
- package/dist/types/core/index.d.ts +0 -5
- package/dist/types/core/plugin/index.d.ts +0 -4
- package/dist/types/core/plugin/types.d.ts +0 -10
- package/dist/types/core/react/index.d.ts +0 -2
- package/dist/types/core/react/wrapper.d.ts +0 -3
- package/dist/types/core/server/constants.d.ts +0 -4
- package/dist/types/core/server/helmet.d.ts +0 -3
- package/dist/types/core/server/index.d.ts +0 -4
- package/dist/types/core/server/react/index.d.ts +0 -2
- package/dist/types/core/server/react/no-ssr-cache/index.d.ts +0 -2
- package/dist/types/core/server/react/nossr/index.d.ts +0 -4
- package/dist/types/core/server/requestHandler.d.ts +0 -13
- package/dist/types/core/server/server.d.ts +0 -4
- package/dist/types/core/server/shared.d.ts +0 -8
- package/dist/types/core/server/stream/afterTemplate.d.ts +0 -13
- package/dist/types/core/server/stream/beforeTemplate.d.ts +0 -9
- package/dist/types/core/server/stream/createReadableStream.d.ts +0 -2
- package/dist/types/core/server/stream/createReadableStream.worker.d.ts +0 -2
- package/dist/types/core/server/stream/deferredScript.d.ts +0 -15
- package/dist/types/core/server/stream/index.d.ts +0 -1
- package/dist/types/core/server/stream/shared.d.ts +0 -33
- package/dist/types/core/server/stream/template.d.ts +0 -9
- package/dist/types/core/server/string/index.d.ts +0 -2
- package/dist/types/core/server/string/loadable.d.ts +0 -36
- package/dist/types/core/server/string/ssrData.d.ts +0 -20
- package/dist/types/core/server/string/types.d.ts +0 -12
- package/dist/types/core/server/tracer.d.ts +0 -17
- package/dist/types/core/server/utils.d.ts +0 -29
- package/dist/types/core/types.d.ts +0 -49
- package/dist/types/document/Body.d.ts +0 -2
- package/dist/types/document/Comment.d.ts +0 -5
- package/dist/types/document/DocumentContext.d.ts +0 -13
- package/dist/types/document/DocumentStructureContext.d.ts +0 -12
- package/dist/types/document/Head.d.ts +0 -5
- package/dist/types/document/Html.d.ts +0 -4
- package/dist/types/document/Links.d.ts +0 -2
- package/dist/types/document/Root.d.ts +0 -7
- package/dist/types/document/Script.d.ts +0 -4
- package/dist/types/document/Scripts.d.ts +0 -2
- package/dist/types/document/Style.d.ts +0 -5
- package/dist/types/document/Title.d.ts +0 -1
- package/dist/types/document/cli/index.d.ts +0 -5
- package/dist/types/document/constants.d.ts +0 -25
- package/dist/types/document/index.d.ts +0 -12
- package/dist/types/exports/config-routes.d.ts +0 -9
- package/dist/types/exports/head.d.ts +0 -4
- package/dist/types/exports/loadable.d.ts +0 -3
- package/dist/types/exports/tanstack-router.d.ts +0 -5
- package/dist/types/index.d.ts +0 -10
- package/dist/types/internal.d.ts +0 -2
- package/dist/types/react-server.d.ts +0 -3
- package/dist/types/router/cli/code/getClientRoutes/getRoutes.d.ts +0 -8
- package/dist/types/router/cli/code/getClientRoutes/index.d.ts +0 -1
- package/dist/types/router/cli/code/getClientRoutes/utils.d.ts +0 -4
- package/dist/types/router/cli/code/index.d.ts +0 -12
- package/dist/types/router/cli/code/inspect.d.ts +0 -22
- package/dist/types/router/cli/code/makeLegalIdentifier.d.ts +0 -1
- package/dist/types/router/cli/code/nestedRoutes.d.ts +0 -13
- package/dist/types/router/cli/code/tanstackTypes.d.ts +0 -10
- package/dist/types/router/cli/code/templates.d.ts +0 -28
- package/dist/types/router/cli/code/utils.d.ts +0 -12
- package/dist/types/router/cli/config-routes/converter.d.ts +0 -15
- package/dist/types/router/cli/config-routes/parseRouteConfig.d.ts +0 -32
- package/dist/types/router/cli/constants.d.ts +0 -31
- package/dist/types/router/cli/entry.d.ts +0 -18
- package/dist/types/router/cli/handler.d.ts +0 -28
- package/dist/types/router/cli/index.d.ts +0 -5
- package/dist/types/router/index.d.ts +0 -1
- package/dist/types/router/internal.d.ts +0 -2
- package/dist/types/router/runtime/CSSLinks.d.ts +0 -9
- package/dist/types/router/runtime/DefaultNotFound.d.ts +0 -2
- package/dist/types/router/runtime/DeferredDataScripts.d.ts +0 -2
- package/dist/types/router/runtime/DeferredDataScripts.node.d.ts +0 -11
- package/dist/types/router/runtime/PrefetchLink.d.ts +0 -27
- package/dist/types/router/runtime/constants.d.ts +0 -146
- package/dist/types/router/runtime/hooks.d.ts +0 -18
- package/dist/types/router/runtime/index.d.ts +0 -7
- package/dist/types/router/runtime/internal.d.ts +0 -11
- package/dist/types/router/runtime/lifecycle.d.ts +0 -25
- package/dist/types/router/runtime/plugin.d.ts +0 -9
- package/dist/types/router/runtime/plugin.node.d.ts +0 -7
- package/dist/types/router/runtime/routerHelper.d.ts +0 -5
- package/dist/types/router/runtime/rsc-router.d.ts +0 -20
- package/dist/types/router/runtime/rsc.d.ts +0 -1
- package/dist/types/router/runtime/server.d.ts +0 -1
- package/dist/types/router/runtime/tanstack/basepathRewrite.d.ts +0 -8
- package/dist/types/router/runtime/tanstack/dataMutation.d.ts +0 -29
- package/dist/types/router/runtime/tanstack/plugin.d.ts +0 -6
- package/dist/types/router/runtime/tanstack/plugin.node.d.ts +0 -6
- package/dist/types/router/runtime/tanstack/prefetchLink.d.ts +0 -11
- package/dist/types/router/runtime/tanstack/routeTree.d.ts +0 -8
- package/dist/types/router/runtime/tanstack/rsc/ClientSlot.d.ts +0 -5
- package/dist/types/router/runtime/tanstack/rsc/CompositeComponent.d.ts +0 -3
- package/dist/types/router/runtime/tanstack/rsc/ReplayableStream.d.ts +0 -24
- package/dist/types/router/runtime/tanstack/rsc/RscNodeRenderer.d.ts +0 -5
- package/dist/types/router/runtime/tanstack/rsc/SlotContext.d.ts +0 -11
- package/dist/types/router/runtime/tanstack/rsc/client.d.ts +0 -11
- package/dist/types/router/runtime/tanstack/rsc/createRscProxy.d.ts +0 -7
- package/dist/types/router/runtime/tanstack/rsc/index.d.ts +0 -2
- package/dist/types/router/runtime/tanstack/rsc/server.d.ts +0 -14
- package/dist/types/router/runtime/tanstack/rsc/slotUsageSanitizer.d.ts +0 -2
- package/dist/types/router/runtime/tanstack/rsc/symbols.d.ts +0 -46
- package/dist/types/router/runtime/types.d.ts +0 -119
- package/dist/types/router/runtime/utils.d.ts +0 -48
- package/dist/types/router/runtime/withRouter.d.ts +0 -10
- package/dist/types/rsc/client.d.ts +0 -2
- package/dist/types/rsc/server.d.ts +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { OnError } from '@modern-js/app-tools';
|
|
2
|
-
import type { ClientManifest as RscClientManifest, ServerManifest as RscServerManifest, SSRManifest as RscSSRManifest } from '@modern-js/types/server';
|
|
3
|
-
import type React from 'react';
|
|
4
|
-
import type { TRuntimeContext } from '../../context';
|
|
5
|
-
import type { HandleRequestConfig } from '../requestHandler';
|
|
6
|
-
import type { RenderStreaming, SSRConfig } from '../shared';
|
|
7
|
-
export type CreateReadableStreamFromElementOptions = {
|
|
8
|
-
runtimeContext: TRuntimeContext;
|
|
9
|
-
config: HandleRequestConfig;
|
|
10
|
-
ssrConfig: SSRConfig;
|
|
11
|
-
htmlTemplate: string;
|
|
12
|
-
entryName: string;
|
|
13
|
-
rscClientManifest?: RscClientManifest;
|
|
14
|
-
rscSSRManifest?: RscSSRManifest;
|
|
15
|
-
rscServerManifest?: RscServerManifest;
|
|
16
|
-
rscRoot?: React.ReactElement;
|
|
17
|
-
onShellReady?: () => void;
|
|
18
|
-
onShellError?: (error: unknown) => void;
|
|
19
|
-
onAllReady?: () => void;
|
|
20
|
-
onError: OnError;
|
|
21
|
-
};
|
|
22
|
-
export type CreateReadableStreamFromElement = (request: Request, rootElement: React.ReactElement, options: CreateReadableStreamFromElementOptions) => Promise<ReadableStream<Uint8Array>>;
|
|
23
|
-
export declare enum ShellChunkStatus {
|
|
24
|
-
START = 0,
|
|
25
|
-
FINISH = 1
|
|
26
|
-
}
|
|
27
|
-
export declare function resolveStreamingMode(request: Request, forceStreamToString: boolean): {
|
|
28
|
-
onReady: 'onAllReady' | 'onShellReady';
|
|
29
|
-
waitForAllReady: boolean;
|
|
30
|
-
};
|
|
31
|
-
export declare function encodeForWebStream(thing: unknown): unknown;
|
|
32
|
-
export declare function getReadableStreamFromString(content: string): ReadableStream;
|
|
33
|
-
export declare function createRenderStreaming(createReadableStreamPromise: Promise<CreateReadableStreamFromElement>): RenderStreaming;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type BuildShellAfterTemplateOptions } from './afterTemplate';
|
|
2
|
-
import { type BuildShellBeforeTemplateOptions } from './beforeTemplate';
|
|
3
|
-
export type InjectTemplate = {
|
|
4
|
-
shellBefore: string;
|
|
5
|
-
shellAfter: string;
|
|
6
|
-
};
|
|
7
|
-
type GetTemplatesOptions = BuildShellAfterTemplateOptions & BuildShellBeforeTemplateOptions;
|
|
8
|
-
export declare const getTemplates: (htmlTemplate: string, options: GetTemplatesOptions) => Promise<InjectTemplate>;
|
|
9
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { ChunkSet, Collector } from './types';
|
|
3
|
-
declare module '@loadable/server' {
|
|
4
|
-
interface ChunkExtractor {
|
|
5
|
-
chunks: string[];
|
|
6
|
-
getChunkAssets: (chunks: string[]) => Chunk[];
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
export interface LoadableCollectorOptions {
|
|
10
|
-
nonce?: string;
|
|
11
|
-
stats?: Record<string, any>;
|
|
12
|
-
routeManifest?: Record<string, any>;
|
|
13
|
-
template: string;
|
|
14
|
-
entryName: string;
|
|
15
|
-
chunkSet: ChunkSet;
|
|
16
|
-
config: LoadableCollectorConfig;
|
|
17
|
-
}
|
|
18
|
-
export interface LoadableCollectorConfig {
|
|
19
|
-
scriptLoading?: 'defer' | 'blocking' | 'module' | 'async';
|
|
20
|
-
inlineStyles?: boolean | RegExp;
|
|
21
|
-
inlineScripts?: boolean | RegExp;
|
|
22
|
-
crossorigin?: boolean | 'anonymous' | 'use-credentials';
|
|
23
|
-
enableAsyncEntry?: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare class LoadableCollector implements Collector {
|
|
26
|
-
private options;
|
|
27
|
-
private extractor?;
|
|
28
|
-
constructor(options: LoadableCollectorOptions);
|
|
29
|
-
private get existsAssets();
|
|
30
|
-
collect(comopnent: ReactElement): ReactElement;
|
|
31
|
-
effect(): Promise<void>;
|
|
32
|
-
private emitLoadableScripts;
|
|
33
|
-
private emitScriptAssets;
|
|
34
|
-
private emitStyleAssets;
|
|
35
|
-
private generateAttributes;
|
|
36
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
2
|
-
import type { TInternalRuntimeContext } from '../../context';
|
|
3
|
-
import type { SSRServerContext } from '../../types';
|
|
4
|
-
import type { SSRConfig } from '../shared';
|
|
5
|
-
import type { ChunkSet, Collector } from './types';
|
|
6
|
-
export interface SSRDataCreatorOptions {
|
|
7
|
-
runtimeContext: TInternalRuntimeContext;
|
|
8
|
-
request: Request;
|
|
9
|
-
chunkSet: ChunkSet;
|
|
10
|
-
ssrContext: SSRServerContext;
|
|
11
|
-
ssrConfig?: SSRConfig;
|
|
12
|
-
routerContext?: StaticHandlerContext;
|
|
13
|
-
nonce?: string;
|
|
14
|
-
useJsonScript?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export declare class SSRDataCollector implements Collector {
|
|
17
|
-
#private;
|
|
18
|
-
constructor(options: SSRDataCreatorOptions);
|
|
19
|
-
effect(): void;
|
|
20
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactElement } from 'react';
|
|
2
|
-
import type { RenderLevel } from '../../constants';
|
|
3
|
-
export interface Collector {
|
|
4
|
-
collect?: (comopnent: ReactElement) => ReactElement;
|
|
5
|
-
effect: () => void | Promise<void>;
|
|
6
|
-
}
|
|
7
|
-
export type ChunkSet = {
|
|
8
|
-
renderLevel: RenderLevel;
|
|
9
|
-
ssrScripts: string;
|
|
10
|
-
jsChunk: string;
|
|
11
|
-
cssChunk: string;
|
|
12
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { OnError, OnTiming } from '@modern-js/app-tools';
|
|
2
|
-
export declare enum SSRTimings {
|
|
3
|
-
PRERENDER = "ssr-prerender",
|
|
4
|
-
RENDER_HTML = "ssr-render-html",
|
|
5
|
-
RENDER_SHELL = "ssr-render-shell"
|
|
6
|
-
}
|
|
7
|
-
export declare enum SSRErrors {
|
|
8
|
-
PRERENDER = "App Prerender",
|
|
9
|
-
RENDER_HTML = "App Render To HTML",
|
|
10
|
-
RENDER_STREAM = "An error occurs during streaming SSR",
|
|
11
|
-
RENDER_SHELL = "An error occurs during streaming render shell",
|
|
12
|
-
LOADER_ERROR = "App error occurs during data loader"
|
|
13
|
-
}
|
|
14
|
-
export type Tracer = {
|
|
15
|
-
onError: OnError;
|
|
16
|
-
onTiming: OnTiming;
|
|
17
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { ServerUserConfig } from '@modern-js/app-tools';
|
|
2
|
-
import { type StaticHandlerContext } from '@modern-js/runtime-utils/router';
|
|
3
|
-
import type { SSRConfig } from './shared';
|
|
4
|
-
export declare function attributesToString(attributes: Record<string, any>): string;
|
|
5
|
-
/**
|
|
6
|
-
* @param source
|
|
7
|
-
* @param searchValue
|
|
8
|
-
* @param replaceValue
|
|
9
|
-
* @returns
|
|
10
|
-
*/
|
|
11
|
-
export declare function safeReplace(source: string, searchValue: string | RegExp, replaceValue: string): string;
|
|
12
|
-
export declare function checkIsNode(): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* forked from https://github.com/remix-run/remix/blob/main/packages/remix-server-runtime/errors.ts
|
|
15
|
-
* license at https://github.com/remix-run/remix/blob/main/LICENSE.md
|
|
16
|
-
*/
|
|
17
|
-
export declare function serializeErrors(errors: StaticHandlerContext['errors']): StaticHandlerContext['errors'];
|
|
18
|
-
export declare function getSSRConfigByEntry(entryName: string, ssr?: ServerUserConfig['ssr'], ssrByEntries?: ServerUserConfig['ssrByEntries']): true | {
|
|
19
|
-
forceCSR?: boolean;
|
|
20
|
-
mode?: import("@modern-js/types").SSRMode;
|
|
21
|
-
preload?: boolean | {
|
|
22
|
-
[x: string]: unknown;
|
|
23
|
-
};
|
|
24
|
-
inlineScript?: boolean;
|
|
25
|
-
disablePrerender?: boolean;
|
|
26
|
-
unsafeHeaders?: string[];
|
|
27
|
-
moduleFederationAppSSR?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export declare function getSSRMode(ssrConfig?: SSRConfig): 'string' | 'stream' | false;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { OnError, OnTiming } from '@modern-js/app-tools';
|
|
2
|
-
import type { BaseSSRServerContext } from '@modern-js/types';
|
|
3
|
-
import type { RenderLevel } from './constants';
|
|
4
|
-
declare global {
|
|
5
|
-
interface Window {
|
|
6
|
-
_SSR_DATA?: SSRContainer;
|
|
7
|
-
_ROUTER_DATA?: RouterSSRData;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export interface SSRData {
|
|
11
|
-
initialData?: Record<string, unknown>;
|
|
12
|
-
i18nData?: Record<string, unknown>;
|
|
13
|
-
[props: string]: any;
|
|
14
|
-
}
|
|
15
|
-
export interface RouteData {
|
|
16
|
-
[routeId: string]: any;
|
|
17
|
-
}
|
|
18
|
-
export interface RouterSSRData {
|
|
19
|
-
loaderData: RouteData;
|
|
20
|
-
errors: RouteData | null;
|
|
21
|
-
}
|
|
22
|
-
export type SSRMode = 'string' | 'stream';
|
|
23
|
-
export interface SSRContainer {
|
|
24
|
-
renderLevel: RenderLevel;
|
|
25
|
-
mode: SSRMode;
|
|
26
|
-
data?: SSRData;
|
|
27
|
-
context?: {
|
|
28
|
-
request: BaseSSRServerContext['request'];
|
|
29
|
-
reporter?: {
|
|
30
|
-
sessionId?: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
type BuildHtmlCb = (tempalte: string) => string;
|
|
35
|
-
export type SSRServerContext = Pick<BaseSSRServerContext, 'baseUrl' | 'response' | 'nonce' | 'mode' | 'loaderContext' | 'reporter' | 'routeManifest'> & {
|
|
36
|
-
request: BaseSSRServerContext['request'] & {
|
|
37
|
-
raw: Request;
|
|
38
|
-
};
|
|
39
|
-
htmlModifiers: BuildHtmlCb[];
|
|
40
|
-
loaderFailureMode?: 'clientRender' | 'errorBoundary';
|
|
41
|
-
onError: OnError;
|
|
42
|
-
onTiming: OnTiming;
|
|
43
|
-
useJsonScript?: boolean;
|
|
44
|
-
};
|
|
45
|
-
export type RequestContext = {
|
|
46
|
-
request: BaseSSRServerContext['request'];
|
|
47
|
-
response: BaseSSRServerContext['response'];
|
|
48
|
-
};
|
|
49
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { type JSX } from 'react';
|
|
2
|
-
type DocumentProps = {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
config?: any;
|
|
5
|
-
templateParams: {
|
|
6
|
-
[y: string]: any;
|
|
7
|
-
mountId?: string;
|
|
8
|
-
};
|
|
9
|
-
processEnv?: Record<string, string | undefined>;
|
|
10
|
-
children?: JSX.Element;
|
|
11
|
-
};
|
|
12
|
-
export declare const DocumentContext: React.Context<DocumentProps>;
|
|
13
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { type ReactNode } from 'react';
|
|
2
|
-
type DocumentStructureContextProps = {
|
|
3
|
-
hasSetHead?: boolean;
|
|
4
|
-
hasSetScripts?: boolean;
|
|
5
|
-
hasSetLinks?: boolean;
|
|
6
|
-
hasSetBody?: boolean;
|
|
7
|
-
hasSetRoot?: boolean;
|
|
8
|
-
hasSetTitle?: boolean;
|
|
9
|
-
docChild?: ReactNode;
|
|
10
|
-
};
|
|
11
|
-
export declare const DocumentStructureContext: React.Context<DocumentStructureContextProps>;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function Title(): import("react").JSX.Element;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
|
2
|
-
import type { Entrypoint } from '@modern-js/types/cli';
|
|
3
|
-
export declare const getDocumentByEntryName: (entrypoints: Entrypoint[], entryName: string, fallbackDir?: string) => string | undefined;
|
|
4
|
-
export declare const documentPlugin: () => CliPlugin<AppTools>;
|
|
5
|
-
export default documentPlugin;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const DOC_EXT: string[];
|
|
2
|
-
export declare const DOCUMENT_META_PLACEHOLDER: string;
|
|
3
|
-
export declare const DOCUMENT_TITLE_PLACEHOLDER: string;
|
|
4
|
-
export declare const HTML_SEPARATOR = "<!--<?- html ?>-->";
|
|
5
|
-
export declare const HEAD_PARTICALS_SEPARATOR: string;
|
|
6
|
-
export declare const BODY_PARTICALS_SEPARATOR: string;
|
|
7
|
-
export declare const TOP_PARTICALS_SEPARATOR: string;
|
|
8
|
-
export declare const HTML_SSRDATASCRIPT_SEPARATOR = "<!--<?- SSRDataScript ?>-->";
|
|
9
|
-
export declare const DOCUMENT_SSR_PLACEHOLDER: string;
|
|
10
|
-
export declare const DOCUMENT_CHUNKSMAP_PLACEHOLDER: string;
|
|
11
|
-
export declare const DOCUMENT_SSRDATASCRIPT_PLACEHOLDER: string;
|
|
12
|
-
export declare const DOCUMENT_FILE_NAME = "Document";
|
|
13
|
-
export declare const DOCUMENT_SCRIPTS_PLACEHOLDER: string;
|
|
14
|
-
export declare const DOCUMENT_LINKS_PLACEHOLDER: string;
|
|
15
|
-
export declare const DOCUMENT_SCRIPT_PLACEHOLDER_START: string;
|
|
16
|
-
export declare const DOCUMENT_SCRIPT_PLACEHOLDER_END: string;
|
|
17
|
-
export declare const DOCUMENT_SCRIPT_ATTRIBUTES_START: string;
|
|
18
|
-
export declare const DOCUMENT_SCRIPT_ATTRIBUTES_END: string;
|
|
19
|
-
export declare const DOCUMENT_STYLE_PLACEHOLDER_START: string;
|
|
20
|
-
export declare const DOCUMENT_STYLE_PLACEHOLDER_END: string;
|
|
21
|
-
export declare const DOCUMENT_COMMENT_PLACEHOLDER_START: string;
|
|
22
|
-
export declare const DOCUMENT_COMMENT_PLACEHOLDER_END: string;
|
|
23
|
-
export declare const PLACEHOLDER_REPLACER_MAP: {
|
|
24
|
-
[x: string]: string;
|
|
25
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from './Body';
|
|
2
|
-
export * from './Comment';
|
|
3
|
-
export * from './constants';
|
|
4
|
-
export * from './DocumentContext';
|
|
5
|
-
export * from './DocumentStructureContext';
|
|
6
|
-
export * from './Head';
|
|
7
|
-
export * from './Html';
|
|
8
|
-
export * from './Links';
|
|
9
|
-
export * from './Root';
|
|
10
|
-
export * from './Script';
|
|
11
|
-
export * from './Scripts';
|
|
12
|
-
export * from './Style';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for config-based routing
|
|
3
|
-
*/
|
|
4
|
-
import type { DefineRoutesFunction, LayoutFunction, PageFunction, RouteConfig, RouteFunction, RouteFunctions, WildcardFunction } from '../router/cli/config-routes/parseRouteConfig';
|
|
5
|
-
export type { DefineRoutesFunction, LayoutFunction, PageFunction, RouteConfig, RouteFunction, RouteFunctions, WildcardFunction, };
|
|
6
|
-
/**
|
|
7
|
-
* defineRoutes - main function to define route configurations
|
|
8
|
-
*/
|
|
9
|
-
export declare function defineRoutes(routesCallback: (routeFunctions: RouteFunctions, fileRoutes: RouteConfig[]) => RouteConfig[]): (routeFunctions: RouteFunctions, fileRoutes: RouteConfig[]) => RouteConfig[];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from '@tanstack/react-router';
|
|
2
|
-
export type { Fetcher, FetcherState, FetcherSubmitOptions, FormProps, SubmitOptions, } from '../router/runtime/tanstack/dataMutation';
|
|
3
|
-
export { Form, RouteActionResponseError, useFetcher, } from '../router/runtime/tanstack/dataMutation';
|
|
4
|
-
export type { LinkProps, NavLinkProps, PrefetchBehavior, } from '../router/runtime/tanstack/prefetchLink';
|
|
5
|
-
export { Link, NavLink } from '../router/runtime/tanstack/prefetchLink';
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RouterConfig } from './router/internal';
|
|
2
|
-
export type { RuntimeConfig } from './common';
|
|
3
|
-
export { isBrowser } from './common';
|
|
4
|
-
export type { RuntimePlugin } from './core';
|
|
5
|
-
export { defineRuntimeConfig, RuntimeContext, useRuntimeContext, } from './core';
|
|
6
|
-
export { getMonitors } from './core/context/monitors';
|
|
7
|
-
export { getRequest } from './core/context/request';
|
|
8
|
-
export { redirect, setHeaders, setStatus } from './core/context/response';
|
|
9
|
-
export type { TRuntimeContext } from './core/context/runtime';
|
|
10
|
-
export type { RouterConfig };
|
package/dist/types/internal.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Entrypoint, NestedRouteForCli, PageRoute } from '@modern-js/types';
|
|
2
|
-
export declare const getClientRoutes: ({ entrypoint, srcDirectory, srcAlias, internalDirectory, internalDirAlias, }: {
|
|
3
|
-
entrypoint: Entrypoint;
|
|
4
|
-
srcDirectory: string;
|
|
5
|
-
srcAlias: string;
|
|
6
|
-
internalDirectory: string;
|
|
7
|
-
internalDirAlias: string;
|
|
8
|
-
}) => (NestedRouteForCli | PageRoute)[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getClientRoutes } from './getRoutes';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AppNormalizedConfig, AppTools, AppToolsContext } from '@modern-js/app-tools';
|
|
2
|
-
import type { CLIPluginAPI } from '@modern-js/plugin';
|
|
3
|
-
import type { Entrypoint, NestedRouteForCli, PageRoute } from '@modern-js/types';
|
|
4
|
-
/**
|
|
5
|
-
* Generate routing information for a single entry point (can be reused by the routes inspect feature)
|
|
6
|
-
*/
|
|
7
|
-
export declare function generateRoutesForEntry(entrypoint: Entrypoint, appContext: AppToolsContext): Promise<NestedRouteForCli[]>;
|
|
8
|
-
export declare const generateCode: (appContext: AppToolsContext, config: AppNormalizedConfig, entrypoints: Entrypoint[], api: CLIPluginAPI<AppTools>, options?: {
|
|
9
|
-
enableTanstackTypes?: boolean;
|
|
10
|
-
}) => Promise<Record<string, (NestedRouteForCli | PageRoute)[]>>;
|
|
11
|
-
export declare function generatorRegisterCode(internalDirectory: string, entryName: string, code: string): void;
|
|
12
|
-
export declare function generatorServerRegisterCode(internalDirectory: string, entryName: string, code: string): void;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { AppTools } from '@modern-js/app-tools';
|
|
2
|
-
import type { CLIPluginAPI } from '@modern-js/plugin';
|
|
3
|
-
export interface RouteInspectInfo {
|
|
4
|
-
path?: string;
|
|
5
|
-
component: string;
|
|
6
|
-
data?: string;
|
|
7
|
-
clientData?: string;
|
|
8
|
-
error?: string;
|
|
9
|
-
loading?: string;
|
|
10
|
-
config?: string;
|
|
11
|
-
params?: string[];
|
|
12
|
-
children?: RouteInspectInfo[];
|
|
13
|
-
}
|
|
14
|
-
export interface RoutesInspectReport {
|
|
15
|
-
routes: RouteInspectInfo[];
|
|
16
|
-
}
|
|
17
|
-
export interface MultiEntryRoutesInspectReport {
|
|
18
|
-
[entryName: string]: {
|
|
19
|
-
routes: RouteInspectInfo[];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare function generateRoutesInspectReport(api: CLIPluginAPI<AppTools>): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function makeLegalIdentifier(str: string): string;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NestedRouteForCli } from '@modern-js/types';
|
|
2
|
-
export declare const getRouteId: (componentPath: string, routesDir: string, entryName: string, isMainEntry: boolean) => string;
|
|
3
|
-
export declare const optimizeRoute: (routeTree: NestedRouteForCli) => NestedRouteForCli[];
|
|
4
|
-
export declare const walk: (options: {
|
|
5
|
-
dirname: string;
|
|
6
|
-
rootDir: string;
|
|
7
|
-
alias?: {
|
|
8
|
-
name: string;
|
|
9
|
-
basename: string;
|
|
10
|
-
};
|
|
11
|
-
entryName: string;
|
|
12
|
-
isMainEntry: boolean;
|
|
13
|
-
}) => Promise<NestedRouteForCli | NestedRouteForCli[] | null>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AppToolsContext } from '@modern-js/app-tools';
|
|
2
|
-
import type { NestedRouteForCli, PageRoute } from '@modern-js/types';
|
|
3
|
-
export declare function isTanstackRouterFrameworkEnabled(appContext: AppToolsContext): Promise<boolean>;
|
|
4
|
-
export declare function generateTanstackRouterTypesSourceForEntry(opts: {
|
|
5
|
-
appContext: AppToolsContext;
|
|
6
|
-
entryName: string;
|
|
7
|
-
routes: (NestedRouteForCli | PageRoute)[];
|
|
8
|
-
}): Promise<{
|
|
9
|
-
routerGenTs: string;
|
|
10
|
-
}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { AppNormalizedConfig, AppToolsContext } from '@modern-js/app-tools';
|
|
2
|
-
import type { Entrypoint, NestedRouteForCli, PageRoute, RouteLegacy, SSRMode } from '@modern-js/types';
|
|
3
|
-
export declare const routesForServer: ({ routesForServerLoaderMatches, }: {
|
|
4
|
-
routesForServerLoaderMatches: (NestedRouteForCli | PageRoute)[];
|
|
5
|
-
}) => string;
|
|
6
|
-
export declare const fileSystemRoutes: ({ metaName, routes, ssrMode, nestedRoutesEntry, entryName, internalDirectory, splitRouteChunks, isRscClientBundle, srcDirectory, internalSrcAlias, }: {
|
|
7
|
-
metaName: string;
|
|
8
|
-
routes: RouteLegacy[] | (NestedRouteForCli | PageRoute)[];
|
|
9
|
-
ssrMode?: SSRMode;
|
|
10
|
-
nestedRoutesEntry?: string;
|
|
11
|
-
entryName: string;
|
|
12
|
-
internalDirectory: string;
|
|
13
|
-
splitRouteChunks?: boolean;
|
|
14
|
-
isRscClientBundle?: boolean;
|
|
15
|
-
srcDirectory?: string;
|
|
16
|
-
internalSrcAlias?: string;
|
|
17
|
-
}) => Promise<string>;
|
|
18
|
-
export declare function ssrLoaderCombinedModule(entrypoints: Entrypoint[], entrypoint: Entrypoint, config: AppNormalizedConfig, appContext: AppToolsContext): string | null;
|
|
19
|
-
export declare const runtimeGlobalContext: ({ entryName, metaName, srcDirectory, nestedRoutesEntry, internalSrcAlias, globalApp, rscType, basename, }: {
|
|
20
|
-
entryName: string;
|
|
21
|
-
metaName: string;
|
|
22
|
-
srcDirectory: string;
|
|
23
|
-
nestedRoutesEntry?: string;
|
|
24
|
-
internalSrcAlias: string;
|
|
25
|
-
globalApp?: string | false;
|
|
26
|
-
rscType?: 'server' | 'client' | false;
|
|
27
|
-
basename?: string;
|
|
28
|
-
}) => Promise<string>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const walkDirectory: (dir: string) => string[];
|
|
2
|
-
export declare const isPageComponentFile: (filePath: string) => boolean;
|
|
3
|
-
export declare const replaceWithAlias: (base: string, filePath: string, alias: string) => string;
|
|
4
|
-
export declare const parseModule: ({ source, filename, }: {
|
|
5
|
-
source: string;
|
|
6
|
-
filename: string;
|
|
7
|
-
}) => Promise<readonly [imports: readonly import("es-module-lexer").ImportSpecifier[], exports: readonly import("es-module-lexer").ExportSpecifier[], facade: boolean, hasModuleSyntax: boolean]>;
|
|
8
|
-
export declare const hasLoader: (filename: string, source?: string) => Promise<boolean>;
|
|
9
|
-
export declare const hasAction: (filename: string, source?: string) => Promise<boolean>;
|
|
10
|
-
export declare const getServerLoadersFile: (internalDirectory: string, entryName: string) => string;
|
|
11
|
-
export declare const getServerCombinedModuleFile: (internalDirectory: string, entryName: string) => string;
|
|
12
|
-
export declare const getPathWithoutExt: (filename: string) => string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NestedRouteForCli } from '@modern-js/types';
|
|
2
|
-
/**
|
|
3
|
-
* Process config-based routes: generate route id, normalize paths and discover related files.
|
|
4
|
-
* Data structure is unified to NestedRouteForCli, only metadata needs to be enriched.
|
|
5
|
-
*/
|
|
6
|
-
export declare function processConfigRoutes(configRoutes: NestedRouteForCli[], entryName: string, isMainEntry: boolean, configRoutesDir: string, alias?: {
|
|
7
|
-
name: string;
|
|
8
|
-
basename: string;
|
|
9
|
-
}): Promise<NestedRouteForCli[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Remove all `component` fields from a routes tree
|
|
12
|
-
* @param generatedRoutes - generated routes array
|
|
13
|
-
* @returns routes with `component` field removed
|
|
14
|
-
*/
|
|
15
|
-
export declare function normalizeRoutes(generatedRoutes: NestedRouteForCli[]): NestedRouteForCli[];
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AppToolsContext } from '@modern-js/app-tools';
|
|
2
|
-
import type { Entrypoint, NestedRouteForCli } from '@modern-js/types';
|
|
3
|
-
/**
|
|
4
|
-
* Type definitions for config-based routing
|
|
5
|
-
*/
|
|
6
|
-
export type RouteConfig = NestedRouteForCli;
|
|
7
|
-
export type RouteFunction = {
|
|
8
|
-
(component: string, path?: string, children?: RouteConfig[]): RouteConfig;
|
|
9
|
-
(component: string, children?: RouteConfig[]): RouteConfig;
|
|
10
|
-
};
|
|
11
|
-
export type LayoutFunction = {
|
|
12
|
-
(component: string, path?: string, children?: RouteConfig[]): RouteConfig;
|
|
13
|
-
(component: string, children?: RouteConfig[]): RouteConfig;
|
|
14
|
-
};
|
|
15
|
-
export type PageFunction = (component: string, path?: string) => RouteConfig;
|
|
16
|
-
export type WildcardFunction = (component: string, path?: string) => RouteConfig;
|
|
17
|
-
export interface RouteFunctions {
|
|
18
|
-
route: RouteFunction;
|
|
19
|
-
layout: LayoutFunction;
|
|
20
|
-
page: PageFunction;
|
|
21
|
-
$: WildcardFunction;
|
|
22
|
-
}
|
|
23
|
-
export type DefineRoutesFunction = (routesCallback: (routeFunctions: RouteFunctions, fileRoutes: RouteConfig[]) => RouteConfig[]) => (routeFunctions: RouteFunctions, fileRoutes: RouteConfig[]) => RouteConfig[];
|
|
24
|
-
export interface ConfigRouteFile {
|
|
25
|
-
entryName: string;
|
|
26
|
-
filePath: string;
|
|
27
|
-
routes: NestedRouteForCli[];
|
|
28
|
-
isMainEntry: boolean;
|
|
29
|
-
}
|
|
30
|
-
export declare function findConfigRoutesFile(entrypoint: Entrypoint, appContext: AppToolsContext): Promise<string | null>;
|
|
31
|
-
export declare function parseConfigRoutesFile(filePath: string, entrypoint: Entrypoint, fileRoutes?: NestedRouteForCli[]): Promise<ConfigRouteFile>;
|
|
32
|
-
export declare function discoverAndParseConfigRoutes(entrypoint: Entrypoint, appContext: AppToolsContext, fileRoutes?: NestedRouteForCli[]): Promise<ConfigRouteFile | null>;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export declare const NESTED_ROUTES_DIR = "routes";
|
|
2
|
-
export declare const FILE_SYSTEM_ROUTES_FILE_NAME = "routes.js";
|
|
3
|
-
export declare const LOADER_EXPORT_NAME = "loader";
|
|
4
|
-
export declare const ACTION_EXPORT_NAME = "action";
|
|
5
|
-
export declare const TEMP_LOADERS_DIR = "__loaders__";
|
|
6
|
-
export declare const FILE_SYSTEM_ROUTES_INDEX = "index";
|
|
7
|
-
export declare const FILE_SYSTEM_ROUTES_IGNORED_REGEX: RegExp;
|
|
8
|
-
export declare const FILE_SYSTEM_ROUTES_DYNAMIC_REGEXP: RegExp;
|
|
9
|
-
export declare const FILE_SYSTEM_ROUTES_COMPONENTS_DIR = "internal_components";
|
|
10
|
-
export declare const APP_CONFIG_NAME = "config";
|
|
11
|
-
export declare const APP_INIT_EXPORTED = "init";
|
|
12
|
-
export declare const NESTED_ROUTE: {
|
|
13
|
-
LAYOUT_FILE: string;
|
|
14
|
-
LAYOUT_CONFIG_FILE: string;
|
|
15
|
-
LAYOUT_LOADER_FILE: string;
|
|
16
|
-
LAYOUT_DATA_FILE: string;
|
|
17
|
-
LAYOUT_CLIENT_LOADER: string;
|
|
18
|
-
PAGE_FILE: string;
|
|
19
|
-
PAGE_CONFIG_FILE: string;
|
|
20
|
-
PAGE_LOADER_FILE: string;
|
|
21
|
-
PAGE_DATA_FILE: string;
|
|
22
|
-
PAGE_CLIENT_LOADER: string;
|
|
23
|
-
SPLATE_FILE: string;
|
|
24
|
-
SPLATE_CONFIG_FILE: string;
|
|
25
|
-
SPLATE_LOADER_FILE: string;
|
|
26
|
-
SPLATE_DATA_FILE: string;
|
|
27
|
-
SPLATE_CLIENT_DATA: string;
|
|
28
|
-
LOADING_FILE: string;
|
|
29
|
-
ERROR_FILE: string;
|
|
30
|
-
LOADER_FILE: string;
|
|
31
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Entrypoint } from '@modern-js/types';
|
|
2
|
-
export declare const ROUTES_DIR_META_KEY = "__modernRoutesDir";
|
|
3
|
-
export declare const ROUTES_OWNER_META_KEY = "__modernRoutesOwner";
|
|
4
|
-
export declare const BUILT_IN_ROUTES_OWNER = "@modern-js/plugin-router";
|
|
5
|
-
export type EntrypointWithRoutesMeta = Entrypoint & {
|
|
6
|
-
[ROUTES_DIR_META_KEY]?: string;
|
|
7
|
-
[ROUTES_OWNER_META_KEY]?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const getEntrypointRoutesDir: (entrypoint: {
|
|
10
|
-
[ROUTES_DIR_META_KEY]?: string;
|
|
11
|
-
nestedRoutesEntry?: string;
|
|
12
|
-
}) => string | null;
|
|
13
|
-
export declare const getEntrypointRoutesOwner: (entrypoint: {
|
|
14
|
-
[ROUTES_OWNER_META_KEY]?: string;
|
|
15
|
-
}) => string | null;
|
|
16
|
-
export declare const hasNestedRoutes: (dir: string, routesDir?: string) => boolean;
|
|
17
|
-
export declare const isRouteEntry: (dir: string, routesDir?: string) => string | false;
|
|
18
|
-
export declare const modifyEntrypoints: (entrypoints: Entrypoint[], routesDir?: string, routesOwner?: string) => EntrypointWithRoutesMeta[];
|