devflare 1.0.0-next.22 → 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.
Files changed (114) hide show
  1. package/LLM.md +144 -5
  2. package/dist/account-j8nfggg4.js +475 -0
  3. package/dist/account-qhe8vtds.js +475 -0
  4. package/dist/bridge/miniflare.d.ts +1 -1
  5. package/dist/bridge/miniflare.d.ts.map +1 -1
  6. package/dist/browser.d.ts +13 -13
  7. package/dist/browser.d.ts.map +1 -1
  8. package/dist/browser.js +4 -2
  9. package/dist/build-vy95gy3f.js +54 -0
  10. package/dist/build-yzx0gsaj.js +54 -0
  11. package/dist/cli/commands/build-artifacts.d.ts.map +1 -1
  12. package/dist/cli/commands/config.d.ts.map +1 -1
  13. package/dist/cli/commands/type-generation/generator.d.ts +4 -2
  14. package/dist/cli/commands/type-generation/generator.d.ts.map +1 -1
  15. package/dist/cli/commands/types.d.ts.map +1 -1
  16. package/dist/cli/index.js +1 -1
  17. package/dist/config/compiler/types.d.ts +1 -1
  18. package/dist/config/compiler/types.d.ts.map +1 -1
  19. package/dist/config/define.d.ts +7 -4
  20. package/dist/config/define.d.ts.map +1 -1
  21. package/dist/config/env-vars.d.ts +309 -0
  22. package/dist/config/env-vars.d.ts.map +1 -0
  23. package/dist/config/index.d.ts +2 -1
  24. package/dist/config/index.d.ts.map +1 -1
  25. package/dist/config/loader.d.ts.map +1 -1
  26. package/dist/config/local-dev-vars.d.ts +2 -2
  27. package/dist/config/local-dev-vars.d.ts.map +1 -1
  28. package/dist/config/schema-env.d.ts +6 -6
  29. package/dist/config/schema-types-bindings-platform.d.ts +378 -0
  30. package/dist/config/schema-types-bindings-platform.d.ts.map +1 -0
  31. package/dist/config/schema-types-bindings-resources.d.ts +551 -0
  32. package/dist/config/schema-types-bindings-resources.d.ts.map +1 -0
  33. package/dist/config/schema-types-bindings.d.ts +254 -0
  34. package/dist/config/schema-types-bindings.d.ts.map +1 -0
  35. package/dist/config/schema-types-build.d.ts +86 -0
  36. package/dist/config/schema-types-build.d.ts.map +1 -0
  37. package/dist/config/schema-types-runtime.d.ts +882 -0
  38. package/dist/config/schema-types-runtime.d.ts.map +1 -0
  39. package/dist/config/schema-types.d.ts +377 -0
  40. package/dist/config/schema-types.d.ts.map +1 -0
  41. package/dist/config/schema.d.ts +14 -15
  42. package/dist/config/schema.d.ts.map +1 -1
  43. package/dist/config-entry.d.ts +2 -0
  44. package/dist/config-entry.d.ts.map +1 -1
  45. package/dist/config-entry.js +3 -1
  46. package/dist/config-gq5jh4cx.js +105 -0
  47. package/dist/config-vec13050.js +105 -0
  48. package/dist/deploy-01j0ep5n.js +1055 -0
  49. package/dist/deploy-tjypkhg7.js +1055 -0
  50. package/dist/dev-bh581ew3.js +2597 -0
  51. package/dist/dev-gn5y93z9.js +2597 -0
  52. package/dist/dev-server/server.d.ts.map +1 -1
  53. package/dist/doctor-h5q28qt1.js +259 -0
  54. package/dist/doctor-khk550tw.js +259 -0
  55. package/dist/env.d.ts +10 -0
  56. package/dist/env.d.ts.map +1 -1
  57. package/dist/index-0bv2qjs1.js +1555 -0
  58. package/dist/index-3tkzn06q.js +413 -0
  59. package/dist/index-8fyz6gcm.js +699 -0
  60. package/dist/index-97z629zr.js +109 -0
  61. package/dist/index-b28c4yr4.js +1205 -0
  62. package/dist/index-c8p4njqy.js +479 -0
  63. package/dist/index-cr06zrgw.js +1033 -0
  64. package/dist/index-cwjjdtgn.js +74 -0
  65. package/dist/index-dref9ecb.js +476 -0
  66. package/dist/index-e151t4ge.js +895 -0
  67. package/dist/index-e7kakw0j.js +1033 -0
  68. package/dist/index-f1g5jdm8.js +1426 -0
  69. package/dist/index-f46984zs.js +1554 -0
  70. package/dist/index-grk8pzhr.js +185 -0
  71. package/dist/index-hzmpecq9.js +52 -0
  72. package/dist/index-j1csb7gb.js +581 -0
  73. package/dist/index-j7x7f72h.js +185 -0
  74. package/dist/index-jkqbjwt2.js +476 -0
  75. package/dist/index-mh5renra.js +895 -0
  76. package/dist/index-p9xq83p7.js +147 -0
  77. package/dist/index-q15nj71j.js +52 -0
  78. package/dist/index-qqp65pyv.js +699 -0
  79. package/dist/index-s0fmwxbk.js +74 -0
  80. package/dist/index-stzx8nc4.js +111 -0
  81. package/dist/index-th4vrnbk.js +1205 -0
  82. package/dist/index-vtcmsgaf.js +581 -0
  83. package/dist/index-x2k3awjs.js +147 -0
  84. package/dist/index-x8x547tz.js +1426 -0
  85. package/dist/index-xxxd0mvw.js +109 -0
  86. package/dist/index.d.ts +1 -1
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.js +8 -6
  89. package/dist/login-280p2cm9.js +77 -0
  90. package/dist/login-4n266whq.js +77 -0
  91. package/dist/previews-3m3ffpaw.js +1337 -0
  92. package/dist/previews-tr8sm03d.js +1337 -0
  93. package/dist/productions-62y489ff.js +505 -0
  94. package/dist/productions-cgn3fz7d.js +505 -0
  95. package/dist/runtime/exports.d.ts +23 -0
  96. package/dist/runtime/exports.d.ts.map +1 -1
  97. package/dist/runtime/index.d.ts +1 -1
  98. package/dist/runtime/index.d.ts.map +1 -1
  99. package/dist/runtime/index.js +5 -3
  100. package/dist/secrets-4050kqf5.js +91 -0
  101. package/dist/secrets-p112cajt.js +91 -0
  102. package/dist/sveltekit/index.js +4 -4
  103. package/dist/test/index.js +23 -11
  104. package/dist/test/resolve-service-bindings.d.ts +1 -1
  105. package/dist/test/resolve-service-bindings.d.ts.map +1 -1
  106. package/dist/test/simple-context-lifecycle.d.ts.map +1 -1
  107. package/dist/types-apmt10yj.js +705 -0
  108. package/dist/types-ttrrgdfj.js +705 -0
  109. package/dist/vite/index.js +5 -5
  110. package/dist/vite/plugin-context.d.ts.map +1 -1
  111. package/dist/vite/plugin-programmatic.d.ts.map +1 -1
  112. package/dist/worker-2k1jyr6p.js +513 -0
  113. package/dist/worker-jqgn6jyj.js +513 -0
  114. 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
+ };