@hype-stack/cli 0.2.0 → 0.2.1

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 (45) hide show
  1. package/dist/{cli-CPOgUkiJ.js → cli-B_p3GdS8.js} +2047 -1258
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/commands/compose.d.ts +14 -1
  4. package/dist/commands/compose.d.ts.map +1 -1
  5. package/dist/commands/create.d.ts.map +1 -1
  6. package/dist/commands/init.d.ts +23 -1
  7. package/dist/commands/init.d.ts.map +1 -1
  8. package/dist/commands/install-helpers.d.ts +41 -0
  9. package/dist/commands/install-helpers.d.ts.map +1 -0
  10. package/dist/commands/template.d.ts +13 -0
  11. package/dist/commands/template.d.ts.map +1 -0
  12. package/dist/config/bin.js +453 -454
  13. package/dist/config/env.d.ts +0 -1
  14. package/dist/config/env.d.ts.map +1 -1
  15. package/dist/constants/constants.d.ts +1 -3
  16. package/dist/constants/constants.d.ts.map +1 -1
  17. package/dist/constants/themes.d.ts +40 -0
  18. package/dist/constants/themes.d.ts.map +1 -0
  19. package/dist/core/apply-theme.d.ts +17 -0
  20. package/dist/core/apply-theme.d.ts.map +1 -0
  21. package/dist/core/codemods.d.ts +42 -3
  22. package/dist/core/codemods.d.ts.map +1 -1
  23. package/dist/core/installer.d.ts +50 -3
  24. package/dist/core/installer.d.ts.map +1 -1
  25. package/dist/core/license.d.ts +5 -0
  26. package/dist/core/license.d.ts.map +1 -1
  27. package/dist/core/login.d.ts.map +1 -1
  28. package/dist/core/pack-categories.d.ts +40 -0
  29. package/dist/core/pack-categories.d.ts.map +1 -0
  30. package/dist/core/post-clone.d.ts.map +1 -1
  31. package/dist/core/stack-config.d.ts.map +1 -1
  32. package/dist/core/templates.d.ts +15 -0
  33. package/dist/core/templates.d.ts.map +1 -0
  34. package/dist/core/tracking.d.ts +9 -0
  35. package/dist/core/tracking.d.ts.map +1 -0
  36. package/dist/core/variants.d.ts +47 -0
  37. package/dist/core/variants.d.ts.map +1 -0
  38. package/dist/index.js +2 -2
  39. package/dist/themes.js +833 -0
  40. package/dist/types/types.d.ts +127 -1
  41. package/dist/types/types.d.ts.map +1 -1
  42. package/dist/ui/banner.d.ts.map +1 -1
  43. package/dist/ui/theme.d.ts +13 -0
  44. package/dist/ui/theme.d.ts.map +1 -1
  45. package/package.json +31 -1
package/dist/cli.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBpC,wBAAgB,aAAa,IAAI,OAAO,CA4EvC"}
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkCpC,wBAAgB,aAAa,IAAI,OAAO,CA6GvC"}
@@ -1,3 +1,16 @@
1
- import { ComposeOptions } from '../types/types.js';
1
+ import { ComposeOptions, PackSelection, SlotsByPack } from '../types/types.js';
2
2
  export declare function composeCommand(options?: ComposeOptions): Promise<void>;
3
+ /**
4
+ * Parse a `--packs` entry into a {@link PackSelection}. A trailing `@frontend` or `@admin`
5
+ * suffix pins the pack to that app shell (layout packs only). Without a suffix the pack
6
+ * installs without a slot, which preserves the pre-slot behavior of installing every file.
7
+ */
8
+ export declare function parsePackSelectionArg(raw: string): PackSelection;
9
+ /** Deduplicate selected pack names, preserving the first-seen order for the install plan. */
10
+ export declare function uniqueNames(selection: PackSelection[]): string[];
11
+ /**
12
+ * Build the per-pack slot map from the selection. Packs without a slot are left out so the
13
+ * installer treats them as install-everything. A layout pack picked for both slots gets both.
14
+ */
15
+ export declare function buildSlotsByPack(selection: PackSelection[]): SlotsByPack;
3
16
  //# sourceMappingURL=compose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/commands/compose.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAgE,MAAM,mBAAmB,CAAC;AAOtH,wBAAsB,cAAc,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6JhF"}
