@jordond/kit 0.0.0-stage → 0.1.0

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 (186) hide show
  1. package/bin/kit +39 -0
  2. package/dist/_verb-espppzez.js +115 -0
  3. package/dist/android-g73naxgg.js +31 -0
  4. package/dist/build-88hxf0kc.js +42 -0
  5. package/dist/check-7mndz8g8.js +54 -0
  6. package/dist/check-ngc4kzmj.js +33 -0
  7. package/dist/cleanup-hrcvxmh2.js +18 -0
  8. package/dist/cli/builtins.d.ts +13 -0
  9. package/dist/cli/command.d.ts +86 -0
  10. package/dist/cli/discover.d.ts +10 -0
  11. package/dist/cli/main.d.ts +1 -0
  12. package/dist/cli/plugin.d.ts +7 -0
  13. package/dist/cli/usage.d.ts +3 -0
  14. package/dist/cli-07t28k94.js +30 -0
  15. package/dist/cli-12dww95e.js +195 -0
  16. package/dist/cli-5d61x8vg.js +675 -0
  17. package/dist/cli-5wasc5mr.js +76 -0
  18. package/dist/cli-6dxp4v3m.js +73 -0
  19. package/dist/cli-7wvrehng.js +23 -0
  20. package/dist/cli-bam7dqfd.js +33 -0
  21. package/dist/cli-fqfan92n.js +135 -0
  22. package/dist/cli-fqxtcj42.js +75 -0
  23. package/dist/cli-h974q2wr.js +2019 -0
  24. package/dist/cli-m53122z6.js +221 -0
  25. package/dist/cli-qhs8ww91.js +51 -0
  26. package/dist/cli-qq1ktr8q.js +234 -0
  27. package/dist/cli-rds33bnp.js +101 -0
  28. package/dist/cli-re3ntm60.js +48 -0
  29. package/dist/cli.d.ts +1 -0
  30. package/dist/cli.js +35 -0
  31. package/dist/cloudflare-n5c46k6x.js +43 -0
  32. package/dist/command-gazq4bmt.js +19 -0
  33. package/dist/commands/_verb.d.ts +15 -0
  34. package/dist/commands/build.d.ts +11 -0
  35. package/dist/commands/check.d.ts +8 -0
  36. package/dist/commands/config.d.ts +2 -0
  37. package/dist/commands/db/create.d.ts +7 -0
  38. package/dist/commands/db/exec.d.ts +16 -0
  39. package/dist/commands/db/list.d.ts +11 -0
  40. package/dist/commands/db/migrate.d.ts +11 -0
  41. package/dist/commands/deploy.d.ts +13 -0
  42. package/dist/commands/deps.d.ts +72 -0
  43. package/dist/commands/dev.d.ts +8 -0
  44. package/dist/commands/doctor.d.ts +56 -0
  45. package/dist/commands/env/check.d.ts +7 -0
  46. package/dist/commands/env/init.d.ts +2 -0
  47. package/dist/commands/env/push.d.ts +12 -0
  48. package/dist/commands/env/sync.d.ts +2 -0
  49. package/dist/commands/format.d.ts +11 -0
  50. package/dist/commands/gradle.d.ts +2 -0
  51. package/dist/commands/init.d.ts +53 -0
  52. package/dist/commands/lint.d.ts +12 -0
  53. package/dist/commands/release/android.d.ts +13 -0
  54. package/dist/commands/release/ios.d.ts +13 -0
  55. package/dist/commands/test.d.ts +2 -0
  56. package/dist/commands/typecheck.d.ts +2 -0
  57. package/dist/commands/wrangler.d.ts +4 -0
  58. package/dist/commands/xcode.d.ts +8 -0
  59. package/dist/config/load.d.ts +6 -0
  60. package/dist/config/schema.d.ts +135 -0
  61. package/dist/config-ey5yrrfn.js +22 -0
  62. package/dist/create-7s8h3dja.js +38 -0
  63. package/dist/deploy-8mg1zhpb.js +102 -0
  64. package/dist/deps-97dq4mg8.js +334 -0
  65. package/dist/dev-yc9xmntj.js +62 -0
  66. package/dist/doctor-0wzmfyyh.js +324 -0
  67. package/dist/errors-1fjbr7ee.js +10 -0
  68. package/dist/exec-1k3sqwxz.js +53 -0
  69. package/dist/format-mnqfak22.js +39 -0
  70. package/dist/git-52v5rk51.js +80 -0
  71. package/dist/gradle-gtkf3geq.js +39 -0
  72. package/dist/index-cx34x4np.js +874 -0
  73. package/dist/index-erv82p4z.js +1528 -0
  74. package/dist/index-jqfz6hfy.js +2659 -0
  75. package/dist/index-mm4ht8yh.js +9 -0
  76. package/dist/index-s3ehw02w.js +1610 -0
  77. package/dist/index.d.ts +10 -0
  78. package/dist/index.js +50 -0
  79. package/dist/init-0402av4m.js +78 -0
  80. package/dist/init-dk5sym9w.js +76 -0
  81. package/dist/init-qr7y55ea.js +185 -0
  82. package/dist/ios-msg4bk15.js +31 -0
  83. package/dist/lib/cleanup.d.ts +21 -0
  84. package/dist/lib/cloudflare.d.ts +96 -0
  85. package/dist/lib/env/init.d.ts +22 -0
  86. package/dist/lib/env/load.d.ts +12 -0
  87. package/dist/lib/env/push.d.ts +54 -0
  88. package/dist/lib/env/render.d.ts +49 -0
  89. package/dist/lib/env/schema.d.ts +49 -0
  90. package/dist/lib/errors.d.ts +14 -0
  91. package/dist/lib/git.d.ts +36 -0
  92. package/dist/lib/log.d.ts +11 -0
  93. package/dist/lib/pm.d.ts +8 -0
  94. package/dist/lib/proc.d.ts +73 -0
  95. package/dist/lib/prompt.d.ts +32 -0
  96. package/dist/lib/secrets.d.ts +32 -0
  97. package/dist/lib/steps.d.ts +38 -0
  98. package/dist/lib/targets.d.ts +46 -0
  99. package/dist/lib/toml.d.ts +15 -0
  100. package/dist/lint-280dpn4y.js +39 -0
  101. package/dist/list-jdc3dqk0.js +34 -0
  102. package/dist/load-5qzs1c6b.js +137 -0
  103. package/dist/log-hhspqwjw.js +11 -0
  104. package/dist/main-ywtsjxev.js +2052 -0
  105. package/dist/migrate-emk758k1.js +35 -0
  106. package/dist/picocolors-0dxagz5d.js +6 -0
  107. package/dist/pm-5q5vz6w3.js +14 -0
  108. package/dist/proc-jv4bcyyx.js +33 -0
  109. package/dist/prompt-v510j04z.js +93 -0
  110. package/dist/push-4z70h3d8.js +117 -0
  111. package/dist/push-xzqw218t.js +117 -0
  112. package/dist/render-488tjnsq.js +22 -0
  113. package/dist/sync-wc4jpmkj.js +53 -0
  114. package/dist/targets-hbwxv97d.js +22 -0
  115. package/dist/test-198w46m4.js +26 -0
  116. package/dist/toml-zbhtxjh1.js +1062 -0
  117. package/dist/typecheck-e86e6yg1.js +24 -0
  118. package/dist/wrangler-0ctx1p3w.js +66 -0
  119. package/dist/xcode-g44qh2rc.js +60 -0
  120. package/fastlane/Fastfile +413 -0
  121. package/fastlane/Gemfile +21 -0
  122. package/fastlane/Gemfile.lock +275 -0
  123. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.jar +0 -0
  124. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.jar.md5 +1 -0
  125. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.jar.sha1 +1 -0
  126. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.jar.sha256 +1 -0
  127. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.jar.sha512 +1 -0
  128. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.module +64 -0
  129. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.module.md5 +1 -0
  130. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.module.sha1 +1 -0
  131. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.module.sha256 +1 -0
  132. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.module.sha512 +1 -0
  133. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.pom +12 -0
  134. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.pom.md5 +1 -0
  135. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.pom.sha1 +1 -0
  136. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.pom.sha256 +1 -0
  137. package/gradle/maven/io/github/jordond/kit/kit-plugins/0.1.0/kit-plugins-0.1.0.pom.sha512 +1 -0
  138. package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml +13 -0
  139. package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.md5 +1 -0
  140. package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha1 +1 -0
  141. package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha256 +1 -0
  142. package/gradle/maven/io/github/jordond/kit/kit-plugins/maven-metadata.xml.sha512 +1 -0
  143. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.jar +0 -0
  144. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.jar.md5 +1 -0
  145. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.jar.sha1 +1 -0
  146. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.jar.sha256 +1 -0
  147. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.jar.sha512 +1 -0
  148. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.module +64 -0
  149. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.module.md5 +1 -0
  150. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.module.sha1 +1 -0
  151. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.module.sha256 +1 -0
  152. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.module.sha512 +1 -0
  153. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.pom +12 -0
  154. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.pom.md5 +1 -0
  155. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.pom.sha1 +1 -0
  156. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.pom.sha256 +1 -0
  157. package/gradle/maven/io/github/jordond/kit/kit-settings/0.1.0/kit-settings-0.1.0.pom.sha512 +1 -0
  158. package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml +13 -0
  159. package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.md5 +1 -0
  160. package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha1 +1 -0
  161. package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha256 +1 -0
  162. package/gradle/maven/io/github/jordond/kit/kit-settings/maven-metadata.xml.sha512 +1 -0
  163. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.1.0/io.github.jordond.kit.release.gradle.plugin-0.1.0.pom +15 -0
  164. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.1.0/io.github.jordond.kit.release.gradle.plugin-0.1.0.pom.md5 +1 -0
  165. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.1.0/io.github.jordond.kit.release.gradle.plugin-0.1.0.pom.sha1 +1 -0
  166. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.1.0/io.github.jordond.kit.release.gradle.plugin-0.1.0.pom.sha256 +1 -0
  167. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/0.1.0/io.github.jordond.kit.release.gradle.plugin-0.1.0.pom.sha512 +1 -0
  168. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml +13 -0
  169. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.md5 +1 -0
  170. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha1 +1 -0
  171. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha256 +1 -0
  172. package/gradle/maven/io/github/jordond/kit/release/io.github.jordond.kit.release.gradle.plugin/maven-metadata.xml.sha512 +1 -0
  173. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.1.0/io.github.jordond.kit.settings.gradle.plugin-0.1.0.pom +15 -0
  174. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.1.0/io.github.jordond.kit.settings.gradle.plugin-0.1.0.pom.md5 +1 -0
  175. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.1.0/io.github.jordond.kit.settings.gradle.plugin-0.1.0.pom.sha1 +1 -0
  176. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.1.0/io.github.jordond.kit.settings.gradle.plugin-0.1.0.pom.sha256 +1 -0
  177. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/0.1.0/io.github.jordond.kit.settings.gradle.plugin-0.1.0.pom.sha512 +1 -0
  178. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml +13 -0
  179. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.md5 +1 -0
  180. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha1 +1 -0
  181. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha256 +1 -0
  182. package/gradle/maven/io/github/jordond/kit/settings/io.github.jordond.kit.settings.gradle.plugin/maven-metadata.xml.sha512 +1 -0
  183. package/package.json +58 -4
  184. package/templates/lefthook.yml +6 -0
  185. package/templates/mise.toml +6 -0
  186. package/README.md +0 -3
