@react-router/dev 0.0.0-experimental-49eef6a01 → 0.0.0-experimental-a26b992a1
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/bin.js +1 -1
- package/dist/cli/commands.js +1 -1
- package/dist/cli/detectPackageManager.js +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -6
- package/dist/cli/run.js +1 -1
- package/dist/cli/useJavascript.js +1 -1
- package/dist/colors.js +1 -1
- package/dist/config/defaults/entry.client.tsx +1 -1
- package/dist/config/format.js +1 -1
- package/dist/config/routes.d.ts +77 -50
- package/dist/config/routes.js +175 -43
- package/dist/invariant.js +1 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.js +23 -0
- package/dist/vite/babel.d.ts +10 -10
- package/dist/vite/babel.js +1 -1
- package/dist/vite/build.js +2 -2
- package/dist/vite/cloudflare-dev-proxy.d.ts +7 -1
- package/dist/vite/cloudflare-dev-proxy.js +23 -7
- package/dist/vite/cloudflare.d.ts +1 -0
- package/dist/vite/cloudflare.js +19 -0
- package/dist/vite/combine-urls.d.ts +1 -0
- package/dist/vite/combine-urls.js +20 -0
- package/dist/{config.d.ts → vite/config.d.ts} +15 -27
- package/dist/{config.js → vite/config.js} +62 -45
- package/dist/vite/dev.js +1 -1
- package/dist/vite/import-vite-esm-sync.js +1 -1
- package/dist/vite/node-adapter.js +1 -1
- package/dist/vite/plugin.d.ts +6 -3
- package/dist/vite/plugin.js +145 -121
- package/dist/vite/profiler.js +1 -1
- package/dist/vite/remove-exports.d.ts +2 -2
- package/dist/vite/remove-exports.js +113 -243
- package/dist/vite/resolve-file-url.js +1 -1
- package/dist/vite/static/refresh-utils.cjs +7 -26
- package/dist/vite/styles.d.ts +3 -2
- package/dist/vite/styles.js +23 -2
- package/dist/vite/vmod.js +1 -1
- package/dist/vite/with-props.d.ts +4 -0
- package/dist/vite/with-props.js +151 -0
- package/dist/vite.d.ts +2 -0
- package/dist/{cli.js → vite.js} +7 -8
- package/package.json +21 -12
- package/dist/config/findConfig.d.ts +0 -1
- package/dist/config/findConfig.js +0 -32
- package/dist/config/flatRoutes.d.ts +0 -14
- package/dist/config/flatRoutes.js +0 -418
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -23
- package/dist/vite/define-route.d.ts +0 -5
- package/dist/vite/define-route.js +0 -207
- package/dist/vite/index.d.ts +0 -3
- package/dist/vite/index.js +0 -31
- /package/dist/{cli.d.ts → vite/combine-urls-test.d.ts} +0 -0
package/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
require("./dist/cli");
|
|
2
|
+
require("./dist/cli/index");
|
package/dist/cli/commands.js
CHANGED
package/dist/cli/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-a26b992a1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
13
|
var run = require('./run.js');
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
run.run().then(() => {
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}, error => {
|
|
18
|
+
if (error) console.error(error);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
});
|
package/dist/cli/run.js
CHANGED
package/dist/colors.js
CHANGED
package/dist/config/format.js
CHANGED
package/dist/config/routes.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare function setAppDirectory(directory: string): void;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
+
* Provides the absolute path to the app directory, for use within `routes.ts`.
|
|
5
|
+
* This is designed to support resolving file system routes.
|
|
4
6
|
*/
|
|
5
|
-
export
|
|
7
|
+
export declare function getAppDirectory(): string;
|
|
8
|
+
export interface RouteManifestEntry {
|
|
6
9
|
/**
|
|
7
10
|
* The path this route uses to match on the URL pathname.
|
|
8
11
|
*/
|
|
@@ -32,67 +35,91 @@ export interface ConfigRoute {
|
|
|
32
35
|
file: string;
|
|
33
36
|
}
|
|
34
37
|
export interface RouteManifest {
|
|
35
|
-
[routeId: string]:
|
|
38
|
+
[routeId: string]: RouteManifestEntry;
|
|
36
39
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Configuration for an individual route, for use within `routes.ts`. As a
|
|
42
|
+
* convenience, route config entries can be created with the {@link route},
|
|
43
|
+
* {@link index} and {@link layout} helper functions.
|
|
44
|
+
*/
|
|
45
|
+
export interface RouteConfigEntry {
|
|
43
46
|
/**
|
|
44
|
-
*
|
|
47
|
+
* The unique id for this route.
|
|
45
48
|
*/
|
|
46
|
-
|
|
49
|
+
id?: string;
|
|
47
50
|
/**
|
|
48
|
-
*
|
|
49
|
-
* two or more routes with the same route file.
|
|
51
|
+
* The path this route uses to match on the URL pathname.
|
|
50
52
|
*/
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
interface DefineRouteChildren {
|
|
54
|
-
(): void;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* A function for defining a route that is passed as the argument to the
|
|
58
|
-
* `defineRoutes` callback.
|
|
59
|
-
*
|
|
60
|
-
* Calls to this function are designed to be nested, using the `children`
|
|
61
|
-
* callback argument.
|
|
62
|
-
*
|
|
63
|
-
* defineRoutes(route => {
|
|
64
|
-
* route('/', 'pages/layout', () => {
|
|
65
|
-
* route('react-router', 'pages/react-router');
|
|
66
|
-
* route('reach-ui', 'pages/reach-ui');
|
|
67
|
-
* });
|
|
68
|
-
* });
|
|
69
|
-
*/
|
|
70
|
-
export interface DefineRouteFunction {
|
|
71
|
-
(
|
|
53
|
+
path?: string;
|
|
72
54
|
/**
|
|
73
|
-
*
|
|
55
|
+
* Should be `true` if it is an index route. This disallows child routes.
|
|
74
56
|
*/
|
|
75
|
-
|
|
57
|
+
index?: boolean;
|
|
76
58
|
/**
|
|
77
|
-
*
|
|
78
|
-
* route as its default export, relative to the `app` directory.
|
|
59
|
+
* Should be `true` if the `path` is case-sensitive. Defaults to `false`.
|
|
79
60
|
*/
|
|
80
|
-
|
|
61
|
+
caseSensitive?: boolean;
|
|
81
62
|
/**
|
|
82
|
-
*
|
|
63
|
+
* The path to the entry point for this route, relative to
|
|
64
|
+
* `config.appDirectory`.
|
|
83
65
|
*/
|
|
84
|
-
|
|
66
|
+
file: string;
|
|
85
67
|
/**
|
|
86
|
-
*
|
|
68
|
+
* The child routes.
|
|
87
69
|
*/
|
|
88
|
-
children?:
|
|
70
|
+
children?: RouteConfigEntry[];
|
|
89
71
|
}
|
|
90
|
-
export
|
|
72
|
+
export declare const routeConfigEntrySchema: v.BaseSchema<RouteConfigEntry, any, v.BaseIssue<unknown>>;
|
|
73
|
+
export declare const resolvedRouteConfigSchema: v.ArraySchema<v.BaseSchema<RouteConfigEntry, any, v.BaseIssue<unknown>>, undefined>;
|
|
74
|
+
type ResolvedRouteConfig = v.InferInput<typeof resolvedRouteConfigSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* Route config to be exported via the `routes` export within `routes.ts`.
|
|
77
|
+
*/
|
|
78
|
+
export type RouteConfig = ResolvedRouteConfig | Promise<ResolvedRouteConfig>;
|
|
79
|
+
export declare function validateRouteConfig({ routeConfigFile, routeConfig, }: {
|
|
80
|
+
routeConfigFile: string;
|
|
81
|
+
routeConfig: unknown;
|
|
82
|
+
}): {
|
|
83
|
+
valid: false;
|
|
84
|
+
message: string;
|
|
85
|
+
} | {
|
|
86
|
+
valid: true;
|
|
87
|
+
};
|
|
88
|
+
declare const createConfigRouteOptionKeys: ["id", "index", "caseSensitive"];
|
|
89
|
+
type CreateRouteOptions = Pick<RouteConfigEntry, (typeof createConfigRouteOptionKeys)[number]>;
|
|
90
|
+
/**
|
|
91
|
+
* Helper function for creating a route config entry, for use within
|
|
92
|
+
* `routes.ts`.
|
|
93
|
+
*/
|
|
94
|
+
declare function createRoute(path: string | null | undefined, file: string, children?: RouteConfigEntry[]): RouteConfigEntry;
|
|
95
|
+
declare function createRoute(path: string | null | undefined, file: string, options: CreateRouteOptions, children?: RouteConfigEntry[]): RouteConfigEntry;
|
|
96
|
+
declare const createIndexOptionKeys: ["id"];
|
|
97
|
+
type CreateIndexOptions = Pick<RouteConfigEntry, (typeof createIndexOptionKeys)[number]>;
|
|
98
|
+
/**
|
|
99
|
+
* Helper function for creating a route config entry for an index route, for use
|
|
100
|
+
* within `routes.ts`.
|
|
101
|
+
*/
|
|
102
|
+
declare function createIndex(file: string, options?: CreateIndexOptions): RouteConfigEntry;
|
|
103
|
+
declare const createLayoutOptionKeys: ["id"];
|
|
104
|
+
type CreateLayoutOptions = Pick<RouteConfigEntry, (typeof createLayoutOptionKeys)[number]>;
|
|
105
|
+
/**
|
|
106
|
+
* Helper function for creating a route config entry for a layout route, for use
|
|
107
|
+
* within `routes.ts`.
|
|
108
|
+
*/
|
|
109
|
+
declare function createLayout(file: string, children?: RouteConfigEntry[]): RouteConfigEntry;
|
|
110
|
+
declare function createLayout(file: string, options: CreateLayoutOptions, children?: RouteConfigEntry[]): RouteConfigEntry;
|
|
111
|
+
export declare const route: typeof createRoute;
|
|
112
|
+
export declare const index: typeof createIndex;
|
|
113
|
+
export declare const layout: typeof createLayout;
|
|
91
114
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
115
|
+
* Creates a set of route config helpers that resolve file paths relative to the
|
|
116
|
+
* given directory, for use within `routes.ts`. This is designed to support
|
|
117
|
+
* splitting route config into multiple files within different directories.
|
|
94
118
|
*/
|
|
95
|
-
export declare function
|
|
96
|
-
|
|
97
|
-
|
|
119
|
+
export declare function relative(directory: string): {
|
|
120
|
+
route: typeof route;
|
|
121
|
+
index: typeof index;
|
|
122
|
+
layout: typeof layout;
|
|
123
|
+
};
|
|
124
|
+
export declare function configRoutesToRouteManifest(routes: RouteConfigEntry[], rootId?: string): RouteManifest;
|
|
98
125
|
export {};
|
package/dist/config/routes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-a26b992a1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
14
|
|
|
15
15
|
var path = require('node:path');
|
|
16
|
+
var v = require('valibot');
|
|
17
|
+
var pick = require('lodash/pick');
|
|
18
|
+
var invariant = require('../invariant.js');
|
|
19
|
+
|
|
20
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
21
|
|
|
17
22
|
function _interopNamespace(e) {
|
|
18
23
|
if (e && e.__esModule) return e;
|
|
@@ -32,62 +37,189 @@ function _interopNamespace(e) {
|
|
|
32
37
|
return Object.freeze(n);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
var
|
|
40
|
+
var v__namespace = /*#__PURE__*/_interopNamespace(v);
|
|
41
|
+
var pick__default = /*#__PURE__*/_interopDefaultLegacy(pick);
|
|
36
42
|
|
|
43
|
+
let appDirectory;
|
|
44
|
+
function setAppDirectory(directory) {
|
|
45
|
+
appDirectory = directory;
|
|
46
|
+
}
|
|
37
47
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
48
|
+
* Provides the absolute path to the app directory, for use within `routes.ts`.
|
|
49
|
+
* This is designed to support resolving file system routes.
|
|
40
50
|
*/
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
function getAppDirectory() {
|
|
52
|
+
invariant["default"](appDirectory);
|
|
53
|
+
return appDirectory;
|
|
54
|
+
}
|
|
55
|
+
const routeConfigEntrySchema = v__namespace.pipe(v__namespace.custom(value => {
|
|
56
|
+
return !(typeof value === "object" && value !== null && "then" in value && "catch" in value);
|
|
57
|
+
}, "Invalid type: Expected object but received a promise. Did you forget to await?"), v__namespace.object({
|
|
58
|
+
id: v__namespace.optional(v__namespace.string()),
|
|
59
|
+
path: v__namespace.optional(v__namespace.string()),
|
|
60
|
+
index: v__namespace.optional(v__namespace.boolean()),
|
|
61
|
+
caseSensitive: v__namespace.optional(v__namespace.boolean()),
|
|
62
|
+
file: v__namespace.string(),
|
|
63
|
+
children: v__namespace.optional(v__namespace.array(v__namespace.lazy(() => routeConfigEntrySchema)))
|
|
64
|
+
}));
|
|
65
|
+
const resolvedRouteConfigSchema = v__namespace.array(routeConfigEntrySchema);
|
|
66
|
+
function validateRouteConfig({
|
|
67
|
+
routeConfigFile,
|
|
68
|
+
routeConfig
|
|
69
|
+
}) {
|
|
70
|
+
if (!routeConfig) {
|
|
71
|
+
return {
|
|
72
|
+
valid: false,
|
|
73
|
+
message: `No "routes" export defined in "${routeConfigFile}.`
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (!Array.isArray(routeConfig)) {
|
|
77
|
+
return {
|
|
78
|
+
valid: false,
|
|
79
|
+
message: `Route config in "${routeConfigFile}" must be an array.`
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
let {
|
|
83
|
+
issues
|
|
84
|
+
} = v__namespace.safeParse(resolvedRouteConfigSchema, routeConfig);
|
|
85
|
+
if (issues !== null && issues !== void 0 && issues.length) {
|
|
86
|
+
let {
|
|
87
|
+
root,
|
|
88
|
+
nested
|
|
89
|
+
} = v__namespace.flatten(issues);
|
|
90
|
+
return {
|
|
91
|
+
valid: false,
|
|
92
|
+
message: [`Route config in "${routeConfigFile}" is invalid.`, root ? `${root}` : [], nested ? Object.entries(nested).map(([path, message]) => `Path: routes.${path}\n${message}`) : []].flat().join("\n\n")
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
valid: true
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
const createConfigRouteOptionKeys = ["id", "index", "caseSensitive"];
|
|
100
|
+
function createRoute(path, file, optionsOrChildren, children) {
|
|
101
|
+
let options = {};
|
|
102
|
+
if (Array.isArray(optionsOrChildren) || !optionsOrChildren) {
|
|
103
|
+
children = optionsOrChildren;
|
|
104
|
+
} else {
|
|
105
|
+
options = optionsOrChildren;
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
file,
|
|
109
|
+
children,
|
|
110
|
+
path: path ?? undefined,
|
|
111
|
+
...pick__default["default"](options, createConfigRouteOptionKeys)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const createIndexOptionKeys = ["id"];
|
|
115
|
+
/**
|
|
116
|
+
* Helper function for creating a route config entry for an index route, for use
|
|
117
|
+
* within `routes.ts`.
|
|
118
|
+
*/
|
|
119
|
+
function createIndex(file, options) {
|
|
120
|
+
return {
|
|
121
|
+
file,
|
|
122
|
+
index: true,
|
|
123
|
+
...pick__default["default"](options, createIndexOptionKeys)
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const createLayoutOptionKeys = ["id"];
|
|
127
|
+
function createLayout(file, optionsOrChildren, children) {
|
|
128
|
+
let options = {};
|
|
129
|
+
if (Array.isArray(optionsOrChildren) || !optionsOrChildren) {
|
|
130
|
+
children = optionsOrChildren;
|
|
131
|
+
} else {
|
|
132
|
+
options = optionsOrChildren;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
file,
|
|
136
|
+
children,
|
|
137
|
+
...pick__default["default"](options, createLayoutOptionKeys)
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
const route = createRoute;
|
|
141
|
+
const index = createIndex;
|
|
142
|
+
const layout = createLayout;
|
|
143
|
+
/**
|
|
144
|
+
* Creates a set of route config helpers that resolve file paths relative to the
|
|
145
|
+
* given directory, for use within `routes.ts`. This is designed to support
|
|
146
|
+
* splitting route config into multiple files within different directories.
|
|
147
|
+
*/
|
|
148
|
+
function relative(directory) {
|
|
149
|
+
return {
|
|
150
|
+
/**
|
|
151
|
+
* Helper function for creating a route config entry, for use within
|
|
152
|
+
* `routes.ts`. Note that this helper has been scoped, meaning that file
|
|
153
|
+
* path will be resolved relative to the directory provided to the
|
|
154
|
+
* `relative` call that created this helper.
|
|
155
|
+
*/
|
|
156
|
+
route: (path$1, file, ...rest) => {
|
|
157
|
+
return route(path$1, path.resolve(directory, file), ...rest);
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* Helper function for creating a route config entry for an index route, for
|
|
161
|
+
* use within `routes.ts`. Note that this helper has been scoped, meaning
|
|
162
|
+
* that file path will be resolved relative to the directory provided to the
|
|
163
|
+
* `relative` call that created this helper.
|
|
164
|
+
*/
|
|
165
|
+
index: (file, ...rest) => {
|
|
166
|
+
return index(path.resolve(directory, file), ...rest);
|
|
167
|
+
},
|
|
168
|
+
/**
|
|
169
|
+
* Helper function for creating a route config entry for a layout route, for
|
|
170
|
+
* use within `routes.ts`. Note that this helper has been scoped, meaning
|
|
171
|
+
* that file path will be resolved relative to the directory provided to the
|
|
172
|
+
* `relative` call that created this helper.
|
|
173
|
+
*/
|
|
174
|
+
layout: (file, ...rest) => {
|
|
175
|
+
return layout(path.resolve(directory, file), ...rest);
|
|
58
176
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
function configRoutesToRouteManifest(routes, rootId = "root") {
|
|
180
|
+
let routeManifest = {};
|
|
181
|
+
function walk(route, parentId) {
|
|
182
|
+
let id = route.id || createRouteId(route.file);
|
|
183
|
+
let manifestItem = {
|
|
184
|
+
id,
|
|
185
|
+
parentId,
|
|
186
|
+
file: route.file,
|
|
187
|
+
path: route.path,
|
|
188
|
+
index: route.index,
|
|
189
|
+
caseSensitive: route.caseSensitive
|
|
66
190
|
};
|
|
67
|
-
if (
|
|
68
|
-
throw new Error(`Unable to define routes with duplicate route id: "${
|
|
191
|
+
if (routeManifest.hasOwnProperty(id)) {
|
|
192
|
+
throw new Error(`Unable to define routes with duplicate route id: "${id}"`);
|
|
69
193
|
}
|
|
70
|
-
|
|
71
|
-
if (children) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
194
|
+
routeManifest[id] = manifestItem;
|
|
195
|
+
if (route.children) {
|
|
196
|
+
for (let child of route.children) {
|
|
197
|
+
walk(child, id);
|
|
198
|
+
}
|
|
75
199
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
200
|
+
}
|
|
201
|
+
for (let route of routes) {
|
|
202
|
+
walk(route, rootId);
|
|
203
|
+
}
|
|
204
|
+
return routeManifest;
|
|
80
205
|
}
|
|
81
206
|
function createRouteId(file) {
|
|
82
207
|
return normalizeSlashes(stripFileExtension(file));
|
|
83
208
|
}
|
|
84
209
|
function normalizeSlashes(file) {
|
|
85
|
-
return file.split(
|
|
210
|
+
return file.split(path.win32.sep).join("/");
|
|
86
211
|
}
|
|
87
212
|
function stripFileExtension(file) {
|
|
88
213
|
return file.replace(/\.[a-z0-9]+$/i, "");
|
|
89
214
|
}
|
|
90
215
|
|
|
91
|
-
exports.
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
216
|
+
exports.configRoutesToRouteManifest = configRoutesToRouteManifest;
|
|
217
|
+
exports.getAppDirectory = getAppDirectory;
|
|
218
|
+
exports.index = index;
|
|
219
|
+
exports.layout = layout;
|
|
220
|
+
exports.relative = relative;
|
|
221
|
+
exports.resolvedRouteConfigSchema = resolvedRouteConfigSchema;
|
|
222
|
+
exports.route = route;
|
|
223
|
+
exports.routeConfigEntrySchema = routeConfigEntrySchema;
|
|
224
|
+
exports.setAppDirectory = setAppDirectory;
|
|
225
|
+
exports.validateRouteConfig = validateRouteConfig;
|
package/dist/invariant.js
CHANGED
package/dist/routes.d.ts
ADDED
package/dist/routes.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-a26b992a1
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Remix Software Inc.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
'use strict';
|
|
12
|
+
|
|
13
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
+
|
|
15
|
+
var routes = require('./config/routes.js');
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
exports.getAppDirectory = routes.getAppDirectory;
|
|
20
|
+
exports.index = routes.index;
|
|
21
|
+
exports.layout = routes.layout;
|
|
22
|
+
exports.relative = routes.relative;
|
|
23
|
+
exports.route = routes.route;
|
package/dist/vite/babel.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { NodePath } from "@babel/traverse";
|
|
2
|
-
import type { types as
|
|
3
|
-
import { parse } from "@babel/parser";
|
|
2
|
+
import type { types as Babel } from "@babel/core";
|
|
3
|
+
import { parse, type ParseResult } from "@babel/parser";
|
|
4
4
|
import * as t from "@babel/types";
|
|
5
5
|
declare const traverse: {
|
|
6
|
-
<S>(parent:
|
|
7
|
-
(parent:
|
|
6
|
+
<S>(parent: Babel.Node, opts: import("@babel/traverse").TraverseOptions<S>, scope: import("@babel/traverse").Scope | undefined, state: S, parentPath?: NodePath<Babel.Node> | undefined): void;
|
|
7
|
+
(parent: Babel.Node, opts?: import("@babel/traverse").TraverseOptions<Babel.Node> | undefined, scope?: import("@babel/traverse").Scope | undefined, state?: any, parentPath?: NodePath<Babel.Node> | undefined): void;
|
|
8
8
|
visitors: typeof import("@babel/traverse").visitors;
|
|
9
9
|
verify: typeof import("@babel/traverse").visitors.verify;
|
|
10
10
|
explode: typeof import("@babel/traverse").visitors.explode;
|
|
11
|
-
cheap: (node:
|
|
12
|
-
node: (node:
|
|
13
|
-
clearNode: (node:
|
|
14
|
-
removeProperties: (tree:
|
|
15
|
-
hasType: (tree:
|
|
11
|
+
cheap: (node: Babel.Node, enter: (node: Babel.Node) => void) => void;
|
|
12
|
+
node: (node: Babel.Node, opts: import("@babel/traverse").TraverseOptions<Babel.Node>, scope?: import("@babel/traverse").Scope | undefined, state?: any, path?: NodePath<Babel.Node> | undefined, skipKeys?: Record<string, boolean> | undefined) => void;
|
|
13
|
+
clearNode: (node: Babel.Node, opts?: Babel.RemovePropertiesOptions | undefined) => void;
|
|
14
|
+
removeProperties: (tree: Babel.Node, opts?: Babel.RemovePropertiesOptions | undefined) => Babel.Node;
|
|
15
|
+
hasType: (tree: Babel.Node, type: "File" | "ArrayPattern" | "ObjectPattern" | "Identifier" | "RestElement" | "AssignmentPattern" | "TSAsExpression" | "TSSatisfiesExpression" | "TSTypeAssertion" | "TSNonNullExpression" | "MemberExpression" | "TSParameterProperty" | "ObjectProperty" | "ArrayExpression" | "AssignmentExpression" | "BinaryExpression" | "CallExpression" | "ConditionalExpression" | "FunctionExpression" | "StringLiteral" | "NumericLiteral" | "NullLiteral" | "BooleanLiteral" | "RegExpLiteral" | "LogicalExpression" | "NewExpression" | "ObjectExpression" | "SequenceExpression" | "ParenthesizedExpression" | "ThisExpression" | "UnaryExpression" | "UpdateExpression" | "ArrowFunctionExpression" | "ClassExpression" | "ImportExpression" | "MetaProperty" | "Super" | "TaggedTemplateExpression" | "TemplateLiteral" | "YieldExpression" | "AwaitExpression" | "Import" | "BigIntLiteral" | "OptionalMemberExpression" | "OptionalCallExpression" | "TypeCastExpression" | "JSXElement" | "JSXFragment" | "BindExpression" | "DoExpression" | "RecordExpression" | "TupleExpression" | "DecimalLiteral" | "ModuleExpression" | "TopicReference" | "PipelineTopicExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "TSInstantiationExpression" | "PrivateName" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayTypeAnnotation" | "BlockStatement" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ContinueStatement" | "DebuggerStatement" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionDeclaration" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "IfStatement" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LabeledStatement" | "MixedTypeAnnotation" | "Noop" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "ObjectMethod" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalIndexedAccessType" | "Placeholder" | "Program" | "QualifiedTypeIdentifier" | "RegexLiteral" | "RestProperty" | "ReturnStatement" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TemplateElement" | "ThisTypeAnnotation" | "ThrowStatement" | "TryStatement" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnionTypeAnnotation" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement", denylistTypes?: string[] | undefined) => boolean;
|
|
16
16
|
cache: typeof import("@babel/traverse").cache;
|
|
17
17
|
};
|
|
18
18
|
declare const generate: typeof import("@babel/generator").default;
|
|
19
19
|
export { traverse, generate, parse, t };
|
|
20
|
-
export type {
|
|
20
|
+
export type { Babel, NodePath, ParseResult };
|
package/dist/vite/babel.js
CHANGED
package/dist/vite/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-a26b992a1
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -16,7 +16,7 @@ var path = require('node:path');
|
|
|
16
16
|
var fse = require('fs-extra');
|
|
17
17
|
var colors = require('picocolors');
|
|
18
18
|
var plugin = require('./plugin.js');
|
|
19
|
-
var config = require('
|
|
19
|
+
var config = require('./config.js');
|
|
20
20
|
var invariant = require('../invariant.js');
|
|
21
21
|
var importViteEsmSync = require('./import-vite-esm-sync.js');
|
|
22
22
|
|
|
@@ -9,7 +9,13 @@ type GetLoadContext<Env, Cf extends CfProperties> = (args: {
|
|
|
9
9
|
request: Request;
|
|
10
10
|
context: LoadContext<Env, Cf>;
|
|
11
11
|
}) => AppLoadContext | Promise<AppLoadContext>;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Vite plugin that provides [Node proxies to local workerd
|
|
14
|
+
* bindings](https://developers.cloudflare.com/workers/wrangler/api/#getplatformproxy)
|
|
15
|
+
* to `context.cloudflare` in your server loaders and server actions during
|
|
16
|
+
* development.
|
|
17
|
+
*/
|
|
18
|
+
export declare const cloudflareDevProxyVitePlugin: <Env, Cf extends CfProperties>(options?: {
|
|
13
19
|
getLoadContext?: GetLoadContext<Env, Cf>;
|
|
14
20
|
} & GetPlatformProxyOptions) => Plugin;
|
|
15
21
|
export {};
|