hatchkit 0.1.42 → 0.1.45

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 (55) hide show
  1. package/dist/adopt.d.ts +77 -0
  2. package/dist/adopt.d.ts.map +1 -1
  3. package/dist/adopt.js +395 -157
  4. package/dist/adopt.js.map +1 -1
  5. package/dist/deploy/rollback.d.ts.map +1 -1
  6. package/dist/deploy/rollback.js +9 -0
  7. package/dist/deploy/rollback.js.map +1 -1
  8. package/dist/dev-setup.d.ts +106 -0
  9. package/dist/dev-setup.d.ts.map +1 -0
  10. package/dist/dev-setup.js +1340 -0
  11. package/dist/dev-setup.js.map +1 -0
  12. package/dist/doctor.d.ts.map +1 -1
  13. package/dist/doctor.js +6 -0
  14. package/dist/doctor.js.map +1 -1
  15. package/dist/index.js +58 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/prompts.d.ts +12 -0
  18. package/dist/prompts.d.ts.map +1 -1
  19. package/dist/prompts.js +42 -0
  20. package/dist/prompts.js.map +1 -1
  21. package/dist/provision/s3-buckets.d.ts.map +1 -1
  22. package/dist/provision/s3-buckets.js +44 -24
  23. package/dist/provision/s3-buckets.js.map +1 -1
  24. package/dist/provision/write-env.d.ts +6 -0
  25. package/dist/provision/write-env.d.ts.map +1 -1
  26. package/dist/provision/write-env.js +17 -0
  27. package/dist/provision/write-env.js.map +1 -1
  28. package/dist/scaffold/app.d.ts +6 -0
  29. package/dist/scaffold/app.d.ts.map +1 -1
  30. package/dist/scaffold/app.js +20 -1
  31. package/dist/scaffold/app.js.map +1 -1
  32. package/dist/scaffold/build-pipeline.d.ts +26 -2
  33. package/dist/scaffold/build-pipeline.d.ts.map +1 -1
  34. package/dist/scaffold/build-pipeline.js +159 -6
  35. package/dist/scaffold/build-pipeline.js.map +1 -1
  36. package/dist/scaffold/manifest.d.ts +12 -0
  37. package/dist/scaffold/manifest.d.ts.map +1 -1
  38. package/dist/scaffold/manifest.js +1 -0
  39. package/dist/scaffold/manifest.js.map +1 -1
  40. package/dist/scaffold/update.d.ts +20 -1
  41. package/dist/scaffold/update.d.ts.map +1 -1
  42. package/dist/scaffold/update.js +126 -54
  43. package/dist/scaffold/update.js.map +1 -1
  44. package/dist/templates/build-pipeline/Dockerfile.nextjs-monorepo.hbs +107 -0
  45. package/dist/templates/build-pipeline/docker-compose.yml.hbs +14 -2
  46. package/dist/utils/flags.d.ts +5 -0
  47. package/dist/utils/flags.d.ts.map +1 -1
  48. package/dist/utils/flags.js +13 -1
  49. package/dist/utils/flags.js.map +1 -1
  50. package/dist/utils/run-ledger.d.ts +9 -0
  51. package/dist/utils/run-ledger.d.ts.map +1 -1
  52. package/dist/utils/run-ledger.js.map +1 -1
  53. package/package.json +4 -2
  54. package/scripts/release-bump.mjs +29 -3
  55. package/scripts/release-packages.mjs +131 -0
