@cedarjs/vite 6.0.0-rc.312 → 6.0.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.
@@ -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,iBAya3B"}
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
@@ -16,7 +16,7 @@ import {
16
16
  transformWithBabel
17
17
  } from "@cedarjs/babel-config";
18
18
  import {
19
- applyEsmExtensions,
19
+ applyImportExtensions,
20
20
  applySrcAlias
21
21
  } from "@cedarjs/internal/dist/build/api.js";
22
22
  import { findApiFiles } from "@cedarjs/internal/dist/files.js";
@@ -282,9 +282,7 @@ async function buildCedarApp({
282
282
  );
283
283
  const applyImportRewrites = (source) => {
284
284
  let rewritten = applySrcAlias(source, fromDirRelativeToApiSrc);
285
- if (projectSideIsEsm("api")) {
286
- rewritten = applyEsmExtensions(rewritten, id);
287
- }
285
+ rewritten = applyImportExtensions(rewritten, id);
288
286
  return rewritten;
289
287
  };
290
288
  const rewrittenCode = applyImportRewrites(code);
@@ -31,7 +31,8 @@ function rscAnalyzePlugin(clientEntryCallback, serverEntryCallback) {
31
31
  };
32
32
  }
33
33
  function isServerAction(node) {
34
- return node.body?.type === "BlockStatement" && node.body.stmts.some(
34
+ const body = node.body;
35
+ return !!body && "stmts" in body && body.stmts.some(
35
36
  (s) => s.type === "ExpressionStatement" && s.expression.type === "StringLiteral" && s.expression.value === "use server"
36
37
  );
37
38
  }
@@ -0,0 +1,2 @@
1
+ export declare function createWebSocketServer(): void;
2
+ //# sourceMappingURL=rscWebSocketServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rscWebSocketServer.d.ts","sourceRoot":"","sources":["../../src/rsc/rscWebSocketServer.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,SAwBpC"}
@@ -0,0 +1,22 @@
1
+ import WebSocket, { WebSocketServer } from "ws";
2
+ function createWebSocketServer() {
3
+ const wsServer = new WebSocketServer({ port: 18998 });
4
+ wsServer.on("connection", (ws) => {
5
+ console.log("A new client connected.");
6
+ ws.on("message", (data) => {
7
+ const message = data.toString();
8
+ console.log("Received message:", message);
9
+ wsServer.clients.forEach((client) => {
10
+ if (client.readyState === WebSocket.OPEN) {
11
+ client.send(message);
12
+ }
13
+ });
14
+ });
15
+ ws.on("close", () => {
16
+ console.log("A client disconnected.");
17
+ });
18
+ });
19
+ }
20
+ export {
21
+ createWebSocketServer
22
+ };
@@ -0,0 +1,10 @@
1
+ import type { default as RSDWServerModule } from 'react-server-dom-webpack/server.edge';
2
+ type RSDWServerType = typeof RSDWServerModule;
3
+ /**
4
+ * This function ensures we load the version of React that's been imported with
5
+ * the react-server condition.
6
+ */
7
+ export declare function importRscReact(): Promise<any>;
8
+ export declare function importRsdwServer(): Promise<RSDWServerType>;
9
+ export {};
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/rsc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sCAAsC,CAAA;AAEvF,KAAK,cAAc,GAAG,OAAO,gBAAgB,CAAA;AAE7C;;;GAGG;AACH,wBAAsB,cAAc,iBAQnC;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,cAAc,CAAC,CAUhE"}
@@ -0,0 +1,21 @@
1
+ async function importRscReact() {
2
+ if (globalThis.__cedarjs__vite_rsc_runtime) {
3
+ const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.import("react");
4
+ return reactMod.default;
5
+ }
6
+ return import("react");
7
+ }
8
+ async function importRsdwServer() {
9
+ if (globalThis.__cedarjs__vite_rsc_runtime) {
10
+ const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
11
+ "react-server-dom-webpack/server.edge"
12
+ );
13
+ return rsdwServerMod.default;
14
+ } else {
15
+ return import("react-server-dom-webpack/server.edge");
16
+ }
17
+ }
18
+ export {
19
+ importRscReact,
20
+ importRsdwServer
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/vite",
3
- "version": "6.0.0-rc.312",
3
+ "version": "6.0.0",
4
4
  "description": "Vite configuration package for CedarJS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -48,22 +48,22 @@
48
48
  "test:watch": "vitest watch"
49
49
  },
