@react-router/dev 0.0.0-experimental-e1f760554 → 0.0.0-experimental-a839ff7e2
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 +2 -4
- package/dist/cli/index.js +1396 -83
- package/dist/config.js +19 -1
- package/dist/routes.js +179 -12
- package/dist/vite/cloudflare.js +155 -17
- package/dist/vite.js +2742 -10
- package/package.json +9 -9
- package/dist/build-7TXNW2O3.js +0 -239
- package/dist/chunk-FJ4CMFCI.js +0 -49
- package/dist/chunk-OQBNE3LV.js +0 -219
- package/dist/chunk-PR3MIATB.js +0 -57
- package/dist/chunk-RXPOXUKM.js +0 -2626
- package/dist/chunk-SSBSSZ6H.js +0 -31
- package/dist/chunk-YZMCCARW.js +0 -81
- package/dist/config/module-sync-enabled/false.cjs +0 -2
- package/dist/config/module-sync-enabled/true.js +0 -2
- package/dist/dev-COP3AUB5.js +0 -74
package/dist/chunk-SSBSSZ6H.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-e1f760554
|
|
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
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
12
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
13
|
-
}) : x)(function(x) {
|
|
14
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
15
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// invariant.ts
|
|
19
|
-
function invariant(value, message) {
|
|
20
|
-
if (value === false || value === null || typeof value === "undefined") {
|
|
21
|
-
console.error(
|
|
22
|
-
"The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose"
|
|
23
|
-
);
|
|
24
|
-
throw new Error(message);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
__require,
|
|
30
|
-
invariant
|
|
31
|
-
};
|
package/dist/chunk-YZMCCARW.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-e1f760554
|
|
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
|
-
import {
|
|
12
|
-
invariant
|
|
13
|
-
} from "./chunk-SSBSSZ6H.js";
|
|
14
|
-
|
|
15
|
-
// vite/node-adapter.ts
|
|
16
|
-
import { once } from "node:events";
|
|
17
|
-
import { Readable } from "node:stream";
|
|
18
|
-
import { splitCookiesString } from "set-cookie-parser";
|
|
19
|
-
import { createReadableStreamFromReadable } from "@react-router/node";
|
|
20
|
-
function fromNodeHeaders(nodeHeaders) {
|
|
21
|
-
let headers = new Headers();
|
|
22
|
-
for (let [key, values] of Object.entries(nodeHeaders)) {
|
|
23
|
-
if (values) {
|
|
24
|
-
if (Array.isArray(values)) {
|
|
25
|
-
for (let value of values) {
|
|
26
|
-
headers.append(key, value);
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
headers.set(key, values);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return headers;
|
|
34
|
-
}
|
|
35
|
-
function fromNodeRequest(nodeReq, nodeRes) {
|
|
36
|
-
let origin = nodeReq.headers.origin && "null" !== nodeReq.headers.origin ? nodeReq.headers.origin : `http://${nodeReq.headers.host}`;
|
|
37
|
-
invariant(
|
|
38
|
-
nodeReq.originalUrl,
|
|
39
|
-
"Expected `nodeReq.originalUrl` to be defined"
|
|
40
|
-
);
|
|
41
|
-
let url = new URL(nodeReq.originalUrl, origin);
|
|
42
|
-
let controller = new AbortController();
|
|
43
|
-
let init = {
|
|
44
|
-
method: nodeReq.method,
|
|
45
|
-
headers: fromNodeHeaders(nodeReq.headers),
|
|
46
|
-
signal: controller.signal
|
|
47
|
-
};
|
|
48
|
-
nodeRes.on("finish", () => controller = null);
|
|
49
|
-
nodeRes.on("close", () => controller?.abort());
|
|
50
|
-
if (nodeReq.method !== "GET" && nodeReq.method !== "HEAD") {
|
|
51
|
-
init.body = createReadableStreamFromReadable(nodeReq);
|
|
52
|
-
init.duplex = "half";
|
|
53
|
-
}
|
|
54
|
-
return new Request(url.href, init);
|
|
55
|
-
}
|
|
56
|
-
async function toNodeRequest(res, nodeRes) {
|
|
57
|
-
nodeRes.statusCode = res.status;
|
|
58
|
-
nodeRes.statusMessage = res.statusText;
|
|
59
|
-
let cookiesStrings = [];
|
|
60
|
-
for (let [name, value] of res.headers) {
|
|
61
|
-
if (name === "set-cookie") {
|
|
62
|
-
cookiesStrings.push(...splitCookiesString(value));
|
|
63
|
-
} else nodeRes.setHeader(name, value);
|
|
64
|
-
}
|
|
65
|
-
if (cookiesStrings.length) {
|
|
66
|
-
nodeRes.setHeader("set-cookie", cookiesStrings);
|
|
67
|
-
}
|
|
68
|
-
if (res.body) {
|
|
69
|
-
let responseBody = res.body;
|
|
70
|
-
let readable = Readable.from(responseBody);
|
|
71
|
-
readable.pipe(nodeRes);
|
|
72
|
-
await once(readable, "end");
|
|
73
|
-
} else {
|
|
74
|
-
nodeRes.end();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export {
|
|
79
|
-
fromNodeRequest,
|
|
80
|
-
toNodeRequest
|
|
81
|
-
};
|
package/dist/dev-COP3AUB5.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @react-router/dev v0.0.0-experimental-e1f760554
|
|
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
|
-
import {
|
|
12
|
-
getSession,
|
|
13
|
-
start,
|
|
14
|
-
stop
|
|
15
|
-
} from "./chunk-FJ4CMFCI.js";
|
|
16
|
-
import {
|
|
17
|
-
getVite,
|
|
18
|
-
preloadVite
|
|
19
|
-
} from "./chunk-PR3MIATB.js";
|
|
20
|
-
import "./chunk-SSBSSZ6H.js";
|
|
21
|
-
|
|
22
|
-
// vite/dev.ts
|
|
23
|
-
import colors from "picocolors";
|
|
24
|
-
async function dev(root, {
|
|
25
|
-
clearScreen,
|
|
26
|
-
config: configFile,
|
|
27
|
-
cors,
|
|
28
|
-
force,
|
|
29
|
-
host,
|
|
30
|
-
logLevel,
|
|
31
|
-
mode,
|
|
32
|
-
open,
|
|
33
|
-
port,
|
|
34
|
-
strictPort
|
|
35
|
-
}) {
|
|
36
|
-
await preloadVite();
|
|
37
|
-
let vite = getVite();
|
|
38
|
-
let server = await vite.createServer({
|
|
39
|
-
root,
|
|
40
|
-
mode,
|
|
41
|
-
configFile,
|
|
42
|
-
server: { open, cors, host, port, strictPort },
|
|
43
|
-
optimizeDeps: { force },
|
|
44
|
-
clearScreen,
|
|
45
|
-
logLevel
|
|
46
|
-
});
|
|
47
|
-
if (!server.config.plugins.find((plugin) => plugin.name === "react-router")) {
|
|
48
|
-
console.error(
|
|
49
|
-
colors.red("React Router Vite plugin not found in Vite config")
|
|
50
|
-
);
|
|
51
|
-
process.exit(1);
|
|
52
|
-
}
|
|
53
|
-
await server.listen();
|
|
54
|
-
server.printUrls();
|
|
55
|
-
let customShortcuts = [
|
|
56
|
-
{
|
|
57
|
-
key: "p",
|
|
58
|
-
description: "start/stop the profiler",
|
|
59
|
-
async action(server2) {
|
|
60
|
-
if (getSession()) {
|
|
61
|
-
await stop(server2.config.logger.info);
|
|
62
|
-
} else {
|
|
63
|
-
await start(() => {
|
|
64
|
-
server2.config.logger.info("Profiler started");
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
];
|
|
70
|
-
server.bindCLIShortcuts({ print: true, customShortcuts });
|
|
71
|
-
}
|
|
72
|
-
export {
|
|
73
|
-
dev
|
|
74
|
-
};
|