@reckona/mreact-router 0.0.91 → 0.0.92
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/build.d.ts +1 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +20 -0
- package/dist/build.js.map +1 -1
- package/dist/bundle-pipeline.js +9 -0
- package/dist/bundle-pipeline.js.map +1 -1
- package/dist/cli-options.d.ts +1 -0
- package/dist/cli-options.d.ts.map +1 -1
- package/dist/cli-options.js +6 -0
- package/dist/cli-options.js.map +1 -1
- package/dist/cli.js +1 -0
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -1
- package/dist/client.js.map +1 -1
- package/dist/module-runner.js +4 -0
- package/dist/module-runner.js.map +1 -1
- package/dist/vite.d.ts.map +1 -1
- package/dist/vite.js +4 -0
- package/dist/vite.js.map +1 -1
- package/package.json +11 -11
- package/src/build.ts +25 -0
- package/src/bundle-pipeline.ts +9 -0
- package/src/cli-options.ts +8 -0
- package/src/cli.ts +1 -0
- package/src/client.ts +5 -1
- package/src/module-runner.ts +4 -0
- package/src/vite.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reckona/mreact-router",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"description": "File-system app router, SSR, actions, and deployment adapters for mreact.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -105,20 +105,20 @@
|
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
107
|
"typescript": "^6.0.3",
|
|
108
|
-
"@reckona/mreact": "0.0.
|
|
109
|
-
"@reckona/mreact
|
|
110
|
-
"@reckona/mreact-
|
|
111
|
-
"@reckona/mreact-
|
|
112
|
-
"@reckona/mreact-
|
|
113
|
-
"@reckona/mreact-
|
|
114
|
-
"@reckona/mreact-server": "0.0.
|
|
115
|
-
"@reckona/mreact-reactive-dom": "0.0.
|
|
116
|
-
"@reckona/mreact-shared": "0.0.
|
|
108
|
+
"@reckona/mreact-compat": "0.0.92",
|
|
109
|
+
"@reckona/mreact": "0.0.92",
|
|
110
|
+
"@reckona/mreact-compiler": "0.0.92",
|
|
111
|
+
"@reckona/mreact-devtools": "0.0.92",
|
|
112
|
+
"@reckona/mreact-query": "0.0.92",
|
|
113
|
+
"@reckona/mreact-reactive-core": "0.0.92",
|
|
114
|
+
"@reckona/mreact-server": "0.0.92",
|
|
115
|
+
"@reckona/mreact-reactive-dom": "0.0.92",
|
|
116
|
+
"@reckona/mreact-shared": "0.0.92"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"vite": ">=8 <9"
|
|
120
120
|
},
|
|
121
121
|
"optionalDependencies": {
|
|
122
|
-
"@reckona/mreact-router-native": "0.0.
|
|
122
|
+
"@reckona/mreact-router-native": "0.0.92"
|
|
123
123
|
}
|
|
124
124
|
}
|
package/src/build.ts
CHANGED
|
@@ -113,6 +113,7 @@ export interface CloudflarePagesArtifactManifest {
|
|
|
113
113
|
export interface PackageAwsLambdaArtifactOptions {
|
|
114
114
|
fromDir: string;
|
|
115
115
|
outDir: string;
|
|
116
|
+
skipRuntimeDependencyCheck?: boolean | undefined;
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
export interface PackageCloudflarePagesArtifactOptions {
|
|
@@ -2477,6 +2478,7 @@ function cloudflareWorkspaceRuntimePlugin(): RouterCompatPlugin {
|
|
|
2477
2478
|
packageFile("react-compat", "@reckona/mreact-compat", "event-priority"),
|
|
2478
2479
|
],
|
|
2479
2480
|
["@reckona/mreact-compat/flight", packageFile("react-compat", "@reckona/mreact-compat", "flight")],
|
|
2481
|
+
["@reckona/mreact-compat/hooks", packageFile("react-compat", "@reckona/mreact-compat", "hooks-entry")],
|
|
2480
2482
|
["@reckona/mreact-compat/internal", packageFile("react-compat", "@reckona/mreact-compat", "internal")],
|
|
2481
2483
|
[
|
|
2482
2484
|
"@reckona/mreact-compat/jsx-dev-runtime",
|
|
@@ -2940,6 +2942,10 @@ export async function packageAwsLambdaArtifact(
|
|
|
2940
2942
|
});
|
|
2941
2943
|
await writeFile(join(options.outDir, "mreact-handler.mjs"), awsLambdaHandlerSource(".mreact"));
|
|
2942
2944
|
|
|
2945
|
+
if (options.skipRuntimeDependencyCheck !== true) {
|
|
2946
|
+
await assertAwsLambdaRuntimeDependencies(options.outDir);
|
|
2947
|
+
}
|
|
2948
|
+
|
|
2943
2949
|
const files = await collectArtifactFiles(options.outDir, "");
|
|
2944
2950
|
const manifest = {
|
|
2945
2951
|
files,
|
|
@@ -2957,6 +2963,25 @@ export async function packageAwsLambdaArtifact(
|
|
|
2957
2963
|
return manifest;
|
|
2958
2964
|
}
|
|
2959
2965
|
|
|
2966
|
+
async function assertAwsLambdaRuntimeDependencies(outDir: string): Promise<void> {
|
|
2967
|
+
try {
|
|
2968
|
+
const info = await stat(join(outDir, "node_modules", "@reckona", "mreact-router", "package.json"));
|
|
2969
|
+
if (info.isFile()) {
|
|
2970
|
+
return;
|
|
2971
|
+
}
|
|
2972
|
+
} catch {
|
|
2973
|
+
// Throw the actionable error below.
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2976
|
+
throw new Error(
|
|
2977
|
+
[
|
|
2978
|
+
"AWS Lambda artifact is missing production runtime dependencies.",
|
|
2979
|
+
"Install production dependencies into the package directory before deployment,",
|
|
2980
|
+
"or rerun with --skip-runtime-dependency-check only when a later deploy step installs them into .lambda/node_modules.",
|
|
2981
|
+
].join(" "),
|
|
2982
|
+
);
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2960
2985
|
export async function packageCloudflarePagesArtifact(
|
|
2961
2986
|
options: PackageCloudflarePagesArtifactOptions,
|
|
2962
2987
|
): Promise<CloudflarePagesArtifactManifest> {
|
package/src/bundle-pipeline.ts
CHANGED
|
@@ -370,6 +370,15 @@ function mreactJsxRuntimeAliasPlugin(): VitePlugin {
|
|
|
370
370
|
packageName: "@reckona/mreact-compat",
|
|
371
371
|
}),
|
|
372
372
|
],
|
|
373
|
+
[
|
|
374
|
+
"@reckona/mreact-compat/hooks",
|
|
375
|
+
workspacePackageFile({
|
|
376
|
+
currentFileUrl: import.meta.url,
|
|
377
|
+
entry: "hooks-entry",
|
|
378
|
+
monorepoDir: "react-compat",
|
|
379
|
+
packageName: "@reckona/mreact-compat",
|
|
380
|
+
}),
|
|
381
|
+
],
|
|
373
382
|
]);
|
|
374
383
|
|
|
375
384
|
return {
|
package/src/cli-options.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface ParsedCliArguments {
|
|
|
20
20
|
out?: string | undefined;
|
|
21
21
|
port?: number | undefined;
|
|
22
22
|
routeArg?: string | undefined;
|
|
23
|
+
skipRuntimeDependencyCheck?: boolean | undefined;
|
|
23
24
|
target?: CliBuildTarget | undefined;
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -114,6 +115,11 @@ export function parseCliArguments(argv: readonly string[]): ParsedCliArguments {
|
|
|
114
115
|
continue;
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
if (value === "--skip-runtime-dependency-check") {
|
|
119
|
+
parsed.skipRuntimeDependencyCheck = true;
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
|
|
117
123
|
if (value.startsWith("--log=")) {
|
|
118
124
|
parsed.log = parseCliRequestLogMode(value.slice("--log=".length));
|
|
119
125
|
continue;
|
|
@@ -194,6 +200,8 @@ export function formatCliHelp(command?: string | undefined): string {
|
|
|
194
200
|
"Options:",
|
|
195
201
|
" --from <dir> Build output directory. Default: .mreact",
|
|
196
202
|
" --out <dir> Output directory. Defaults to .lambda for aws-lambda and .mreact/pages for cloudflare-pages.",
|
|
203
|
+
" --skip-runtime-dependency-check",
|
|
204
|
+
" For aws-lambda only, skip the production node_modules check when a later deploy step installs dependencies into the package directory.",
|
|
197
205
|
" -h, --help Show this help message.",
|
|
198
206
|
"",
|
|
199
207
|
"Examples:",
|
package/src/cli.ts
CHANGED
|
@@ -59,6 +59,7 @@ if (parsed !== undefined) {
|
|
|
59
59
|
const manifest = await packageAwsLambdaArtifact({
|
|
60
60
|
fromDir: resolve(parsed.from ?? ".mreact"),
|
|
61
61
|
outDir: resolve(parsed.out ?? ".lambda"),
|
|
62
|
+
skipRuntimeDependencyCheck: parsed.skipRuntimeDependencyCheck,
|
|
62
63
|
});
|
|
63
64
|
console.log(
|
|
64
65
|
`Packaged AWS Lambda artifact with ${manifest.files.length} files (${manifest.totalBytes} bytes).`,
|
package/src/client.ts
CHANGED
|
@@ -1748,7 +1748,7 @@ function __mreactResolveRouteNode(value) {
|
|
|
1748
1748
|
if (
|
|
1749
1749
|
value !== null &&
|
|
1750
1750
|
typeof value === "object" &&
|
|
1751
|
-
value.$$typeof === Symbol.for("
|
|
1751
|
+
value.$$typeof === Symbol.for("react.transitional.element") &&
|
|
1752
1752
|
typeof value.type === "function"
|
|
1753
1753
|
) {
|
|
1754
1754
|
return __mreactResolveRouteNode(value.type(value.props ?? {}));
|
|
@@ -3448,6 +3448,10 @@ function workspaceRuntimePlugin(options: { routeFiles: readonly string[] }) {
|
|
|
3448
3448
|
"@reckona/mreact-compat/flight",
|
|
3449
3449
|
packageFile("react-compat", "@reckona/mreact-compat", "flight"),
|
|
3450
3450
|
],
|
|
3451
|
+
[
|
|
3452
|
+
"@reckona/mreact-compat/hooks",
|
|
3453
|
+
packageFile("react-compat", "@reckona/mreact-compat", "hooks-entry"),
|
|
3454
|
+
],
|
|
3451
3455
|
[
|
|
3452
3456
|
"@reckona/mreact-compat/internal",
|
|
3453
3457
|
packageFile("react-compat", "@reckona/mreact-compat", "internal"),
|
package/src/module-runner.ts
CHANGED
|
@@ -1019,6 +1019,10 @@ function workspacePackageResolutionPlugin() {
|
|
|
1019
1019
|
"@reckona/mreact-compat/flight",
|
|
1020
1020
|
{ entry: "flight", monorepoDir: "react-compat", packageName: "@reckona/mreact-compat" },
|
|
1021
1021
|
],
|
|
1022
|
+
[
|
|
1023
|
+
"@reckona/mreact-compat/hooks",
|
|
1024
|
+
{ entry: "hooks-entry", monorepoDir: "react-compat", packageName: "@reckona/mreact-compat" },
|
|
1025
|
+
],
|
|
1022
1026
|
[
|
|
1023
1027
|
"@reckona/mreact-compat/internal",
|
|
1024
1028
|
{ entry: "internal", monorepoDir: "react-compat", packageName: "@reckona/mreact-compat" },
|
package/src/vite.ts
CHANGED
|
@@ -127,6 +127,10 @@ export function createAppRouterVitePlugin(options: AppRouterVitePluginOptions):
|
|
|
127
127
|
"@reckona/mreact-compat/flight",
|
|
128
128
|
packageFile("react-compat", "@reckona/mreact-compat", "flight"),
|
|
129
129
|
],
|
|
130
|
+
[
|
|
131
|
+
"@reckona/mreact-compat/hooks",
|
|
132
|
+
packageFile("react-compat", "@reckona/mreact-compat", "hooks-entry"),
|
|
133
|
+
],
|
|
130
134
|
[
|
|
131
135
|
"@reckona/mreact-compat/internal",
|
|
132
136
|
packageFile("react-compat", "@reckona/mreact-compat", "internal"),
|