@cedarjs/vite 4.0.0-rc.129 → 4.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.
- package/dist/bundled/react-server-dom-webpack.server.js +1224 -28521
- package/dist/cjs/rsc/rscWebSocketServer.js +56 -0
- package/dist/cjs/rsc/utils.js +56 -0
- package/dist/rsc/rscWebSocketServer.d.ts +2 -0
- package/dist/rsc/rscWebSocketServer.d.ts.map +1 -0
- package/dist/rsc/rscWebSocketServer.js +22 -0
- package/dist/rsc/utils.d.ts +10 -0
- package/dist/rsc/utils.d.ts.map +1 -0
- package/dist/rsc/utils.js +21 -0
- package/package.json +10 -10
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var rscWebSocketServer_exports = {};
|
|
30
|
+
__export(rscWebSocketServer_exports, {
|
|
31
|
+
createWebSocketServer: () => createWebSocketServer
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(rscWebSocketServer_exports);
|
|
34
|
+
var import_ws = __toESM(require("ws"), 1);
|
|
35
|
+
function createWebSocketServer() {
|
|
36
|
+
const wsServer = new import_ws.WebSocketServer({ port: 18998 });
|
|
37
|
+
wsServer.on("connection", (ws) => {
|
|
38
|
+
console.log("A new client connected.");
|
|
39
|
+
ws.on("message", (data) => {
|
|
40
|
+
const message = data.toString();
|
|
41
|
+
console.log("Received message:", message);
|
|
42
|
+
wsServer.clients.forEach((client) => {
|
|
43
|
+
if (client.readyState === import_ws.default.OPEN) {
|
|
44
|
+
client.send(message);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
ws.on("close", () => {
|
|
49
|
+
console.log("A client disconnected.");
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
54
|
+
0 && (module.exports = {
|
|
55
|
+
createWebSocketServer
|
|
56
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var utils_exports = {};
|
|
30
|
+
__export(utils_exports, {
|
|
31
|
+
importRscReact: () => importRscReact,
|
|
32
|
+
importRsdwServer: () => importRsdwServer
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
|
+
async function importRscReact() {
|
|
36
|
+
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
37
|
+
const reactMod = await globalThis.__cedarjs__vite_rsc_runtime.import("react");
|
|
38
|
+
return reactMod.default;
|
|
39
|
+
}
|
|
40
|
+
return import("react");
|
|
41
|
+
}
|
|
42
|
+
async function importRsdwServer() {
|
|
43
|
+
if (globalThis.__cedarjs__vite_rsc_runtime) {
|
|
44
|
+
const rsdwServerMod = await globalThis.__cedarjs__vite_rsc_runtime.import(
|
|
45
|
+
"react-server-dom-webpack/server.edge"
|
|
46
|
+
);
|
|
47
|
+
return rsdwServerMod.default;
|
|
48
|
+
} else {
|
|
49
|
+
return import("react-server-dom-webpack/server.edge");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
importRscReact,
|
|
55
|
+
importRsdwServer
|
|
56
|
+
});
|
|
@@ -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": "4.0.0
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -64,14 +64,14 @@
|
|
|
64
64
|
"@babel/generator": "7.29.1",
|
|
65
65
|
"@babel/parser": "7.29.2",
|
|
66
66
|
"@babel/traverse": "7.29.0",
|
|
67
|
-
"@cedarjs/auth": "4.0.0
|
|
68
|
-
"@cedarjs/babel-config": "4.0.0
|
|
69
|
-
"@cedarjs/cookie-jar": "4.0.0
|
|
70
|
-
"@cedarjs/internal": "4.0.0
|
|
71
|
-
"@cedarjs/project-config": "4.0.0
|
|
72
|
-
"@cedarjs/server-store": "4.0.0
|
|
73
|
-
"@cedarjs/testing": "4.0.0
|
|
74
|
-
"@cedarjs/web": "4.0.0
|
|
67
|
+
"@cedarjs/auth": "4.0.0",
|
|
68
|
+
"@cedarjs/babel-config": "4.0.0",
|
|
69
|
+
"@cedarjs/cookie-jar": "4.0.0",
|
|
70
|
+
"@cedarjs/internal": "4.0.0",
|
|
71
|
+
"@cedarjs/project-config": "4.0.0",
|
|
72
|
+
"@cedarjs/server-store": "4.0.0",
|
|
73
|
+
"@cedarjs/testing": "4.0.0",
|
|
74
|
+
"@cedarjs/web": "4.0.0",
|
|
75
75
|
"@swc/core": "1.15.24",
|
|
76
76
|
"@vitejs/plugin-react": "4.7.0",
|
|
77
77
|
"@whatwg-node/fetch": "0.10.13",
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"publishConfig": {
|
|
119
119
|
"access": "public"
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "b73014711894261b601a749b8caa2ae3bb1bec07"
|
|
122
122
|
}
|