@react-router/dev 0.0.0-experimental-5bbc45fb6 → 0.0.0-experimental-b7b187661

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/cli/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/dev v0.0.0-experimental-5bbc45fb6
3
+ * @react-router/dev v0.0.0-experimental-b7b187661
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -1007,81 +1007,85 @@ function generateRoutes(ctx) {
1007
1007
  return { filename: filename2, content };
1008
1008
  }
1009
1009
  function generateRouteModuleAnnotations(ctx) {
1010
- return Object.values(ctx.config.routes).map((route) => {
1010
+ return Object.values(ctx.config.routes).filter((route) => isRouteInAppDirectory(ctx, route)).map((route) => {
1011
1011
  const filename2 = getRouteModuleAnnotationsFilepath(ctx, route);
1012
1012
  const parents = getParents(ctx, route);
1013
1013
  const content = import_dedent.default`
1014
- // Generated by React Router
1014
+ // Generated by React Router
1015
1015
 
1016
- import type {
1017
- Params,
1018
- RouteModuleAnnotations,
1019
- CreateLoaderData,
1020
- CreateActionData,
1021
- } from "react-router/internal";
1016
+ import type {
1017
+ Params,
1018
+ RouteModuleAnnotations,
1019
+ CreateLoaderData,
1020
+ CreateActionData,
1021
+ } from "react-router/internal";
1022
1022
 
1023
- ${parents.map((parent) => parent.import).join("\n" + " ".repeat(3))}
1024
- type Parents = [${parents.map((parent) => parent.name).join(", ")}]
1023
+ ${parents.map((parent) => parent.import).join("\n" + " ".repeat(3))}
1024
+ type Parents = [${parents.map((parent) => parent.name).join(", ")}]
1025
1025
 
1026
- type Id = "${route.id}"
1027
- type Module = typeof import("../${Pathe.filename(route.file)}.js")
1026
+ type Id = "${route.id}"
1027
+ type Module = typeof import("../${Pathe.filename(route.file)}.js")
1028
1028
 
1029
- export type unstable_Props = {
1030
- params: Params[Id]
1031
- loaderData: CreateLoaderData<Module>
1032
- actionData: CreateActionData<Module>
1033
- }
1029
+ export type unstable_Props = {
1030
+ params: Params[Id]
1031
+ loaderData: CreateLoaderData<Module>
1032
+ actionData: CreateActionData<Module>
1033
+ }
1034
1034
 
1035
- type Annotations = RouteModuleAnnotations<unstable_Props & {
1036
- parents: Parents,
1037
- module: Module,
1038
- }>;
1035
+ type Annotations = RouteModuleAnnotations<unstable_Props & {
1036
+ parents: Parents,
1037
+ module: Module,
1038
+ }>;
1039
1039
 
1040
- export namespace Route {
1041
- // links
1042
- export type LinkDescriptors = Annotations["LinkDescriptors"];
1043
- export type LinksFunction = Annotations["LinksFunction"];
1040
+ export namespace Route {
1041
+ // links
1042
+ export type LinkDescriptors = Annotations["LinkDescriptors"];
1043
+ export type LinksFunction = Annotations["LinksFunction"];
1044
1044
 
1045
- // meta
1046
- export type MetaArgs = Annotations["MetaArgs"];
1047
- export type MetaDescriptors = Annotations["MetaDescriptors"];
1048
- export type MetaFunction = Annotations["MetaFunction"];
1045
+ // meta
1046
+ export type MetaArgs = Annotations["MetaArgs"];
1047
+ export type MetaDescriptors = Annotations["MetaDescriptors"];
1048
+ export type MetaFunction = Annotations["MetaFunction"];
1049
1049
 
1050
- // headers
1051
- export type HeadersArgs = Annotations["HeadersArgs"];
1052
- export type HeadersFunction = Annotations["HeadersFunction"];
1050
+ // headers
1051
+ export type HeadersArgs = Annotations["HeadersArgs"];
1052
+ export type HeadersFunction = Annotations["HeadersFunction"];
1053
1053
 
1054
- // unstable_middleware
1055
- export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
1054
+ // unstable_middleware
1055
+ export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
1056
1056
 
1057
- // unstable_clientMiddleware
1058
- export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
1057
+ // unstable_clientMiddleware
1058
+ export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
1059
1059
 
1060
- // loader
1061
- export type LoaderArgs = Annotations["LoaderArgs"];
1060
+ // loader
1061
+ export type LoaderArgs = Annotations["LoaderArgs"];
1062
1062
 
1063
- // clientLoader
1064
- export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
1063
+ // clientLoader
1064
+ export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
1065
1065
 
1066
- // action
1067
- export type ActionArgs = Annotations["ActionArgs"];
1066
+ // action
1067
+ export type ActionArgs = Annotations["ActionArgs"];
1068
1068
 
1069
- // clientAction
1070
- export type ClientActionArgs = Annotations["ClientActionArgs"];
1069
+ // clientAction
1070
+ export type ClientActionArgs = Annotations["ClientActionArgs"];
1071
1071
 
1072
- // HydrateFallback
1073
- export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
1072
+ // HydrateFallback
1073
+ export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
1074
1074
 
1075
- // Component
1076
- export type ComponentProps = Annotations["ComponentProps"];
1075
+ // Component
1076
+ export type ComponentProps = Annotations["ComponentProps"];
1077
1077
 
1078
- // ErrorBoundary
1079
- export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
1080
- }
1081
- `;
1078
+ // ErrorBoundary
1079
+ export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
1080
+ }
1081
+ `;
1082
1082
  return { filename: filename2, content };
1083
1083
  });
1084
1084
  }
1085
+ function isRouteInAppDirectory(ctx, route) {
1086
+ const absoluteRoutePath = Path3.resolve(ctx.config.appDirectory, route.file);
1087
+ return absoluteRoutePath.startsWith(ctx.config.appDirectory);
1088
+ }
1085
1089
  function getRouteModuleAnnotationsFilepath(ctx, route) {
1086
1090
  return Path3.join(
1087
1091
  typesDirectory(ctx),
@@ -1155,7 +1159,7 @@ async function write(...files) {
1155
1159
  }
1156
1160
  async function run(rootDirectory, { mode }) {
1157
1161
  const ctx = await createContext2({ rootDirectory, mode, watch: false });
1158
- await clearRouteModuleAnnotations(ctx);
1162
+ await import_promises.default.rm(typesDirectory(ctx), { recursive: true, force: true });
1159
1163
  await write(
1160
1164
  generateFuture(ctx),
1161
1165
  generatePages(ctx),
@@ -1166,7 +1170,7 @@ async function run(rootDirectory, { mode }) {
1166
1170
  }
1167
1171
  async function watch(rootDirectory, { mode, logger }) {
1168
1172
  const ctx = await createContext2({ rootDirectory, mode, watch: true });
1169
- await clearRouteModuleAnnotations(ctx);
1173
+ await import_promises.default.rm(typesDirectory(ctx), { recursive: true, force: true });
1170
1174
  await write(
1171
1175
  generateFuture(ctx),
1172
1176
  generatePages(ctx),
package/dist/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v0.0.0-experimental-5bbc45fb6
2
+ * @react-router/dev v0.0.0-experimental-b7b187661
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/routes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v0.0.0-experimental-5bbc45fb6
2
+ * @react-router/dev v0.0.0-experimental-b7b187661
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v0.0.0-experimental-5bbc45fb6
2
+ * @react-router/dev v0.0.0-experimental-b7b187661
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/dev v0.0.0-experimental-5bbc45fb6
2
+ * @react-router/dev v0.0.0-experimental-b7b187661
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -994,81 +994,85 @@ function generateRoutes(ctx) {
994
994
  return { filename: filename2, content };
995
995
  }
996
996
  function generateRouteModuleAnnotations(ctx) {
997
- return Object.values(ctx.config.routes).map((route) => {
997
+ return Object.values(ctx.config.routes).filter((route) => isRouteInAppDirectory(ctx, route)).map((route) => {
998
998
  const filename2 = getRouteModuleAnnotationsFilepath(ctx, route);
999
999
  const parents = getParents(ctx, route);
1000
1000
  const content = import_dedent.default`
1001
- // Generated by React Router
1001
+ // Generated by React Router
1002
1002
 
1003
- import type {
1004
- Params,
1005
- RouteModuleAnnotations,
1006
- CreateLoaderData,
1007
- CreateActionData,
1008
- } from "react-router/internal";
1003
+ import type {
1004
+ Params,
1005
+ RouteModuleAnnotations,
1006
+ CreateLoaderData,
1007
+ CreateActionData,
1008
+ } from "react-router/internal";
1009
1009
 
1010
- ${parents.map((parent) => parent.import).join("\n" + " ".repeat(3))}
1011
- type Parents = [${parents.map((parent) => parent.name).join(", ")}]
1010
+ ${parents.map((parent) => parent.import).join("\n" + " ".repeat(3))}
1011
+ type Parents = [${parents.map((parent) => parent.name).join(", ")}]
1012
1012
 
1013
- type Id = "${route.id}"
1014
- type Module = typeof import("../${Pathe.filename(route.file)}.js")
1013
+ type Id = "${route.id}"
1014
+ type Module = typeof import("../${Pathe.filename(route.file)}.js")
1015
1015
 
1016
- export type unstable_Props = {
1017
- params: Params[Id]
1018
- loaderData: CreateLoaderData<Module>
1019
- actionData: CreateActionData<Module>
1020
- }
1016
+ export type unstable_Props = {
1017
+ params: Params[Id]
1018
+ loaderData: CreateLoaderData<Module>
1019
+ actionData: CreateActionData<Module>
1020
+ }
1021
1021
 
1022
- type Annotations = RouteModuleAnnotations<unstable_Props & {
1023
- parents: Parents,
1024
- module: Module,
1025
- }>;
1022
+ type Annotations = RouteModuleAnnotations<unstable_Props & {
1023
+ parents: Parents,
1024
+ module: Module,
1025
+ }>;
1026
1026
 
1027
- export namespace Route {
1028
- // links
1029
- export type LinkDescriptors = Annotations["LinkDescriptors"];
1030
- export type LinksFunction = Annotations["LinksFunction"];
1027
+ export namespace Route {
1028
+ // links
1029
+ export type LinkDescriptors = Annotations["LinkDescriptors"];
1030
+ export type LinksFunction = Annotations["LinksFunction"];
1031
1031
 
1032
- // meta
1033
- export type MetaArgs = Annotations["MetaArgs"];
1034
- export type MetaDescriptors = Annotations["MetaDescriptors"];
1035
- export type MetaFunction = Annotations["MetaFunction"];
1032
+ // meta
1033
+ export type MetaArgs = Annotations["MetaArgs"];
1034
+ export type MetaDescriptors = Annotations["MetaDescriptors"];
1035
+ export type MetaFunction = Annotations["MetaFunction"];
1036
1036
 
1037
- // headers
1038
- export type HeadersArgs = Annotations["HeadersArgs"];
1039
- export type HeadersFunction = Annotations["HeadersFunction"];
1037
+ // headers
1038
+ export type HeadersArgs = Annotations["HeadersArgs"];
1039
+ export type HeadersFunction = Annotations["HeadersFunction"];
1040
1040
 
1041
- // unstable_middleware
1042
- export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
1041
+ // unstable_middleware
1042
+ export type unstable_MiddlewareFunction = Annotations["unstable_MiddlewareFunction"];
1043
1043
 
1044
- // unstable_clientMiddleware
1045
- export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
1044
+ // unstable_clientMiddleware
1045
+ export type unstable_ClientMiddlewareFunction = Annotations["unstable_ClientMiddlewareFunction"];
1046
1046
 
1047
- // loader
1048
- export type LoaderArgs = Annotations["LoaderArgs"];
1047
+ // loader
1048
+ export type LoaderArgs = Annotations["LoaderArgs"];
1049
1049
 
1050
- // clientLoader
1051
- export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
1050
+ // clientLoader
1051
+ export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
1052
1052
 
1053
- // action
1054
- export type ActionArgs = Annotations["ActionArgs"];
1053
+ // action
1054
+ export type ActionArgs = Annotations["ActionArgs"];
1055
1055
 
1056
- // clientAction
1057
- export type ClientActionArgs = Annotations["ClientActionArgs"];
1056
+ // clientAction
1057
+ export type ClientActionArgs = Annotations["ClientActionArgs"];
1058
1058
 
1059
- // HydrateFallback
1060
- export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
1059
+ // HydrateFallback
1060
+ export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
1061
1061
 
1062
- // Component
1063
- export type ComponentProps = Annotations["ComponentProps"];
1062
+ // Component
1063
+ export type ComponentProps = Annotations["ComponentProps"];
1064
1064
 
1065
- // ErrorBoundary
1066
- export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
1067
- }
1068
- `;
1065
+ // ErrorBoundary
1066
+ export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
1067
+ }
1068
+ `;
1069
1069
  return { filename: filename2, content };
1070
1070
  });
1071
1071
  }
1072
+ function isRouteInAppDirectory(ctx, route) {
1073
+ const absoluteRoutePath = Path3.resolve(ctx.config.appDirectory, route.file);
1074
+ return absoluteRoutePath.startsWith(ctx.config.appDirectory);
1075
+ }
1072
1076
  function getRouteModuleAnnotationsFilepath(ctx, route) {
1073
1077
  return Path3.join(
1074
1078
  typesDirectory(ctx),
@@ -1129,7 +1133,7 @@ async function write(...files) {
1129
1133
  }
1130
1134
  async function watch(rootDirectory, { mode, logger }) {
1131
1135
  const ctx = await createContext2({ rootDirectory, mode, watch: true });
1132
- await clearRouteModuleAnnotations(ctx);
1136
+ await import_promises.default.rm(typesDirectory(ctx), { recursive: true, force: true });
1133
1137
  await write(
1134
1138
  generateFuture(ctx),
1135
1139
  generatePages(ctx),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/dev",
3
- "version": "0.0.0-experimental-5bbc45fb6",
3
+ "version": "0.0.0-experimental-b7b187661",
4
4
  "description": "Dev tools and CLI for React Router",
5
5
  "homepage": "https://reactrouter.com",
6
6
  "bugs": {
@@ -86,7 +86,7 @@
86
86
  "set-cookie-parser": "^2.6.0",
87
87
  "valibot": "^0.41.0",
88
88
  "vite-node": "3.0.0-beta.2",
89
- "@react-router/node": "0.0.0-experimental-5bbc45fb6"
89
+ "@react-router/node": "0.0.0-experimental-b7b187661"
90
90
  },
91
91
  "devDependencies": {
92
92
  "@types/babel__core": "^7.20.5",
@@ -110,15 +110,15 @@
110
110
  "vite": "^6.1.0",
111
111
  "wireit": "0.14.9",
112
112
  "wrangler": "^4.2.0",
113
- "@react-router/serve": "0.0.0-experimental-5bbc45fb6",
114
- "react-router": "^0.0.0-experimental-5bbc45fb6"
113
+ "react-router": "^0.0.0-experimental-b7b187661",
114
+ "@react-router/serve": "0.0.0-experimental-b7b187661"
115
115
  },
116
116
  "peerDependencies": {
117
117
  "typescript": "^5.1.0",
118
118
  "vite": "^5.1.0 || ^6.0.0",
119
119
  "wrangler": "^3.28.2 || ^4.0.0",
120
- "@react-router/serve": "^0.0.0-experimental-5bbc45fb6",
121
- "react-router": "^0.0.0-experimental-5bbc45fb6"
120
+ "@react-router/serve": "^0.0.0-experimental-b7b187661",
121
+ "react-router": "^0.0.0-experimental-b7b187661"
122
122
  },
123
123
  "peerDependenciesMeta": {
124
124
  "@react-router/serve": {