@hype-stack/cli 1.3.4 → 1.4.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.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAUnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAsS3E"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAUnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAiT3E"}
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { d as e, n as t, t as n, u as r } from "../cli-Do0t2lin.js";
2
+ import { d as e, n as t, t as n, u as r } from "../cli-C1Bvl6gU.js";
3
3
  import { z as i } from "zod";
4
4
  import * as a from "@sentry/node";
5
5
  //#region src/core/sentry.ts
@@ -9,9 +9,20 @@ import { CodeEditor } from '../types/types.js';
9
9
  export declare const VERSION: string;
10
10
  /** `owner/repo` of the template the CLI clones. Also the id it is recorded under in `stack.json`. */
11
11
  export declare const TEMPLATE_REPO_SLUG = "BetterTyped/hype-stack";
12
- /** Branch the template is cloned from when no commit is pinned. */
12
+ /**
13
+ * Branch the template is cloned from when no release can be resolved. Also what a dev build always
14
+ * uses, so working from source keeps tracking the template's head.
15
+ */
13
16
  export declare const TEMPLATE_REPO_REF = "main";
14
17
  export declare const TEMPLATE_REPO = "gh:BetterTyped/hype-stack";
18
+ /**
19
+ * Overrides which template revision `create` clones: a tag, a branch, or a sha. This is the lever
20
+ * for trying a breaking template change end to end before it is released, without touching a
21
+ * deploy.
22
+ */
23
+ export declare const TEMPLATE_REF_ENV_KEY = "HYPE_STACK_TEMPLATE_REF";
24
+ /** API path telling the CLI which template release this registry serves packs for. */
25
+ export declare const TEMPLATE_CHANNEL_PATH = "/cli/template-channel";
15
26
  export declare const STACK_CONFIG_FILE = "stack.json";
16
27
  export declare const SCHEMA_PATH = "/schema/stack.json";
17
28
  export declare const DEFAULT_API_URL = "https://api.hype-stack.dev";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,QAAkE,CAAC;AAEvF,qGAAqG;AACrG,eAAO,MAAM,kBAAkB,2BAA2B,CAAC;AAE3D,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,eAAO,MAAM,aAAa,8BAA6B,CAAC;AAExD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAMhD,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,uGAAuG;AACvG,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,mEAAmE;AACnE,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,qCAAqC,CAAC;AAErE,kDAAkD;AAClD,eAAO,MAAM,eAAe,oCAAoC,CAAC;AAEjE,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAErD,iEAAiE;AACjE,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,QAAwC,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,c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C,MAAM,EAAE,UAAU,GAAG,MAAM,CAEtD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG;IAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAOvG;AAED,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,UAAU,YAAY,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAClD,eAAO,MAAM,iBAAiB,mBAAmB,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,cAAc,cAAc,CAAC;AAE1C,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAED,wBAAgB,SAAS,IAAI,MAAM,CAOlC;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAYhD;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD"}