50
50
  "dependencies": {
51
- "@babel/generator": "7.29.7",
52
- "@babel/parser": "7.29.7",
53
- "@babel/traverse": "7.29.7",
54
- "@babel/types": "7.29.7",
55
- "@cedarjs/api": "6.0.0-rc.312",
56
- "@cedarjs/api-server": "6.0.0-rc.312",
57
- "@cedarjs/babel-config": "6.0.0-rc.312",
58
- "@cedarjs/context": "6.0.0-rc.312",
59
- "@cedarjs/graphql-server": "6.0.0-rc.312",
60
- "@cedarjs/internal": "6.0.0-rc.312",
61
- "@cedarjs/jobs": "6.0.0-rc.312",
62
- "@cedarjs/project-config": "6.0.0-rc.312",
63
- "@cedarjs/server-store": "6.0.0-rc.312",
64
- "@cedarjs/structure": "6.0.0-rc.312",
65
- "@cedarjs/testing": "6.0.0-rc.312",
66
- "@swc/core": "1.15.47",
51
+ "@babel/generator": "7.29.8",
52
+ "@babel/parser": "7.29.8",
53
+ "@babel/traverse": "7.29.8",
54
+ "@babel/types": "7.29.8",
55
+ "@cedarjs/api": "6.0.0",
56
+ "@cedarjs/api-server": "6.0.0",
57
+ "@cedarjs/babel-config": "6.0.0",
58
+ "@cedarjs/context": "6.0.0",
59
+ "@cedarjs/graphql-server": "6.0.0",
60
+ "@cedarjs/internal": "6.0.0",
61
+ "@cedarjs/jobs": "6.0.0",
62
+ "@cedarjs/project-config": "6.0.0",
63
+ "@cedarjs/server-store": "6.0.0",
64
+ "@cedarjs/structure": "6.0.0",
65
+ "@cedarjs/testing": "6.0.0",
66
+ "@swc/core": "1.16.0",
67
67
  "@universal-deploy/store": "^0.2.1",
68
68
  "@universal-deploy/vite": "^0.1.9",
69
69
  "@vitejs/plugin-react": "4.7.0",
@@ -93,10 +93,10 @@
93
93
  "yargs-parser": "21.1.1"
94
94
  },
95
95
  "devDependencies": {
96
- "@cedarjs/auth": "6.0.0-rc.312",
97
- "@cedarjs/framework-tools": "6.0.0-rc.312",
98
- "@cedarjs/router": "6.0.0-rc.312",
99
- "@cedarjs/web": "6.0.0-rc.312",
96
+ "@cedarjs/auth": "6.0.0",
97
+ "@cedarjs/framework-tools": "6.0.0",
98
+ "@cedarjs/router": "6.0.0",
99
+ "@cedarjs/web": "6.0.0",
100
100
  "@dr.pogodin/react-helmet": "2.0.4",
101
101
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",
102
102
  "@jridgewell/trace-mapping": "0.3.31",
@@ -116,9 +116,9 @@
116
116
  "vitest": "4.1.10"
117
117
  },
118
118
  "peerDependencies": {
119
- "@cedarjs/auth": "6.0.0-rc.312",
120
- "@cedarjs/router": "6.0.0-rc.312",
121
- "@cedarjs/web": "6.0.0-rc.312"
119
+ "@cedarjs/auth": "6.0.0",
120
+ "@cedarjs/router": "6.0.0",
121
+ "@cedarjs/web": "6.0.0"
122
122
  },
123
123
  "engines": {
124
124
  "node": ">=24"