@react-router/dev 7.16.0 → 8.0.0-pre.0

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 CHANGED
@@ -5,11 +5,9 @@
5
5
  ### Minor Changes
6
6
 
7
7
  - Stabilize `future.unstable_trailingSlashAwareDataRequests` as `future.v8_trailingSlashAwareDataRequests` ([#15098](https://github.com/remix-run/react-router/pull/15098))
8
-
9
8
  - The unstable flag is no longer supported and will error during config resolution
10
9
 
11
10
  - Log future flag warnings for upcoming React Router v8 flags ([#15029](https://github.com/remix-run/react-router/pull/15029))
12
-
13
11
  - `v8_middleware`, `v8_splitRouteModules`, `v8_viteEnvironmentApi`, `v8_passThroughRequests`, `v8_trailingSlashAwareDataRequests`
14
12
 
15
13
  ### Patch Changes
package/bin.cjs ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ void (async () => {
3
+ let { default: arg } = await import("arg");
4
+
5
+ // Minimal replication of our actual parsing in `run.ts`. If not already set,
6
+ // default `NODE_ENV` so React loads the proper version in its CJS entry script.
7
+ // We have to do this before importing `run.ts` since that is what imports
8
+ // `react` (indirectly via `react-router`)
9
+ let args = arg({}, { argv: process.argv.slice(2), permissive: true });
10
+ if (args._.length === 0 || args._[0] === "dev") {
11
+ process.env.NODE_ENV = process.env.NODE_ENV ?? "development";
12
+ } else {
13
+ process.env.NODE_ENV = process.env.NODE_ENV ?? "production";
14
+ }
15
+
16
+ await import("./dist/cli/index.js");
17
+ })().catch((error) => {
18
+ if (error) console.error(error);
19
+ process.exit(1);
20
+ });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @react-router/dev v8.0.0-pre.0
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 { g as preloadVite, h as getVite } from "./typegen-BLMwBSoM.js";
12
+ //#region vite/build.ts
13
+ async function build(root, viteBuildOptions) {
14
+ await preloadVite();
15
+ let { assetsInlineLimit, clearScreen, config: configFile, emptyOutDir, force, logLevel, minify, mode, sourcemapClient, sourcemapServer } = viteBuildOptions;
16
+ await (await getVite().createBuilder({
17
+ root,
18
+ mode,
19
+ configFile,
20
+ build: {
21
+ assetsInlineLimit,
22
+ emptyOutDir,
23
+ minify
24
+ },
25
+ optimizeDeps: { force },
26
+ clearScreen,
27
+ logLevel,
28
+ plugins: [{
29
+ name: "react-router:cli-config",
30
+ configEnvironment(name) {
31
+ if (sourcemapClient && name === "client") return { build: { sourcemap: sourcemapClient } };
32
+ if (sourcemapServer && name !== "client") return { build: { sourcemap: sourcemapServer } };
33
+ },
34
+ configResolved(config) {
35
+ if (!config.plugins.find((plugin) => plugin.name === "react-router" || plugin.name === "react-router/rsc")) throw new Error("React Router Vite plugin not found in Vite config");
36
+ }
37
+ }]
38
+ })).buildApp();
39
+ }
40
+ //#endregion
41
+ export { build };
@@ -1 +1,2 @@
1
- #!/usr/bin/env node
1
+
2
+ export { };