@lunora/vite 1.0.0-alpha.4 → 1.0.0-alpha.6
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -6
- package/dist/packem_shared/{CLASS_A_WIRING-Cja0SF6x.mjs → CLASS_A_WIRING-CZVcjgKo.mjs} +14 -4
- package/dist/packem_shared/{codegenPlugin-CHzvXqK6.mjs → codegenPlugin-MuvbqAP8.mjs} +7 -2
- package/dist/packem_shared/{devVariablesPlugin-DbDf7tmi.mjs → devVariablesPlugin-CVjkQay7.mjs} +1 -1
- package/dist/packem_shared/log-BjO9EWah.mjs +8 -0
- package/dist/packem_shared/{wranglerValidatorPlugin-DggqUjxL.mjs → wranglerValidatorPlugin-CEoJEghS.mjs} +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/log-Bgkv6QhO.mjs +0 -6
package/dist/index.d.mts
CHANGED
|
@@ -198,7 +198,7 @@ declare const isAutoComposable: (context: LunoraPluginContext) => boolean;
|
|
|
198
198
|
* virtual module id. Absolute paths are resolved correctly in all environments
|
|
199
199
|
* (Vite 8 + rolldown 1.x confirmed).
|
|
200
200
|
*/
|
|
201
|
-
declare const buildWorkerEntrySource: (framework: DetectedFramework, generatedImportBase: string, hasContainers?: boolean) => string;
|
|
201
|
+
declare const buildWorkerEntrySource: (framework: DetectedFramework, generatedImportBase: string, hasContainers?: boolean, useUmbrella?: boolean) => string;
|
|
202
202
|
/**
|
|
203
203
|
* Vite plugin that auto-composes a detected class-A meta-framework's SSR
|
|
204
204
|
* handler with Lunora into one Cloudflare Worker (PLAN4 §2.4 / §3 class-A row).
|
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,7 @@ declare const isAutoComposable: (context: LunoraPluginContext) => boolean;
|
|
|
198
198
|
* virtual module id. Absolute paths are resolved correctly in all environments
|
|
199
199
|
* (Vite 8 + rolldown 1.x confirmed).
|
|
200
200
|
*/
|
|
201
|
-
declare const buildWorkerEntrySource: (framework: DetectedFramework, generatedImportBase: string, hasContainers?: boolean) => string;
|
|
201
|
+
declare const buildWorkerEntrySource: (framework: DetectedFramework, generatedImportBase: string, hasContainers?: boolean, useUmbrella?: boolean) => string;
|
|
202
202
|
/**
|
|
203
203
|
* Vite plugin that auto-composes a detected class-A meta-framework's SSR
|
|
204
204
|
* handler with Lunora into one Cloudflare Worker (PLAN4 §2.4 / §3 class-A row).
|
package/dist/index.mjs
CHANGED
|
@@ -2,20 +2,20 @@ import { cloudflare } from '@cloudflare/vite-plugin';
|
|
|
2
2
|
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
|
-
import { l as lunoraLine } from './packem_shared/log-
|
|
6
|
-
import codegenPlugin from './packem_shared/codegenPlugin-
|
|
7
|
-
import devVariablesPlugin from './packem_shared/devVariablesPlugin-
|
|
5
|
+
import { l as lunoraLine } from './packem_shared/log-BjO9EWah.mjs';
|
|
6
|
+
import codegenPlugin from './packem_shared/codegenPlugin-MuvbqAP8.mjs';
|
|
7
|
+
import devVariablesPlugin from './packem_shared/devVariablesPlugin-CVjkQay7.mjs';
|
|
8
8
|
import { createCommandProbe, withDevWorkerEnv } from './packem_shared/DEV_WORKER_ENV_VALUE-Coo6bgVz.mjs';
|
|
9
9
|
export { DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR } from './packem_shared/DEV_WORKER_ENV_VALUE-Coo6bgVz.mjs';
|
|
10
|
-
import { frameworkComposePlugin } from './packem_shared/CLASS_A_WIRING-
|
|
11
|
-
export { CLASS_A_WIRING, LUNORA_WORKER_VIRTUAL_ID, buildWorkerEntrySource, isAutoComposable } from './packem_shared/CLASS_A_WIRING-
|
|
10
|
+
import { frameworkComposePlugin } from './packem_shared/CLASS_A_WIRING-CZVcjgKo.mjs';
|
|
11
|
+
export { CLASS_A_WIRING, LUNORA_WORKER_VIRTUAL_ID, buildWorkerEntrySource, isAutoComposable } from './packem_shared/CLASS_A_WIRING-CZVcjgKo.mjs';
|
|
12
12
|
import logStreamPlugin from './packem_shared/logStreamPlugin-CqvZ17kd.mjs';
|
|
13
13
|
import { planViteRemoteBindings, remoteBindingsCleanupPlugin, withRemoteBindings } from './packem_shared/planViteRemoteBindings-QN5ncUS1.mjs';
|
|
14
14
|
import { studioPlugin } from './packem_shared/STUDIO_PATH-5ppCdBHa.mjs';
|
|
15
15
|
export { STUDIO_PATH, buildStudioUrl } from './packem_shared/STUDIO_PATH-5ppCdBHa.mjs';
|
|
16
16
|
import { withWorkerStartupHint } from './packem_shared/WORKER_STARTUP_HINT-DhsXUW8k.mjs';
|
|
17
17
|
export { WORKER_STARTUP_HINT, augmentWorkerStartupError, isWorkerEntryEvalError } from './packem_shared/WORKER_STARTUP_HINT-DhsXUW8k.mjs';
|
|
18
|
-
import { wranglerValidatorPlugin } from './packem_shared/wranglerValidatorPlugin-
|
|
18
|
+
import { wranglerValidatorPlugin } from './packem_shared/wranglerValidatorPlugin-CEoJEghS.mjs';
|
|
19
19
|
export { reconcileWranglerCrons } from './packem_shared/reconcileWranglerCrons-PxGwfCp_.mjs';
|
|
20
20
|
|
|
21
21
|
const agentRulesHintPlugin = (options) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { resolve, join } from 'node:path';
|
|
3
3
|
|
|
4
4
|
const LUNORA_WORKER_VIRTUAL_ID = "virtual:lunora/worker";
|
|
@@ -36,18 +36,27 @@ const isAutoComposable = (context) => {
|
|
|
36
36
|
return detected?.class === "A" && CLASS_A_WIRING[detected.framework] !== void 0;
|
|
37
37
|
};
|
|
38
38
|
const isWorkerVirtualActive = (context) => isAutoComposable(context);
|
|
39
|
-
const
|
|
39
|
+
const projectUsesUmbrella = (projectRoot) => {
|
|
40
|
+
try {
|
|
41
|
+
const pkg = JSON.parse(readFileSync(join(projectRoot, "package.json"), "utf8"));
|
|
42
|
+
return ["dependencies", "devDependencies", "peerDependencies"].some((field) => pkg[field]?.["lunorash"] !== void 0);
|
|
43
|
+
} catch {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const buildWorkerEntrySource = (framework, generatedImportBase, hasContainers = false, useUmbrella = false) => {
|
|
40
48
|
const wiring = CLASS_A_WIRING[framework];
|
|
41
49
|
if (wiring === void 0) {
|
|
42
50
|
throw new Error(`[lunora] no class-A worker wiring for framework "${framework}"`);
|
|
43
51
|
}
|
|
52
|
+
const runtimeModule = useUmbrella ? "lunorash/runtime" : "@lunora/runtime";
|
|
44
53
|
const containersReexport = hasContainers ? `
|
|
45
54
|
export * from "${generatedImportBase}/containers";
|
|
46
55
|
` : "";
|
|
47
56
|
return `// Generated by @lunora/vite — class-A worker composition (PLAN4 M2).
|
|
48
57
|
// Do not edit: emitted from the detected framework (${framework}). Point your
|
|
49
58
|
// wrangler \`main\` here (or re-export it) instead of hand-wiring createWorker.
|
|
50
|
-
import { composeWorker } from "
|
|
59
|
+
import { composeWorker } from "${runtimeModule}";
|
|
51
60
|
${wiring.imports}
|
|
52
61
|
import { LUNORA_FUNCTIONS } from "${generatedImportBase}/functions";
|
|
53
62
|
import { openApiSpec } from "${generatedImportBase}/openapi";
|
|
@@ -75,11 +84,12 @@ export default {
|
|
|
75
84
|
};
|
|
76
85
|
const frameworkComposePlugin = (options, context) => {
|
|
77
86
|
const generatedImportBase = resolve(options.projectRoot, options.generatedDir.replace(TRAILING_SLASH, ""));
|
|
87
|
+
const useUmbrella = projectUsesUmbrella(options.projectRoot);
|
|
78
88
|
return {
|
|
79
89
|
load(id) {
|
|
80
90
|
if (id === RESOLVED_LUNORA_WORKER_ID && isWorkerVirtualActive(context) && context.framework !== void 0) {
|
|
81
91
|
const hasContainers = existsSync(join(generatedImportBase, "containers.ts"));
|
|
82
|
-
return buildWorkerEntrySource(context.framework.framework, generatedImportBase, hasContainers);
|
|
92
|
+
return buildWorkerEntrySource(context.framework.framework, generatedImportBase, hasContainers, useUmbrella);
|
|
83
93
|
}
|
|
84
94
|
return void 0;
|
|
85
95
|
},
|
|
@@ -3,7 +3,7 @@ import { resolve, sep, join } from 'node:path';
|
|
|
3
3
|
import { createCodegenProject, refreshCodegenProject, runCodegen, CodegenDiagnosticError } from '@lunora/codegen';
|
|
4
4
|
import { inferLunoraBindings, reconcileWranglerBindings } from '@lunora/config';
|
|
5
5
|
import { reconcileWranglerCrons } from './reconcileWranglerCrons-PxGwfCp_.mjs';
|
|
6
|
-
import { L as LUNORA_TAG } from './log-
|
|
6
|
+
import { L as LUNORA_TAG, a as advisoryLine } from './log-BjO9EWah.mjs';
|
|
7
7
|
|
|
8
8
|
const DEBOUNCE_MS = 100;
|
|
9
9
|
const TSCONFIG_VARIANT_RE = /[/\\]tsconfig\..+\.json$/u;
|
|
@@ -56,7 +56,12 @@ const runCodegenSafely = (options, logger, overlay, project) => {
|
|
|
56
56
|
logger.warn(`${LUNORA_TAG} cron trigger sync skipped: ${message}`);
|
|
57
57
|
}
|
|
58
58
|
for (const advisory of result.advisories) {
|
|
59
|
-
|
|
59
|
+
const line = advisoryLine(advisory.level, advisory.name, advisory.detail, advisory.remediation);
|
|
60
|
+
if (advisory.level === "ERROR") {
|
|
61
|
+
logger.error(line);
|
|
62
|
+
} else {
|
|
63
|
+
logger.warn(line);
|
|
64
|
+
}
|
|
60
65
|
}
|
|
61
66
|
return resolve(result.outputDirectory);
|
|
62
67
|
} catch (error) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { paintBadge, BADGES } from '@lunora/config';
|
|
2
|
+
|
|
3
|
+
const LUNORA_TAG = paintBadge(BADGES.lunora);
|
|
4
|
+
const lunoraLine = (message) => `${LUNORA_TAG} ${message}`;
|
|
5
|
+
const ADVISORY_BADGE = { ERROR: BADGES.error, INFO: BADGES.info, WARN: BADGES.warn };
|
|
6
|
+
const advisoryLine = (level, name, detail, remediation) => `${paintBadge(ADVISORY_BADGE[level])} ${name}: ${detail} — ${remediation}`;
|
|
7
|
+
|
|
8
|
+
export { LUNORA_TAG as L, advisoryLine as a, lunoraLine as l };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process';
|
|
2
2
|
import { validateWranglerProject, readWranglerJsonc } from '@lunora/config';
|
|
3
|
-
import { l as lunoraLine } from './log-
|
|
3
|
+
import { l as lunoraLine } from './log-BjO9EWah.mjs';
|
|
4
4
|
|
|
5
5
|
const isLocalImagePath = (image) => image.startsWith("./") || image.startsWith("../") || image.startsWith("/") || image.includes("Dockerfile");
|
|
6
6
|
const probeDocker = () => {
|
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.6",
|
|
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,14 +46,14 @@
|
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@cloudflare/vite-plugin": "1.42.0",
|
|
49
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
50
|
-
"@lunora/config": "1.0.0-alpha.
|
|
49
|
+
"@lunora/codegen": "1.0.0-alpha.4",
|
|
50
|
+
"@lunora/config": "1.0.0-alpha.6",
|
|
51
51
|
"@visulima/vite-overlay": "2.0.0-alpha.35",
|
|
52
52
|
"jsonc-parser": "^3.3.1",
|
|
53
53
|
"ts-morph": "^28.0.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@lunora/studio": "1.0.0-alpha.
|
|
56
|
+
"@lunora/studio": "1.0.0-alpha.4",
|
|
57
57
|
"vite": "^8.0.16"
|
|
58
58
|
},
|
|
59
59
|
"peerDependenciesMeta": {
|