@cedarjs/vite 2.8.1-next.116 → 2.8.1

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.
Files changed (32) hide show
  1. package/dist/api/vite-plugin-cedar-vitest-api-preset.d.ts +1 -1
  2. package/dist/api/vite-plugin-cedar-vitest-api-preset.d.ts.map +1 -1
  3. package/dist/cjs/lib/entries.js +4 -3
  4. package/dist/cjs/lib/registerFwGlobalsAndShims.js +0 -3
  5. package/dist/cjs/plugins/vite-plugin-rsc-transform-server.js +2 -2
  6. package/dist/cjs/rsc/rscBuildAnalyze.js +0 -2
  7. package/dist/cjs/rsc/rscBuildClient.js +1 -1
  8. package/dist/cjs/rsc/rscBuildEntriesFile.js +2 -2
  9. package/dist/cjs/rsc/rscBuildForServer.js +0 -2
  10. package/dist/cjs/rsc/rscBuildForSsr.js +8 -10
  11. package/dist/cjs/rsc/rscRenderer.js +5 -5
  12. package/dist/cjs/streaming/streamHelpers.js +12 -14
  13. package/dist/cjs/utils.js +2 -2
  14. package/dist/lib/entries.d.ts.map +1 -1
  15. package/dist/lib/entries.js +4 -3
  16. package/dist/lib/registerFwGlobalsAndShims.d.ts.map +1 -1
  17. package/dist/lib/registerFwGlobalsAndShims.js +0 -2
  18. package/dist/plugins/vite-plugin-rsc-transform-server.js +2 -2
  19. package/dist/rsc/rscBuildAnalyze.d.ts.map +1 -1
  20. package/dist/rsc/rscBuildAnalyze.js +0 -2
  21. package/dist/rsc/rscBuildClient.js +1 -1
  22. package/dist/rsc/rscBuildEntriesFile.js +2 -2
  23. package/dist/rsc/rscBuildForServer.d.ts.map +1 -1
  24. package/dist/rsc/rscBuildForServer.js +0 -2
  25. package/dist/rsc/rscBuildForSsr.d.ts.map +1 -1
  26. package/dist/rsc/rscBuildForSsr.js +8 -10
  27. package/dist/rsc/rscRenderer.js +5 -5
  28. package/dist/streaming/streamHelpers.d.ts +1 -1
  29. package/dist/streaming/streamHelpers.d.ts.map +1 -1
  30. package/dist/streaming/streamHelpers.js +12 -14
  31. package/dist/utils.js +2 -2
  32. package/package.json +16 -15
@@ -1,2 +1,2 @@
1
- export declare function cedarVitestPreset(): (import("vite").Plugin<any> | import("vite").Plugin<any>[])[];
1
+ export declare function cedarVitestPreset(): any[];
2
2
  //# sourceMappingURL=vite-plugin-cedar-vitest-api-preset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin-cedar-vitest-api-preset.d.ts","sourceRoot":"","sources":["../../src/api/vite-plugin-cedar-vitest-api-preset.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,kEAOhC"}
