@cedarjs/vite 5.0.0-canary.2432 → 5.0.0-canary.2433
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 +14 -0
- package/dist/buildUDApiServer.d.ts.map +1 -1
- package/dist/buildUDApiServer.js +73 -51
- package/dist/cjs/buildApp.js +14 -0
- package/dist/cjs/buildUDApiServer.js +73 -51
- package/dist/cjs/plugins/vite-plugin-cedar-universal-deploy.js +1 -4
- package/dist/plugins/vite-plugin-cedar-universal-deploy.d.ts.map +1 -1
- package/dist/plugins/vite-plugin-cedar-universal-deploy.js +1 -4
- package/package.json +12 -12
package/dist/buildApp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,GAC3B,GAAE,oBAAyB,
|
|
1
|
+
{"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,GAC3B,GAAE,oBAAyB,iBA0P3B"}
|
package/dist/buildApp.js
CHANGED
|
@@ -125,6 +125,20 @@ async function buildCedarApp({
|
|
|
125
125
|
delete config.environments.ssr;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: "cedar-build-app",
|
|
131
|
+
buildApp: {
|
|
132
|
+
order: "pre",
|
|
133
|
+
async handler(builder2) {
|
|
134
|
+
if (workspace.includes("web") && builder2.environments.client && !builder2.environments.client.isBuilt) {
|
|
135
|
+
await builder2.build(builder2.environments.client);
|
|
136
|
+
}
|
|
137
|
+
if (workspace.includes("api") && builder2.environments.api && !builder2.environments.api.isBuilt) {
|
|
138
|
+
await builder2.build(builder2.environments.api);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
128
142
|
}
|
|
129
143
|
];
|
|
130
144
|
if (workspace.includes("api")) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUDApiServer.d.ts","sourceRoot":"","sources":["../src/buildUDApiServer.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAe,GAChB,GAAE,uBAA4B,
|
|
1
|
+
{"version":3,"file":"buildUDApiServer.d.ts","sourceRoot":"","sources":["../src/buildUDApiServer.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CAAC,EACrC,OAAe,GAChB,GAAE,uBAA4B,iBAyG9B"}
|
package/dist/buildUDApiServer.js
CHANGED
|
@@ -9,62 +9,84 @@ async function buildUDApiServer({
|
|
|
9
9
|
const { catchAllEntry, getAllEntries } = await import("@universal-deploy/store");
|
|
10
10
|
const cedarPaths = getPaths();
|
|
11
11
|
const outDir = path.join(cedarPaths.api.dist, "ud");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
12
|
+
const providerOutputDirs = [path.join(cedarPaths.base, ".vercel", "output")];
|
|
13
|
+
const savedDirs = /* @__PURE__ */ new Map();
|
|
14
|
+
for (const dir of providerOutputDirs) {
|
|
15
|
+
if (fs.existsSync(dir)) {
|
|
16
|
+
const tmpDir = dir + ".cedar-ud-backup";
|
|
17
|
+
await fs.promises.cp(dir, tmpDir, { recursive: true, force: true });
|
|
18
|
+
savedDirs.set(dir, tmpDir);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
await build({
|
|
23
|
+
// Load the user's Vite config so all plugins (Cedar's UD plugin,
|
|
24
|
+
// provider plugins, etc.) run during the build.
|
|
25
|
+
configFile: cedarPaths.web.viteConfig,
|
|
26
|
+
logLevel: verbose ? "info" : "warn",
|
|
27
|
+
plugins: [
|
|
28
|
+
// catchAll() generates the rou3-based route dispatcher
|
|
29
|
+
// (virtual:ud:catch-all). devServer() provides Vite dev support for
|
|
30
|
+
// cedar dev --ud.
|
|
31
|
+
//
|
|
32
|
+
// NOTE: We intentionally do NOT use universalDeploy() here — that
|
|
33
|
+
// plugin auto-detects deployment targets and would embed the Node
|
|
34
|
+
// HTTP server startup code into the output. Our plugin list is
|
|
35
|
+
// adapter-free: the output is a pure Fetchable export, and cedar
|
|
36
|
+
// serve wraps it in srvx at runtime.
|
|
37
|
+
catchAll(),
|
|
38
|
+
devServer(),
|
|
39
|
+
// Warn if no Cedar API routes were registered — likely means the
|
|
40
|
+
// user's vite config is missing cedarUniversalDeployPlugin or there
|
|
41
|
+
// are no API functions to serve.
|
|
42
|
+
{
|
|
43
|
+
name: "cedar-ud-verify-routes",
|
|
44
|
+
configResolved() {
|
|
45
|
+
const entries = getAllEntries();
|
|
46
|
+
if (entries.length === 0) {
|
|
47
|
+
console.warn(
|
|
48
|
+
"\n Warning: No Universal Deploy API routes were registered.",
|
|
49
|
+
"\n The built server entry will be an empty router (404 for all",
|
|
50
|
+
"\n requests). Check that you have API functions under",
|
|
51
|
+
"\n `api/src/functions/` and that your vite config includes",
|
|
52
|
+
"\n `cedarUniversalDeployPlugin()`.\n"
|
|
53
|
+
);
|
|
54
|
+
}
|
|
44
55
|
}
|
|
45
56
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
],
|
|
58
|
+
// Legacy ssr flag approach. The explicit rollupOptions.input prevents the
|
|
59
|
+
// "index.html as SSR entry" error. Vite will also build a 'client'
|
|
60
|
+
// environment from the user's config file (wasteful but harmless), and
|
|
61
|
+
// the 'ssr' environment produces our canonical Fetchable artifact at
|
|
62
|
+
// api/dist/ud/index.js.
|
|
63
|
+
build: {
|
|
64
|
+
ssr: true,
|
|
65
|
+
outDir,
|
|
66
|
+
rollupOptions: {
|
|
67
|
+
input: catchAllEntry,
|
|
68
|
+
output: {
|
|
69
|
+
entryFileNames: "index.js"
|
|
70
|
+
}
|
|
60
71
|
}
|
|
61
72
|
}
|
|
73
|
+
});
|
|
74
|
+
fs.writeFileSync(
|
|
75
|
+
path.join(outDir, "package.json"),
|
|
76
|
+
JSON.stringify({ type: "module" }, null, 2)
|
|
77
|
+
);
|
|
78
|
+
} finally {
|
|
79
|
+
for (const [dir, tmpDir] of savedDirs) {
|
|
80
|
+
if (fs.existsSync(tmpDir)) {
|
|
81
|
+
const opts = { recursive: true, force: true };
|
|
82
|
+
await fs.promises.rm(dir, opts).catch(() => {
|
|
83
|
+
});
|
|
84
|
+
await fs.promises.cp(tmpDir, dir, opts);
|
|
85
|
+
await fs.promises.rm(tmpDir, opts).catch(() => {
|
|
86
|
+
});
|
|
87
|
+
}
|
|
62
88
|
}
|
|
63
|
-
}
|
|
64
|
-
fs.writeFileSync(
|
|
65
|
-
path.join(outDir, "package.json"),
|
|
66
|
-
JSON.stringify({ type: "module" }, null, 2)
|
|
67
|
-
);
|
|
89
|
+
}
|
|
68
90
|
}
|
|
69
91
|
export {
|
|
70
92
|
buildUDApiServer
|
package/dist/cjs/buildApp.js
CHANGED
|
@@ -155,6 +155,20 @@ async function buildCedarApp({
|
|
|
155
155
|
delete config.environments.ssr;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "cedar-build-app",
|
|
161
|
+
buildApp: {
|
|
162
|
+
order: "pre",
|
|
163
|
+
async handler(builder2) {
|
|
164
|
+
if (workspace.includes("web") && builder2.environments.client && !builder2.environments.client.isBuilt) {
|
|
165
|
+
await builder2.build(builder2.environments.client);
|
|
166
|
+
}
|
|
167
|
+
if (workspace.includes("api") && builder2.environments.api && !builder2.environments.api.isBuilt) {
|
|
168
|
+
await builder2.build(builder2.environments.api);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
158
172
|
}
|
|
159
173
|
];
|
|
160
174
|
if (workspace.includes("api")) {
|
|
@@ -42,62 +42,84 @@ async function buildUDApiServer({
|
|
|
42
42
|
const { catchAllEntry, getAllEntries } = await import("@universal-deploy/store");
|
|
43
43
|
const cedarPaths = (0, import_project_config.getPaths)();
|
|
44
44
|
const outDir = import_node_path.default.join(cedarPaths.api.dist, "ud");
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
45
|
+
const providerOutputDirs = [import_node_path.default.join(cedarPaths.base, ".vercel", "output")];
|
|
46
|
+
const savedDirs = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const dir of providerOutputDirs) {
|
|
48
|
+
if (import_node_fs.default.existsSync(dir)) {
|
|
49
|
+
const tmpDir = dir + ".cedar-ud-backup";
|
|
50
|
+
await import_node_fs.default.promises.cp(dir, tmpDir, { recursive: true, force: true });
|
|
51
|
+
savedDirs.set(dir, tmpDir);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
await build({
|
|
56
|
+
// Load the user's Vite config so all plugins (Cedar's UD plugin,
|
|
57
|
+
// provider plugins, etc.) run during the build.
|
|
58
|
+
configFile: cedarPaths.web.viteConfig,
|
|
59
|
+
logLevel: verbose ? "info" : "warn",
|
|
60
|
+
plugins: [
|
|
61
|
+
// catchAll() generates the rou3-based route dispatcher
|
|
62
|
+
// (virtual:ud:catch-all). devServer() provides Vite dev support for
|
|
63
|
+
// cedar dev --ud.
|
|
64
|
+
//
|
|
65
|
+
// NOTE: We intentionally do NOT use universalDeploy() here — that
|
|
66
|
+
// plugin auto-detects deployment targets and would embed the Node
|
|
67
|
+
// HTTP server startup code into the output. Our plugin list is
|
|
68
|
+
// adapter-free: the output is a pure Fetchable export, and cedar
|
|
69
|
+
// serve wraps it in srvx at runtime.
|
|
70
|
+
catchAll(),
|
|
71
|
+
devServer(),
|
|
72
|
+
// Warn if no Cedar API routes were registered — likely means the
|
|
73
|
+
// user's vite config is missing cedarUniversalDeployPlugin or there
|
|
74
|
+
// are no API functions to serve.
|
|
75
|
+
{
|
|
76
|
+
name: "cedar-ud-verify-routes",
|
|
77
|
+
configResolved() {
|
|
78
|
+
const entries = getAllEntries();
|
|
79
|
+
if (entries.length === 0) {
|
|
80
|
+
console.warn(
|
|
81
|
+
"\n Warning: No Universal Deploy API routes were registered.",
|
|
82
|
+
"\n The built server entry will be an empty router (404 for all",
|
|
83
|
+
"\n requests). Check that you have API functions under",
|
|
84
|
+
"\n `api/src/functions/` and that your vite config includes",
|
|
85
|
+
"\n `cedarUniversalDeployPlugin()`.\n"
|
|
86
|
+
);
|
|
87
|
+
}
|
|
77
88
|
}
|
|
78
89
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
],
|
|
91
|
+
// Legacy ssr flag approach. The explicit rollupOptions.input prevents the
|
|
92
|
+
// "index.html as SSR entry" error. Vite will also build a 'client'
|
|
93
|
+
// environment from the user's config file (wasteful but harmless), and
|
|
94
|
+
// the 'ssr' environment produces our canonical Fetchable artifact at
|
|
95
|
+
// api/dist/ud/index.js.
|
|
96
|
+
build: {
|
|
97
|
+
ssr: true,
|
|
98
|
+
outDir,
|
|
99
|
+
rollupOptions: {
|
|
100
|
+
input: catchAllEntry,
|
|
101
|
+
output: {
|
|
102
|
+
entryFileNames: "index.js"
|
|
103
|
+
}
|
|
93
104
|
}
|
|
94
105
|
}
|
|
106
|
+
});
|
|
107
|
+
import_node_fs.default.writeFileSync(
|
|
108
|
+
import_node_path.default.join(outDir, "package.json"),
|
|
109
|
+
JSON.stringify({ type: "module" }, null, 2)
|
|
110
|
+
);
|
|
111
|
+
} finally {
|
|
112
|
+
for (const [dir, tmpDir] of savedDirs) {
|
|
113
|
+
if (import_node_fs.default.existsSync(tmpDir)) {
|
|
114
|
+
const opts = { recursive: true, force: true };
|
|
115
|
+
await import_node_fs.default.promises.rm(dir, opts).catch(() => {
|
|
116
|
+
});
|
|
117
|
+
await import_node_fs.default.promises.cp(tmpDir, dir, opts);
|
|
118
|
+
await import_node_fs.default.promises.rm(tmpDir, opts).catch(() => {
|
|
119
|
+
});
|
|
120
|
+
}
|
|
95
121
|
}
|
|
96
|
-
}
|
|
97
|
-
import_node_fs.default.writeFileSync(
|
|
98
|
-
import_node_path.default.join(outDir, "package.json"),
|
|
99
|
-
JSON.stringify({ type: "module" }, null, 2)
|
|
100
|
-
);
|
|
122
|
+
}
|
|
101
123
|
}
|
|
102
124
|
// Annotate the CommonJS export names for ESM import in node:
|
|
103
125
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-cedar-universal-deploy.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-cedar-universal-deploy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAMlC,MAAM,WAAW,iCAAiC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAuJD,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,iCAAsC,GAC9C,MAAM,
|
|
1
|
+
{"version":3,"file":"vite-plugin-cedar-universal-deploy.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-cedar-universal-deploy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAMlC,MAAM,WAAW,iCAAiC;IAChD,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAuJD,wBAAgB,0BAA0B,CACxC,OAAO,GAAE,iCAAsC,GAC9C,MAAM,CAuHR"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "5.0.0-canary.
|
|
3
|
+
"version": "5.0.0-canary.2433",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"@babel/generator": "7.29.1",
|
|
70
70
|
"@babel/parser": "7.29.3",
|
|
71
71
|
"@babel/traverse": "7.29.0",
|
|
72
|
-
"@cedarjs/api": "5.0.0-canary.
|
|
73
|
-
"@cedarjs/auth": "5.0.0-canary.
|
|
74
|
-
"@cedarjs/babel-config": "5.0.0-canary.
|
|
75
|
-
"@cedarjs/context": "5.0.0-canary.
|
|
76
|
-
"@cedarjs/cookie-jar": "5.0.0-canary.
|
|
77
|
-
"@cedarjs/graphql-server": "5.0.0-canary.
|
|
78
|
-
"@cedarjs/internal": "5.0.0-canary.
|
|
79
|
-
"@cedarjs/project-config": "5.0.0-canary.
|
|
80
|
-
"@cedarjs/server-store": "5.0.0-canary.
|
|
81
|
-
"@cedarjs/testing": "5.0.0-canary.
|
|
82
|
-
"@cedarjs/web": "5.0.0-canary.
|
|
72
|
+
"@cedarjs/api": "5.0.0-canary.2433",
|
|
73
|
+
"@cedarjs/auth": "5.0.0-canary.2433",
|
|
74
|
+
"@cedarjs/babel-config": "5.0.0-canary.2433",
|
|
75
|
+
"@cedarjs/context": "5.0.0-canary.2433",
|
|
76
|
+
"@cedarjs/cookie-jar": "5.0.0-canary.2433",
|
|
77
|
+
"@cedarjs/graphql-server": "5.0.0-canary.2433",
|
|
78
|
+
"@cedarjs/internal": "5.0.0-canary.2433",
|
|
79
|
+
"@cedarjs/project-config": "5.0.0-canary.2433",
|
|
80
|
+
"@cedarjs/server-store": "5.0.0-canary.2433",
|
|
81
|
+
"@cedarjs/testing": "5.0.0-canary.2433",
|
|
82
|
+
"@cedarjs/web": "5.0.0-canary.2433",
|
|
83
83
|
"@fastify/url-data": "6.0.3",
|
|
84
84
|
"@swc/core": "1.15.33",
|
|
85
85
|
"@universal-deploy/store": "^0.2.1",
|