@lunora/vite 1.0.0-alpha.55 → 1.0.0-alpha.56
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/index.mjs +2 -2
- package/dist/packem_shared/{codegenPlugin-3AqQzOq0.mjs → codegenPlugin-Bo3IZF46.mjs} +23 -14
- package/dist/packem_shared/{devStatePlugin-D7Qc2gKr.mjs → devStatePlugin-DdjfMrhx.mjs} +8 -2
- package/dist/packem_shared/server-close-DKDp7YTU.mjs +16 -0
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import errorOverlayPlugin from '@visulima/vite-overlay';
|
|
|
3
3
|
import { detectAgentRules, claimAgentRulesHint, AGENT_RULES_HINT, detectFramework } from '@lunora/config';
|
|
4
4
|
export { detectFramework } from '@lunora/config';
|
|
5
5
|
import { l as lunoraLine } from './packem_shared/log-BjO9EWah.mjs';
|
|
6
|
-
import codegenPlugin from './packem_shared/codegenPlugin-
|
|
6
|
+
import codegenPlugin from './packem_shared/codegenPlugin-Bo3IZF46.mjs';
|
|
7
7
|
import containerLogsPlugin from './packem_shared/containerLogsPlugin-DMssU3wb.mjs';
|
|
8
|
-
import devStatePlugin from './packem_shared/devStatePlugin-
|
|
8
|
+
import devStatePlugin from './packem_shared/devStatePlugin-DdjfMrhx.mjs';
|
|
9
9
|
import devVariablesPlugin from './packem_shared/devVariablesPlugin-CDNSnvOP.mjs';
|
|
10
10
|
import { createCommandProbe, withDevWorkerEnv } from './packem_shared/DEV_WORKER_ENV_VALUE-Coo6bgVz.mjs';
|
|
11
11
|
export { DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR } from './packem_shared/DEV_WORKER_ENV_VALUE-Coo6bgVz.mjs';
|
|
@@ -6,6 +6,7 @@ import { isRunnableDevEnvironment } from 'vite';
|
|
|
6
6
|
import { reconcileWranglerCrons } from './reconcileWranglerCrons-PxGwfCp_.mjs';
|
|
7
7
|
import LUNORA_API_UPDATED_EVENT from './LUNORA_API_UPDATED_EVENT-BrkWk3rr.mjs';
|
|
8
8
|
import { L as LUNORA_TAG, a as advisoryLine } from './log-BjO9EWah.mjs';
|
|
9
|
+
import { r as runPendingClose, a as registerDevServerClose } from './server-close-DKDp7YTU.mjs';
|
|
9
10
|
|
|
10
11
|
const fingerprintJsonc = (filePath, normalize) => {
|
|
11
12
|
try {
|
|
@@ -139,6 +140,7 @@ const codegenPlugin = (options) => {
|
|
|
139
140
|
let absoluteGeneratedDirectory = resolve(options.projectRoot, options.generatedDir);
|
|
140
141
|
let debounceTimer;
|
|
141
142
|
let devServer;
|
|
143
|
+
const pendingMiddlewareTeardowns = /* @__PURE__ */ new Map();
|
|
142
144
|
let configFingerprint;
|
|
143
145
|
let configBaselineSettled = false;
|
|
144
146
|
let restartInFlight = false;
|
|
@@ -303,23 +305,30 @@ const codegenPlugin = (options) => {
|
|
|
303
305
|
server.watcher.on("add", onConfigChange);
|
|
304
306
|
server.watcher.on("change", onConfigChange);
|
|
305
307
|
server.watcher.on("unlink", onConfigChange);
|
|
308
|
+
const teardown = () => {
|
|
309
|
+
if (closed) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
closed = true;
|
|
313
|
+
cachedProject = void 0;
|
|
314
|
+
if (debounceTimer) {
|
|
315
|
+
clearTimeout(debounceTimer);
|
|
316
|
+
debounceTimer = void 0;
|
|
317
|
+
}
|
|
318
|
+
server.watcher.off("add", onChange);
|
|
319
|
+
server.watcher.off("change", onChange);
|
|
320
|
+
server.watcher.off("unlink", onChange);
|
|
321
|
+
server.watcher.off("add", onConfigChange);
|
|
322
|
+
server.watcher.off("change", onConfigChange);
|
|
323
|
+
server.watcher.off("unlink", onConfigChange);
|
|
324
|
+
};
|
|
306
325
|
return () => {
|
|
307
|
-
server
|
|
308
|
-
closed = true;
|
|
309
|
-
cachedProject = void 0;
|
|
310
|
-
if (debounceTimer) {
|
|
311
|
-
clearTimeout(debounceTimer);
|
|
312
|
-
debounceTimer = void 0;
|
|
313
|
-
}
|
|
314
|
-
server.watcher.off("add", onChange);
|
|
315
|
-
server.watcher.off("change", onChange);
|
|
316
|
-
server.watcher.off("unlink", onChange);
|
|
317
|
-
server.watcher.off("add", onConfigChange);
|
|
318
|
-
server.watcher.off("change", onConfigChange);
|
|
319
|
-
server.watcher.off("unlink", onConfigChange);
|
|
320
|
-
});
|
|
326
|
+
registerDevServerClose(server, pendingMiddlewareTeardowns, teardown);
|
|
321
327
|
};
|
|
322
328
|
},
|
|
329
|
+
buildEnd() {
|
|
330
|
+
runPendingClose(pendingMiddlewareTeardowns, this.environment);
|
|
331
|
+
},
|
|
323
332
|
name: "lunora:codegen"
|
|
324
333
|
};
|
|
325
334
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { claimDevServerState, DEV_LOG_FILE_ENV, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, clearDevServerState } from '@lunora/config';
|
|
2
2
|
import { l as lunoraLine } from './log-BjO9EWah.mjs';
|
|
3
|
+
import { r as runPendingClose, a as registerDevServerClose } from './server-close-DKDp7YTU.mjs';
|
|
3
4
|
|
|
4
5
|
const TRAILING_SLASH = /\/$/;
|
|
5
6
|
const resolveLocalUrl = (server) => {
|
|
@@ -15,6 +16,7 @@ const resolveLocalUrl = (server) => {
|
|
|
15
16
|
};
|
|
16
17
|
const devStatePlugin = (options) => {
|
|
17
18
|
let recorded = false;
|
|
19
|
+
const pendingMiddlewareClears = /* @__PURE__ */ new Map();
|
|
18
20
|
return {
|
|
19
21
|
apply: "serve",
|
|
20
22
|
configureServer(server) {
|
|
@@ -52,12 +54,13 @@ const devStatePlugin = (options) => {
|
|
|
52
54
|
}
|
|
53
55
|
recorded = true;
|
|
54
56
|
};
|
|
55
|
-
|
|
57
|
+
const clearOnClose = () => {
|
|
56
58
|
if (recorded) {
|
|
57
59
|
clearDevServerState(root, process.pid);
|
|
58
60
|
recorded = false;
|
|
59
61
|
}
|
|
60
|
-
}
|
|
62
|
+
};
|
|
63
|
+
registerDevServerClose(server, pendingMiddlewareClears, clearOnClose);
|
|
61
64
|
return () => {
|
|
62
65
|
if (typeof server.printUrls === "function") {
|
|
63
66
|
const printUrls = server.printUrls.bind(server);
|
|
@@ -71,6 +74,9 @@ const devStatePlugin = (options) => {
|
|
|
71
74
|
});
|
|
72
75
|
};
|
|
73
76
|
},
|
|
77
|
+
buildEnd() {
|
|
78
|
+
runPendingClose(pendingMiddlewareClears, this.environment);
|
|
79
|
+
},
|
|
74
80
|
name: "lunora:dev-state"
|
|
75
81
|
};
|
|
76
82
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const registerDevServerClose = (server, pending, onClose) => {
|
|
2
|
+
if (server.httpServer) {
|
|
3
|
+
server.httpServer.once("close", onClose);
|
|
4
|
+
} else {
|
|
5
|
+
pending.set(server.environments.client, onClose);
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const runPendingClose = (pending, environment) => {
|
|
9
|
+
const onClose = pending.get(environment);
|
|
10
|
+
if (onClose !== void 0) {
|
|
11
|
+
pending.delete(environment);
|
|
12
|
+
onClose();
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export { registerDevServerClose as a, runPendingClose as r };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/vite",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.56",
|
|
4
4
|
"description": "The Lunora Vite plugin: codegen, type sync, wrangler validation, and an error overlay over @cloudflare/vite-plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@cloudflare/vite-plugin": "1.43.0",
|
|
49
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
50
|
-
"@lunora/config": "1.0.0-alpha.
|
|
51
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
49
|
+
"@lunora/codegen": "1.0.0-alpha.34",
|
|
50
|
+
"@lunora/config": "1.0.0-alpha.56",
|
|
51
|
+
"@lunora/errors": "1.0.0-alpha.2",
|
|
52
52
|
"@visulima/vite-overlay": "2.0.0-alpha.35",
|
|
53
53
|
"jsonc-parser": "^3.3.1",
|
|
54
54
|
"ts-morph": "^28.0.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@lunora/studio": "1.0.0-alpha.
|
|
57
|
+
"@lunora/studio": "1.0.0-alpha.41",
|
|
58
58
|
"vite": "^8.1.3"
|
|
59
59
|
},
|
|
60
60
|
"peerDependenciesMeta": {
|