1
+ {"version":3,"file":"vite-plugin-cedar-vitest-api-preset.d.ts","sourceRoot":"","sources":["../../src/api/vite-plugin-cedar-vitest-api-preset.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,UAOhC"}
@@ -27,7 +27,8 @@ var import_dist = require("@cedarjs/structure/dist/index.js");
27
27
  var import_utils = require("../utils.js");
28
28
  function getEntries() {
29
29
  const entries = {};
30
- const routes = (0, import_dist.getProject)().getRouter().routes;
30
+ const rwProject = (0, import_dist.getProject)((0, import_project_config.getPaths)().base);
31
+ const routes = rwProject.getRouter().routes;
31
32
  const pages = routes.map((route) => route.page);
32
33
  for (const page of pages) {
33
34
  entries[page.constName] = (0, import_project_config.ensurePosixPath)((0, import_project_config.importStatementPath)(page.path));
@@ -36,8 +37,8 @@ function getEntries() {
36
37
  if (!serverEntry) {
37
38
  throw new Error("Server Entry file not found");
38
39
  }
39
- entries["__cedarjs__ServerEntry"] = serverEntry;
40
- entries["__cedarjs__Routes"] = (0, import_project_config.getPaths)().web.routes;
40
+ entries["__rwjs__ServerEntry"] = serverEntry;
41
+ entries["__rwjs__Routes"] = (0, import_project_config.getPaths)().web.routes;
41
42
  return entries;
42
43
  }
43
44
  async function getEntriesFromDist() {
@@ -21,9 +21,7 @@ __export(registerFwGlobalsAndShims_exports, {
21
21
  registerFwGlobalsAndShims: () => registerFwGlobalsAndShims
22
22
  });
23
23
  module.exports = __toCommonJS(registerFwGlobalsAndShims_exports);
24
- var import_node_module = require("node:module");
25
24
  var import_project_config = require("@cedarjs/project-config");
26
- const import_meta = {};
27
25
  const registerFwGlobalsAndShims = () => {
28
26
  registerFwGlobals();
29
27
  registerFwShims();
@@ -91,7 +89,6 @@ function registerFwShims() {
91
89
  console.log("registerFwShims require id", id);
92
90
  return globalThis.__rw_module_cache__.get(id);
93
91
  };
94
- globalThis.__non_webpack_require__ ||= (0, import_node_module.createRequire)(import_meta.url);
95
92
  }
96
93
  function swapLocalhostFor127(hostString) {
97
94
  return hostString.replace("localhost", "127.0.0.1");
@@ -306,7 +306,7 @@ function babelPluginTransformServerAction({
306
306
  if (!name) {
307
307
  throw new Error("Server action must have a name");
308
308
  }
309
- const uniqueName = `__cedarjs__rsa${serverActionNodes.length}_${name}`;
309
+ const uniqueName = `__rwjs__rsa${serverActionNodes.length}_${name}`;
310
310
  serverActionNode.id = t.identifier(uniqueName);
311
311
  serverActionNodes.push(serverActionNode);
312
312
  init.body.body[serverActionNodeIndex] = t.variableDeclaration(
@@ -350,7 +350,7 @@ function babelPluginTransformServerAction({
350
350
  if (!name) {
351
351
  throw new Error("Server action must have a name");
352
352
  }
353
- const uniqueName = `__cedarjs__rsa${serverActionNodes.length}_${name}`;
353
+ const uniqueName = `__rwjs__rsa${serverActionNodes.length}_${name}`;
354
354
  serverActionNode.id = t.identifier(uniqueName);
355
355
  serverActionNodes.push(serverActionNode);
356
356
  body.body[serverActionNodeIndex] = t.variableDeclaration(
@@ -60,10 +60,8 @@ async function rscBuildAnalyze() {
60
60
  // it means we can skip analyzing them, which means faster build times.
61
61
  external: [
62
62
  "@prisma/client",
63
- "@prisma/adapter-better-sqlite3",
64
63
  "@prisma/fetch-engine",
65
64
  "@prisma/internals",
66
- "better-sqlite3",
67
65
  "@cedarjs/auth-dbauth-api",
68
66
  "@cedarjs/cookie-jar",
69
67
  "@cedarjs/server-store",
@@ -51,7 +51,7 @@ async function rscBuildClient(clientEntryFiles) {
51
51
  input: {
52
52
  // @MARK: temporary hack to find the entry client so we can get the
53
53
  // index.css bundle but we don't actually want this on an rsc page!
54
- __cedarjs__client_entry: rwPaths.web.entryClient,
54
+ __rwjs__client_entry: rwPaths.web.entryClient,
55
55
  // we need this, so that the output contains rsc-specific bundles
56
56
  // for the client-only components. They get loaded once the page is
57
57
  // rendered
@@ -89,8 +89,8 @@ export const ssrEntries = ${JSON.stringify(ssrEntries, void 0, 2)};
89
89
  );
90
90
  const serverEntries = {};
91
91
  const entries = {
92
- __cedarjs__ServerEntry: (0, import_project_config.getPaths)().web.entryServer || "",
93
- __cedarjs__Routes: (0, import_project_config.getPaths)().web.routes
92
+ __rwjs__ServerEntry: (0, import_project_config.getPaths)().web.entryServer || "",
93
+ __rwjs__Routes: (0, import_project_config.getPaths)().web.routes
94
94
  };
95
95
  for (const [name, sourceFile] of Object.entries(entries)) {
96
96
  const buildOutputItem = serverBuildOutput.find((item) => {
@@ -62,10 +62,8 @@ async function rscBuildForServer(clientEntryFiles, serverEntryFiles, customModul
62
62
  // Server store has to be externalized, because it's a singleton (shared between FW and App)
63
63
  external: [
64
64
  "@prisma/client",
65
- "@prisma/adapter-better-sqlite3",
66
65
  "@prisma/fetch-engine",
67
66
  "@prisma/internals",
68
- "better-sqlite3",
69
67
  "@cedarjs/auth-dbauth-api",
70
68
  "@cedarjs/cookie-jar",
71
69
  "@cedarjs/server-store",
@@ -67,10 +67,8 @@ async function rscBuildForSsr({
67
67
  noExternal: true,
68
68
  external: [
69
69
  "@prisma/client",
70
- "@prisma/adapter-better-sqlite3",
71
70
  "@prisma/fetch-engine",
72
71
  "@prisma/internals",
73
- "better-sqlite3",
74
72
  "@cedarjs/auth-dbauth-api",
75
73
  "@cedarjs/cookie-jar",
76
74
  "@cedarjs/server-store",
@@ -107,19 +105,19 @@ async function rscBuildForSsr({
107
105
  // index.css bundle but we don't actually want this on an rsc page!
108
106
  // TODO (RSC): Look into if we can remove this (and perhaps instead
109
107
  // use entry.server)
110
- __cedarjs__client_entry: rwPaths.web.entryClient,
108
+ __rwjs__client_entry: rwPaths.web.entryClient,
111
109
  "entry.server": rwPaths.web.entryServer,
112
110
  // we need this, so that the output contains rsc-specific bundles
113
111
  // for the client-only components. They get loaded once the page is
114
112
  // rendered
115
113
  ...clientEntryFiles,
116
114
  // These import redirections are so that we don't bundle multiple versions of react
117
- __cedarjs__react: "react",
118
- __cedarjs__location: "@cedarjs/router/location",
119
- __cedarjs__server_auth_provider: "@cedarjs/auth/ServerAuthProvider",
120
- __cedarjs__server_inject: "@cedarjs/web/serverInject",
121
- "__cedarjs__rsdw-client": "react-server-dom-webpack/client.edge",
122
- // TODO (RSC): add __cedarjs__ prefix to the entry below
115
+ __rwjs__react: "react",
116
+ __rwjs__location: "@cedarjs/router/location",
117
+ __rwjs__server_auth_provider: "@cedarjs/auth/ServerAuthProvider",
118
+ __rwjs__server_inject: "@cedarjs/web/serverInject",
119
+ "__rwjs__rsdw-client": "react-server-dom-webpack/client.edge",
120
+ // TODO (RSC): add __rwjs__ prefix to the entry below
123
121
  "rd-server": "react-dom/server.edge",
124
122
  // We need the document for React's fallback
125
123
  Document: rwPaths.web.document
@@ -134,7 +132,7 @@ async function rscBuildForSsr({
134
132
  // is resolved
135
133
  hoistTransitiveImports: false,
136
134
  entryFileNames: (chunkInfo) => {
137
- if (chunkInfo.name === "rd-server" || chunkInfo.name === "__cedarjs__react" || chunkInfo.name === "__cedarjs__location" || chunkInfo.name === "__cedarjs__server_auth_provider" || chunkInfo.name === "__cedarjs__server_inject" || chunkInfo.name === "__cedarjs__rsdw-client" || chunkInfo.name === "entry.server" || chunkInfo.name === "Document") {
135
+ if (chunkInfo.name === "rd-server" || chunkInfo.name === "__rwjs__react" || chunkInfo.name === "__rwjs__location" || chunkInfo.name === "__rwjs__server_auth_provider" || chunkInfo.name === "__rwjs__server_inject" || chunkInfo.name === "__rwjs__rsdw-client" || chunkInfo.name === "entry.server" || chunkInfo.name === "Document") {
138
136
  return "[name].mjs";
139
137
  }
140
138
  return "assets/[name]-[hash].mjs";
@@ -51,10 +51,10 @@ const getRoutesComponent = async () => {
51
51
  console.log("rscRenderer.ts serverEntries", serverEntries);
52
52
  const routesPath = import_node_path.default.join(
53
53
  (0, import_project_config.getPaths)().web.distRsc,
54
- serverEntries["__cedarjs__Routes"]
54
+ serverEntries["__rwjs__Routes"]
55
55
  );
56
56
  if (!routesPath) {
57
- throw new import_StatusError.StatusError("No entry found for __cedarjs__Routes", 404);
57
+ throw new import_StatusError.StatusError("No entry found for __rwjs__Routes", 404);
58
58
  }
59
59
  const routes = await loadServerFile(routesPath);
60
60
  return routes.default;
@@ -115,7 +115,7 @@ async function renderRsc(input) {
115
115
  console.log("renderRsc input", input);
116
116
  const serverRoutes = await getRoutesComponent();
117
117
  const model = {
118
- __cedarjs__Routes: (0, import_react.createElement)(serverRoutes)
118
+ __rwjs__Routes: (0, import_react.createElement)(serverRoutes)
119
119
  };
120
120
  console.log("rscRenderer.ts renderRsc model", model);
121
121
  return (0, import_server.renderToReadableStream)(model, getBundlerConfig());
@@ -152,8 +152,8 @@ async function executeRsa(input) {
152
152
  const serverRoutes = await getRoutesComponent();
153
153
  console.log("rscRenderer.ts executeRsa serverRoutes", serverRoutes);
154
154
  const model = {
155
- __cedarjs__Routes: (0, import_react.createElement)(serverRoutes),
156
- __cedarjs__rsa_data: data
155
+ __rwjs__Routes: (0, import_react.createElement)(serverRoutes),
156
+ __rwjs__rsa_data: data
157
157
  };
158
158
  console.log("rscRenderer.ts executeRsa model", model);
159
159
  return (0, import_server.renderToReadableStream)(model, getBundlerConfig());
@@ -84,12 +84,12 @@ async function reactRenderToStreamResponse(mwRes, renderOptions, streamOptions)
84
84
  meta: metaTags
85
85
  });
86
86
  const rscEnabled = (0, import_project_config.getConfig)().experimental?.rsc?.enabled;
87
- const { createElement } = rscEnabled ? await importModule("__cedarjs__react") : await import("react");
87
+ const { createElement } = rscEnabled ? await importModule("__rwjs__react") : await import("react");
88
88
  const {
89
89
  createInjector,
90
90
  ServerHtmlProvider,
91
91
  ServerInjectedHtml
92
- } = rscEnabled ? await importModule("__cedarjs__server_inject") : await import("@cedarjs/web/serverInject");
92
+ } = rscEnabled ? await importModule("__rwjs__server_inject") : await import("@cedarjs/web/serverInject");
93
93
  const { renderToString } = rscEnabled ? await importModule("rd-server") : await import("react-dom/server");
94
94
  const { injectionState, injectToPage } = createInjector();
95
95
  const bufferTransform = (0, import_bufferedTransform.createBufferedTransformStream)();
@@ -105,8 +105,8 @@ async function reactRenderToStreamResponse(mwRes, renderOptions, streamOptions)
105
105
  controller.abort();
106
106
  }, 1e4);
107
107
  const timeoutTransform = (0, import_cancelTimeoutTransform.createTimeoutTransform)(timeoutHandle);
108
- const { ServerAuthProvider } = rscEnabled ? await importModule("__cedarjs__server_auth_provider") : await import("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
109
- const { LocationProvider } = rscEnabled ? await importModule("__cedarjs__location") : await import("@cedarjs/router/location");
108
+ const { ServerAuthProvider } = rscEnabled ? await importModule("__rwjs__server_auth_provider") : await import("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
109
+ const { LocationProvider } = rscEnabled ? await importModule("__rwjs__location") : await import("@cedarjs/router/location");
110
110
  const renderRoot = (url) => {
111
111
  return createElement(
112
112
  ServerAuthProvider,
@@ -200,25 +200,23 @@ function applyStreamTransforms(reactStream, transformsToApply) {
200
200
  async function importModule(mod) {
201
201
  const distSsr = (0, import_project_config.getPaths)().web.distSsr;
202
202
  const rdServerPath = (0, import_utils.makeFilePath)(import_node_path.default.join(distSsr, "rd-server.mjs"));
203
- const reactPath = (0, import_utils.makeFilePath)(import_node_path.default.join(distSsr, "__cedarjs__react.mjs"));
204
- const locationPath = (0, import_utils.makeFilePath)(
205
- import_node_path.default.join(distSsr, "__cedarjs__location.mjs")
206
- );
203
+ const reactPath = (0, import_utils.makeFilePath)(import_node_path.default.join(distSsr, "__rwjs__react.mjs"));
204
+ const locationPath = (0, import_utils.makeFilePath)(import_node_path.default.join(distSsr, "__rwjs__location.mjs"));
207
205
  const ServerAuthProviderPath = (0, import_utils.makeFilePath)(
208
- import_node_path.default.join(distSsr, "__cedarjs__server_auth_provider.mjs")
206
+ import_node_path.default.join(distSsr, "__rwjs__server_auth_provider.mjs")
209
207
  );
210
208
  const ServerInjectPath = (0, import_utils.makeFilePath)(
211
- import_node_path.default.join(distSsr, "__cedarjs__server_inject.mjs")
209
+ import_node_path.default.join(distSsr, "__rwjs__server_inject.mjs")
212
210
  );
213
211
  if (mod === "rd-server") {
214
212
  return (await import(rdServerPath)).default;
215
- } else if (mod === "__cedarjs__react") {
213
+ } else if (mod === "__rwjs__react") {
216
214
  return (await import(reactPath)).default;
217
- } else if (mod === "__cedarjs__location") {
215
+ } else if (mod === "__rwjs__location") {
218
216
  return await import(locationPath);
219
- } else if (mod === "__cedarjs__server_auth_provider") {
217
+ } else if (mod === "__rwjs__server_auth_provider") {
220
218
  return await import(ServerAuthProviderPath);
221
- } else if (mod === "__cedarjs__server_inject") {
219
+ } else if (mod === "__rwjs__server_inject") {
222
220
  return await import(ServerInjectPath);
223
221
  }
224
222
  throw new Error("Unknown module " + mod);
package/dist/cjs/utils.js CHANGED
@@ -72,8 +72,8 @@ function convertExpressHeaders(expressDistinctHeaders) {
72
72
  const getFullUrl = (req, rscEnabled) => {
73
73
  const baseUrl = req.protocol + "://" + req.headers.host;
74
74
  const url = new URL(req.originalUrl || "", baseUrl);
75
- const pathname = url.searchParams.get("__cedarjs__pathname");
76
- const search = url.searchParams.get("__cedarjs__search");
75
+ const pathname = url.searchParams.get("__rwjs__pathname");
76
+ const search = url.searchParams.get("__rwjs__search");
77
77
  let pathnamePlusSearch = req.originalUrl;
78
78
  if (rscEnabled && pathname !== null && search !== null) {
79
79
  pathnamePlusSearch = pathname + "?" + search;
@@ -1 +1 @@
1
- {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/lib/entries.ts"],"names":[],"mappings":"AAWA,wBAAgB,UAAU,2BAyBzB;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI1E"}
1
+ {"version":3,"file":"entries.d.ts","sourceRoot":"","sources":["../../src/lib/entries.ts"],"names":[],"mappings":"AAWA,wBAAgB,UAAU,2BA0BzB;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAI1E"}
@@ -7,7 +7,8 @@ import { getProject } from "@cedarjs/structure/dist/index.js";
7
7
  import { makeFilePath } from "../utils.js";
8
8
  function getEntries() {
9
9
  const entries = {};
10
- const routes = getProject().getRouter().routes;
10
+ const rwProject = getProject(getPaths().base);
11
+ const routes = rwProject.getRouter().routes;
11
12
  const pages = routes.map((route) => route.page);
12
13
  for (const page of pages) {
13
14
  entries[page.constName] = ensurePosixPath(importStatementPath(page.path));
@@ -16,8 +17,8 @@ function getEntries() {
16
17
  if (!serverEntry) {
17
18
  throw new Error("Server Entry file not found");
18
19
  }
19
- entries["__cedarjs__ServerEntry"] = serverEntry;
20
- entries["__cedarjs__Routes"] = getPaths().web.routes;
20
+ entries["__rwjs__ServerEntry"] = serverEntry;
21
+ entries["__rwjs__Routes"] = getPaths().web.routes;
21
22
  return entries;
22
23
  }
23
24
  async function getEntriesFromDist() {
@@ -1 +1 @@
1
- {"version":3,"file":"registerFwGlobalsAndShims.d.ts","sourceRoot":"","sources":["../../src/lib/registerFwGlobalsAndShims.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,YAGrC,CAAA"}
1
+ {"version":3,"file":"registerFwGlobalsAndShims.d.ts","sourceRoot":"","sources":["../../src/lib/registerFwGlobalsAndShims.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,YAGrC,CAAA"}
@@ -1,4 +1,3 @@
1
- import { createRequire } from "node:module";
2
1
  import { getConfig, getEnvVarDefinitions } from "@cedarjs/project-config";
3
2
  const registerFwGlobalsAndShims = () => {
4
3
  registerFwGlobals();
@@ -67,7 +66,6 @@ function registerFwShims() {
67
66
  console.log("registerFwShims require id", id);
68
67
  return globalThis.__rw_module_cache__.get(id);
69
68
  };
70
- globalThis.__non_webpack_require__ ||= createRequire(import.meta.url);
71
69
  }
72
70
  function swapLocalhostFor127(hostString) {
73
71
  return hostString.replace("localhost", "127.0.0.1");
@@ -273,7 +273,7 @@ function babelPluginTransformServerAction({
273
273
  if (!name) {
274
274
  throw new Error("Server action must have a name");
275
275
  }
276
- const uniqueName = `__cedarjs__rsa${serverActionNodes.length}_${name}`;
276
+ const uniqueName = `__rwjs__rsa${serverActionNodes.length}_${name}`;
277
277
  serverActionNode.id = t.identifier(uniqueName);
278
278
  serverActionNodes.push(serverActionNode);
279
279
  init.body.body[serverActionNodeIndex] = t.variableDeclaration(
@@ -317,7 +317,7 @@ function babelPluginTransformServerAction({
317
317
  if (!name) {
318
318
  throw new Error("Server action must have a name");
319
319
  }
320
- const uniqueName = `__cedarjs__rsa${serverActionNodes.length}_${name}`;
320
+ const uniqueName = `__rwjs__rsa${serverActionNodes.length}_${name}`;
321
321
  serverActionNode.id = t.identifier(uniqueName);
322
322
  serverActionNodes.push(serverActionNode);
323
323
  body.body[serverActionNodeIndex] = t.variableDeclaration(
@@ -1 +1 @@
1
- {"version":3,"file":"rscBuildAnalyze.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildAnalyze.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,eAAe;;;;;;;GAkGpC"}
1
+ {"version":3,"file":"rscBuildAnalyze.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildAnalyze.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAsB,eAAe;;;;;;;GAgGpC"}
@@ -37,10 +37,8 @@ async function rscBuildAnalyze() {
37
37
  // it means we can skip analyzing them, which means faster build times.
38
38
  external: [
39
39
  "@prisma/client",
40
- "@prisma/adapter-better-sqlite3",
41
40
  "@prisma/fetch-engine",
42
41
  "@prisma/internals",
43
- "better-sqlite3",
44
42
  "@cedarjs/auth-dbauth-api",
45
43
  "@cedarjs/cookie-jar",
46
44
  "@cedarjs/server-store",
@@ -28,7 +28,7 @@ async function rscBuildClient(clientEntryFiles) {
28
28
  input: {
29
29
  // @MARK: temporary hack to find the entry client so we can get the
30
30
  // index.css bundle but we don't actually want this on an rsc page!
31
- __cedarjs__client_entry: rwPaths.web.entryClient,
31
+ __rwjs__client_entry: rwPaths.web.entryClient,
32
32
  // we need this, so that the output contains rsc-specific bundles
33
33
  // for the client-only components. They get loaded once the page is
34
34
  // rendered
@@ -56,8 +56,8 @@ export const ssrEntries = ${JSON.stringify(ssrEntries, void 0, 2)};
56
56
  );
57
57
  const serverEntries = {};
58
58
  const entries = {
59
- __cedarjs__ServerEntry: getPaths().web.entryServer || "",
60
- __cedarjs__Routes: getPaths().web.routes
59
+ __rwjs__ServerEntry: getPaths().web.entryServer || "",
60
+ __rwjs__Routes: getPaths().web.routes
61
61
  };
62
62
  for (const [name, sourceFile] of Object.entries(entries)) {
63
63
  const buildOutputItem = serverBuildOutput.find((item) => {
@@ -1 +1 @@
1
- {"version":3,"file":"rscBuildForServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForServer.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,+GA2ItC"}
1
+ {"version":3,"file":"rscBuildForServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForServer.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,+GAyItC"}
@@ -39,10 +39,8 @@ async function rscBuildForServer(clientEntryFiles, serverEntryFiles, customModul
39
39
  // Server store has to be externalized, because it's a singleton (shared between FW and App)
40
40
  external: [
41
41
  "@prisma/client",
42
- "@prisma/adapter-better-sqlite3",
43
42
  "@prisma/fetch-engine",
44
43
  "@prisma/internals",
45
- "better-sqlite3",
46
44
  "@cedarjs/auth-dbauth-api",
47
45
  "@cedarjs/cookie-jar",
48
46
  "@cedarjs/server-store",
@@ -1 +1 @@
1
- {"version":3,"file":"rscBuildForSsr.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForSsr.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,cAAc,CAAC,EACnC,gBAAgB,EAChB,OAAe,GAChB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,+GA6IA"}
1
+ {"version":3,"file":"rscBuildForSsr.d.ts","sourceRoot":"","sources":["../../src/rsc/rscBuildForSsr.ts"],"names":[],"mappings":"AAWA;;;GAGG;AACH,wBAAsB,cAAc,CAAC,EACnC,gBAAgB,EAChB,OAAe,GAChB,EAAE;IACD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,+GA2IA"}
@@ -34,10 +34,8 @@ async function rscBuildForSsr({
34
34
  noExternal: true,
35
35
  external: [
36
36
  "@prisma/client",
37
- "@prisma/adapter-better-sqlite3",
38
37
  "@prisma/fetch-engine",
39
38
  "@prisma/internals",
40
- "better-sqlite3",
41
39
  "@cedarjs/auth-dbauth-api",
42
40
  "@cedarjs/cookie-jar",
43
41
  "@cedarjs/server-store",
@@ -74,19 +72,19 @@ async function rscBuildForSsr({
74
72
  // index.css bundle but we don't actually want this on an rsc page!
75
73
  // TODO (RSC): Look into if we can remove this (and perhaps instead
76
74
  // use entry.server)
77
- __cedarjs__client_entry: rwPaths.web.entryClient,
75
+ __rwjs__client_entry: rwPaths.web.entryClient,
78
76
  "entry.server": rwPaths.web.entryServer,
79
77
  // we need this, so that the output contains rsc-specific bundles
80
78
  // for the client-only components. They get loaded once the page is
81
79
  // rendered
82
80
  ...clientEntryFiles,
83
81
  // These import redirections are so that we don't bundle multiple versions of react
84
- __cedarjs__react: "react",
85
- __cedarjs__location: "@cedarjs/router/location",
86
- __cedarjs__server_auth_provider: "@cedarjs/auth/ServerAuthProvider",
87
- __cedarjs__server_inject: "@cedarjs/web/serverInject",
88
- "__cedarjs__rsdw-client": "react-server-dom-webpack/client.edge",
89
- // TODO (RSC): add __cedarjs__ prefix to the entry below
82
+ __rwjs__react: "react",
83
+ __rwjs__location: "@cedarjs/router/location",
84
+ __rwjs__server_auth_provider: "@cedarjs/auth/ServerAuthProvider",
85
+ __rwjs__server_inject: "@cedarjs/web/serverInject",
86
+ "__rwjs__rsdw-client": "react-server-dom-webpack/client.edge",
87
+ // TODO (RSC): add __rwjs__ prefix to the entry below
90
88
  "rd-server": "react-dom/server.edge",
91
89
  // We need the document for React's fallback
92
90
  Document: rwPaths.web.document
@@ -101,7 +99,7 @@ async function rscBuildForSsr({
101
99
  // is resolved
102
100
  hoistTransitiveImports: false,
103
101
  entryFileNames: (chunkInfo) => {
104
- if (chunkInfo.name === "rd-server" || chunkInfo.name === "__cedarjs__react" || chunkInfo.name === "__cedarjs__location" || chunkInfo.name === "__cedarjs__server_auth_provider" || chunkInfo.name === "__cedarjs__server_inject" || chunkInfo.name === "__cedarjs__rsdw-client" || chunkInfo.name === "entry.server" || chunkInfo.name === "Document") {
102
+ if (chunkInfo.name === "rd-server" || chunkInfo.name === "__rwjs__react" || chunkInfo.name === "__rwjs__location" || chunkInfo.name === "__rwjs__server_auth_provider" || chunkInfo.name === "__rwjs__server_inject" || chunkInfo.name === "__rwjs__rsdw-client" || chunkInfo.name === "entry.server" || chunkInfo.name === "Document") {
105
103
  return "[name].mjs";
106
104
  }
107
105
  return "assets/[name]-[hash].mjs";
@@ -17,10 +17,10 @@ const getRoutesComponent = async () => {
17
17
  console.log("rscRenderer.ts serverEntries", serverEntries);
18
18
  const routesPath = path.join(
19
19
  getPaths().web.distRsc,
20
- serverEntries["__cedarjs__Routes"]
20
+ serverEntries["__rwjs__Routes"]
21
21
  );
22
22
  if (!routesPath) {
23
- throw new StatusError("No entry found for __cedarjs__Routes", 404);
23
+ throw new StatusError("No entry found for __rwjs__Routes", 404);
24
24
  }
25
25
  const routes = await loadServerFile(routesPath);
26
26
  return routes.default;
@@ -81,7 +81,7 @@ async function renderRsc(input) {
81
81
  console.log("renderRsc input", input);
82
82
  const serverRoutes = await getRoutesComponent();
83
83
  const model = {
84
- __cedarjs__Routes: createElement(serverRoutes)
84
+ __rwjs__Routes: createElement(serverRoutes)
85
85
  };
86
86
  console.log("rscRenderer.ts renderRsc model", model);
87
87
  return renderToReadableStream(model, getBundlerConfig());
@@ -118,8 +118,8 @@ async function executeRsa(input) {
118
118
  const serverRoutes = await getRoutesComponent();
119
119
  console.log("rscRenderer.ts executeRsa serverRoutes", serverRoutes);
120
120
  const model = {
121
- __cedarjs__Routes: createElement(serverRoutes),
122
- __cedarjs__rsa_data: data
121
+ __rwjs__Routes: createElement(serverRoutes),
122
+ __rwjs__rsa_data: data
123
123
  };
124
124
  console.log("rscRenderer.ts executeRsa model", model);
125
125
  return renderToReadableStream(model, getBundlerConfig());
@@ -18,6 +18,6 @@ interface StreamOptions {
18
18
  onError?: (err: Error) => void;
19
19
  }
20
20
  export declare function reactRenderToStreamResponse(mwRes: MiddlewareResponse, renderOptions: RenderToStreamArgs, streamOptions: StreamOptions): Promise<Response>;
21
- export declare function importModule(mod: 'rd-server' | '__cedarjs__react' | '__cedarjs__location' | '__cedarjs__server_auth_provider' | '__cedarjs__server_inject'): Promise<any>;
21
+ export declare function importModule(mod: 'rd-server' | '__rwjs__react' | '__rwjs__location' | '__rwjs__server_auth_provider' | '__rwjs__server_inject'): Promise<any>;
22
22
  export {};
23
23
  //# sourceMappingURL=streamHelpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"streamHelpers.d.ts","sourceRoot":"","sources":["../../src/streaming/streamHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAI5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAYlD,UAAU,kBAAkB;IAC1B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACzC,UAAU,EAAE,GAAG,CAAA;IACf,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,eAAe,CAAA;CAC3B;AAED,UAAU,aAAa;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;CAC/B;AA2BD,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,kBAAkB,EACzB,aAAa,EAAE,kBAAkB,EACjC,aAAa,EAAE,aAAa,qBAgM7B;AA2BD,wBAAsB,YAAY,CAChC,GAAG,EACC,WAAW,GACX,kBAAkB,GAClB,qBAAqB,GACrB,iCAAiC,GACjC,0BAA0B,gBA6B/B"}
1
+ {"version":3,"file":"streamHelpers.d.ts","sourceRoot":"","sources":["../../src/streaming/streamHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAA;AAI5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAGjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAYlD,UAAU,kBAAkB;IAC1B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACzC,UAAU,EAAE,GAAG,CAAA;IACf,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,eAAe,CAAA;CAC3B;AAED,UAAU,aAAa;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;CAC/B;AA2BD,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,kBAAkB,EACzB,aAAa,EAAE,kBAAkB,EACjC,aAAa,EAAE,aAAa,qBAgM7B;AA2BD,wBAAsB,YAAY,CAChC,GAAG,EACC,WAAW,GACX,eAAe,GACf,kBAAkB,GAClB,8BAA8B,GAC9B,uBAAuB,gBA2B5B"}
@@ -49,12 +49,12 @@ async function reactRenderToStreamResponse(mwRes, renderOptions, streamOptions)
49
49
  meta: metaTags
50
50
  });
51
51
  const rscEnabled = getConfig().experimental?.rsc?.enabled;
52
- const { createElement } = rscEnabled ? await importModule("__cedarjs__react") : await import("react");
52
+ const { createElement } = rscEnabled ? await importModule("__rwjs__react") : await import("react");
53
53
  const {
54
54
  createInjector,
55
55
  ServerHtmlProvider,
56
56
  ServerInjectedHtml
57
- } = rscEnabled ? await importModule("__cedarjs__server_inject") : await import("@cedarjs/web/serverInject");
57
+ } = rscEnabled ? await importModule("__rwjs__server_inject") : await import("@cedarjs/web/serverInject");
58
58
  const { renderToString } = rscEnabled ? await importModule("rd-server") : await import("react-dom/server");
59
59
  const { injectionState, injectToPage } = createInjector();
60
60
  const bufferTransform = createBufferedTransformStream();
@@ -70,8 +70,8 @@ async function reactRenderToStreamResponse(mwRes, renderOptions, streamOptions)
70
70
  controller.abort();
71
71
  }, 1e4);
72
72
  const timeoutTransform = createTimeoutTransform(timeoutHandle);
73
- const { ServerAuthProvider } = rscEnabled ? await importModule("__cedarjs__server_auth_provider") : await import("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
74
- const { LocationProvider } = rscEnabled ? await importModule("__cedarjs__location") : await import("@cedarjs/router/location");
73
+ const { ServerAuthProvider } = rscEnabled ? await importModule("__rwjs__server_auth_provider") : await import("@cedarjs/auth/dist/AuthProvider/ServerAuthProvider.js");
74
+ const { LocationProvider } = rscEnabled ? await importModule("__rwjs__location") : await import("@cedarjs/router/location");
75
75
  const renderRoot = (url) => {
76
76
  return createElement(
77
77
  ServerAuthProvider,
@@ -165,25 +165,23 @@ function applyStreamTransforms(reactStream, transformsToApply) {
165
165
  async function importModule(mod) {
166
166
  const distSsr = getPaths().web.distSsr;
167
167
  const rdServerPath = makeFilePath(path.join(distSsr, "rd-server.mjs"));
168
- const reactPath = makeFilePath(path.join(distSsr, "__cedarjs__react.mjs"));
169
- const locationPath = makeFilePath(
170
- path.join(distSsr, "__cedarjs__location.mjs")
171
- );
168
+ const reactPath = makeFilePath(path.join(distSsr, "__rwjs__react.mjs"));
169
+ const locationPath = makeFilePath(path.join(distSsr, "__rwjs__location.mjs"));
172
170
  const ServerAuthProviderPath = makeFilePath(
173
- path.join(distSsr, "__cedarjs__server_auth_provider.mjs")
171
+ path.join(distSsr, "__rwjs__server_auth_provider.mjs")
174
172
  );
175
173
  const ServerInjectPath = makeFilePath(
176
- path.join(distSsr, "__cedarjs__server_inject.mjs")
174
+ path.join(distSsr, "__rwjs__server_inject.mjs")
177
175
  );
178
176
  if (mod === "rd-server") {
179
177
  return (await import(rdServerPath)).default;
180
- } else if (mod === "__cedarjs__react") {
178
+ } else if (mod === "__rwjs__react") {
181
179
  return (await import(reactPath)).default;
182
- } else if (mod === "__cedarjs__location") {
180
+ } else if (mod === "__rwjs__location") {
183
181
  return await import(locationPath);
184
- } else if (mod === "__cedarjs__server_auth_provider") {
182
+ } else if (mod === "__rwjs__server_auth_provider") {
185
183
  return await import(ServerAuthProviderPath);
186
- } else if (mod === "__cedarjs__server_inject") {
184
+ } else if (mod === "__rwjs__server_inject") {
187
185
  return await import(ServerInjectPath);
188
186
  }
189
187
  throw new Error("Unknown module " + mod);
package/dist/utils.js CHANGED
@@ -44,8 +44,8 @@ function convertExpressHeaders(expressDistinctHeaders) {
44
44
  const getFullUrl = (req, rscEnabled) => {
45
45
  const baseUrl = req.protocol + "://" + req.headers.host;
46
46
  const url = new URL(req.originalUrl || "", baseUrl);
47
- const pathname = url.searchParams.get("__cedarjs__pathname");
48
- const search = url.searchParams.get("__cedarjs__search");
47
+ const pathname = url.searchParams.get("__rwjs__pathname");
48
+ const search = url.searchParams.get("__rwjs__search");
49
49
  let pathnamePlusSearch = req.originalUrl;
50
50
  if (rscEnabled && pathname !== null && search !== null) {
51
51
  pathnamePlusSearch = pathname + "?" + search;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/vite",
3
- "version": "2.8.1-next.116+784d2c048",
3
+ "version": "2.8.1",
4
4
  "description": "Vite configuration package for CedarJS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -60,18 +60,18 @@
60
60
  "test:watch": "vitest watch"
61
61
  },
62
62
  "dependencies": {
63
- "@ast-grep/napi": "0.42.0",
63
+ "@ast-grep/napi": "0.41.0",
64
64
  "@babel/generator": "7.29.1",
65
- "@babel/parser": "7.29.2",
65
+ "@babel/parser": "7.29.0",
66
66
  "@babel/traverse": "7.29.0",
67
- "@cedarjs/auth": "2.8.1-next.116+784d2c048",
68
- "@cedarjs/babel-config": "2.8.1-next.116+784d2c048",
69
- "@cedarjs/cookie-jar": "2.8.1-next.116+784d2c048",
70
- "@cedarjs/internal": "2.8.1-next.116+784d2c048",
71
- "@cedarjs/project-config": "2.8.1-next.116+784d2c048",
72
- "@cedarjs/server-store": "2.8.1-next.116+784d2c048",
73
- "@cedarjs/testing": "2.8.1-next.116+784d2c048",
74
- "@cedarjs/web": "2.8.1-next.116+784d2c048",
67
+ "@cedarjs/auth": "2.8.1",
68
+ "@cedarjs/babel-config": "2.8.1",
69
+ "@cedarjs/cookie-jar": "2.8.1",
70
+ "@cedarjs/internal": "2.8.1",
71
+ "@cedarjs/project-config": "2.8.1",
72
+ "@cedarjs/server-store": "2.8.1",
73
+ "@cedarjs/testing": "2.8.1",
74
+ "@cedarjs/web": "2.8.1",
75
75
  "@swc/core": "1.15.18",
76
76
  "@vitejs/plugin-react": "4.7.0",
77
77
  "@whatwg-node/fetch": "0.10.13",
@@ -80,17 +80,18 @@
80
80
  "buffer": "6.0.3",
81
81
  "busboy": "^1.6.0",
82
82
  "cookie": "1.1.1",
83
+ "core-js": "3.48.0",
83
84
  "dotenv-defaults": "5.0.2",
84
85
  "execa": "5.1.1",
85
86
  "express": "4.22.1",
86
87
  "find-my-way": "8.2.2",
87
88
  "http-proxy-middleware": "3.0.5",
88
- "isbot": "5.1.36",
89
+ "isbot": "5.1.35",
89
90
  "react": "18.3.1",
90
91
  "react-server-dom-webpack": "19.2.4",
91
92
  "rimraf": "6.1.3",
92
93
  "vite": "5.4.21",
93
- "vite-plugin-cjs-interop": "2.4.4",
94
+ "vite-plugin-cjs-interop": "2.4.3",
94
95
  "vite-plugin-node-polyfills": "0.25.0",
95
96
  "ws": "8.19.0",
96
97
  "yargs-parser": "21.1.1"
@@ -105,7 +106,7 @@
105
106
  "@types/yargs-parser": "21.0.3",
106
107
  "concurrently": "9.2.1",
107
108
  "glob": "11.1.0",
108
- "memfs": "4.56.11",
109
+ "memfs": "4.56.10",
109
110
  "publint": "0.3.18",
110
111
  "rollup": "4.59.0",
111
112
  "tsx": "4.21.0",
@@ -115,5 +116,5 @@
115
116
  "publishConfig": {
116
117
  "access": "public"
117
118
  },
118
- "gitHead": "784d2c0484936b2d853e5b316d167602bd80d996"
119
+ "gitHead": "b1a808f72ff10c72375d0ff2c0be03631a1b79a2"
119
120
  }