@@ -0,0 +1,106 @@
1
+ import { CADDYFILE_PATH, DEV_CONFIG_DIR, isLocalDevActive, LOCAL_DEV_DOMAIN, LOCAL_DEV_DOMAIN_WILDCARD, MANAGED_MARKER, projectFragmentPath, PROJECTS_DIR, readCaddyPort, removeProjectFragment, type TailscaleIdentity, tailscaleIdentity, tailscaleServeTcpTarget, writeProjectFragment } from "@hatchkit/dev-shared";
2
+ export { CADDYFILE_PATH, DEV_CONFIG_DIR, LOCAL_DEV_DOMAIN, LOCAL_DEV_DOMAIN_WILDCARD, MANAGED_MARKER, PROJECTS_DIR, isLocalDevActive, readCaddyPort, tailscaleIdentity, tailscaleServeTcpTarget, };
3
+ export type { TailscaleIdentity };
4
+ export declare const CADDY_LOG_PATH: string;
5
+ export declare const CADDY_ERR_LOG_PATH: string;
6
+ export declare const CADDY_WRAPPER_PATH: string;
7
+ export declare const LAUNCHD_LABEL = "com.hatchkit.dev-caddy";
8
+ export declare const LAUNCHD_PLIST_PATH: string;
9
+ /** Default keychain pair used when the Caddy ACME token lives outside
10
+ * the launchd plist. When this entry exists, `dev-setup init` writes a
11
+ * wrapper-style plist that exec's a small shell script which pulls the
12
+ * token from keychain on demand — no plaintext secret in
13
+ * `~/Library/LaunchAgents/`. Override via
14
+ * `DevSetupInitOptions.caddyTokenKeychain`. */
15
+ export declare const DEFAULT_CADDY_KEYCHAIN_SERVICE = "caddy-dev";
16
+ export declare const DEFAULT_CADDY_KEYCHAIN_ACCOUNT = "cloudflare-acme";
17
+ export interface CheckResult {
18
+ name: string;
19
+ status: "ok" | "fail" | "skip";
20
+ detail?: string;
21
+ hint?: string[];
22
+ }
23
+ export declare function caddyfileContents(caddyPort: number): string;
24
+ export declare function pickFreeCaddyPort(): Promise<number | null>;
25
+ export declare function checkLocalDevHost(): Promise<CheckResult[]>;
26
+ export interface DevSetupInitOptions {
27
+ force?: boolean;
28
+ skipLaunchd?: boolean;
29
+ skipServe?: boolean;
30
+ caddyBinPath?: string;
31
+ cloudflareToken?: string | null;
32
+ /** Pull the Cloudflare ACME token from a macOS Keychain entry at
33
+ * Caddy start time instead of embedding it in the launchd plist.
34
+ * When set (or when the `caddy-dev/cloudflare-acme` default entry
35
+ * exists), `init` writes a wrapper script and a plist that exec's
36
+ * the wrapper — the secret never lands on disk in plaintext. Pass
37
+ * `false` to force inline-env mode even if the default entry exists. */
38
+ caddyTokenKeychain?: {
39
+ service: string;
40
+ account: string;
41
+ } | false;
42
+ }
43
+ export interface DevSetupInitResult {
44
+ caddyPort: number;
45
+ wroteCaddyfile: boolean;
46
+ wrotePlist: boolean;
47
+ /** True when the wrapper script at CADDY_WRAPPER_PATH was created or
48
+ * rewritten. Only set in wrapper-mode runs. */
49
+ wroteWrapper: boolean;
50
+ loadedLaunchd: boolean;
51
+ registeredServe: boolean;
52
+ /** State of the `*.local.ricoslabs.com` DNS A record that points at
53
+ * the laptop's tailnet IP. `null` when no Cloudflare token is
54
+ * reachable (manual DNS setup expected); a status string when
55
+ * hatchkit managed the record itself. */
56
+ dnsRecord: "created" | "updated" | "unchanged" | "skipped-no-token" | "failed" | null;
57
+ notes: string[];
58
+ }
59
+ export declare function runDevSetupInit(opts?: DevSetupInitOptions): Promise<DevSetupInitResult>;
60
+ export { projectFragmentPath, removeProjectFragment, writeProjectFragment };
61
+ export interface EnableProjectLocalDevInput {
62
+ /** Absolute path to the project root (contains `.hatchkit.json`). */
63
+ projectDir: string;
64
+ slug: string;
65
+ /** Dev port the Caddy fragment should reverse-proxy to. For client-
66
+ * bearing projects this is the client port; for server-only, the
67
+ * server port. The dev plugin will overwrite the fragment with the
68
+ * live port at the next `pnpm dev` if this guess is wrong. */
69
+ devPort: number;
70
+ /** When false, skip the framework-config patch (next.config.ts).
71
+ * Useful for `hatchkit dev-setup enable` invocations on projects
72
+ * whose Next config has been hand-edited beyond the auto-patch
73
+ * comfort zone — the user can wire the plugin themselves. */
74
+ patchNextConfig?: boolean;
75
+ /** When false, skip the package.json dep injection. Same rationale. */
76
+ patchPackageJson?: boolean;
77
+ }
78
+ export interface EnableProjectLocalDevResult {
79
+ wroteFragment: "created" | "updated" | "unchanged";
80
+ wroteDocs: boolean;
81
+ /** Which framework the patcher detected (or `none` when neither a
82
+ * Next nor a Vite config is reachable from the project). Drives
83
+ * which plugin package is injected. */
84
+ framework: "next" | "vite" | "none";
85
+ patchedConfig: "added" | "already-wrapped" | "no-file" | "unsupported-shape" | "manual-wire-required" | "skipped";
86
+ patchedPackageJson: "added" | "already-present" | "no-file" | "skipped";
87
+ }
88
+ /** Wire a single project for Tailscale-served local dev. Idempotent —
89
+ * safe to call from scaffold (first run) AND from `dev-setup enable`
90
+ * on an already-wired project. */
91
+ export declare function enableProjectLocalDev(input: EnableProjectLocalDevInput): Promise<EnableProjectLocalDevResult>;
92
+ /** Remove the project's Caddy fragment + the docs file. Leaves the
93
+ * next.config wrapper + the plugin dep in place — they're inert when
94
+ * `~/.config/dev/projects/<slug>.caddy` is gone, and ripping them
95
+ * back out risks colliding with user edits to either file. */
96
+ export declare function disableProjectLocalDev(projectDir: string, slug: string): {
97
+ removedFragment: boolean;
98
+ removedDocs: boolean;
99
+ };
100
+ export interface DevSetupDocsInput {
101
+ slug: string;
102
+ tailscale?: TailscaleIdentity | null;
103
+ }
104
+ export declare function renderDevSetupDocs(input: DevSetupDocsInput): string;
105
+ export declare function runDevSetupCli(args: string[]): Promise<void>;
106
+ //# sourceMappingURL=dev-setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-setup.d.ts","sourceRoot":"","sources":["../src/dev-setup.ts"],"names":[],"mappings":"AAgCA,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,KAAK,iBAAiB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,uBAAuB,GACxB,CAAC;AACF,YAAY,EAAE,iBAAiB,EAAE,CAAC;AAElC,eAAO,MAAM,cAAc,QAAoC,CAAC;AAChE,eAAO,MAAM,kBAAkB,QAAwC,CAAC;AACxE,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAC3E,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,kBAAkB,QAK9B,CAAC;AAEF;;;;;gDAKgD;AAChD,eAAO,MAAM,8BAA8B,cAAc,CAAC;AAC1D,eAAO,MAAM,8BAA8B,oBAAoB,CAAC;AAKhE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAMD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CA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