1
+ {"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/commands/compose.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,cAAc,EAEd,aAAa,EAEb,WAAW,EAEZ,MAAM,mBAAmB,CAAC;AAiB3B,wBAAsB,cAAc,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiMhF;AA2ED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAIhE;AAED,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,MAAM,EAAE,CAShE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,WAAW,CAYxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsLzE"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAQnE,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CA8NzE"}
@@ -1,4 +1,26 @@
1
1
  import { InitOptions } from '../types/types.js';
2
2
  export declare function initCommand(options: InitOptions): Promise<void>;
3
- export declare function ensureInit(cwd: string): Promise<void>;
3
+ /**
4
+ * Optional overrides for {@link ensureInit}. Tests inject fakes so the interactive
5
+ * `init` / `create` commands don't have to be exercised end-to-end here.
6
+ */
7
+ export interface EnsureInitRunners {
8
+ runInit?: (cwd: string) => Promise<void>;
9
+ runCreate?: (cwd: string) => Promise<void>;
10
+ }
11
+ /**
12
+ * Make sure a `stack.json` exists in `cwd` before a command that needs it runs.
13
+ *
14
+ * - If one already exists, nothing happens and this returns `true`.
15
+ * - If the directory looks like a Hype Stack project, ask whether to generate
16
+ * `stack.json` now. Accepting runs `init` (silent, so it just writes the file
17
+ * with detected defaults) and returns `true` on success.
18
+ * - If the directory is not a Hype Stack project, offer to scaffold a new one
19
+ * via `create`.
20
+ *
21
+ * Returns `false` when the user declines or cancels any prompt. The caller is
22
+ * responsible for surfacing an understandable error in that case; this helper
23
+ * never exits the process on decline.
24
+ */
25
+ export declare function ensureInit(cwd: string, runners?: EnsureInitRunners): Promise<boolean>;
4
26
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAUrD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFrE;AAED,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM3D"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWrD,wBAAsB,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwFrE;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CA0C/F"}
@@ -0,0 +1,41 @@
1
+ import { PreparedPack } from '../core/installer.js';
2
+ import { PackAuthorizationMap, PackListItem, PackSlot, StackConfig, StackPaths } from '../types/types.js';
3
+ import * as p from "@clack/prompts";
4
+ export type PackState = "free" | "owned" | "locked";
5
+ export declare function errorMessage(error: unknown): string;
6
+ /** Authorize paid, not-yet-installed packs. Returns an empty map on failure (everything stays locked). */
7
+ export declare function authorizeUnowned(packs: PackListItem[], installedSet: Set<string>, auth: {
8
+ token?: string | null;
9
+ key?: string | null;
10
+ }): Promise<PackAuthorizationMap>;
11
+ export declare function stateTag(state: PackState, price: number): string;
12
+ /** Tell the user which packs were dropped and offer to open purchase pages for locked ones. */
13
+ export declare function handleBlocked(blocked: string[], isLocked: (name: string) => boolean, packsByName: Map<string, PackListItem>): Promise<void>;
14
+ export declare function showPlanSummary(installable: string[], packsByName: Map<string, PackListItem>): void;
15
+ /** Fetch each pack's manifest and download its files into a temp dir, in install order. */
16
+ export declare function downloadPacks(order: string[], auth: {
17
+ token?: string | null;
18
+ key?: string | null;
19
+ }): Promise<PreparedPack[]>;
20
+ export declare function installNpmForPacks(args: {
21
+ prepared: PreparedPack[];
22
+ paths: StackPaths;
23
+ cwd: string;
24
+ spinner: ReturnType<typeof p.spinner>;
25
+ }): Promise<void>;
26
+ export declare function printPostInstall(prepared: PreparedPack[]): void;
27
+ /**
28
+ * Decide which existing files to overwrite. `force` overwrites everything (empty set, handled
29
+ * downstream by force). Non-interactive runs keep the safe default and leave existing files alone.
30
+ * Otherwise ask once per conflicting file, like shadcn does, and collect the approved paths.
31
+ */
32
+ export declare function resolveOverwrites(args: {
33
+ prepared: PreparedPack[];
34
+ config: StackConfig;
35
+ cwd: string;
36
+ force: boolean;
37
+ yes: boolean;
38
+ /** Per-pack selected slots, used to scope which files count as conflicts. */
39
+ slotsByPack?: Map<string, PackSlot[]>;
40
+ }): Promise<Set<string>>;
41
+ //# sourceMappingURL=install-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"install-helpers.d.ts","sourceRoot":"","sources":["../../src/commands/install-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AAIpC,OAAO,EAAqB,KAAK,YAAY,EAAwB,MAAM,sBAAsB,CAAC;AAGlG,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAgB,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG7H,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEpD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEnD;AAED,0GAA0G;AAC1G,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,YAAY,EAAE,EACrB,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,EACzB,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnD,OAAO,CAAC,oBAAoB,CAAC,CAI/B;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,+FAA+F;AAC/F,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,EACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI,CAQnG;AAED,2FAA2F;AAC3F,wBAAsB,aAAa,CACjC,KAAK,EAAE,MAAM,EAAE,EACf,IAAI,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACnD,OAAO,CAAC,YAAY,EAAE,CAAC,CAmBzB;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE;IAC7C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,UAAU,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC;CACvC,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBhB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAI,CAK/D;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,MAAM,EAAE,WAAW,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;IACb,6EAA6E;IAC7E,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACvC,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAiCvB"}
@@ -0,0 +1,13 @@
1
+ import { TemplateCommandOptions } from '../types/types.js';
2
+ /**
3
+ * Install a template. The template expands to its starter/layout slot variants
4
+ * plus a fixed set of feature packs, installs them like a normal compose, then
5
+ * layers the template's frontend override files (landing page, etc.) on top so
6
+ * the template takes responsibility for those paths.
7
+ *
8
+ * Built for template making: you can swap the starter/layout variants for a
9
+ * different same-family pack, and add extra packs that fall outside the
10
+ * template's predefined scope.
11
+ */
12
+ export declare function templateCommand(options?: TemplateCommandOptions): Promise<void>;
13
+ //# sourceMappingURL=template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/commands/template.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAyC,sBAAsB,EAAoB,MAAM,mBAAmB,CAAC;AAezH;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,IAAI,CAAC,CAgRzF"}