@reckona/mreact-router 0.0.87 → 0.0.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -1,6 +1,10 @@
1
1
  export type AppRouterBuildTarget = "node" | "cloudflare" | "aws-lambda";
2
+ export type AppRouterClientConsoleMethod = "debug" | "error" | "info" | "log" | "trace" | "warn";
2
3
  export type AppRouterClientSourceMapMode = "none" | "hidden" | "linked";
3
4
  export type AppRouterClientSourceMapOption = boolean | AppRouterClientSourceMapMode;
5
+ export interface AppRouterProductionOptions {
6
+ dropClientConsole?: boolean | readonly AppRouterClientConsoleMethod[] | undefined;
7
+ }
4
8
  export interface AppRouterProjectOptions {
5
9
  assetBaseUrl?: string | undefined;
6
10
  buildTargets?: readonly AppRouterBuildTarget[] | undefined;
@@ -16,6 +20,7 @@ export interface AppRouterProjectOptions {
16
20
  appDir?: string | undefined;
17
21
  allowedSourceDirs?: readonly string[] | undefined;
18
22
  projectRoot?: string | undefined;
23
+ production?: AppRouterProductionOptions | undefined;
19
24
  publicDir?: string | undefined;
20
25
  publicAssetBaseUrl?: string | undefined;
21
26
  routesDir?: string | undefined;
@@ -25,12 +30,14 @@ export interface ResolvedAppRouterProject {
25
30
  assetBaseUrl?: string | undefined;
26
31
  buildTargets: readonly AppRouterBuildTarget[];
27
32
  clientSourceMaps: AppRouterClientSourceMapMode;
33
+ clientConsolePureFunctions?: readonly string[] | undefined;
28
34
  projectRoot: string;
29
35
  publicAssetBaseUrl?: string | undefined;
30
36
  publicDir: string;
31
37
  routesDir: string;
32
38
  }
33
39
  export declare function resolveAppRouterProjectOptions(options: AppRouterProjectOptions): ResolvedAppRouterProject;
40
+ export declare function resolveClientConsolePureFunctions(value: AppRouterProductionOptions["dropClientConsole"]): readonly string[] | undefined;
34
41
  export declare function resolveClientSourceMapMode(value: AppRouterClientSourceMapOption | undefined): AppRouterClientSourceMapMode;
35
42
  export declare function resolveBuildTargets(targets: readonly AppRouterBuildTarget[] | undefined): readonly AppRouterBuildTarget[];
36
43
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,YAAY,GAAG,YAAY,CAAC;AACxE,MAAM,MAAM,4BAA4B,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACxE,MAAM,MAAM,8BAA8B,GAAG,OAAO,GAAG,4BAA4B,CAAC;AAEpF,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,CAAC,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAC;IAC3D,gBAAgB,CAAC,EAAE,8BAA8B,GAAG,SAAS,CAAC;IAC9D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAClD,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9C,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,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AE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAC9C,gBAAgB,EAAE,4BAA4B,CAAC;IAC/C,0BAA0B,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,uBAAuB,GAC/B,wBAAwB,CA8C1B;AAYD,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,0BAA0B,CAAC,mBAAmB,CAAC,GACrD,SAAS,MAAM,EAAE,GAAG,SAAS,CAmB/B;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,8BAA8B,GAAG,SAAS,GAChD,4BAA4B,CAgB9B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,GACnD,SAAS,oBAAoB,EAAE,CAoBjC"}
package/dist/config.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { isAbsolute, relative, resolve } from "node:path";
2
2
  export function resolveAppRouterProjectOptions(options) {
3
+ const clientConsolePureFunctions = resolveClientConsolePureFunctions(options.production?.dropClientConsole);
3
4
  if (options.appDir !== undefined &&
4
5
  options.projectRoot === undefined &&
5
6
  options.routesDir === undefined) {
@@ -9,6 +10,7 @@ export function resolveAppRouterProjectOptions(options) {
9
10
  ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),
10
11
  buildTargets: resolveBuildTargets(options.buildTargets),
11
12
  clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),
13
+ ...(clientConsolePureFunctions === undefined ? {} : { clientConsolePureFunctions }),
12
14
  projectRoot: appDir,
13
15
  ...(options.publicAssetBaseUrl === undefined
14
16
  ? {}
@@ -23,6 +25,7 @@ export function resolveAppRouterProjectOptions(options) {
23
25
  ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),
24
26
  buildTargets: resolveBuildTargets(options.buildTargets),
25
27
  clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),
28
+ ...(clientConsolePureFunctions === undefined ? {} : { clientConsolePureFunctions }),
26
29
  projectRoot,
27
30
  ...(options.publicAssetBaseUrl === undefined
28
31
  ? {}
@@ -31,6 +34,30 @@ export function resolveAppRouterProjectOptions(options) {
31
34
  routesDir: resolveProjectPath(projectRoot, options.routesDir ?? "src/app", "routesDir"),
32
35
  };
33
36
  }
37
+ const defaultDroppedClientConsoleMethods = ["debug", "info", "log"];
38
+ const supportedClientConsoleMethods = new Set([
39
+ "debug",
40
+ "error",
41
+ "info",
42
+ "log",
43
+ "trace",
44
+ "warn",
45
+ ]);
46
+ export function resolveClientConsolePureFunctions(value) {
47
+ if (value === undefined || value === false) {
48
+ return undefined;
49
+ }
50
+ const methods = value === true ? defaultDroppedClientConsoleMethods : value;
51
+ const uniqueMethods = [...new Set(methods)];
52
+ for (const method of uniqueMethods) {
53
+ if (!supportedClientConsoleMethods.has(method)) {
54
+ throw new Error(`Unsupported mreactRouter production.dropClientConsole method ${JSON.stringify(method)}. Expected "debug", "error", "info", "log", "trace", or "warn".`);
55
+ }
56
+ }
57
+ return uniqueMethods.length === 0
58
+ ? undefined
59
+ : uniqueMethods.map((method) => `console.${method}`);
60
+ }
34
61
  export function resolveClientSourceMapMode(value) {
35
62
  if (value === undefined || value === false || value === "none") {
36
63
  return "none";
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"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,IAAI,EAAE,IAAI,CAAC,CAAC;IAE1C,OAAO,YAAY,KAAK,EAAE,IAAI,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\n\nexport type AppRouterBuildTarget = \"node\" | \"cloudflare\" | \"aws-lambda\";\nexport type AppRouterClientSourceMapMode = \"none\" | \"hidden\" | \"linked\";\nexport type AppRouterClientSourceMapOption = boolean | AppRouterClientSourceMapMode;\n\nexport interface AppRouterProjectOptions {\n assetBaseUrl?: string | undefined;\n buildTargets?: readonly AppRouterBuildTarget[] | undefined;\n clientSourceMaps?: AppRouterClientSourceMapOption | undefined;\n /**\n * Legacy route root. When provided without routesDir/projectRoot, this keeps\n * the historical \"appDir is the whole app boundary\" behavior.\n *\n * @deprecated Use projectRoot + routesDir instead. The legacy appDir shortcut\n * is kept for direct tests and older programmatic callers and is planned for\n * removal after 0.1.0.\n */\n appDir?: string | undefined;\n allowedSourceDirs?: readonly string[] | undefined;\n projectRoot?: string | undefined;\n publicDir?: string | undefined;\n publicAssetBaseUrl?: string | undefined;\n routesDir?: string | undefined;\n}\n\nexport interface ResolvedAppRouterProject {\n allowedSourceDirs: readonly string[];\n assetBaseUrl?: string | undefined;\n buildTargets: readonly AppRouterBuildTarget[];\n clientSourceMaps: AppRouterClientSourceMapMode;\n projectRoot: string;\n publicAssetBaseUrl?: string | undefined;\n publicDir: string;\n routesDir: string;\n}\n\nexport function resolveAppRouterProjectOptions(\n options: AppRouterProjectOptions,\n): ResolvedAppRouterProject {\n if (\n options.appDir !== undefined &&\n options.projectRoot === undefined &&\n options.routesDir === undefined\n ) {\n const appDir = resolve(options.appDir);\n\n return {\n allowedSourceDirs: (options.allowedSourceDirs ?? [appDir]).map((directory) =>\n resolveProjectPath(appDir, directory, \"allowedSourceDirs\"),\n ),\n ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),\n buildTargets: resolveBuildTargets(options.buildTargets),\n clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),\n projectRoot: appDir,\n ...(options.publicAssetBaseUrl === undefined\n ? {}\n : { publicAssetBaseUrl: options.publicAssetBaseUrl }),\n publicDir: resolveProjectPath(appDir, options.publicDir ?? \"public\", \"publicDir\"),\n routesDir: appDir,\n };\n }\n\n const projectRoot = resolve(options.projectRoot ?? process.cwd());\n\n return {\n allowedSourceDirs: (options.allowedSourceDirs ?? [\"src\"]).map((directory) =>\n resolveProjectPath(projectRoot, directory, \"allowedSourceDirs\"),\n ),\n ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),\n buildTargets: resolveBuildTargets(options.buildTargets),\n clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),\n projectRoot,\n ...(options.publicAssetBaseUrl === undefined\n ? {}\n : { publicAssetBaseUrl: options.publicAssetBaseUrl }),\n publicDir: resolveProjectPath(projectRoot, options.publicDir ?? \"public\", \"publicDir\"),\n routesDir: resolveProjectPath(projectRoot, options.routesDir ?? \"src/app\", \"routesDir\"),\n };\n}\n\nexport function resolveClientSourceMapMode(\n value: AppRouterClientSourceMapOption | undefined,\n): AppRouterClientSourceMapMode {\n if (value === undefined || value === false || value === \"none\") {\n return \"none\";\n }\n\n if (value === true || value === \"linked\") {\n return \"linked\";\n }\n\n if (value === \"hidden\") {\n return \"hidden\";\n }\n\n throw new Error(\n `Unsupported mreactRouter clientSourceMaps value ${JSON.stringify(value)}. Expected false, true, \"none\", \"hidden\", or \"linked\".`,\n );\n}\n\nexport function resolveBuildTargets(\n targets: readonly AppRouterBuildTarget[] | undefined,\n): readonly AppRouterBuildTarget[] {\n if (targets === undefined) {\n return [\"node\", \"cloudflare\"];\n }\n\n const uniqueTargets = [...new Set(targets)];\n\n if (uniqueTargets.length === 0) {\n throw new Error(\"mreactRouter buildTargets must include at least one target.\");\n }\n\n for (const target of uniqueTargets) {\n if (target !== \"node\" && target !== \"cloudflare\" && target !== \"aws-lambda\") {\n throw new Error(\n `Unsupported mreactRouter build target ${JSON.stringify(target)}. Expected \"node\", \"cloudflare\", or \"aws-lambda\".`,\n );\n }\n }\n\n return uniqueTargets;\n}\n\nfunction resolveProjectPath(root: string, path: string, optionName: string): string {\n const resolvedPath = resolvePath(root, path);\n\n if (!isInsideDirectory(root, resolvedPath)) {\n throw new Error(\n `mreactRouter ${optionName} must resolve inside projectRoot. projectRoot: ${root}; ${optionName}: ${resolvedPath}`,\n );\n }\n\n return resolvedPath;\n}\n\nfunction resolvePath(root: string, path: string): string {\n return isAbsolute(path) ? resolve(path) : resolve(root, path);\n}\n\nfunction isInsideDirectory(root: string, path: string): boolean {\n const relativePath = relative(root, path);\n\n return relativePath === \"\" || (!relativePath.startsWith(\"..\") && !isAbsolute(relativePath));\n}\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA4C1D,MAAM,UAAU,8BAA8B,CAC5C,OAAgC;IAEhC,MAAM,0BAA0B,GAAG,iCAAiC,CAClE,OAAO,CAAC,UAAU,EAAE,iBAAiB,CACtC,CAAC;IAEF,IACE,OAAO,CAAC,MAAM,KAAK,SAAS;QAC5B,OAAO,CAAC,WAAW,KAAK,SAAS;QACjC,OAAO,CAAC,SAAS,KAAK,SAAS,EAC/B,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEvC,OAAO;YACL,iBAAiB,EAAE,CAAC,OAAO,CAAC,iBAAiB,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC3E,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,mBAAmB,CAAC,CAC3D;YACD,GAAG,CAAC,OAAO,C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CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,IAAY,EAAE,UAAkB;IACxE,MAAM,YAAY,GAAG,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAE7C,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,YAAY,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,gBAAgB,UAAU,kDAAkD,IAAI,KAAK,UAAU,KAAK,YAAY,EAAE,CACnH,CAAC;IACJ,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,IAAY;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChE,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY,EAAE,IAAY;IACnD,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAE1C,OAAO,YAAY,KAAK,EAAE,IAAI,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC;AAC9F,CAAC","sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\n\nexport type AppRouterBuildTarget = \"node\" | \"cloudflare\" | \"aws-lambda\";\nexport type AppRouterClientConsoleMethod = \"debug\" | \"error\" | \"info\" | \"log\" | \"trace\" | \"warn\";\nexport type AppRouterClientSourceMapMode = \"none\" | \"hidden\" | \"linked\";\nexport type AppRouterClientSourceMapOption = boolean | AppRouterClientSourceMapMode;\n\nexport interface AppRouterProductionOptions {\n dropClientConsole?: boolean | readonly AppRouterClientConsoleMethod[] | undefined;\n}\n\nexport interface AppRouterProjectOptions {\n assetBaseUrl?: string | undefined;\n buildTargets?: readonly AppRouterBuildTarget[] | undefined;\n clientSourceMaps?: AppRouterClientSourceMapOption | undefined;\n /**\n * Legacy route root. When provided without routesDir/projectRoot, this keeps\n * the historical \"appDir is the whole app boundary\" behavior.\n *\n * @deprecated Use projectRoot + routesDir instead. The legacy appDir shortcut\n * is kept for direct tests and older programmatic callers and is planned for\n * removal after 0.1.0.\n */\n appDir?: string | undefined;\n allowedSourceDirs?: readonly string[] | undefined;\n projectRoot?: string | undefined;\n production?: AppRouterProductionOptions | undefined;\n publicDir?: string | undefined;\n publicAssetBaseUrl?: string | undefined;\n routesDir?: string | undefined;\n}\n\nexport interface ResolvedAppRouterProject {\n allowedSourceDirs: readonly string[];\n assetBaseUrl?: string | undefined;\n buildTargets: readonly AppRouterBuildTarget[];\n clientSourceMaps: AppRouterClientSourceMapMode;\n clientConsolePureFunctions?: readonly string[] | undefined;\n projectRoot: string;\n publicAssetBaseUrl?: string | undefined;\n publicDir: string;\n routesDir: string;\n}\n\nexport function resolveAppRouterProjectOptions(\n options: AppRouterProjectOptions,\n): ResolvedAppRouterProject {\n const clientConsolePureFunctions = resolveClientConsolePureFunctions(\n options.production?.dropClientConsole,\n );\n\n if (\n options.appDir !== undefined &&\n options.projectRoot === undefined &&\n options.routesDir === undefined\n ) {\n const appDir = resolve(options.appDir);\n\n return {\n allowedSourceDirs: (options.allowedSourceDirs ?? [appDir]).map((directory) =>\n resolveProjectPath(appDir, directory, \"allowedSourceDirs\"),\n ),\n ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),\n buildTargets: resolveBuildTargets(options.buildTargets),\n clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),\n ...(clientConsolePureFunctions === undefined ? {} : { clientConsolePureFunctions }),\n projectRoot: appDir,\n ...(options.publicAssetBaseUrl === undefined\n ? {}\n : { publicAssetBaseUrl: options.publicAssetBaseUrl }),\n publicDir: resolveProjectPath(appDir, options.publicDir ?? \"public\", \"publicDir\"),\n routesDir: appDir,\n };\n }\n\n const projectRoot = resolve(options.projectRoot ?? process.cwd());\n\n return {\n allowedSourceDirs: (options.allowedSourceDirs ?? [\"src\"]).map((directory) =>\n resolveProjectPath(projectRoot, directory, \"allowedSourceDirs\"),\n ),\n ...(options.assetBaseUrl === undefined ? {} : { assetBaseUrl: options.assetBaseUrl }),\n buildTargets: resolveBuildTargets(options.buildTargets),\n clientSourceMaps: resolveClientSourceMapMode(options.clientSourceMaps),\n ...(clientConsolePureFunctions === undefined ? {} : { clientConsolePureFunctions }),\n projectRoot,\n ...(options.publicAssetBaseUrl === undefined\n ? {}\n : { publicAssetBaseUrl: options.publicAssetBaseUrl }),\n publicDir: resolveProjectPath(projectRoot, options.publicDir ?? \"public\", \"publicDir\"),\n routesDir: resolveProjectPath(projectRoot, options.routesDir ?? \"src/app\", \"routesDir\"),\n };\n}\n\nconst defaultDroppedClientConsoleMethods = [\"debug\", \"info\", \"log\"] as const;\nconst supportedClientConsoleMethods = new Set<AppRouterClientConsoleMethod>([\n \"debug\",\n \"error\",\n \"info\",\n \"log\",\n \"trace\",\n \"warn\",\n]);\n\nexport function resolveClientConsolePureFunctions(\n value: AppRouterProductionOptions[\"dropClientConsole\"],\n): readonly string[] | undefined {\n if (value === undefined || value === false) {\n return undefined;\n }\n\n const methods = value === true ? defaultDroppedClientConsoleMethods : value;\n const uniqueMethods = [...new Set(methods)];\n\n for (const method of uniqueMethods) {\n if (!supportedClientConsoleMethods.has(method)) {\n throw new Error(\n `Unsupported mreactRouter production.dropClientConsole method ${JSON.stringify(method)}. Expected \"debug\", \"error\", \"info\", \"log\", \"trace\", or \"warn\".`,\n );\n }\n }\n\n return uniqueMethods.length === 0\n ? undefined\n : uniqueMethods.map((method) => `console.${method}`);\n}\n\nexport function resolveClientSourceMapMode(\n value: AppRouterClientSourceMapOption | undefined,\n): AppRouterClientSourceMapMode {\n if (value === undefined || value === false || value === \"none\") {\n return \"none\";\n }\n\n if (value === true || value === \"linked\") {\n return \"linked\";\n }\n\n if (value === \"hidden\") {\n return \"hidden\";\n }\n\n throw new Error(\n `Unsupported mreactRouter clientSourceMaps value ${JSON.stringify(value)}. Expected false, true, \"none\", \"hidden\", or \"linked\".`,\n );\n}\n\nexport function resolveBuildTargets(\n targets: readonly AppRouterBuildTarget[] | undefined,\n): readonly AppRouterBuildTarget[] {\n if (targets === undefined) {\n return [\"node\", \"cloudflare\"];\n }\n\n const uniqueTargets = [...new Set(targets)];\n\n if (uniqueTargets.length === 0) {\n throw new Error(\"mreactRouter buildTargets must include at least one target.\");\n }\n\n for (const target of uniqueTargets) {\n if (target !== \"node\" && target !== \"cloudflare\" && target !== \"aws-lambda\") {\n throw new Error(\n `Unsupported mreactRouter build target ${JSON.stringify(target)}. Expected \"node\", \"cloudflare\", or \"aws-lambda\".`,\n );\n }\n }\n\n return uniqueTargets;\n}\n\nfunction resolveProjectPath(root: string, path: string, optionName: string): string {\n const resolvedPath = resolvePath(root, path);\n\n if (!isInsideDirectory(root, resolvedPath)) {\n throw new Error(\n `mreactRouter ${optionName} must resolve inside projectRoot. projectRoot: ${root}; ${optionName}: ${resolvedPath}`,\n );\n }\n\n return resolvedPath;\n}\n\nfunction resolvePath(root: string, path: string): string {\n return isAbsolute(path) ? resolve(path) : resolve(root, path);\n}\n\nfunction isInsideDirectory(root: string, path: string): boolean {\n const relativePath = relative(root, path);\n\n return relativePath === \"\" || (!relativePath.startsWith(\"..\") && !isAbsolute(relativePath));\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ export declare const getSession: typeof getSessionInternal;
39
39
  export declare const rotateSession: typeof rotateSessionInternal;
40
40
  export type { AwsLambdaArtifactManifest, BuildAppOptions, BuildAppResult, BuiltImportPolicyArtifact, CloudflarePagesArtifactManifest, PackageAwsLambdaArtifactOptions, PackageCloudflarePagesArtifactOptions, } from "./build.js";
41
41
  export type { InferLoaderData, LayoutProps, LoaderContext, GenerateMetadataContext, ManifestContext, ManifestDescriptor, MetadataImage, MetadataScalar, MetadataThemeColor, MetadataViewport, MReactNode, PageProps, RobotsContext, RobotsManifest, RobotsRule, RouteHeadDescriptor, RouteHandlerContext, RouteMetadata, RouteParams, RouteSecurityHeaders, RouteStrictTransportSecurity, SitemapContext, SitemapEntry, } from "./types.js";
42
- export type { AppRouterBuildTarget, AppRouterClientSourceMapMode, AppRouterClientSourceMapOption, } from "./config.js";
42
+ export type { AppRouterBuildTarget, AppRouterClientConsoleMethod, AppRouterClientSourceMapMode, AppRouterClientSourceMapOption, AppRouterProductionOptions, } from "./config.js";
43
43
  export type { AssetHelperOptions, AssetLinkDescriptor, AssetManifest, AssetManifestEntry, } from "./assets.js";
44
44
  export type { AppRouterCache, AppRouterCacheEntry, CacheControlOptions, MemoryRouteCacheOptions, RouteCachePolicy, } from "./cache.js";
45
45
  export type { CookieOptions } from "./cookies.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC5D,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,YAAY,EACV,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;A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IAAI,kBAAkB,EAChC,aAAa,IAAI,qBAAqB,GACvC,MAAM,cAAc,CAAC;AAQtB;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,gCAAgC,CAAC;AACzE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC;AACrD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAC7C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAkFnD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAkBnB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAM/C,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAiBpB,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASxF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { buildApp, packageAwsLambdaArtifact, packageCloudflarePagesArtifact } from \"./build.js\";\nexport { assetHref, assetPreloadLinks } from \"./assets.js\";\nexport { cacheControl, createMemoryRouteCache, revalidatePath } from \"./cache.js\";\nexport { deleteCookie, parseCookieHeader, serializeCookie, setCookie } from \"./cookies.js\";\nexport { defineMessages, detectLocale } from \"./i18n.js\";\nexport { defer, isDeferredLoaderData } from \"./deferred.js\";\nexport type { DeferredLoaderData } from \"./deferred.js\";\nexport { Link, linkProps } from \"./link.js\";\nexport { parseMultipartStream } from \"./multipart.js\";\nexport type {\n MultipartFixedLengthStream,\n MultipartStreamFieldOptions,\n MultipartStreamParseOptions,\n MultipartStreamPart,\n} from \"./multipart.js\";\nexport { getNavigationState, subscribeNavigationState } from \"./navigation-state.js\";\nexport { getRouterRuntimeCacheStats } from \"./runtime-cache.js\";\nexport type { HttpUpgradeHandler } from \"./upgrade.js\";\nexport {\n cookies,\n headers,\n html,\n isNotFoundError,\n isRedirectError,\n json,\n next,\n notFound,\n parseForm,\n redirect,\n redirect303,\n redirectExternal,\n rewrite,\n textError,\n} from \"./navigation.js\";\nexport type { ParseSchema } from \"./navigation.js\";\nexport { createMemoryPrerenderStore } from \"./prerender-store.js\";\nexport { getServerRuntimeState } from \"./runtime-state.js\";\nimport {\n createMemorySessionStore as createMemorySessionStoreInternal,\n createSession as createSessionInternal,\n destroySession as destroySessionInternal,\n getSession as getSessionInternal,\n rotateSession as rotateSessionInternal,\n} from \"./session.js\";\nimport type {\n MemorySessionStoreOptions as MemorySessionStoreOptionsInternal,\n SessionCookieOptions as SessionCookieOptionsInternal,\n SessionRecord as SessionRecordInternal,\n SessionStore as SessionStoreInternal,\n} from \"./session.js\";\n\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const createMemorySessionStore = createMemorySessionStoreInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const createSession = createSessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const destroySession = destroySessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const getSession = getSessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const rotateSession = rotateSessionInternal;\nexport type {\n AwsLambdaArtifactManifest,\n BuildAppOptions,\n BuildAppResult,\n BuiltImportPolicyArtifact,\n CloudflarePagesArtifactManifest,\n PackageAwsLambdaArtifactOptions,\n PackageCloudflarePagesArtifactOptions,\n} from \"./build.js\";\nexport type {\n InferLoaderData,\n LayoutProps,\n LoaderContext,\n GenerateMetadataContext,\n ManifestContext,\n ManifestDescriptor,\n MetadataImage,\n MetadataScalar,\n MetadataThemeColor,\n MetadataViewport,\n MReactNode,\n PageProps,\n RobotsContext,\n RobotsManifest,\n RobotsRule,\n RouteHeadDescriptor,\n RouteHandlerContext,\n RouteMetadata,\n RouteParams,\n RouteSecurityHeaders,\n RouteStrictTransportSecurity,\n SitemapContext,\n SitemapEntry,\n} from \"./types.js\";\nexport type {\n AppRouterBuildTarget,\n AppRouterClientSourceMapMode,\n AppRouterClientSourceMapOption,\n} from \"./config.js\";\nexport type {\n AssetHelperOptions,\n AssetLinkDescriptor,\n AssetManifest,\n AssetManifestEntry,\n} from \"./assets.js\";\nexport type {\n AppRouterCache,\n AppRouterCacheEntry,\n CacheControlOptions,\n MemoryRouteCacheOptions,\n RouteCachePolicy,\n} from \"./cache.js\";\nexport type { CookieOptions } from \"./cookies.js\";\nexport type { AppRouterImportPolicy } from \"./import-policy.js\";\nexport type {\n LinkOptions,\n LinkPrefetch,\n LinkProps,\n LinkScroll,\n LinkTransition,\n} from \"./link.js\";\nexport type {\n AppRouterNavigationState,\n AppRouterNavigationStateListener,\n AppRouterNavigationType,\n} from \"./navigation-state.js\";\nexport type { RouterRuntimeCacheStat } from \"./runtime-cache.js\";\nexport type { MemorySessionStoreOptionsInternal as MemorySessionStoreOptions };\nexport type {\n AppRouterLogError,\n AppRouterLogEvent,\n AppRouterLogger,\n AppRouterLogLevel,\n AppRouterRuntime,\n AppRouterRequestEndLogEvent,\n AppRouterRequestErrorLogEvent,\n AppRouterRenderTimingLogEvent,\n AppRouterRequestStartLogEvent,\n AppRouterRequestTimingLogEvent,\n} from \"./logger.js\";\nexport type { DetectedLocale, LocaleRoutingOptions, MessageTree } from \"./i18n.js\";\nexport {\n createFormCsrfToken,\n formCsrfCookie,\n formCsrfFieldName,\n validateFormCsrf,\n} from \"./csrf.js\";\nexport type {\n AppRouterAllowedServerAction,\n AppRouterServerActionOptions,\n PreparedFormActionReference,\n} from \"./actions.js\";\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionCookieOptions = SessionCookieOptionsInternal;\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionRecord<TData = unknown> = SessionRecordInternal<TData>;\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionStore<TData = unknown> = SessionStoreInternal<TData>;\nexport { startDevServer } from \"./dev-server.js\";\nexport type { StartDevServerOptions } from \"./dev-server.js\";\nexport { renderAppRequest } from \"./render.js\";\nexport type {\n AppRouterResponseHook,\n AppRouterResponseHookContext,\n RenderAppRequestOptions,\n} from \"./render.js\";\nexport {\n parseTraceContext,\n traceContextFromRequest,\n} from \"./trace.js\";\nexport type {\n RouterInstrumentation,\n RouterMiddlewareEndInstrumentationEvent,\n RouterMiddlewareInstrumentationEvent,\n RouterRequestEndInstrumentationEvent,\n RouterRequestInstrumentationEvent,\n RouterRouteEndInstrumentationEvent,\n RouterRouteInstrumentationEvent,\n RouterTraceContext,\n} from \"./trace.js\";\nexport type {\n FileSystemPrerenderStoreOptions,\n KeyValuePrerenderStoreAdapter,\n KeyValuePrerenderStoreOptions,\n MemoryPrerenderStoreOptions,\n} from \"./prerender-store.js\";\nexport { createFileSystemPrerenderStore, createKeyValuePrerenderStore } from \"./prerender-store.js\";\nexport { preloadBuiltAppRuntime, renderBuiltAppRequest, startServer } from \"./serve.js\";\nexport type {\n BuiltAppRuntimePreloadMode,\n AppRouterPrerenderStore,\n BuiltAppRuntimePreloadStrategy,\n RenderBuiltAppRequestOptions,\n RequestHostPolicy,\n StartServerOptions,\n} from \"./serve.js\";\nexport { matchRoute, scanAppRoutes } from \"./routes.js\";\nexport type { AppFileConvention } from \"./file-conventions.js\";\nexport type {\n AppAssetRoute,\n AppMetadataRoute,\n AppRoute,\n MatchedRoute,\n PageRoute,\n RouteSegment,\n ServerRoute,\n} from \"./routes.js\";\n"]}
1
+ {"version":3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BAAwB,GAAG,gCAAgC,CAAC;AACzE;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AACnD;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC;AACrD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AAC7C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAoFnD,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAkBnB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAM/C,OAAO,EACL,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAiBpB,OAAO,EAAE,8BAA8B,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpG,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AASxF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { buildApp, packageAwsLambdaArtifact, packageCloudflarePagesArtifact } from \"./build.js\";\nexport { assetHref, assetPreloadLinks } from \"./assets.js\";\nexport { cacheControl, createMemoryRouteCache, revalidatePath } from \"./cache.js\";\nexport { deleteCookie, parseCookieHeader, serializeCookie, setCookie } from \"./cookies.js\";\nexport { defineMessages, detectLocale } from \"./i18n.js\";\nexport { defer, isDeferredLoaderData } from \"./deferred.js\";\nexport type { DeferredLoaderData } from \"./deferred.js\";\nexport { Link, linkProps } from \"./link.js\";\nexport { parseMultipartStream } from \"./multipart.js\";\nexport type {\n MultipartFixedLengthStream,\n MultipartStreamFieldOptions,\n MultipartStreamParseOptions,\n MultipartStreamPart,\n} from \"./multipart.js\";\nexport { getNavigationState, subscribeNavigationState } from \"./navigation-state.js\";\nexport { getRouterRuntimeCacheStats } from \"./runtime-cache.js\";\nexport type { HttpUpgradeHandler } from \"./upgrade.js\";\nexport {\n cookies,\n headers,\n html,\n isNotFoundError,\n isRedirectError,\n json,\n next,\n notFound,\n parseForm,\n redirect,\n redirect303,\n redirectExternal,\n rewrite,\n textError,\n} from \"./navigation.js\";\nexport type { ParseSchema } from \"./navigation.js\";\nexport { createMemoryPrerenderStore } from \"./prerender-store.js\";\nexport { getServerRuntimeState } from \"./runtime-state.js\";\nimport {\n createMemorySessionStore as createMemorySessionStoreInternal,\n createSession as createSessionInternal,\n destroySession as destroySessionInternal,\n getSession as getSessionInternal,\n rotateSession as rotateSessionInternal,\n} from \"./session.js\";\nimport type {\n MemorySessionStoreOptions as MemorySessionStoreOptionsInternal,\n SessionCookieOptions as SessionCookieOptionsInternal,\n SessionRecord as SessionRecordInternal,\n SessionStore as SessionStoreInternal,\n} from \"./session.js\";\n\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const createMemorySessionStore = createMemorySessionStoreInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const createSession = createSessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const destroySession = destroySessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const getSession = getSessionInternal;\n/**\n * @deprecated Import session helpers from `@reckona/mreact-auth` instead.\n */\nexport const rotateSession = rotateSessionInternal;\nexport type {\n AwsLambdaArtifactManifest,\n BuildAppOptions,\n BuildAppResult,\n BuiltImportPolicyArtifact,\n CloudflarePagesArtifactManifest,\n PackageAwsLambdaArtifactOptions,\n PackageCloudflarePagesArtifactOptions,\n} from \"./build.js\";\nexport type {\n InferLoaderData,\n LayoutProps,\n LoaderContext,\n GenerateMetadataContext,\n ManifestContext,\n ManifestDescriptor,\n MetadataImage,\n MetadataScalar,\n MetadataThemeColor,\n MetadataViewport,\n MReactNode,\n PageProps,\n RobotsContext,\n RobotsManifest,\n RobotsRule,\n RouteHeadDescriptor,\n RouteHandlerContext,\n RouteMetadata,\n RouteParams,\n RouteSecurityHeaders,\n RouteStrictTransportSecurity,\n SitemapContext,\n SitemapEntry,\n} from \"./types.js\";\nexport type {\n AppRouterBuildTarget,\n AppRouterClientConsoleMethod,\n AppRouterClientSourceMapMode,\n AppRouterClientSourceMapOption,\n AppRouterProductionOptions,\n} from \"./config.js\";\nexport type {\n AssetHelperOptions,\n AssetLinkDescriptor,\n AssetManifest,\n AssetManifestEntry,\n} from \"./assets.js\";\nexport type {\n AppRouterCache,\n AppRouterCacheEntry,\n CacheControlOptions,\n MemoryRouteCacheOptions,\n RouteCachePolicy,\n} from \"./cache.js\";\nexport type { CookieOptions } from \"./cookies.js\";\nexport type { AppRouterImportPolicy } from \"./import-policy.js\";\nexport type {\n LinkOptions,\n LinkPrefetch,\n LinkProps,\n LinkScroll,\n LinkTransition,\n} from \"./link.js\";\nexport type {\n AppRouterNavigationState,\n AppRouterNavigationStateListener,\n AppRouterNavigationType,\n} from \"./navigation-state.js\";\nexport type { RouterRuntimeCacheStat } from \"./runtime-cache.js\";\nexport type { MemorySessionStoreOptionsInternal as MemorySessionStoreOptions };\nexport type {\n AppRouterLogError,\n AppRouterLogEvent,\n AppRouterLogger,\n AppRouterLogLevel,\n AppRouterRuntime,\n AppRouterRequestEndLogEvent,\n AppRouterRequestErrorLogEvent,\n AppRouterRenderTimingLogEvent,\n AppRouterRequestStartLogEvent,\n AppRouterRequestTimingLogEvent,\n} from \"./logger.js\";\nexport type { DetectedLocale, LocaleRoutingOptions, MessageTree } from \"./i18n.js\";\nexport {\n createFormCsrfToken,\n formCsrfCookie,\n formCsrfFieldName,\n validateFormCsrf,\n} from \"./csrf.js\";\nexport type {\n AppRouterAllowedServerAction,\n AppRouterServerActionOptions,\n PreparedFormActionReference,\n} from \"./actions.js\";\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionCookieOptions = SessionCookieOptionsInternal;\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionRecord<TData = unknown> = SessionRecordInternal<TData>;\n/**\n * @deprecated Import session helpers and types from `@reckona/mreact-auth` instead.\n */\nexport type SessionStore<TData = unknown> = SessionStoreInternal<TData>;\nexport { startDevServer } from \"./dev-server.js\";\nexport type { StartDevServerOptions } from \"./dev-server.js\";\nexport { renderAppRequest } from \"./render.js\";\nexport type {\n AppRouterResponseHook,\n AppRouterResponseHookContext,\n RenderAppRequestOptions,\n} from \"./render.js\";\nexport {\n parseTraceContext,\n traceContextFromRequest,\n} from \"./trace.js\";\nexport type {\n RouterInstrumentation,\n RouterMiddlewareEndInstrumentationEvent,\n RouterMiddlewareInstrumentationEvent,\n RouterRequestEndInstrumentationEvent,\n RouterRequestInstrumentationEvent,\n RouterRouteEndInstrumentationEvent,\n RouterRouteInstrumentationEvent,\n RouterTraceContext,\n} from \"./trace.js\";\nexport type {\n FileSystemPrerenderStoreOptions,\n KeyValuePrerenderStoreAdapter,\n KeyValuePrerenderStoreOptions,\n MemoryPrerenderStoreOptions,\n} from \"./prerender-store.js\";\nexport { createFileSystemPrerenderStore, createKeyValuePrerenderStore } from \"./prerender-store.js\";\nexport { preloadBuiltAppRuntime, renderBuiltAppRequest, startServer } from \"./serve.js\";\nexport type {\n BuiltAppRuntimePreloadMode,\n AppRouterPrerenderStore,\n BuiltAppRuntimePreloadStrategy,\n RenderBuiltAppRequestOptions,\n RequestHostPolicy,\n StartServerOptions,\n} from \"./serve.js\";\nexport { matchRoute, scanAppRoutes } from \"./routes.js\";\nexport type { AppFileConvention } from \"./file-conventions.js\";\nexport type {\n AppAssetRoute,\n AppMetadataRoute,\n AppRoute,\n MatchedRoute,\n PageRoute,\n RouteSegment,\n ServerRoute,\n} from \"./routes.js\";\n"]}
@@ -10,6 +10,7 @@ export declare function importAppRouterSourceModule<T>(options: {
10
10
  code: string;
11
11
  externalizeAppSourceModuleDirs?: readonly string[] | undefined;
12
12
  label: string;
13
+ plugins?: readonly RouterCompatPlugin[] | undefined;
13
14
  resolveDir?: string | undefined;
14
15
  serverSourceTransform?: ServerSourceTransformOptions | undefined;
15
16
  sourcefile?: string | undefined;
@@ -24,6 +25,7 @@ export declare function bundleAppRouterSourceModule(options: {
24
25
  code: string;
25
26
  externalizeAppSourceModuleDirs?: readonly string[] | undefined;
26
27
  label: string;
28
+ plugins?: readonly RouterCompatPlugin[] | undefined;
27
29
  resolveDir?: string | undefined;
28
30
  serverSourceTransform?: ServerSourceTransformOptions | undefined;
29
31
  sourcefile?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"module-runner.d.ts","sourceRoot":"","sources":["../src/module-runner.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjF,OAAO,EAAmC,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAE1E,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAKL,KAAK,sBAAsB,EAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAKL,KAAK,yBAAyB,EAC/B,MAAM,6BAA6B,CAAC;AAsBrC,wBAAgB,mCAAmC,IAAI,sBAAsB,EAAE,CAe9E;AAED,wBAAsB,2BAA2B,CAAC,CAAC,EAAE,OAAO,EAAE;IAC5D,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,qBAAqB,CAAC,EAAE,4BAA4B,GAAG,SAAS,CAAC;IACjE,UAAU,CAAC,EAAE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