@cedarjs/vite 7.0.0-canary.3259 → 7.0.0-rc.127
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/buildApp.d.ts.map +1 -1
- package/dist/buildApp.js +7 -3
- package/dist/buildRouteHooks.d.ts +13 -7
- package/dist/buildRouteHooks.d.ts.map +1 -1
- package/dist/buildRouteHooks.js +10 -5
- package/dist/bundled/react-server-dom-webpack.server.js +29125 -2264
- package/dist/devFeServer.js +19 -278
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/lib/registerFwGlobalsAndShims.js +0 -9
- package/dist/plugins/vite-plugin-cedar-cell.d.ts +1 -2
- package/dist/plugins/vite-plugin-cedar-cell.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-cedar-cell.js +11 -30
- package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts +6 -2
- package/dist/plugins/vite-plugin-handler-als-wrapping.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-handler-als-wrapping.js +7 -4
- package/dist/plugins/vite-plugin-rsc-ssr-router-import.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-rsc-ssr-router-import.js +2 -2
- package/dist/plugins/vite-plugin-rsc-transform-server.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-rsc-transform-server.js +0 -4
- package/dist/rsc/rscRenderer.d.ts.map +1 -1
- package/dist/rsc/rscRenderer.js +5 -19
- package/dist/rsc/rscRequestHandler.d.ts +2 -2
- package/dist/rsc/rscRequestHandler.d.ts.map +1 -1
- package/dist/rsc/rscRequestHandler.js +4 -4
- package/dist/runFeServer.js +24 -5
- package/dist/streaming/createReactStreamingHandler.d.ts +1 -1
- package/dist/streaming/createReactStreamingHandler.d.ts.map +1 -1
- package/dist/streaming/createReactStreamingHandler.js +10 -13
- package/dist/streaming/streamHelpers.d.ts +3 -8
- package/dist/streaming/streamHelpers.d.ts.map +1 -1
- package/dist/streaming/streamHelpers.js +32 -50
- package/dist/streaming/triggerRouteHooks.d.ts +2 -2
- package/dist/streaming/triggerRouteHooks.d.ts.map +1 -1
- package/dist/streaming/triggerRouteHooks.js +3 -3
- package/package.json +29 -31
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts +0 -20
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.d.ts.map +0 -1
- package/dist/plugins/vite-plugin-cedar-parsed-scalars.js +0 -60
- package/dist/rsc/rscWebSocketServer.d.ts +0 -2
- package/dist/rsc/rscWebSocketServer.d.ts.map +0 -1
- package/dist/rsc/rscWebSocketServer.js +0 -22
- package/dist/rsc/utils.d.ts +0 -10
- package/dist/rsc/utils.d.ts.map +0 -1
- package/dist/rsc/utils.js +0 -21
package/dist/buildApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,
|
|
1
|
+
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,iBA0a3B"}
|
package/dist/buildApp.js
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
applySrcAlias
|
|
21
21
|
} from "@cedarjs/internal/dist/build/api.js";
|
|
22
22
|
import { findApiFiles } from "@cedarjs/internal/dist/files.js";
|
|
23
|
-
import { getConfig, getPaths } from "@cedarjs/project-config";
|
|
23
|
+
import { getConfig, getPaths, projectSideIsEsm } from "@cedarjs/project-config";
|
|
24
24
|
import { generateDiffSourceMap } from "./lib/generateDiffSourceMap.js";
|
|
25
25
|
import { getWorkspacePackageAliases } from "./lib/workspacePackageAliases.js";
|
|
26
26
|
import { cedarAutoImportsPlugin } from "./plugins/vite-plugin-cedar-auto-import.js";
|
|
@@ -60,6 +60,8 @@ async function buildCedarApp({
|
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
if (workspace.includes("api")) {
|
|
63
|
+
const isEsm = projectSideIsEsm("api");
|
|
64
|
+
const format = isEsm ? "es" : "cjs";
|
|
63
65
|
const apiFiles = findApiFiles();
|
|
64
66
|
const input = {};
|
|
65
67
|
for (const f of apiFiles) {
|
|
@@ -75,7 +77,7 @@ async function buildCedarApp({
|
|
|
75
77
|
rollupOptions: {
|
|
76
78
|
input,
|
|
77
79
|
output: {
|
|
78
|
-
format
|
|
80
|
+
format,
|
|
79
81
|
preserveModules: true,
|
|
80
82
|
preserveModulesRoot: cedarPaths.api.src,
|
|
81
83
|
entryFileNames: "[name].js",
|
|
@@ -254,7 +256,9 @@ async function buildCedarApp({
|
|
|
254
256
|
plugins.push(cedarDirectoryNamedImportPlugin());
|
|
255
257
|
plugins.push(cedarOtelWrappingPlugin());
|
|
256
258
|
plugins.push(cedarjsJobPathInjectorPlugin());
|
|
257
|
-
plugins.push(
|
|
259
|
+
plugins.push(
|
|
260
|
+
handlerAlsWrappingPlugin({ projectIsEsm: projectSideIsEsm("api") })
|
|
261
|
+
);
|
|
258
262
|
}
|
|
259
263
|
plugins.push(cedarMockCellDataPlugin());
|
|
260
264
|
if (workspace.includes("api")) {
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import type { Paths } from '@cedarjs/project-config';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
* Route hooks are built as ES modules. Node reads a `.js` file as CommonJS
|
|
4
|
+
* when the nearest package.json has no `"type": "module"`, so in a CommonJS
|
|
5
|
+
* web side the output gets the `.mjs` extension instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getRouteHookDistExtension(): ".js" | ".mjs";
|
|
8
|
+
/**
|
|
9
|
+
* Returns the path, relative to `web/dist/ssr/routeHooks`, that the built
|
|
10
|
+
* version of the given route hook source file is written to. The layout
|
|
11
|
+
* mirrors `web/src`, so `web/src/pages/HomePage/HomePage.routeHooks.ts` ends
|
|
12
|
+
* up at `pages/HomePage/HomePage.routeHooks.js` and `web/src/App.routeHooks.ts`
|
|
13
|
+
* at `App.routeHooks.js` (`.mjs` in a CommonJS web side, see
|
|
14
|
+
* getRouteHookDistExtension()).
|
|
9
15
|
*
|
|
10
16
|
* Used both by the build (to name the Rollup entries) and by the route
|
|
11
17
|
* manifest (so the streaming handler can find the file at request time).
|
|
12
18
|
*/
|
|
13
|
-
export declare function getRouteHookDistPath(routeHookSrcPath: string, webSrc?: string): string;
|
|
19
|
+
export declare function getRouteHookDistPath(routeHookSrcPath: string, webSrc?: string, extension?: string): string;
|
|
14
20
|
/**
|
|
15
21
|
* Bundles every `web/src/** /*.routeHooks.{js,ts,tsx,jsx}` file into
|
|
16
22
|
* `web/dist/ssr/routeHooks` as a node ESM module, one output file per route
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildRouteHooks.d.ts","sourceRoot":"","sources":["../src/buildRouteHooks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAiBpD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,MAAM,EACxB,MAAM,SAAqB,
|
|
1
|
+
{"version":3,"file":"buildRouteHooks.d.ts","sourceRoot":"","sources":["../src/buildRouteHooks.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAiBpD;;;;GAIG;AACH,wBAAgB,yBAAyB,mBAExC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,MAAM,EACxB,MAAM,SAAqB,EAC3B,SAAS,SAA8B,UAGxC;AA6BD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,OAAO,EAAE,OAAO,GAAG,SAAS,EAC5B,OAAO,EAAE,KAAK,iBAyEf"}
|
package/dist/buildRouteHooks.js
CHANGED
|
@@ -3,7 +3,7 @@ import { build as viteBuild } from "vite";
|
|
|
3
3
|
import { gqlPlugin as gqlTagPlugin } from "vite-plugin-graphql-tag";
|
|
4
4
|
import tsPathsMod from "vite-tsconfig-paths";
|
|
5
5
|
import { findRouteHooksSrc } from "@cedarjs/internal/dist/files.js";
|
|
6
|
-
import { getPaths } from "@cedarjs/project-config";
|
|
6
|
+
import { getPaths, projectSideIsEsm } from "@cedarjs/project-config";
|
|
7
7
|
import { cedarApiImportGuardPlugin } from "./plugins/vite-plugin-cedar-api-import-guard.js";
|
|
8
8
|
import { cedarAutoImportsPlugin } from "./plugins/vite-plugin-cedar-auto-import.js";
|
|
9
9
|
import { cedarDirectoryNamedImportPlugin } from "./plugins/vite-plugin-cedar-directory-named-import.js";
|
|
@@ -13,8 +13,11 @@ const tsconfigPaths = (
|
|
|
13
13
|
// interop
|
|
14
14
|
tsPathsMod.default?.default || tsPathsMod.default || tsPathsMod
|
|
15
15
|
);
|
|
16
|
-
function
|
|
17
|
-
return
|
|
16
|
+
function getRouteHookDistExtension() {
|
|
17
|
+
return projectSideIsEsm("web") ? ".js" : ".mjs";
|
|
18
|
+
}
|
|
19
|
+
function getRouteHookDistPath(routeHookSrcPath, webSrc = getPaths().web.src, extension = getRouteHookDistExtension()) {
|
|
20
|
+
return getRouteHookEntryName(routeHookSrcPath, webSrc) + extension;
|
|
18
21
|
}
|
|
19
22
|
function getRouteHookEntryName(routeHookSrcPath, webSrc) {
|
|
20
23
|
return path.relative(webSrc, routeHookSrcPath).replace(/\.(js|ts|tsx|jsx)$/, "").split(path.sep).join("/");
|
|
@@ -35,6 +38,7 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
35
38
|
for (const routeHook of allRouteHooks) {
|
|
36
39
|
input[getRouteHookEntryName(routeHook, rwPaths.web.src)] = routeHook;
|
|
37
40
|
}
|
|
41
|
+
const extension = getRouteHookDistExtension();
|
|
38
42
|
await viteBuild({
|
|
39
43
|
// Route hooks run in node, so the project's web/vite.config, which is set
|
|
40
44
|
// up for browser and SSR builds of React code, doesn't apply. Only the
|
|
@@ -77,9 +81,9 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
77
81
|
input,
|
|
78
82
|
output: {
|
|
79
83
|
format: "es",
|
|
80
|
-
entryFileNames: "[name]
|
|
84
|
+
entryFileNames: "[name]" + extension,
|
|
81
85
|
// Modules shared between route hooks, like the api side's db.js
|
|
82
|
-
chunkFileNames: "chunks/[name]-[hash]
|
|
86
|
+
chunkFileNames: "chunks/[name]-[hash]" + extension,
|
|
83
87
|
exports: "named"
|
|
84
88
|
}
|
|
85
89
|
}
|
|
@@ -96,5 +100,6 @@ async function buildRouteHooks(verbose, rwPaths) {
|
|
|
96
100
|
}
|
|
97
101
|
export {
|
|
98
102
|
buildRouteHooks,
|
|
103
|
+
getRouteHookDistExtension,
|
|
99
104
|
getRouteHookDistPath
|
|
100
105
|
};
|