@hype-stack/cli 1.3.5 → 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.
- package/dist/{cli-pTQ4lEfV.js → cli-C1Bvl6gU.js} +2486 -2433
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/config/bin.js +1 -1
- package/dist/constants/constants.d.ts +12 -1
- package/dist/constants/constants.d.ts.map +1 -1
- package/dist/core/clone.d.ts +12 -4
- package/dist/core/clone.d.ts.map +1 -1
- package/dist/core/template-channel.d.ts +24 -0
- package/dist/core/template-channel.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"
|
|
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"}
|
package/dist/config/bin.js
CHANGED
|
@@ -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
|
-
/**
|
|
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
|
|
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;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAS,CAAC;AAExC,eAAO,MAAM,aAAa,8BAA6B,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAMhD,eAAO,MAAM,eAAe,+BAA+B,CAAC;AAE5D,eAAO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,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"}
|
package/dist/core/clone.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
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
|
package/dist/core/clone.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone.d.ts","sourceRoot":"","sources":["../../src/core/clone.ts"],"names":[],"mappings":"
|
|
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"}
|
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-
|
|
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 };
|