devflare 1.0.0-next.21 → 1.0.0-next.23
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/LLM.md +144 -5
- package/dist/account-j8nfggg4.js +475 -0
- package/dist/account-qhe8vtds.js +475 -0
- package/dist/bridge/gateway-runtime.d.ts +1 -1
- package/dist/bridge/gateway-runtime.d.ts.map +1 -1
- package/dist/bridge/miniflare.d.ts +1 -1
- package/dist/bridge/miniflare.d.ts.map +1 -1
- package/dist/bridge/proxy.d.ts +2 -0
- package/dist/bridge/proxy.d.ts.map +1 -1
- package/dist/bridge/server.d.ts.map +1 -1
- package/dist/browser.d.ts +13 -13
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +5 -3
- package/dist/build-qsgnme4z.js +54 -0
- package/dist/build-vy95gy3f.js +54 -0
- package/dist/build-yzx0gsaj.js +54 -0
- package/dist/cli/commands/build-artifacts.d.ts.map +1 -1
- package/dist/cli/commands/config.d.ts.map +1 -1
- package/dist/cli/commands/type-generation/generator.d.ts +4 -2
- package/dist/cli/commands/type-generation/generator.d.ts.map +1 -1
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/compiler/types.d.ts +1 -1
- package/dist/config/compiler/types.d.ts.map +1 -1
- package/dist/config/define.d.ts +7 -4
- package/dist/config/define.d.ts.map +1 -1
- package/dist/config/env-vars.d.ts +309 -0
- package/dist/config/env-vars.d.ts.map +1 -0
- package/dist/config/index.d.ts +2 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/local-dev-vars.d.ts +2 -2
- package/dist/config/local-dev-vars.d.ts.map +1 -1
- package/dist/config/schema-env.d.ts +6 -6
- package/dist/config/schema-types-bindings-platform.d.ts +378 -0
- package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
- package/dist/config/schema-types-bindings-resources.d.ts +551 -0
- package/dist/config/schema-types-bindings-resources.d.ts.map +1 -0
- package/dist/config/schema-types-bindings.d.ts +254 -0
- package/dist/config/schema-types-bindings.d.ts.map +1 -0
- package/dist/config/schema-types-build.d.ts +86 -0
- package/dist/config/schema-types-build.d.ts.map +1 -0
- package/dist/config/schema-types-runtime.d.ts +882 -0
- package/dist/config/schema-types-runtime.d.ts.map +1 -0
- package/dist/config/schema-types.d.ts +377 -0
- package/dist/config/schema-types.d.ts.map +1 -0
- package/dist/config/schema.d.ts +14 -15
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config-entry.d.ts +2 -0
- package/dist/config-entry.d.ts.map +1 -1
- package/dist/config-entry.js +3 -1
- package/dist/config-gq5jh4cx.js +105 -0
- package/dist/config-vec13050.js +105 -0
- package/dist/deploy-01j0ep5n.js +1055 -0
- package/dist/deploy-nh5tbv45.js +1055 -0
- package/dist/deploy-tjypkhg7.js +1055 -0
- package/dist/dev-bh581ew3.js +2597 -0
- package/dist/dev-cme5de75.js +2551 -0
- package/dist/dev-gn5y93z9.js +2597 -0
- package/dist/dev-server/server.d.ts.map +1 -1
- package/dist/doctor-h5q28qt1.js +259 -0
- package/dist/doctor-khk550tw.js +259 -0
- package/dist/env.d.ts +10 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/index-0bv2qjs1.js +1555 -0
- package/dist/index-35bmgpfw.js +573 -0
- package/dist/index-3tkzn06q.js +413 -0
- package/dist/index-4se6krdj.js +574 -0
- package/dist/index-8fyz6gcm.js +699 -0
- package/dist/index-97z629zr.js +109 -0
- package/dist/index-b28c4yr4.js +1205 -0
- package/dist/index-c1cj9085.js +2250 -0
- package/dist/index-c8p4njqy.js +479 -0
- package/dist/index-cr06zrgw.js +1033 -0
- package/dist/index-cwjjdtgn.js +74 -0
- package/dist/index-dref9ecb.js +476 -0
- package/dist/index-e151t4ge.js +895 -0
- package/dist/index-e7kakw0j.js +1033 -0
- package/dist/index-f1g5jdm8.js +1426 -0
- package/dist/index-f46984zs.js +1554 -0
- package/dist/index-grk8pzhr.js +185 -0
- package/dist/index-hbxkmb1q.js +1426 -0
- package/dist/index-hzmpecq9.js +52 -0
- package/dist/index-j1csb7gb.js +581 -0
- package/dist/index-j7x7f72h.js +185 -0
- package/dist/index-jkqbjwt2.js +476 -0
- package/dist/index-jwd3fanx.js +412 -0
- package/dist/index-mh5renra.js +895 -0
- package/dist/index-p9xq83p7.js +147 -0
- package/dist/index-q15nj71j.js +52 -0
- package/dist/index-qqp65pyv.js +699 -0
- package/dist/index-s0fmwxbk.js +74 -0
- package/dist/index-s9q605sq.js +1033 -0
- package/dist/index-stzx8nc4.js +111 -0
- package/dist/index-th4vrnbk.js +1205 -0
- package/dist/index-vtcmsgaf.js +581 -0
- package/dist/index-w36q6819.js +895 -0
- package/dist/index-x2k3awjs.js +147 -0
- package/dist/index-x8x547tz.js +1426 -0
- package/dist/index-xp0qkkxf.js +68 -0
- package/dist/index-xxxd0mvw.js +109 -0
- package/dist/index-zawn5tte.js +109 -0
- package/dist/index-zpy9caxn.js +1193 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/login-280p2cm9.js +77 -0
- package/dist/login-4n266whq.js +77 -0
- package/dist/previews-3m3ffpaw.js +1337 -0
- package/dist/previews-tr8sm03d.js +1337 -0
- package/dist/productions-62y489ff.js +505 -0
- package/dist/productions-cgn3fz7d.js +505 -0
- package/dist/runtime/exports.d.ts +23 -0
- package/dist/runtime/exports.d.ts.map +1 -1
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +6 -4
- package/dist/secrets-4050kqf5.js +91 -0
- package/dist/secrets-p112cajt.js +91 -0
- package/dist/sveltekit/index.js +8 -7
- package/dist/sveltekit/local-bindings.d.ts.map +1 -1
- package/dist/test/index.js +24 -12
- package/dist/test/resolve-service-bindings.d.ts +1 -1
- package/dist/test/resolve-service-bindings.d.ts.map +1 -1
- package/dist/test/simple-context-lifecycle.d.ts.map +1 -1
- package/dist/types-apmt10yj.js +705 -0
- package/dist/types-ttrrgdfj.js +705 -0
- package/dist/vite/index.js +5 -5
- package/dist/vite/plugin-context.d.ts.map +1 -1
- package/dist/vite/plugin-programmatic.d.ts.map +1 -1
- package/dist/worker-2k1jyr6p.js +513 -0
- package/dist/worker-jqgn6jyj.js +513 -0
- package/package.json +1 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compileBuildConfig,
|
|
3
|
+
compileConfig
|
|
4
|
+
} from "./index-8fyz6gcm.js";
|
|
5
|
+
import {
|
|
6
|
+
ConfigResourceResolutionError,
|
|
7
|
+
loadConfig,
|
|
8
|
+
loadResolvedConfig,
|
|
9
|
+
resolveResources
|
|
10
|
+
} from "./index-0bv2qjs1.js";
|
|
11
|
+
import"./index-1d4jg11n.js";
|
|
12
|
+
import"./index-mg8vwqxf.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveConfigEnvVars
|
|
15
|
+
} from "./index-c8p4njqy.js";
|
|
16
|
+
import"./index-q8f4kawk.js";
|
|
17
|
+
import"./index-37x76zdn.js";
|
|
18
|
+
|
|
19
|
+
// src/cli/commands/config.ts
|
|
20
|
+
function isSupportedFormat(value) {
|
|
21
|
+
return value === "devflare" || value === "wrangler";
|
|
22
|
+
}
|
|
23
|
+
function isSupportedPhase(value) {
|
|
24
|
+
return value === "build" || value === "local" || value === "deploy";
|
|
25
|
+
}
|
|
26
|
+
async function loadConfigForPhase(options) {
|
|
27
|
+
if (options.phase === "deploy") {
|
|
28
|
+
const resolvedConfig = await loadResolvedConfig({
|
|
29
|
+
cwd: options.cwd,
|
|
30
|
+
configFile: options.configPath,
|
|
31
|
+
environment: options.environment
|
|
32
|
+
});
|
|
33
|
+
return await resolveConfigEnvVars(resolvedConfig, {
|
|
34
|
+
cwd: options.cwd,
|
|
35
|
+
configPath: options.configPath,
|
|
36
|
+
mode: "build"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const config = await loadConfig({
|
|
40
|
+
cwd: options.cwd,
|
|
41
|
+
configFile: options.configPath
|
|
42
|
+
});
|
|
43
|
+
const resourceResolvedConfig = await resolveResources(config, {
|
|
44
|
+
phase: options.phase,
|
|
45
|
+
environment: options.environment
|
|
46
|
+
});
|
|
47
|
+
return await resolveConfigEnvVars(resourceResolvedConfig, {
|
|
48
|
+
cwd: options.cwd,
|
|
49
|
+
configPath: options.configPath,
|
|
50
|
+
mode: options.phase === "local" ? "dev" : "build"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async function runConfigCommand(parsed, logger, options) {
|
|
54
|
+
const cwd = options.cwd || process.cwd();
|
|
55
|
+
const configPath = parsed.options.config;
|
|
56
|
+
const environment = parsed.options.env;
|
|
57
|
+
const subcommand = parsed.args[0] ?? "print";
|
|
58
|
+
const formatOption = parsed.options.format;
|
|
59
|
+
const format = formatOption ?? "devflare";
|
|
60
|
+
const phaseOption = parsed.options.local === true ? "local" : parsed.options.phase ?? "deploy";
|
|
61
|
+
if (subcommand !== "print") {
|
|
62
|
+
logger.error(`Unknown config subcommand: ${subcommand}`);
|
|
63
|
+
logger.info("Supported subcommands: print");
|
|
64
|
+
return { exitCode: 1 };
|
|
65
|
+
}
|
|
66
|
+
if (!isSupportedFormat(format)) {
|
|
67
|
+
logger.error(`Unsupported config format: ${format}`);
|
|
68
|
+
logger.info("Supported formats: devflare, wrangler");
|
|
69
|
+
return { exitCode: 1 };
|
|
70
|
+
}
|
|
71
|
+
if (!isSupportedPhase(phaseOption)) {
|
|
72
|
+
logger.error(`Unsupported config phase: ${phaseOption}`);
|
|
73
|
+
logger.info("Supported phases: build, local, deploy");
|
|
74
|
+
return { exitCode: 1 };
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const resolvedConfig = await loadConfigForPhase({
|
|
78
|
+
cwd,
|
|
79
|
+
configPath,
|
|
80
|
+
environment,
|
|
81
|
+
phase: phaseOption
|
|
82
|
+
});
|
|
83
|
+
const output = format === "wrangler" ? phaseOption === "build" ? compileBuildConfig(resolvedConfig, undefined, { alreadyResolved: true }) : compileConfig(resolvedConfig) : resolvedConfig;
|
|
84
|
+
const text = JSON.stringify(output, null, "\t");
|
|
85
|
+
if (!options.silent) {
|
|
86
|
+
process.stdout.write(`${text}
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
exitCode: 0,
|
|
91
|
+
output: text
|
|
92
|
+
};
|
|
93
|
+
} catch (error) {
|
|
94
|
+
if (error instanceof Error) {
|
|
95
|
+
logger.error("Config command failed:", error.message);
|
|
96
|
+
if (error instanceof ConfigResourceResolutionError) {
|
|
97
|
+
logger.info("For offline inspection, run `devflare config --phase local` or `devflare config --phase build --format wrangler`.");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { exitCode: 1 };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
runConfigCommand
|
|
105
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
compileBuildConfig,
|
|
3
|
+
compileConfig
|
|
4
|
+
} from "./index-qqp65pyv.js";
|
|
5
|
+
import {
|
|
6
|
+
ConfigResourceResolutionError,
|
|
7
|
+
loadConfig,
|
|
8
|
+
loadResolvedConfig,
|
|
9
|
+
resolveResources
|
|
10
|
+
} from "./index-f46984zs.js";
|
|
11
|
+
import"./index-1d4jg11n.js";
|
|
12
|
+
import"./index-mg8vwqxf.js";
|
|
13
|
+
import {
|
|
14
|
+
resolveConfigEnvVars
|
|
15
|
+
} from "./index-c8p4njqy.js";
|
|
16
|
+
import"./index-q8f4kawk.js";
|
|
17
|
+
import"./index-37x76zdn.js";
|
|
18
|
+
|
|
19
|
+
// src/cli/commands/config.ts
|
|
20
|
+
function isSupportedFormat(value) {
|
|
21
|
+
return value === "devflare" || value === "wrangler";
|
|
22
|
+
}
|
|
23
|
+
function isSupportedPhase(value) {
|
|
24
|
+
return value === "build" || value === "local" || value === "deploy";
|
|
25
|
+
}
|
|
26
|
+
async function loadConfigForPhase(options) {
|
|
27
|
+
if (options.phase === "deploy") {
|
|
28
|
+
const resolvedConfig = await loadResolvedConfig({
|
|
29
|
+
cwd: options.cwd,
|
|
30
|
+
configFile: options.configPath,
|
|
31
|
+
environment: options.environment
|
|
32
|
+
});
|
|
33
|
+
return await resolveConfigEnvVars(resolvedConfig, {
|
|
34
|
+
cwd: options.cwd,
|
|
35
|
+
configPath: options.configPath,
|
|
36
|
+
mode: "build"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
const config = await loadConfig({
|
|
40
|
+
cwd: options.cwd,
|
|
41
|
+
configFile: options.configPath
|
|
42
|
+
});
|
|
43
|
+
const resourceResolvedConfig = await resolveResources(config, {
|
|
44
|
+
phase: options.phase,
|
|
45
|
+
environment: options.environment
|
|
46
|
+
});
|
|
47
|
+
return await resolveConfigEnvVars(resourceResolvedConfig, {
|
|
48
|
+
cwd: options.cwd,
|
|
49
|
+
configPath: options.configPath,
|
|
50
|
+
mode: options.phase === "local" ? "dev" : "build"
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
async function runConfigCommand(parsed, logger, options) {
|
|
54
|
+
const cwd = options.cwd || process.cwd();
|
|
55
|
+
const configPath = parsed.options.config;
|
|
56
|
+
const environment = parsed.options.env;
|
|
57
|
+
const subcommand = parsed.args[0] ?? "print";
|
|
58
|
+
const formatOption = parsed.options.format;
|
|
59
|
+
const format = formatOption ?? "devflare";
|
|
60
|
+
const phaseOption = parsed.options.local === true ? "local" : parsed.options.phase ?? "deploy";
|
|
61
|
+
if (subcommand !== "print") {
|
|
62
|
+
logger.error(`Unknown config subcommand: ${subcommand}`);
|
|
63
|
+
logger.info("Supported subcommands: print");
|
|
64
|
+
return { exitCode: 1 };
|
|
65
|
+
}
|
|
66
|
+
if (!isSupportedFormat(format)) {
|
|
67
|
+
logger.error(`Unsupported config format: ${format}`);
|
|
68
|
+
logger.info("Supported formats: devflare, wrangler");
|
|
69
|
+
return { exitCode: 1 };
|
|
70
|
+
}
|
|
71
|
+
if (!isSupportedPhase(phaseOption)) {
|
|
72
|
+
logger.error(`Unsupported config phase: ${phaseOption}`);
|
|
73
|
+
logger.info("Supported phases: build, local, deploy");
|
|
74
|
+
return { exitCode: 1 };
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
const resolvedConfig = await loadConfigForPhase({
|
|
78
|
+
cwd,
|
|
79
|
+
configPath,
|
|
80
|
+
environment,
|
|
81
|
+
phase: phaseOption
|
|
82
|
+
});
|
|
83
|
+
const output = format === "wrangler" ? phaseOption === "build" ? compileBuildConfig(resolvedConfig, undefined, { alreadyResolved: true }) : compileConfig(resolvedConfig) : resolvedConfig;
|
|
84
|
+
const text = JSON.stringify(output, null, "\t");
|
|
85
|
+
if (!options.silent) {
|
|
86
|
+
process.stdout.write(`${text}
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
exitCode: 0,
|
|
91
|
+
output: text
|
|
92
|
+
};
|
|
93
|
+
} catch (error) {
|
|
94
|
+
if (error instanceof Error) {
|
|
95
|
+
logger.error("Config command failed:", error.message);
|
|
96
|
+
if (error instanceof ConfigResourceResolutionError) {
|
|
97
|
+
logger.info("For offline inspection, run `devflare config --phase local` or `devflare config --phase build --format wrangler`.");
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { exitCode: 1 };
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
runConfigCommand
|
|
105
|
+
};
|