@react-router/dev 0.0.0-experimental-c0856287f
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/CHANGELOG.md +1773 -0
- package/LICENSE.md +23 -0
- package/README.md +13 -0
- package/dist/cli/commands.d.ts +12 -0
- package/dist/cli/commands.js +174 -0
- package/dist/cli/detectPackageManager.d.ts +10 -0
- package/dist/cli/detectPackageManager.js +39 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +19 -0
- package/dist/cli/run.d.ts +5 -0
- package/dist/cli/run.js +180 -0
- package/dist/cli/useJavascript.d.ts +4 -0
- package/dist/cli/useJavascript.js +66 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +21 -0
- package/dist/colors.d.ts +17 -0
- package/dist/colors.js +49 -0
- package/dist/config/defaults/entry.client.tsx +12 -0
- package/dist/config/defaults/entry.dev.d.ts +2 -0
- package/dist/config/defaults/entry.dev.ts +13 -0
- package/dist/config/defaults/entry.server.cloudflare.tsx +55 -0
- package/dist/config/defaults/entry.server.deno.tsx +55 -0
- package/dist/config/defaults/entry.server.node.tsx +155 -0
- package/dist/config/defaults/entry.server.spa.tsx +20 -0
- package/dist/config/flat-routes.d.ts +14 -0
- package/dist/config/flat-routes.js +418 -0
- package/dist/config/format.d.ts +5 -0
- package/dist/config/format.js +68 -0
- package/dist/config/routes.d.ts +98 -0
- package/dist/config/routes.js +93 -0
- package/dist/config/serverModes.d.ts +9 -0
- package/dist/config/serverModes.js +28 -0
- package/dist/config.d.ts +75 -0
- package/dist/config.js +152 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +23 -0
- package/dist/invariant.d.ts +2 -0
- package/dist/invariant.js +22 -0
- package/dist/manifest.d.ts +28 -0
- package/dist/vite/babel.d.ts +20 -0
- package/dist/vite/babel.js +49 -0
- package/dist/vite/build.d.ts +15 -0
- package/dist/vite/build.js +271 -0
- package/dist/vite/cloudflare-proxy-plugin.d.ts +15 -0
- package/dist/vite/cloudflare-proxy-plugin.js +82 -0
- package/dist/vite/dev.d.ts +15 -0
- package/dist/vite/dev.js +81 -0
- package/dist/vite/import-vite-esm-sync.d.ts +4 -0
- package/dist/vite/import-vite-esm-sync.js +28 -0
- package/dist/vite/index.d.ts +4 -0
- package/dist/vite/index.js +30 -0
- package/dist/vite/node-adapter.d.ts +6 -0
- package/dist/vite/node-adapter.js +78 -0
- package/dist/vite/plugin.d.ts +165 -0
- package/dist/vite/plugin.js +1178 -0
- package/dist/vite/profiler.d.ts +5 -0
- package/dist/vite/profiler.js +55 -0
- package/dist/vite/remove-exports-test.d.ts +1 -0
- package/dist/vite/remove-exports.d.ts +2 -0
- package/dist/vite/remove-exports.js +278 -0
- package/dist/vite/resolve-file-url.d.ts +3 -0
- package/dist/vite/resolve-file-url.js +53 -0
- package/dist/vite/static/refresh-utils.cjs +185 -0
- package/dist/vite/styles.d.ts +13 -0
- package/dist/vite/styles.js +176 -0
- package/dist/vite/vmod.d.ts +3 -0
- package/dist/vite/vmod.js +21 -0
- package/package.json +107 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-c0856287f
|
|
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
|
+
/**
|
|
16
|
+
* The mode to use when running the server.
|
|
17
|
+
*/
|
|
18
|
+
exports.ServerMode = void 0;
|
|
19
|
+
(function (ServerMode) {
|
|
20
|
+
ServerMode["Development"] = "development";
|
|
21
|
+
ServerMode["Production"] = "production";
|
|
22
|
+
ServerMode["Test"] = "test";
|
|
23
|
+
})(exports.ServerMode || (exports.ServerMode = {}));
|
|
24
|
+
function isValidServerMode(mode) {
|
|
25
|
+
return mode === exports.ServerMode.Development || mode === exports.ServerMode.Production || mode === exports.ServerMode.Test;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.isValidServerMode = isValidServerMode;
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { RouteManifest, DefineRoutesFunction } from "./config/routes";
|
|
2
|
+
import { ServerMode } from "./config/serverModes";
|
|
3
|
+
export type ServerModuleFormat = "esm" | "cjs";
|
|
4
|
+
export type ServerPlatform = "node" | "neutral";
|
|
5
|
+
interface FutureConfig {
|
|
6
|
+
v3_fetcherPersist: boolean;
|
|
7
|
+
v3_relativeSplatPath: boolean;
|
|
8
|
+
v3_throwAbortReason: boolean;
|
|
9
|
+
unstable_singleFetch: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The user-provided config in `remix.config.js`.
|
|
13
|
+
*/
|
|
14
|
+
export interface AppConfig {
|
|
15
|
+
/**
|
|
16
|
+
* The path to the `app` directory, relative to `remix.config.js`. Defaults
|
|
17
|
+
* to `"app"`.
|
|
18
|
+
*/
|
|
19
|
+
appDirectory?: string;
|
|
20
|
+
/**
|
|
21
|
+
* A function for defining custom routes, in addition to those already defined
|
|
22
|
+
* using the filesystem convention in `app/routes`. Both sets of routes will
|
|
23
|
+
* be merged.
|
|
24
|
+
*/
|
|
25
|
+
routes?: (defineRoutes: DefineRoutesFunction) => ReturnType<DefineRoutesFunction> | Promise<ReturnType<DefineRoutesFunction>>;
|
|
26
|
+
/**
|
|
27
|
+
* The output format of the server build. Defaults to "esm".
|
|
28
|
+
*/
|
|
29
|
+
serverModuleFormat?: ServerModuleFormat;
|
|
30
|
+
/**
|
|
31
|
+
* A list of filenames or a glob patterns to match files in the `app/routes`
|
|
32
|
+
* directory that Remix will ignore. Matching files will not be recognized as
|
|
33
|
+
* routes.
|
|
34
|
+
*/
|
|
35
|
+
ignoredRouteFiles?: string[];
|
|
36
|
+
/**
|
|
37
|
+
* Enabled future flags
|
|
38
|
+
*/
|
|
39
|
+
future?: [keyof FutureConfig] extends [never] ? {
|
|
40
|
+
[key: string]: never;
|
|
41
|
+
} : Partial<FutureConfig>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Fully resolved configuration object we use throughout Remix.
|
|
45
|
+
*/
|
|
46
|
+
export interface RemixConfig {
|
|
47
|
+
/**
|
|
48
|
+
* The absolute path to the application source directory.
|
|
49
|
+
*/
|
|
50
|
+
appDirectory: string;
|
|
51
|
+
/**
|
|
52
|
+
* The absolute path to the entry.client file.
|
|
53
|
+
*/
|
|
54
|
+
entryClientFilePath: string;
|
|
55
|
+
/**
|
|
56
|
+
* The absolute path to the entry.server file.
|
|
57
|
+
*/
|
|
58
|
+
entryServerFilePath: string;
|
|
59
|
+
/**
|
|
60
|
+
* An object of all available routes, keyed by route id.
|
|
61
|
+
*/
|
|
62
|
+
routes: RouteManifest;
|
|
63
|
+
/**
|
|
64
|
+
* The output format of the server build. Defaults to "esm".
|
|
65
|
+
*/
|
|
66
|
+
serverModuleFormat: ServerModuleFormat;
|
|
67
|
+
future: FutureConfig;
|
|
68
|
+
}
|
|
69
|
+
export declare function resolveConfig(appConfig: AppConfig, { rootDirectory, serverMode, isSpaMode, }: {
|
|
70
|
+
rootDirectory: string;
|
|
71
|
+
serverMode?: ServerMode;
|
|
72
|
+
isSpaMode?: boolean;
|
|
73
|
+
}): Promise<RemixConfig>;
|
|
74
|
+
export declare function findConfig(dir: string, basename: string, extensions: string[]): string | undefined;
|
|
75
|
+
export {};
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-c0856287f
|
|
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 node_child_process = require('node:child_process');
|
|
16
|
+
var path = require('node:path');
|
|
17
|
+
var fse = require('fs-extra');
|
|
18
|
+
var PackageJson = require('@npmcli/package-json');
|
|
19
|
+
var routes = require('./config/routes.js');
|
|
20
|
+
var serverModes = require('./config/serverModes.js');
|
|
21
|
+
var flatRoutes = require('./config/flat-routes.js');
|
|
22
|
+
var detectPackageManager = require('./cli/detectPackageManager.js');
|
|
23
|
+
|
|
24
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
|
+
|
|
26
|
+
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
27
|
+
var fse__default = /*#__PURE__*/_interopDefaultLegacy(fse);
|
|
28
|
+
var PackageJson__default = /*#__PURE__*/_interopDefaultLegacy(PackageJson);
|
|
29
|
+
|
|
30
|
+
async function resolveConfig(appConfig, {
|
|
31
|
+
rootDirectory,
|
|
32
|
+
serverMode = serverModes.ServerMode.Production,
|
|
33
|
+
isSpaMode = false
|
|
34
|
+
}) {
|
|
35
|
+
var _appConfig$future, _appConfig$future2, _appConfig$future3, _appConfig$future4, _appConfig$future5;
|
|
36
|
+
if (!serverModes.isValidServerMode(serverMode)) {
|
|
37
|
+
throw new Error(`Invalid server mode "${serverMode}"`);
|
|
38
|
+
}
|
|
39
|
+
let serverModuleFormat = appConfig.serverModuleFormat || "esm";
|
|
40
|
+
let appDirectory = path__default["default"].resolve(rootDirectory, appConfig.appDirectory || "app");
|
|
41
|
+
let defaultsDirectory = path__default["default"].resolve(__dirname, "config", "defaults");
|
|
42
|
+
let userEntryClientFile = findEntry(appDirectory, "entry.client");
|
|
43
|
+
let userEntryServerFile = findEntry(appDirectory, "entry.server");
|
|
44
|
+
let entryServerFile;
|
|
45
|
+
let entryClientFile = userEntryClientFile || "entry.client.tsx";
|
|
46
|
+
let pkgJson = await PackageJson__default["default"].load(rootDirectory);
|
|
47
|
+
let deps = pkgJson.content.dependencies ?? {};
|
|
48
|
+
if (isSpaMode && ((_appConfig$future = appConfig.future) === null || _appConfig$future === void 0 ? void 0 : _appConfig$future.unstable_singleFetch) != true) {
|
|
49
|
+
// This is a super-simple default since we don't need streaming in SPA Mode.
|
|
50
|
+
// We can include this in a remix-spa template, but right now `npx remix reveal`
|
|
51
|
+
// will still expose the streaming template since that command doesn't have
|
|
52
|
+
// access to the `ssr:false` flag in the vite config (the streaming template
|
|
53
|
+
// works just fine so maybe instea dof having this we _only have this version
|
|
54
|
+
// in the template...). We let users manage an entry.server file in SPA Mode
|
|
55
|
+
// so they can de ide if they want to hydrate the full document or just an
|
|
56
|
+
// embedded `<div id="app">` or whatever.
|
|
57
|
+
entryServerFile = "entry.server.spa.tsx";
|
|
58
|
+
} else if (userEntryServerFile) {
|
|
59
|
+
entryServerFile = userEntryServerFile;
|
|
60
|
+
} else {
|
|
61
|
+
let serverRuntime = deps["@react-router/deno"] ? "deno" : deps["@react-router/cloudflare"] ? "cloudflare" : deps["@react-router/node"] ? "node" : undefined;
|
|
62
|
+
if (!serverRuntime) {
|
|
63
|
+
let serverRuntimes = ["@react-router/deno", "@react-router/cloudflare", "@react-router/node"];
|
|
64
|
+
let formattedList = disjunctionListFormat.format(serverRuntimes);
|
|
65
|
+
throw new Error(`Could not determine server runtime. Please install one of the following: ${formattedList}`);
|
|
66
|
+
}
|
|
67
|
+
if (!deps["isbot"]) {
|
|
68
|
+
console.log("adding `isbot` to your package.json, you should commit this change");
|
|
69
|
+
pkgJson.update({
|
|
70
|
+
dependencies: {
|
|
71
|
+
...pkgJson.content.dependencies,
|
|
72
|
+
isbot: "^4"
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
await pkgJson.save();
|
|
76
|
+
let packageManager = detectPackageManager.detectPackageManager() ?? "npm";
|
|
77
|
+
node_child_process.execSync(`${packageManager} install`, {
|
|
78
|
+
cwd: rootDirectory,
|
|
79
|
+
stdio: "inherit"
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
entryServerFile = `entry.server.${serverRuntime}.tsx`;
|
|
83
|
+
}
|
|
84
|
+
let entryClientFilePath = userEntryClientFile ? path__default["default"].resolve(appDirectory, userEntryClientFile) : path__default["default"].resolve(defaultsDirectory, entryClientFile);
|
|
85
|
+
let entryServerFilePath = userEntryServerFile ? path__default["default"].resolve(appDirectory, userEntryServerFile) : path__default["default"].resolve(defaultsDirectory, entryServerFile);
|
|
86
|
+
let rootRouteFile = findEntry(appDirectory, "root");
|
|
87
|
+
if (!rootRouteFile) {
|
|
88
|
+
throw new Error(`Missing "root" route file in ${appDirectory}`);
|
|
89
|
+
}
|
|
90
|
+
let routes$1 = {
|
|
91
|
+
root: {
|
|
92
|
+
path: "",
|
|
93
|
+
id: "root",
|
|
94
|
+
file: rootRouteFile
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
if (fse__default["default"].existsSync(path__default["default"].resolve(appDirectory, "routes"))) {
|
|
98
|
+
let fileRoutes = flatRoutes.flatRoutes(appDirectory, appConfig.ignoredRouteFiles);
|
|
99
|
+
for (let route of Object.values(fileRoutes)) {
|
|
100
|
+
routes$1[route.id] = {
|
|
101
|
+
...route,
|
|
102
|
+
parentId: route.parentId || "root"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (appConfig.routes) {
|
|
107
|
+
let manualRoutes = await appConfig.routes(routes.defineRoutes);
|
|
108
|
+
for (let route of Object.values(manualRoutes)) {
|
|
109
|
+
routes$1[route.id] = {
|
|
110
|
+
...route,
|
|
111
|
+
parentId: route.parentId || "root"
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
let future = {
|
|
116
|
+
v3_fetcherPersist: ((_appConfig$future2 = appConfig.future) === null || _appConfig$future2 === void 0 ? void 0 : _appConfig$future2.v3_fetcherPersist) === true,
|
|
117
|
+
v3_relativeSplatPath: ((_appConfig$future3 = appConfig.future) === null || _appConfig$future3 === void 0 ? void 0 : _appConfig$future3.v3_relativeSplatPath) === true,
|
|
118
|
+
v3_throwAbortReason: ((_appConfig$future4 = appConfig.future) === null || _appConfig$future4 === void 0 ? void 0 : _appConfig$future4.v3_throwAbortReason) === true,
|
|
119
|
+
unstable_singleFetch: ((_appConfig$future5 = appConfig.future) === null || _appConfig$future5 === void 0 ? void 0 : _appConfig$future5.unstable_singleFetch) === true
|
|
120
|
+
};
|
|
121
|
+
return {
|
|
122
|
+
appDirectory,
|
|
123
|
+
entryClientFilePath,
|
|
124
|
+
entryServerFilePath,
|
|
125
|
+
routes: routes$1,
|
|
126
|
+
serverModuleFormat,
|
|
127
|
+
future
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
const entryExts = [".js", ".jsx", ".ts", ".tsx"];
|
|
131
|
+
function findEntry(dir, basename) {
|
|
132
|
+
for (let ext of entryExts) {
|
|
133
|
+
let file = path__default["default"].resolve(dir, basename + ext);
|
|
134
|
+
if (fse__default["default"].existsSync(file)) return path__default["default"].relative(dir, file);
|
|
135
|
+
}
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
function findConfig(dir, basename, extensions) {
|
|
139
|
+
for (let ext of extensions) {
|
|
140
|
+
let name = basename + ext;
|
|
141
|
+
let file = path__default["default"].join(dir, name);
|
|
142
|
+
if (fse__default["default"].existsSync(file)) return file;
|
|
143
|
+
}
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
let disjunctionListFormat = new Intl.ListFormat("en", {
|
|
147
|
+
style: "long",
|
|
148
|
+
type: "disjunction"
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
exports.findConfig = findConfig;
|
|
152
|
+
exports.resolveConfig = resolveConfig;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-c0856287f
|
|
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 index = require('./cli/index.js');
|
|
16
|
+
var index$1 = require('./vite/index.js');
|
|
17
|
+
var cloudflareProxyPlugin = require('./vite/cloudflare-proxy-plugin.js');
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.cli = index;
|
|
22
|
+
exports.vitePlugin = index$1.vitePlugin;
|
|
23
|
+
exports.cloudflareDevProxyVitePlugin = cloudflareProxyPlugin.cloudflareDevProxyVitePlugin;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-c0856287f
|
|
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
|
+
function invariant(value, message) {
|
|
16
|
+
if (value === false || value === null || typeof value === "undefined") {
|
|
17
|
+
console.error("The following error is a bug in Remix; please open an issue! https://github.com/remix-run/remix/issues/new");
|
|
18
|
+
throw new Error(message);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports["default"] = invariant;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export type Manifest = {
|
|
2
|
+
version: string;
|
|
3
|
+
url?: string;
|
|
4
|
+
entry: {
|
|
5
|
+
module: string;
|
|
6
|
+
imports: string[];
|
|
7
|
+
};
|
|
8
|
+
routes: {
|
|
9
|
+
[routeId: string]: {
|
|
10
|
+
id: string;
|
|
11
|
+
parentId?: string;
|
|
12
|
+
path?: string;
|
|
13
|
+
index?: boolean;
|
|
14
|
+
caseSensitive?: boolean;
|
|
15
|
+
module: string;
|
|
16
|
+
imports?: string[];
|
|
17
|
+
hasAction: boolean;
|
|
18
|
+
hasLoader: boolean;
|
|
19
|
+
hasClientAction: boolean;
|
|
20
|
+
hasClientLoader: boolean;
|
|
21
|
+
hasErrorBoundary: boolean;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
hmr?: {
|
|
25
|
+
timestamp?: number;
|
|
26
|
+
runtime: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { NodePath } from "@babel/traverse";
|
|
2
|
+
import type { types as BabelTypes } from "@babel/core";
|
|
3
|
+
import { parse } from "@babel/parser";
|
|
4
|
+
import * as t from "@babel/types";
|
|
5
|
+
declare const traverse: {
|
|
6
|
+
<S>(parent: BabelTypes.Node, opts: import("@babel/traverse").TraverseOptions<S>, scope: import("@babel/traverse").Scope | undefined, state: S, parentPath?: NodePath<BabelTypes.Node> | undefined): void;
|
|
7
|
+
(parent: BabelTypes.Node, opts?: import("@babel/traverse").TraverseOptions<BabelTypes.Node> | undefined, scope?: import("@babel/traverse").Scope | undefined, state?: any, parentPath?: NodePath<BabelTypes.Node> | undefined): void;
|
|
8
|
+
visitors: typeof import("@babel/traverse").visitors;
|
|
9
|
+
verify: typeof import("@babel/traverse").visitors.verify;
|
|
10
|
+
explode: typeof import("@babel/traverse").visitors.explode;
|
|
11
|
+
cheap: (node: BabelTypes.Node, enter: (node: BabelTypes.Node) => void) => void;
|
|
12
|
+
node: (node: BabelTypes.Node, opts: import("@babel/traverse").TraverseOptions<BabelTypes.Node>, scope?: import("@babel/traverse").Scope | undefined, state?: any, path?: NodePath<BabelTypes.Node> | undefined, skipKeys?: Record<string, boolean> | undefined) => void;
|
|
13
|
+
clearNode: (node: BabelTypes.Node, opts?: BabelTypes.RemovePropertiesOptions | undefined) => void;
|
|
14
|
+
removeProperties: (tree: BabelTypes.Node, opts?: BabelTypes.RemovePropertiesOptions | undefined) => BabelTypes.Node;
|
|
15
|
+
hasType: (tree: BabelTypes.Node, type: "File" | "FunctionDeclaration" | "FunctionExpression" | "ArrowFunctionExpression" | "Identifier" | "Program" | "AnyTypeAnnotation" | "ArgumentPlaceholder" | "ArrayExpression" | "ArrayPattern" | "ArrayTypeAnnotation" | "AssignmentExpression" | "AssignmentPattern" | "AwaitExpression" | "BigIntLiteral" | "BinaryExpression" | "BindExpression" | "BlockStatement" | "BooleanLiteral" | "BooleanLiteralTypeAnnotation" | "BooleanTypeAnnotation" | "BreakStatement" | "CallExpression" | "CatchClause" | "ClassAccessorProperty" | "ClassBody" | "ClassDeclaration" | "ClassExpression" | "ClassImplements" | "ClassMethod" | "ClassPrivateMethod" | "ClassPrivateProperty" | "ClassProperty" | "ConditionalExpression" | "ContinueStatement" | "DebuggerStatement" | "DecimalLiteral" | "DeclareClass" | "DeclareExportAllDeclaration" | "DeclareExportDeclaration" | "DeclareFunction" | "DeclareInterface" | "DeclareModule" | "DeclareModuleExports" | "DeclareOpaqueType" | "DeclareTypeAlias" | "DeclareVariable" | "DeclaredPredicate" | "Decorator" | "Directive" | "DirectiveLiteral" | "DoExpression" | "DoWhileStatement" | "EmptyStatement" | "EmptyTypeAnnotation" | "EnumBooleanBody" | "EnumBooleanMember" | "EnumDeclaration" | "EnumDefaultedMember" | "EnumNumberBody" | "EnumNumberMember" | "EnumStringBody" | "EnumStringMember" | "EnumSymbolBody" | "ExistsTypeAnnotation" | "ExportAllDeclaration" | "ExportDefaultDeclaration" | "ExportDefaultSpecifier" | "ExportNamedDeclaration" | "ExportNamespaceSpecifier" | "ExportSpecifier" | "ExpressionStatement" | "ForInStatement" | "ForOfStatement" | "ForStatement" | "FunctionTypeAnnotation" | "FunctionTypeParam" | "GenericTypeAnnotation" | "IfStatement" | "Import" | "ImportAttribute" | "ImportDeclaration" | "ImportDefaultSpecifier" | "ImportExpression" | "ImportNamespaceSpecifier" | "ImportSpecifier" | "IndexedAccessType" | "InferredPredicate" | "InterfaceDeclaration" | "InterfaceExtends" | "InterfaceTypeAnnotation" | "InterpreterDirective" | "IntersectionTypeAnnotation" | "JSXAttribute" | "JSXClosingElement" | "JSXClosingFragment" | "JSXElement" | "JSXEmptyExpression" | "JSXExpressionContainer" | "JSXFragment" | "JSXIdentifier" | "JSXMemberExpression" | "JSXNamespacedName" | "JSXOpeningElement" | "JSXOpeningFragment" | "JSXSpreadAttribute" | "JSXSpreadChild" | "JSXText" | "LabeledStatement" | "LogicalExpression" | "MemberExpression" | "MetaProperty" | "MixedTypeAnnotation" | "ModuleExpression" | "NewExpression" | "Noop" | "NullLiteral" | "NullLiteralTypeAnnotation" | "NullableTypeAnnotation" | "NumberLiteral" | "NumberLiteralTypeAnnotation" | "NumberTypeAnnotation" | "NumericLiteral" | "ObjectExpression" | "ObjectMethod" | "ObjectPattern" | "ObjectProperty" | "ObjectTypeAnnotation" | "ObjectTypeCallProperty" | "ObjectTypeIndexer" | "ObjectTypeInternalSlot" | "ObjectTypeProperty" | "ObjectTypeSpreadProperty" | "OpaqueType" | "OptionalCallExpression" | "OptionalIndexedAccessType" | "OptionalMemberExpression" | "ParenthesizedExpression" | "PipelineBareFunction" | "PipelinePrimaryTopicReference" | "PipelineTopicExpression" | "Placeholder" | "PrivateName" | "QualifiedTypeIdentifier" | "RecordExpression" | "RegExpLiteral" | "RegexLiteral" | "RestElement" | "RestProperty" | "ReturnStatement" | "SequenceExpression" | "SpreadElement" | "SpreadProperty" | "StaticBlock" | "StringLiteral" | "StringLiteralTypeAnnotation" | "StringTypeAnnotation" | "Super" | "SwitchCase" | "SwitchStatement" | "SymbolTypeAnnotation" | "TSAnyKeyword" | "TSArrayType" | "TSAsExpression" | "TSBigIntKeyword" | "TSBooleanKeyword" | "TSCallSignatureDeclaration" | "TSConditionalType" | "TSConstructSignatureDeclaration" | "TSConstructorType" | "TSDeclareFunction" | "TSDeclareMethod" | "TSEnumDeclaration" | "TSEnumMember" | "TSExportAssignment" | "TSExpressionWithTypeArguments" | "TSExternalModuleReference" | "TSFunctionType" | "TSImportEqualsDeclaration" | "TSImportType" | "TSIndexSignature" | "TSIndexedAccessType" | "TSInferType" | "TSInstantiationExpression" | "TSInterfaceBody" | "TSInterfaceDeclaration" | "TSIntersectionType" | "TSIntrinsicKeyword" | "TSLiteralType" | "TSMappedType" | "TSMethodSignature" | "TSModuleBlock" | "TSModuleDeclaration" | "TSNamedTupleMember" | "TSNamespaceExportDeclaration" | "TSNeverKeyword" | "TSNonNullExpression" | "TSNullKeyword" | "TSNumberKeyword" | "TSObjectKeyword" | "TSOptionalType" | "TSParameterProperty" | "TSParenthesizedType" | "TSPropertySignature" | "TSQualifiedName" | "TSRestType" | "TSSatisfiesExpression" | "TSStringKeyword" | "TSSymbolKeyword" | "TSThisType" | "TSTupleType" | "TSTypeAliasDeclaration" | "TSTypeAnnotation" | "TSTypeAssertion" | "TSTypeLiteral" | "TSTypeOperator" | "TSTypeParameter" | "TSTypeParameterDeclaration" | "TSTypeParameterInstantiation" | "TSTypePredicate" | "TSTypeQuery" | "TSTypeReference" | "TSUndefinedKeyword" | "TSUnionType" | "TSUnknownKeyword" | "TSVoidKeyword" | "TaggedTemplateExpression" | "TemplateElement" | "TemplateLiteral" | "ThisExpression" | "ThisTypeAnnotation" | "ThrowStatement" | "TopicReference" | "TryStatement" | "TupleExpression" | "TupleTypeAnnotation" | "TypeAlias" | "TypeAnnotation" | "TypeCastExpression" | "TypeParameter" | "TypeParameterDeclaration" | "TypeParameterInstantiation" | "TypeofTypeAnnotation" | "UnaryExpression" | "UnionTypeAnnotation" | "UpdateExpression" | "V8IntrinsicIdentifier" | "VariableDeclaration" | "VariableDeclarator" | "Variance" | "VoidTypeAnnotation" | "WhileStatement" | "WithStatement" | "YieldExpression", denylistTypes?: string[] | undefined) => boolean;
|
|
16
|
+
cache: typeof import("@babel/traverse").cache;
|
|
17
|
+
};
|
|
18
|
+
declare const generate: typeof import("@babel/generator").default;
|
|
19
|
+
export { traverse, generate, parse, t };
|
|
20
|
+
export type { BabelTypes, NodePath };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @react-router/dev v0.0.0-experimental-c0856287f
|
|
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 parser = require('@babel/parser');
|
|
16
|
+
var t = require('@babel/types');
|
|
17
|
+
|
|
18
|
+
function _interopNamespace(e) {
|
|
19
|
+
if (e && e.__esModule) return e;
|
|
20
|
+
var n = Object.create(null);
|
|
21
|
+
if (e) {
|
|
22
|
+
Object.keys(e).forEach(function (k) {
|
|
23
|
+
if (k !== 'default') {
|
|
24
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () { return e[k]; }
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
n["default"] = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var t__namespace = /*#__PURE__*/_interopNamespace(t);
|
|
37
|
+
|
|
38
|
+
// These `require`s were needed to support building within vite-ecosystem-ci,
|
|
39
|
+
// otherwise we get errors that `traverse` and `generate` are not functions.
|
|
40
|
+
const traverse = require("@babel/traverse").default;
|
|
41
|
+
const generate = require("@babel/generator").default;
|
|
42
|
+
|
|
43
|
+
Object.defineProperty(exports, 'parse', {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return parser.parse; }
|
|
46
|
+
});
|
|
47
|
+
exports.t = t__namespace;
|
|
48
|
+
exports.generate = generate;
|
|
49
|
+
exports.traverse = traverse;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as Vite from "vite";
|
|
2
|
+
export interface ViteBuildOptions {
|
|
3
|
+
assetsInlineLimit?: number;
|
|
4
|
+
clearScreen?: boolean;
|
|
5
|
+
config?: string;
|
|
6
|
+
emptyOutDir?: boolean;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
logLevel?: Vite.LogLevel;
|
|
9
|
+
minify?: Vite.BuildOptions["minify"];
|
|
10
|
+
mode?: string;
|
|
11
|
+
profile?: boolean;
|
|
12
|
+
sourcemapClient?: boolean | "inline" | "hidden";
|
|
13
|
+
sourcemapServer?: boolean | "inline" | "hidden";
|
|
14
|
+
}
|
|
15
|
+
export declare function build(root: string, { assetsInlineLimit, clearScreen, config: configFile, emptyOutDir, force, logLevel, minify, mode, sourcemapClient, sourcemapServer, }: ViteBuildOptions): Promise<void>;
|