@@ -1,3 +1,4 @@
1
+ import { TemplateRefSource } from './template-channel.js';
1
2
  export interface CloneResult {
2
3
  dir: string;
3
4
  source: string;
@@ -7,6 +8,10 @@ export interface CloneResult {
7
8
  * what a later upgrade of the template itself has to diff against.
8
9
  */
9
10
  commit: string | null;
11
+ /** The ref that was cloned: a release tag, a branch, or a sha. */
12
+ ref: string;
13
+ /** How the ref was chosen. See {@link resolveTemplateRef}. */
14
+ refSource: TemplateRefSource;
10
15
  }
11
16
  /**
12
17
  * Ask GitHub for the commit a ref currently points at. `Accept: application/vnd.github.sha` makes
@@ -20,10 +25,13 @@ export declare function resolveTemplateCommit(ref?: string): Promise<string | nu
20
25
  /**
21
26
  * Clone the Hype Stack template into `targetDir`.
22
27
  *
23
- * The clone is pinned to a resolved commit rather than to the branch, so the sha written into
24
- * `stack.json` is exactly the tree on disk. Resolving and then cloning `main` separately would leave
25
- * a window where a push lands between the two calls and the project records a commit it never had.
26
- * When the sha cannot be resolved, fall back to the branch: an unrecorded commit beats no project.
28
+ * Which revision gets cloned is decided by {@link resolveTemplateRef}: a released CLI takes the
29
+ * release the registry serves packs for, a dev build takes `main`.
30
+ *
31
+ * The clone is then pinned to a resolved commit rather than to the ref, so the sha written into
32
+ * `stack.json` is exactly the tree on disk. Resolving and then cloning the ref separately would
33
+ * leave a window where a push lands between the two calls and the project records a commit it never
34
+ * had. When the sha cannot be resolved, fall back to the ref: an unrecorded commit beats no project.
27
35
  */
28
36
  export declare function cloneTemplate(targetDir: string): Promise<CloneResult>;
29
37
  //# sourceMappingURL=clone.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/core/clone.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAID;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,GAAE,MAA0B,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASnG;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAa3E"}
1
+ {"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/core/clone.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,uBAAuB,CAAC;AAEnF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,8DAA8D;IAC9D,SAAS,EAAE,iBAAiB,CAAC;CAC9B;AAID;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,GAAE,MAA0B,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CASnG;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAkB3E"}
@@ -0,0 +1,24 @@
1
+ /** Where the answer came from. Reported so `create` can say why it cloned what it cloned. */
2
+ export type TemplateRefSource = "env" | "dev" | "api" | "github-tag" | "default";
3
+ export interface TemplateChannel {
4
+ /** Ref to clone: a tag (`v1.4.0`), a branch, or a sha. */
5
+ ref: string;
6
+ source: TemplateRefSource;
7
+ }
8
+ /**
9
+ * Which revision of the template `create` should clone.
10
+ *
11
+ * A released CLI clones a tagged release, which is what makes `main` usable as a workspace: a
12
+ * breaking change can sit there for a week without a single user seeing it. A dev build keeps
13
+ * cloning `main`, so working from source still tests the template as it is right now.
14
+ *
15
+ * Every lookup is best-effort. Nobody should fail to create a project because a metadata endpoint
16
+ * was down, so each step falls through to the next and the last one needs no network at all.
17
+ */
18
+ export declare function resolveTemplateRef(): Promise<TemplateChannel>;
19
+ /**
20
+ * Whether a ref names a release rather than a moving branch. Only a release is worth recording as
21
+ * the project's template version: "main" would age into a lie the moment the branch moves.
22
+ */
23
+ export declare function isReleaseRef(ref: string): boolean;
24
+ //# sourceMappingURL=template-channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-channel.d.ts","sourceRoot":"","sources":["../../src/core/template-channel.ts"],"names":[],"mappings":"AASA,6FAA6F;AAC7F,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjF,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,iBAAiB,CAAC;CAC3B;AA+DD;;;;;;;;;GASG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC,CAanE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEjD"}
@@ -33,6 +33,12 @@ export interface AuthIO {
33
33
  createRunner(env: AuthEnv): CommandRunner;
34
34
  /** Run a command with the terminal attached. Browser logins need a real TTY. */
35
35
  runInteractive(command: string, args: string[], cwd: string): Promise<number>;
36
+ /**
37
+ * Fetch the provider CLI into a private tools dir and put it on this
38
+ * process's PATH. Returns where it landed, or null when it could not be
39
+ * fetched. Optional so test fakes without an opinion keep compiling.
40
+ */
41
+ bootstrapCli?(spec: ProviderSpec): Promise<string | null>;
36
42
  confirmInstall(spec: ProviderSpec): Promise<boolean>;
37
43
  chooseMethod(spec: ProviderSpec): Promise<SignInMethod>;
38
44
  readToken(spec: ProviderSpec): Promise<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/deploy/auth.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,qBAAqB,EAAmB,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAE,KAAK,aAAa,EAAuB,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEvE;;;;;;;;;;;GAWG;AAEH,qFAAqF;AACrF,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,GAAG,EAAE,OAAO,CAAC;IACb,6EAA6E;IAC7E,QA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does not have.
4
+ *
5
+ * `npx @hype-stack/cli deploy` has to be the whole story: nobody should be
6
+ * sent off to install `railway` or `fly` by hand first. When a binary is
7
+ * missing from PATH, this module puts a private copy under `~/.hype-stack/
8
+ * tools` and the deploy runs against that. The user's own installation, when
9
+ * they have one, always wins because PATH is only ever appended in front for
10
+ * this process.
11
+ *
12
+ * Railway ships its CLI on npm (`@railway/cli`), and npm is guaranteed to be
13
+ * present because that is how this CLI itself was started. Fly has no npm
14
+ * distribution, so flyctl comes from its official GitHub releases, the same
15
+ * artifacts `fly.io/install.sh` unpacks.
16
+ */
17
+ /** Pinned to a major so a deploy stays predictable; bump deliberately, with a live test run. */
18
+ export declare const RAILWAY_CLI_PACKAGE = "@railway/cli@5";
19
+ export declare function toolsRoot(): string;
20
+ export declare function railwayBinDir(root: string): string;
21
+ export declare function flyBinDir(root: string): string;
22
+ /** `dir` moved to the front of `currentPath`, once. */
23
+ export declare function prependedPath(dir: string, currentPath: string | undefined, delimiter: string): string;
24
+ /** Make `dir` visible to every child this process spawns from now on. */
25
+ export declare function registerOnPath(dir: string): void;
26
+ /** The tag GitHub's `releases/latest` answer names, e.g. `v0.3.190`. */
27
+ export declare function parseLatestFlyTag(json: string): string | null;
28
+ /**
29
+ * The release asset for this machine, or null when Fly does not build for it.
30
+ * Fly names assets `flyctl_0.3.190_macOS_arm64.tar.gz` (and `.zip` on Windows).
31
+ */
32
+ export declare function flyReleaseAsset(platform: NodeJS.Platform, arch: string, tag: string): string | null;
33
+ /**
34
+ * Ensure the provider's CLI exists under the tools root and is on this
35
+ * process's PATH. Returns the bin directory, or null when it could not be
36
+ * fetched (offline, unsupported platform), in which case the caller falls
37
+ * back to manual install instructions.
38
+ */
39
+ export declare function bootstrapProviderCli(spec: ProviderSpec, root?: string): Promise<string | null>;
40
+ //# sourceMappingURL=tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/deploy/tools.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;;;;;;;;GAcG;AAEH,gGAAgG;AAChG,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AAIpD,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,uDAAuD;AACvD,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAGrG;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wEAAwE;AACxE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU7D;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQnG;AAmED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,GAAE,MAAoB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIjH"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, o as i, r as a, s as o, t as s } from "./cli-Do0t2lin.js";
1
+ import { a as e, c as t, i as n, l as r, o as i, r as a, s as o, t as s } from "./cli-C1Bvl6gU.js";
2
2
  export { i as composeCommand, r as createCommand, s as createProgram, e as deployCommand, o as ensureInit, t as initCommand, n as loginCommand, a as logoutCommand };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hype-stack/cli",
3
- "version": "1.3.4",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -44,7 +44,8 @@
44
44
  "zod": "^4.4.3"
45
45
  },
46
46
  "devDependencies": {
47
- "@types/node": "^25.6.0"
47
+ "@types/node": "^25.6.0",
48
+ "tsx": "^4.19.0"
48
49
  },
49
50
  "nx": {
50
51
  "targets": {
@@ -78,6 +79,8 @@
78
79
  "local:run": "HYPE_STACK_API_URL=${HYPE_STACK_API_URL:-http://localhost:3000} HYPE_STACK_WEB_URL=${HYPE_STACK_WEB_URL:-http://localhost:4200} node ./dist/config/bin.js",
79
80
  "format": "pnpm --dir ../.. exec oxfmt --write packages/cli",
80
81
  "typecheck": "pnpm --dir ../.. exec tsgo -p packages/cli/tsconfig.json --noEmit",
81
- "lint": "pnpm --dir ../.. exec oxlint --fix packages/cli"
82
+ "lint": "pnpm --dir ../.. exec oxlint --fix packages/cli",
83
+ "test:live": "vitest run --config vitest.live.config.mts",
84
+ "sweep:live": "tsx tests/live/sweep.ts"
82
85
  }
83
86
  }