@@ -0,0 +1,35 @@
1
+ // @bun
2
+ import {
3
+ dbArgs,
4
+ remoteArg
5
+ } from "./cli-m53122z6.js";
6
+ import"./cli-bam7dqfd.js";
7
+ import"./cli-qhs8ww91.js";
8
+ import"./cli-fqfan92n.js";
9
+ import"./cli-fqxtcj42.js";
10
+ import {
11
+ defineCommand
12
+ } from "./cli-6dxp4v3m.js";
13
+ import"./cli-07t28k94.js";
14
+ import"./cli-5wasc5mr.js";
15
+ import"./cli-7wvrehng.js";
16
+ import {
17
+ __require
18
+ } from "./cli-re3ntm60.js";
19
+
20
+ // src/commands/db/migrate.ts
21
+ var migrate_default = defineCommand({
22
+ description: "Apply pending D1 migrations (local by default)",
23
+ group: "Infra",
24
+ args: { ...dbArgs, ...remoteArg },
25
+ examples: `kit db migrate
26
+ kit db migrate --remote
27
+ kit db migrate --db analytics --dry-run`,
28
+ async run(ctx) {
29
+ const { runD1 } = await import("./cloudflare-n5c46k6x.js");
30
+ await runD1(ctx, { kind: "migrate", remote: !!ctx.args.remote }, { mutates: true });
31
+ }
32
+ });
33
+ export {
34
+ migrate_default as default
35
+ };
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import {
3
+ require_picocolors
4
+ } from "./cli-5wasc5mr.js";
5
+ import"./cli-re3ntm60.js";
6
+ export default require_picocolors();
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ detectPackageManager,
4
+ packageScripts,
5
+ pmExec,
6
+ runScript
7
+ } from "./cli-qhs8ww91.js";
8
+ import"./cli-re3ntm60.js";
9
+ export {
10
+ runScript,
11
+ pmExec,
12
+ packageScripts,
13
+ detectPackageManager
14
+ };
@@ -0,0 +1,33 @@
1
+ // @bun
2
+ import {
3
+ ProcError,
4
+ addChildEnv,
5
+ childEnv,
6
+ restoreTty,
7
+ run,
8
+ runCapture,
9
+ runInteractive,
10
+ runLines,
11
+ runOrThrow,
12
+ runPiped,
13
+ runQuiet,
14
+ runToStderr,
15
+ shell
16
+ } from "./cli-fqfan92n.js";
17
+ import"./cli-fqxtcj42.js";
18
+ import"./cli-re3ntm60.js";
19
+ export {
20
+ shell,
21
+ runToStderr,
22
+ runQuiet,
23
+ runPiped,
24
+ runOrThrow,
25
+ runLines,
26
+ runInteractive,
27
+ runCapture,
28
+ run,
29
+ restoreTty,
30
+ childEnv,
31
+ addChildEnv,
32
+ ProcError
33
+ };
@@ -0,0 +1,93 @@
1
+ // @bun
2
+ import {
3
+ ExitCode,
4
+ KitError
5
+ } from "./cli-7wvrehng.js";
6
+ import {
7
+ __require
8
+ } from "./cli-re3ntm60.js";
9
+
10
+ // src/lib/prompt.ts
11
+ var out = { output: process.stderr };
12
+ async function drainTypeahead() {
13
+ const stdin = process.stdin;
14
+ if (!stdin.isTTY)
15
+ return;
16
+ const discard = () => {};
17
+ stdin.setRawMode(true);
18
+ stdin.on("data", discard);
19
+ stdin.resume();
20
+ await Bun.sleep(50);
21
+ stdin.off("data", discard);
22
+ stdin.pause();
23
+ stdin.setRawMode(false);
24
+ }
25
+ function cancelled() {
26
+ throw new KitError("Cancelled", undefined, ExitCode.interrupted);
27
+ }
28
+ function noTty(what, hint) {
29
+ throw new KitError(`Cannot ${what} without a terminal`, hint, ExitCode.usage);
30
+ }
31
+ async function confirm(flags, message, opts = {}) {
32
+ if (flags.yes && !opts.force)
33
+ return true;
34
+ if (!flags.interactive)
35
+ noTty("confirm", opts.force ? "Run it from a terminal" : "Re-run with --yes");
36
+ const clack = await import("./index-jqfz6hfy.js");
37
+ await drainTypeahead();
38
+ const answer = await clack.confirm({ message, initialValue: opts.initial ?? false, ...out });
39
+ if (clack.isCancel(answer))
40
+ cancelled();
41
+ return answer;
42
+ }
43
+ async function text(flags, message, opts = {}) {
44
+ if (!flags.interactive)
45
+ noTty(`ask "${message}"`, opts.hint ?? "Pass the value as a flag");
46
+ const clack = await import("./index-jqfz6hfy.js");
47
+ await drainTypeahead();
48
+ const answer = await clack.text({
49
+ message,
50
+ initialValue: opts.initial,
51
+ placeholder: opts.placeholder,
52
+ validate: opts.validate ? (v) => opts.validate(v ?? "") : undefined,
53
+ ...out
54
+ });
55
+ if (clack.isCancel(answer))
56
+ cancelled();
57
+ return answer;
58
+ }
59
+ async function password(flags, message, opts = {}) {
60
+ if (!flags.interactive)
61
+ noTty(`ask for ${message}`, opts.hint ?? "Set it in .env");
62
+ const clack = await import("./index-jqfz6hfy.js");
63
+ await drainTypeahead();
64
+ const answer = await clack.password({
65
+ message,
66
+ validate: opts.validate ? (v) => opts.validate(v ?? "") : undefined,
67
+ ...out
68
+ });
69
+ if (clack.isCancel(answer))
70
+ cancelled();
71
+ return answer;
72
+ }
73
+ async function select(flags, message, options, opts = {}) {
74
+ if (!flags.interactive)
75
+ noTty(`ask "${message}"`, opts.hint ?? "Pass the value as a flag");
76
+ const clack = await import("./index-jqfz6hfy.js");
77
+ await drainTypeahead();
78
+ const answer = await clack.select({
79
+ message,
80
+ options,
81
+ initialValue: opts.initial,
82
+ ...out
83
+ });
84
+ if (clack.isCancel(answer))
85
+ cancelled();
86
+ return answer;
87
+ }
88
+ export {
89
+ text,
90
+ select,
91
+ password,
92
+ confirm
93
+ };
@@ -0,0 +1,117 @@
1
+ // @bun
2
+ import {
3
+ parseSecretNames,
4
+ wrangler,
5
+ wranglerSecretPut
6
+ } from "./cli-m53122z6.js";
7
+ import {
8
+ pipeSecret,
9
+ redact
10
+ } from "./cli-bam7dqfd.js";
11
+ import"./cli-qhs8ww91.js";
12
+ import {
13
+ runPiped
14
+ } from "./cli-fqfan92n.js";
15
+ import"./cli-fqxtcj42.js";
16
+ import {
17
+ ExitCode,
18
+ KitError
19
+ } from "./cli-7wvrehng.js";
20
+ import"./cli-re3ntm60.js";
21
+
22
+ // src/lib/env/push.ts
23
+ var GITHUB = "github";
24
+ async function planPush(dest, values, opts = {}) {
25
+ const listed = await dest.list();
26
+ if (!listed.ok && !opts.proceedOnListFailure) {
27
+ return {
28
+ destination: dest,
29
+ listError: listed.error,
30
+ items: dest.keys.map((key) => ({ key, status: "list-failed" }))
31
+ };
32
+ }
33
+ const existing = new Set(listed.names);
34
+ return {
35
+ destination: dest,
36
+ ...listed.ok ? {} : { listError: listed.error },
37
+ items: dest.keys.map((key) => ({
38
+ key,
39
+ status: !values[key] ? "skipped-empty" : !listed.ok ? "unknown" : existing.has(key) ? "overwrite" : "new"
40
+ }))
41
+ };
42
+ }
43
+ var pushable = (s) => s === "new" || s === "overwrite" || s === "unknown";
44
+ async function executePush(plans, values, onPush = () => {}) {
45
+ const out = [];
46
+ let failed = false;
47
+ for (const plan of plans) {
48
+ const destination = plan.destination.name;
49
+ for (const { key, status } of plan.items) {
50
+ if (!pushable(status)) {
51
+ out.push({ destination, key, status });
52
+ continue;
53
+ }
54
+ if (failed) {
55
+ out.push({ destination, key, status: "not-run" });
56
+ continue;
57
+ }
58
+ onPush(destination, key);
59
+ const r = await plan.destination.put(key, values[key] ?? "");
60
+ if (r.code !== 0) {
61
+ failed = true;
62
+ out.push({ destination, key, status: "failed", output: redact(r.output) });
63
+ continue;
64
+ }
65
+ out.push({ destination, key, status: "pushed" });
66
+ }
67
+ }
68
+ return out;
69
+ }
70
+ var firstLine = (s) => redact(s.trim().split(`
71
+ `)[0] ?? "");
72
+ async function capture(cmd, cwd) {
73
+ return runPiped(cmd, { cwd });
74
+ }
75
+ function workerDestination(root, config, target) {
76
+ const keys = config.env?.workerSecrets?.[target];
77
+ if (!keys) {
78
+ const known = Object.keys(config.env?.workerSecrets ?? {});
79
+ throw new KitError(`No env.workerSecrets for "${target}"`, known.length ? `Targets with secrets: ${known.join(", ")}` : "Add env.workerSecrets in kit.config.ts", ExitCode.usage);
80
+ }
81
+ return {
82
+ name: target,
83
+ keys,
84
+ async list() {
85
+ const w = wrangler(root, config, target, "secret", "list", "--format", "json");
86
+ const r = await capture(w.cmd, w.cwd);
87
+ if (r.code !== 0)
88
+ return { ok: false, names: [], error: firstLine(r.stderr || r.stdout) };
89
+ return { ok: true, names: parseSecretNames(r.stdout) };
90
+ },
91
+ put(key, value) {
92
+ return wranglerSecretPut(wrangler(root, config, target, "secret", "put", key), value);
93
+ }
94
+ };
95
+ }
96
+ function githubDestination(root, keys) {
97
+ return {
98
+ name: GITHUB,
99
+ keys,
100
+ async list() {
101
+ const r = await capture(["gh", "secret", "list", "--json", "name"], root);
102
+ if (r.code !== 0)
103
+ return { ok: false, names: [], error: firstLine(r.stderr || r.stdout) };
104
+ return { ok: true, names: parseSecretNames(r.stdout) };
105
+ },
106
+ put(key, value) {
107
+ return pipeSecret(["gh", "secret", "set", key], value, { cwd: root });
108
+ }
109
+ };
110
+ }
111
+ export {
112
+ workerDestination,
113
+ planPush,
114
+ githubDestination,
115
+ executePush,
116
+ GITHUB
117
+ };
@@ -0,0 +1,117 @@
1
+ // @bun
2
+ import {
3
+ defineCommand
4
+ } from "./cli-6dxp4v3m.js";
5
+ import"./cli-07t28k94.js";
6
+ import"./cli-5wasc5mr.js";
7
+ import"./cli-7wvrehng.js";
8
+ import {
9
+ __require
10
+ } from "./cli-re3ntm60.js";
11
+
12
+ // src/commands/env/push.ts
13
+ var push_default = defineCommand({
14
+ description: "Push secrets to Cloudflare workers (wrangler) and GitHub Actions (gh)",
15
+ group: "Infra",
16
+ args: {
17
+ target: { type: "string", short: "t", description: "Only this worker target (env.workerSecrets)" },
18
+ github: { type: "boolean", description: "Push env.githubSecrets with gh" }
19
+ },
20
+ examples: [
21
+ "kit env push # every target in env.workerSecrets",
22
+ "kit env push --target edge",
23
+ "kit env push --github # GitHub Actions secrets only",
24
+ "kit env push --target edge --github",
25
+ "kit env push --dry-run"
26
+ ].join(`
27
+ `),
28
+ async run(ctx) {
29
+ const { requireProject } = await import("./command-gazq4bmt.js");
30
+ const { loadEnv, assertValid } = await import("./load-5qzs1c6b.js");
31
+ const { executePush, githubDestination, planPush, workerDestination } = await import("./push-4z70h3d8.js");
32
+ const { pinCloudflareAccount } = await import("./cloudflare-n5c46k6x.js");
33
+ const { confirm } = await import("./prompt-v510j04z.js");
34
+ const { emitJson } = await import("./log-hhspqwjw.js");
35
+ const { ExitCode, KitError } = await import("./errors-1fjbr7ee.js");
36
+ const { root, config } = requireProject(ctx);
37
+ const state = await loadEnv(root, config);
38
+ assertValid(state);
39
+ const workerNames = ctx.args.target ? [ctx.args.target] : ctx.args.github ? [] : Object.keys(config.env?.workerSecrets ?? {});
40
+ const destinations = workerNames.map((t) => workerDestination(root, config, t));
41
+ if (ctx.args.github) {
42
+ const keys = config.env?.githubSecrets ?? [];
43
+ if (!keys.length) {
44
+ throw new KitError("No env.githubSecrets configured", "Add env.githubSecrets in kit.config.ts", ExitCode.usage);
45
+ }
46
+ destinations.push(githubDestination(root, keys));
47
+ }
48
+ if (!destinations.length) {
49
+ throw new KitError("Nothing to push", "Add env.workerSecrets or env.githubSecrets in kit.config.ts", ExitCode.usage);
50
+ }
51
+ if (workerNames.length)
52
+ pinCloudflareAccount(root, config);
53
+ const plans = [];
54
+ for (const d of destinations)
55
+ plans.push(await planPush(d, state.values, { proceedOnListFailure: ctx.flags.yes }));
56
+ const toPush = plans.flatMap((p) => p.items.filter((i) => i.status === "new" || i.status === "overwrite" || i.status === "unknown"));
57
+ const listFailed = plans.filter((p) => p.items.some((i) => i.status === "list-failed"));
58
+ if (!ctx.flags.json) {
59
+ for (const p of plans) {
60
+ ctx.log.info(p.destination.name);
61
+ if (p.listError)
62
+ ctx.log.warn(`could not list existing secrets: ${p.listError}`);
63
+ for (const i of p.items)
64
+ ctx.log.dim(` ${i.key} ${i.status}`);
65
+ }
66
+ if (listFailed.length)
67
+ ctx.log.warn("Skipping remotes kit could not list; re-run with --yes to push anyway");
68
+ }
69
+ const report = (outcomes2, ok) => {
70
+ if (ctx.flags.json)
71
+ emitJson({ dryRun: ctx.flags.dryRun, ok, outcomes: outcomes2 });
72
+ };
73
+ const failListed = () => {
74
+ if (!listFailed.length)
75
+ return;
76
+ if (!ctx.flags.json) {
77
+ ctx.log.error(`could not list secrets on ${listFailed.map((p) => p.destination.name).join(", ")}`);
78
+ }
79
+ process.exitCode = ExitCode.failed;
80
+ };
81
+ if (ctx.flags.dryRun || !toPush.length) {
82
+ report(plans.flatMap((p) => p.items.map((i) => ({ destination: p.destination.name, key: i.key, status: i.status }))), !listFailed.length);
83
+ if (!ctx.flags.json && !toPush.length && !listFailed.length)
84
+ ctx.log.warn("Nothing to push");
85
+ failListed();
86
+ return;
87
+ }
88
+ const where = plans.map((p) => p.destination.name).join(", ");
89
+ if (!await confirm(ctx.flags, `Push ${toPush.length} secret(s) to ${where}?`)) {
90
+ throw new KitError("Cancelled", undefined, ExitCode.interrupted);
91
+ }
92
+ const outcomes = await executePush(plans, state.values, (dest, key) => {
93
+ if (!ctx.flags.json)
94
+ ctx.log.step(`${key} \u2192 ${dest}`);
95
+ });
96
+ const failed = outcomes.find((o) => o.status === "failed");
97
+ report(outcomes, !failed && !listFailed.length);
98
+ if (failed) {
99
+ if (!ctx.flags.json) {
100
+ ctx.log.error(`push ${failed.key} \u2192 ${failed.destination} failed`);
101
+ if (failed.output?.trim())
102
+ process.stderr.write(`${failed.output.trim()}
103
+ `);
104
+ }
105
+ process.exitCode = ExitCode.failed;
106
+ return;
107
+ }
108
+ if (!ctx.flags.json) {
109
+ const pushed = outcomes.filter((o) => o.status === "pushed").length;
110
+ ctx.log.success(`pushed ${pushed}, skipped ${outcomes.length - pushed}`);
111
+ }
112
+ failListed();
113
+ }
114
+ });
115
+ export {
116
+ push_default as default
117
+ };
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import {
3
+ GENERATED_BANNER,
4
+ checkOutputs,
5
+ diffKeys,
6
+ outputs,
7
+ parseDotenv,
8
+ render,
9
+ writeAtomic,
10
+ writeOutputs
11
+ } from "./cli-rds33bnp.js";
12
+ import"./cli-re3ntm60.js";
13
+ export {
14
+ writeOutputs,
15
+ writeAtomic,
16
+ render,
17
+ parseDotenv,
18
+ outputs,
19
+ diffKeys,
20
+ checkOutputs,
21
+ GENERATED_BANNER
22
+ };
@@ -0,0 +1,53 @@
1
+ // @bun
2
+ import {
3
+ defineCommand
4
+ } from "./cli-6dxp4v3m.js";
5
+ import"./cli-07t28k94.js";
6
+ import"./cli-5wasc5mr.js";
7
+ import"./cli-7wvrehng.js";
8
+ import {
9
+ __require
10
+ } from "./cli-re3ntm60.js";
11
+
12
+ // src/commands/env/sync.ts
13
+ var sync_default = defineCommand({
14
+ description: "Render env outputs (.dev.vars) from .env",
15
+ group: "Infra",
16
+ examples: `kit env sync
17
+ kit env sync --dry-run
18
+ kit env sync --json`,
19
+ async run(ctx) {
20
+ const { requireProject } = await import("./command-gazq4bmt.js");
21
+ const { loadEnv, assertValid } = await import("./load-5qzs1c6b.js");
22
+ const { outputs, writeOutputs } = await import("./render-488tjnsq.js");
23
+ const { emitJson } = await import("./log-hhspqwjw.js");
24
+ const { root, config } = requireProject(ctx);
25
+ const state = await loadEnv(root, config);
26
+ assertValid(state);
27
+ const results = writeOutputs(root, outputs(config, state.schema), state.values, ctx.flags.dryRun);
28
+ if (ctx.flags.json) {
29
+ emitJson({ dryRun: ctx.flags.dryRun, outputs: results });
30
+ return;
31
+ }
32
+ if (!results.length) {
33
+ ctx.log.warn("No env.outputs configured");
34
+ return;
35
+ }
36
+ const verb = ctx.flags.dryRun ? "would write" : "wrote";
37
+ for (const r of results) {
38
+ if (!r.changed) {
39
+ ctx.log.dim(` ${r.path} up to date`);
40
+ continue;
41
+ }
42
+ const keys = [
43
+ ...r.added.map((k) => `+${k}`),
44
+ ...r.updated.map((k) => `~${k}`),
45
+ ...r.removed.map((k) => `-${k}`)
46
+ ];
47
+ ctx.log.success(`${verb} ${r.path}${keys.length ? ` ${keys.join(" ")}` : ""}`);
48
+ }
49
+ }
50
+ });
51
+ export {
52
+ sync_default as default
53
+ };
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import {
3
+ WORKSPACE,
4
+ isGradleTask,
5
+ planVerbs,
6
+ selectTargets,
7
+ suggest,
8
+ targetCommands
9
+ } from "./cli-12dww95e.js";
10
+ import"./cli-qhs8ww91.js";
11
+ import"./cli-fqfan92n.js";
12
+ import"./cli-fqxtcj42.js";
13
+ import"./cli-7wvrehng.js";
14
+ import"./cli-re3ntm60.js";
15
+ export {
16
+ targetCommands,
17
+ suggest,
18
+ selectTargets,
19
+ planVerbs,
20
+ isGradleTask,
21
+ WORKSPACE
22
+ };
@@ -0,0 +1,26 @@
1
+ // @bun
2
+ import {
3
+ defineCommand
4
+ } from "./cli-6dxp4v3m.js";
5
+ import"./cli-07t28k94.js";
6
+ import"./cli-5wasc5mr.js";
7
+ import"./cli-7wvrehng.js";
8
+ import {
9
+ __require
10
+ } from "./cli-re3ntm60.js";
11
+
12
+ // src/commands/test.ts
13
+ var test_default = defineCommand({
14
+ description: "Run the test suites",
15
+ group: "Quality",
16
+ examples: `kit test
17
+ kit test api
18
+ kit test client -- --rerun`,
19
+ async run(ctx) {
20
+ const { runVerb } = await import("./_verb-espppzez.js");
21
+ await runVerb(ctx, { name: "test", verbs: ["test"] });
22
+ }
23
+ });
24
+ export {
25
+ test_default as default
26
+ };