@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.
- package/dist/{cli-CPOgUkiJ.js → cli-B_p3GdS8.js} +2047 -1258
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/compose.d.ts +14 -1
- package/dist/commands/compose.d.ts.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/init.d.ts +23 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/install-helpers.d.ts +41 -0
- package/dist/commands/install-helpers.d.ts.map +1 -0
- package/dist/commands/template.d.ts +13 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/config/bin.js +453 -454
- package/dist/config/env.d.ts +0 -1
- package/dist/config/env.d.ts.map +1 -1
- package/dist/constants/constants.d.ts +1 -3
- package/dist/constants/constants.d.ts.map +1 -1
- package/dist/constants/themes.d.ts +40 -0
- package/dist/constants/themes.d.ts.map +1 -0
- package/dist/core/apply-theme.d.ts +17 -0
- package/dist/core/apply-theme.d.ts.map +1 -0
- package/dist/core/codemods.d.ts +42 -3
- package/dist/core/codemods.d.ts.map +1 -1
- package/dist/core/installer.d.ts +50 -3
- package/dist/core/installer.d.ts.map +1 -1
- package/dist/core/license.d.ts +5 -0
- package/dist/core/license.d.ts.map +1 -1
- package/dist/core/login.d.ts.map +1 -1
- package/dist/core/pack-categories.d.ts +40 -0
- package/dist/core/pack-categories.d.ts.map +1 -0
- package/dist/core/post-clone.d.ts.map +1 -1
- package/dist/core/stack-config.d.ts.map +1 -1
- package/dist/core/templates.d.ts +15 -0
- package/dist/core/templates.d.ts.map +1 -0
- package/dist/core/tracking.d.ts +9 -0
- package/dist/core/tracking.d.ts.map +1 -0
- package/dist/core/variants.d.ts +47 -0
- package/dist/core/variants.d.ts.map +1 -0
- package/dist/index.js +2 -2
- package/dist/themes.js +833 -0
- package/dist/types/types.d.ts +127 -1
- package/dist/types/types.d.ts.map +1 -1
- package/dist/ui/banner.d.ts.map +1 -1
- package/dist/ui/theme.d.ts +13 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/package.json +31 -1
package/dist/config/env.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const envSchema: z.ZodObject<{
|
|
3
3
|
HYPE_STACK_API_URL: z.ZodOptional<z.ZodString>;
|
|
4
4
|
HYPE_STACK_WEB_URL: z.ZodOptional<z.ZodString>;
|
|
5
|
-
HYPE_STACK_LICENSE_KEY: z.ZodOptional<z.ZodString>;
|
|
6
5
|
}, z.core.$strip>;
|
|
7
6
|
export type CliEnv = z.infer<typeof envSchema>;
|
|
8
7
|
export declare const validateEnv: () => CliEnv;
|
package/dist/config/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS;;;iBAGpB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAE/C,eAAO,MAAM,WAAW,QAAO,MAS9B,CAAC"}
|
|
@@ -2,13 +2,11 @@ export declare const VERSION = "0.0.1";
|
|
|
2
2
|
export declare const TEMPLATE_REPO = "gh:BetterTyped/hype-stack";
|
|
3
3
|
export declare const STACK_CONFIG_FILE = "stack.json";
|
|
4
4
|
export declare const SCHEMA_PATH = "/schema/stack.json";
|
|
5
|
-
export declare const DEFAULT_API_URL = "https://
|
|
5
|
+
export declare const DEFAULT_API_URL = "https://hype-stack.dev";
|
|
6
6
|
export declare const API_URL_ENV_KEY = "HYPE_STACK_API_URL";
|
|
7
7
|
/** The web app (storefront / login pages). Defaults to the API host when not set separately. */
|
|
8
8
|
export declare const WEB_URL_ENV_KEY = "HYPE_STACK_WEB_URL";
|
|
9
9
|
export declare const STACK_CONFIG_VERSION = 1;
|
|
10
|
-
/** Env var for the license key used to validate paid pack installs */
|
|
11
|
-
export declare const LICENSE_KEY_ENV = "HYPE_STACK_LICENSE_KEY";
|
|
12
10
|
/** API path for license validation */
|
|
13
11
|
export declare const LICENSE_VALIDATE_PATH = "/api/licenses/validate";
|
|
14
12
|
/** API path for the pack registry (list of all available packs) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,eAAO,MAAM,aAAa,8BAA8B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAEhD,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,eAAO,MAAM,aAAa,8BAA8B,CAAC;AAEzD,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAEhD,eAAO,MAAM,eAAe,2BAA2B,CAAC;AAExD,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,gGAAgG;AAChG,eAAO,MAAM,eAAe,uBAAuB,CAAC;AAEpD,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAItC,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D,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,eAAO,MAAM,cAAc;;;;;;;;;;;;;EAKjB,CAAC;AAEX,eAAO,MAAM,aAAa,kDAAqC,CAAC;AAEhE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,UAAU,YAAY,CAAC;AACpC,eAAO,MAAM,UAAU,YAAY,CAAC;AAEpC,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,qBAAqB,IAAI,MAAM,CAE9C;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEtD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export type ThemeName = "default" | "slate" | "rose" | "emerald" | "violet" | "amber" | "ocean" | "zinc-mono" | "crimson" | "midnight";
|
|
2
|
+
/** Keys are CSS variable names without the `--` prefix. */
|
|
3
|
+
export type ThemeTokens = Record<string, string>;
|
|
4
|
+
export interface Theme {
|
|
5
|
+
name: ThemeName;
|
|
6
|
+
label: string;
|
|
7
|
+
hint?: string;
|
|
8
|
+
light: ThemeTokens;
|
|
9
|
+
dark: ThemeTokens;
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_THEME: ThemeName;
|
|
12
|
+
export declare const THEME_TOKEN_KEYS: ReadonlyArray<string>;
|
|
13
|
+
export declare const THEMES: Record<ThemeName, Theme>;
|
|
14
|
+
export declare const THEME_LIST: Theme[];
|
|
15
|
+
export declare const THEME_CHOICES: {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
hint: string | undefined;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const VALID_THEME_NAMES: ReadonlySet<string>;
|
|
21
|
+
export declare function isThemeName(value: string): value is ThemeName;
|
|
22
|
+
export declare function getTheme(name: ThemeName): Theme;
|
|
23
|
+
export declare function getThemeTokenKeys(): ReadonlyArray<string>;
|
|
24
|
+
/**
|
|
25
|
+
* A theme reduced to the shape the preview/capture pipeline consumes: an id, a
|
|
26
|
+
* display name, and the `light` / `dark` CSS-variable maps. Keys are CSS custom
|
|
27
|
+
* property names WITHOUT the leading `--` (matching `ThemeTokens`); callers
|
|
28
|
+
* that set inline styles prefix them with `--`. The `default` preset carries
|
|
29
|
+
* the full token set too, but preview/capture callers treat `default` as the
|
|
30
|
+
* reset target by skipping overrides.
|
|
31
|
+
*/
|
|
32
|
+
export interface ThemePreset {
|
|
33
|
+
id: ThemeName;
|
|
34
|
+
name: string;
|
|
35
|
+
light: ThemeTokens;
|
|
36
|
+
dark: ThemeTokens;
|
|
37
|
+
}
|
|
38
|
+
export declare const THEME_PRESET_LIST: ThemePreset[];
|
|
39
|
+
export declare function getThemePreset(id: string): ThemePreset | null;
|
|
40
|
+
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/constants/themes.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,SAAS,GACjB,SAAS,GACT,OAAO,GACP,MAAM,GACN,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,UAAU,CAAC;AAEf,2DAA2D;AAC3D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEjD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,SAAuB,CAAC;AA2CpD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAoB,CAAC;AAOxE,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CA41B3C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,EAA0B,CAAC;AAEzD,eAAO,MAAM,aAAa;WACH,MAAM;;;GAG1B,CAAC;AAEJ,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAAkD,CAAC;AAErG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAE7D;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,CAE/C;AAED,wBAAgB,iBAAiB,IAAI,aAAa,CAAC,MAAM,CAAC,CAEzD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,SAAS,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;IACnB,IAAI,EAAE,WAAW,CAAC;CACnB;AAED,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAKxC,CAAC;AAEJ,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAI7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '../constants/themes.js';
|
|
2
|
+
/**
|
|
3
|
+
* Rewrite the `:root` and `.dark` color tokens in `css` according to `theme`.
|
|
4
|
+
* Non-color tokens (typography, sugar-high syntax, docs accents, code surface)
|
|
5
|
+
* outside the two blocks are left untouched, and tokens that those blocks define
|
|
6
|
+
* but the theme does not list are preserved. Idempotent: applying the same theme
|
|
7
|
+
* twice yields the same output.
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyThemeToCss(css: string, theme: Theme): string;
|
|
10
|
+
export declare const THEME_STYLES_RELATIVE_PATH = "assets/styles.css";
|
|
11
|
+
/**
|
|
12
|
+
* Apply `theme` to the `assets/styles.css` of the frontend app rooted at
|
|
13
|
+
* `frontendRoot`. Returns true when the file was rewritten, false when the file
|
|
14
|
+
* is missing (the create flow keeps going in that case rather than failing).
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyThemeToProject(frontendRoot: string, theme: Theme): Promise<boolean>;
|
|
17
|
+
//# sourceMappingURL=apply-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply-theme.d.ts","sourceRoot":"","sources":["../../src/core/apply-theme.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAe,MAAM,wBAAwB,CAAC;AAsDjE;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAyBjE;AAED,eAAO,MAAM,0BAA0B,sBAAsB,CAAC;AAE9D;;;;GAIG;AACH,wBAAsB,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAe9F"}
|
package/dist/core/codemods.d.ts
CHANGED
|
@@ -1,13 +1,44 @@
|
|
|
1
|
-
import { PackContextEntry, PackEnumEntry, PackEnvEntry, PackFile, PackFrontendRoute, PackNavbarAction, PackNavEntry, PackOnboardingStep, PackRoute, PackSocket, StackPaths } from '../types/types.js';
|
|
1
|
+
import { PackContextEntry, PackEnumEntry, PackEnvEntry, PackFile, PackFrontendRoute, PackNavbarAction, PackNavEntry, PackOnboardingStep, PackRoute, PackSdkConfiguration, PackSlot, PackSocket, StackPaths } from '../types/types.js';
|
|
2
2
|
export declare function patchEnv(env: PackEnvEntry[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
3
3
|
export declare function patchRoutes(routes: PackRoute[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
4
4
|
export declare function patchContext(context: PackContextEntry[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
5
5
|
export declare function patchEnums(enums: PackEnumEntry[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
6
6
|
export declare function patchSockets(sockets: PackSocket[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
7
|
+
export declare function patchSdkConfigurations(configurations: PackSdkConfiguration[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
7
8
|
export declare function patchFrontendUrl(frontendRoutes: PackFrontendRoute[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
8
|
-
export
|
|
9
|
+
export interface PatchNavConstantsOptions {
|
|
10
|
+
entries: PackNavEntry[];
|
|
11
|
+
paths: StackPaths;
|
|
12
|
+
projectRoot: string;
|
|
13
|
+
/** App shell to target (frontend by default, admin when retargeted). */
|
|
14
|
+
slot?: PackSlot;
|
|
15
|
+
}
|
|
16
|
+
export declare function patchNavConstants(options: PatchNavConstantsOptions): Promise<void>;
|
|
17
|
+
export interface PatchPostLoginRedirectOptions {
|
|
18
|
+
/** Path the app should redirect to after login (e.g. /dashboard). */
|
|
19
|
+
postLoginRedirect: string;
|
|
20
|
+
paths: StackPaths;
|
|
21
|
+
projectRoot: string;
|
|
22
|
+
/** App shell to target (frontend by default, admin when retargeted). */
|
|
23
|
+
slot?: PackSlot;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Rewrite the starter's `POST_LOGIN_REDIRECT_PATH` constant to the manifest-declared
|
|
27
|
+
* path so login lands on the right authenticated page (e.g. /dashboard for a template
|
|
28
|
+
* whose public landing owns /). No-op when the constants file is absent (no starter
|
|
29
|
+
* installed) or the constant isn't found, so the codemod is safe to run unconditionally.
|
|
30
|
+
*/
|
|
31
|
+
export declare function patchPostLoginRedirect(options: PatchPostLoginRedirectOptions): Promise<void>;
|
|
9
32
|
export declare function patchOnboardingSteps(steps: PackOnboardingStep[], paths: StackPaths, projectRoot: string): Promise<void>;
|
|
10
|
-
export
|
|
33
|
+
export interface PatchActionsOptions {
|
|
34
|
+
actions: PackNavbarAction[];
|
|
35
|
+
paths: StackPaths;
|
|
36
|
+
projectRoot: string;
|
|
37
|
+
/** App shell to target (frontend by default, admin when retargeted). */
|
|
38
|
+
slot?: PackSlot;
|
|
39
|
+
}
|
|
40
|
+
export declare function patchNavbarActions(options: PatchActionsOptions): Promise<void>;
|
|
41
|
+
export declare function patchUserMenuActions(options: PatchActionsOptions): Promise<void>;
|
|
11
42
|
interface RewritePackScopeOptions {
|
|
12
43
|
files: PackFile[];
|
|
13
44
|
paths: StackPaths;
|
|
@@ -15,5 +46,13 @@ interface RewritePackScopeOptions {
|
|
|
15
46
|
projectName: string;
|
|
16
47
|
}
|
|
17
48
|
export declare function rewritePackScope(options: RewritePackScopeOptions): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Rewrite the `@hype-stack/` scope to `@<projectName>/` across every source file under `rootDir`.
|
|
51
|
+
* `create` only renames the scope inside package.json, so base-template source files (e.g.
|
|
52
|
+
* `app.constants.ts` importing `@hype-stack/enums`) keep dangling specifiers once the workspace
|
|
53
|
+
* packages are renamed. This walks the freshly cloned tree and fixes those imports so they match
|
|
54
|
+
* the renamed package names. Pack files are handled separately by `rewritePackScope`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function rewriteScopeInTree(rootDir: string, projectName: string): Promise<void>;
|
|
18
57
|
export {};
|
|
19
58
|
//# sourceMappingURL=codemods.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codemods.d.ts","sourceRoot":"","sources":["../../src/core/codemods.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,QAAQ,E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K,EAAE,QAAQ,EAAE,CAAC;IAClB,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBtF;AAID;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5F"}
|
package/dist/core/installer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PackManifest, StackConfig } from '../types/types.js';
|
|
1
|
+
import { PackManifest, PackSlot, StackConfig, TemplateManifest } from '../types/types.js';
|
|
2
2
|
export interface InstallResult {
|
|
3
3
|
installed: string[];
|
|
4
4
|
skipped: string[];
|
|
@@ -9,9 +9,33 @@ interface PackInstallOptions {
|
|
|
9
9
|
config: StackConfig;
|
|
10
10
|
projectRoot: string;
|
|
11
11
|
force: boolean;
|
|
12
|
+
/** Resolved target paths the user explicitly approved overwriting (in addition to `force`). */
|
|
13
|
+
overwrite?: Set<string>;
|
|
12
14
|
/** Directory holding the pack files downloaded from the backend. */
|
|
13
15
|
packDir: string;
|
|
16
|
+
/** Selected slots for this pack, used to scope which file entries install. */
|
|
17
|
+
slots?: PackSlot[];
|
|
18
|
+
}
|
|
19
|
+
export interface FileConflict {
|
|
20
|
+
/** Pack the conflicting file belongs to. */
|
|
21
|
+
packName: string;
|
|
22
|
+
/** The manifest target template, for display. */
|
|
23
|
+
target: string;
|
|
24
|
+
/** Resolved absolute path of the file that already exists. */
|
|
25
|
+
targetPath: string;
|
|
14
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Find every file that `applyPackInstall` would silently skip because its target already exists.
|
|
29
|
+
* Only `create` files can conflict: `skip-if-exists` is an intentional no-op and `merge` edits the
|
|
30
|
+
* existing file in place. Deduplicated by resolved path so the same target is never reported twice.
|
|
31
|
+
*/
|
|
32
|
+
export declare function findInstallConflicts(options: {
|
|
33
|
+
packs: PreparedPack[];
|
|
34
|
+
config: StackConfig;
|
|
35
|
+
projectRoot: string;
|
|
36
|
+
/** Per-pack selected slots, used to scope which files count as conflicts. */
|
|
37
|
+
slotsByPack?: Map<string, PackSlot[]>;
|
|
38
|
+
}): Promise<FileConflict[]>;
|
|
15
39
|
/**
|
|
16
40
|
* Validate one pack's file mappings without writing. Returns the list of blocking errors
|
|
17
41
|
* (missing sources, missing merge markers, unknown strategies). An empty array means the pack
|
|
@@ -20,8 +44,8 @@ interface PackInstallOptions {
|
|
|
20
44
|
export declare function planPackInstall(options: PackInstallOptions): Promise<string[]>;
|
|
21
45
|
/**
|
|
22
46
|
* Apply one pack: copy its files to the project and run every codemod the manifest declares
|
|
23
|
-
* (routes, context, sockets, enums, env, nav, onboarding, scope rewrite).
|
|
24
|
-
* already been validated with `planPackInstall`.
|
|
47
|
+
* (routes, context, sockets, sdk configurations, enums, env, nav, onboarding, scope rewrite).
|
|
48
|
+
* Assumes the pack has already been validated with `planPackInstall`.
|
|
25
49
|
*/
|
|
26
50
|
export declare function applyPackInstall(options: PackInstallOptions): Promise<InstallResult>;
|
|
27
51
|
export interface PreparedPack {
|
|
@@ -51,7 +75,30 @@ export declare function installPlan(options: {
|
|
|
51
75
|
config: StackConfig;
|
|
52
76
|
projectRoot: string;
|
|
53
77
|
force: boolean;
|
|
78
|
+
/** Resolved target paths the user explicitly approved overwriting (in addition to `force`). */
|
|
79
|
+
overwrite?: Set<string>;
|
|
80
|
+
/** Per-pack selected slots, used to scope which file entries install for each pack. */
|
|
81
|
+
slotsByPack?: Map<string, PackSlot[]>;
|
|
54
82
|
}): Promise<InstallPlanResult>;
|
|
55
83
|
export declare function markPackInstalled(config: StackConfig, packName: string, projectRoot: string): Promise<StackConfig>;
|
|
84
|
+
export interface TemplateOverlayResult {
|
|
85
|
+
installed: string[];
|
|
86
|
+
errors: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Apply a template's frontend overlay after every pack has landed. Template
|
|
90
|
+
* files use the `override` strategy to take responsibility for a path a pack
|
|
91
|
+
* shipped (or `create` for files no pack ships, like the landing route), and
|
|
92
|
+
* this pass runs last so the template always wins. It also runs the template's
|
|
93
|
+
* frontend-route and nav codemods so the generated app knows about the new
|
|
94
|
+
* routes (e.g. `/landing`) and sidebar entries.
|
|
95
|
+
*/
|
|
96
|
+
export declare function applyTemplateOverlay(options: {
|
|
97
|
+
manifest: TemplateManifest;
|
|
98
|
+
config: StackConfig;
|
|
99
|
+
projectRoot: string;
|
|
100
|
+
/** Directory holding the template override files downloaded from the backend. */
|
|
101
|
+
templateDir: string;
|
|
102
|
+
}): Promise<TemplateOverlayResult>;
|
|
56
103
|
export {};
|
|
57
104
|
//# sourceMappingURL=installer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/core/installer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"installer.d.ts","sourceRoot":"","sources":["../../src/core/installer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,YAAY,EACZ,QAAQ,EACR,WAAW,EAEX,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAoB3B,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAyKD,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,+FAA+F;IAC/F,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;I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ACpB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,+FAA+F;IAC/F,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,uFAAuF;IACvF,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;CACvC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAgD7B;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,WAAW,CAAC,CAOtB;AAED,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE;IAClD,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAiDjC"}
|
package/dist/core/license.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The marketplace page where a pack is purchased. This is a frontend route, so it uses the web URL
|
|
3
|
+
* (not the API URL). Locally the web app and API live on different ports; in production they share
|
|
4
|
+
* a host and `getWebUrl()` falls back to the API URL.
|
|
5
|
+
*/
|
|
1
6
|
export declare function getPurchaseUrl(packName: string): string;
|
|
2
7
|
//# sourceMappingURL=license.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/core/license.ts"],"names":[],"mappings":"AAEA,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/core/license.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvD"}
|
package/dist/core/login.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/core/login.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,iBAAiB,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAOD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,SAAS,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/core/login.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAc,MAAM,iBAAiB,CAAC;AAM/D,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAOD;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,SAAS,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CA+E1F"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PackCategory, PackListItem, PackSlot } from '../types/types.js';
|
|
2
|
+
/** How a category is chosen in the compose picker. */
|
|
3
|
+
export type ChoiceMode = "single" | "multiple";
|
|
4
|
+
export interface PackChoiceGroup {
|
|
5
|
+
category: PackCategory;
|
|
6
|
+
/** Heading shown above the prompt. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Single-choice categories use a radio select; multiple uses a multiselect. */
|
|
9
|
+
mode: ChoiceMode;
|
|
10
|
+
/** Packs offered in this group, in catalog order. */
|
|
11
|
+
packs: PackListItem[];
|
|
12
|
+
/** Pack name to highlight by default for single-choice groups, or null. */
|
|
13
|
+
preselect: string | null;
|
|
14
|
+
/**
|
|
15
|
+
* App shell this group targets. Layout packs are installed per slot so the
|
|
16
|
+
* frontend and the admin app can pick different shells. Omitted for non-layout
|
|
17
|
+
* groups (starter, features), which install without a slot.
|
|
18
|
+
*/
|
|
19
|
+
slot?: PackSlot;
|
|
20
|
+
}
|
|
21
|
+
/** Fixed order the picker walks the modules in: foundation first, then shell, then add-ons. */
|
|
22
|
+
export declare const CATEGORY_ORDER: PackCategory[];
|
|
23
|
+
export interface BuildPackChoiceGroupsOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the project has an `apps/admin` to install a layout into. When true and
|
|
26
|
+
* layout packs are on offer, a second single-choice "Admin Layout" group is emitted
|
|
27
|
+
* (slot `admin`) alongside the frontend layout group.
|
|
28
|
+
*/
|
|
29
|
+
adminAvailable?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Group the selectable packs into ordered choice groups for the compose picker.
|
|
33
|
+
* Starter and Layout are single-choice; Features is multiselect. Layout defaults
|
|
34
|
+
* to Basic when it is on offer. When `adminAvailable` is set, a second layout group
|
|
35
|
+
* is emitted so the admin app gets its own independent layout pick. Categories with
|
|
36
|
+
* no selectable packs are dropped, so a fully-installed module never shows an empty
|
|
37
|
+
* prompt.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildPackChoiceGroups(selectable: PackListItem[], options?: BuildPackChoiceGroupsOptions): PackChoiceGroup[];
|
|
40
|
+
//# sourceMappingURL=pack-categories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pack-categories.d.ts","sourceRoot":"","sources":["../../src/core/pack-categories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE9E,sDAAsD;AACtD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE/C,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,IAAI,EAAE,UAAU,CAAC;IACjB,qDAAqD;IACrD,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,YAAY,EAAqC,CAAC;AAc/E,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,4BAAiC,GACzC,eAAe,EAAE,CAqBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-clone.d.ts","sourceRoot":"","sources":["../../src/core/post-clone.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post-clone.d.ts","sourceRoot":"","sources":["../../src/core/post-clone.ts"],"names":[],"mappings":"AAwBA,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;AAED,wBAAsB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBnE;AAED,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsCvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack-config.d.ts","sourceRoot":"","sources":["../../src/core/stack-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE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AC,CAMhF;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOtE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,CAY/E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TemplateDownloadResult, TemplateListItem, TemplateManifest } from '../types/types.js';
|
|
2
|
+
/** Fetch every template the marketplace offers, with slot/variant metadata for the compose picker. */
|
|
3
|
+
export declare function fetchTemplateList(): Promise<TemplateListItem[]>;
|
|
4
|
+
/** Fetch a single template's manifest (override files + codemod wiring). */
|
|
5
|
+
export declare function fetchTemplateManifest(templateId: string): Promise<TemplateManifest>;
|
|
6
|
+
/**
|
|
7
|
+
* Download a template's override files into a fresh temp directory. Like pack
|
|
8
|
+
* downloads, paid templates are authorized before a byte is sent, via a CLI
|
|
9
|
+
* token or license key. The caller removes `templateDir` when done.
|
|
10
|
+
*/
|
|
11
|
+
export declare function downloadTemplate(templateId: string, auth?: {
|
|
12
|
+
licenseKey?: string | null;
|
|
13
|
+
token?: string | null;
|
|
14
|
+
}): Promise<TemplateDownloadResult>;
|
|
15
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/core/templates.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAkBpG,sGAAsG;AACtG,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAMrE;AAED,4EAA4E;AAC5E,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgBzF;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAO,GAC/D,OAAO,CAAC,sBAAsB,CAAC,CA4CjC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type CliTrackEvent = "project_create";
|
|
2
|
+
/**
|
|
3
|
+
* Report a CLI lifecycle event to the backend, fire-and-forget. This never throws
|
|
4
|
+
* and never blocks the command on failure: the `create` command is otherwise fully
|
|
5
|
+
* offline, so a telemetry hiccup (no network, server down) must stay invisible. If
|
|
6
|
+
* the user is logged in, the stored token attributes the event to them.
|
|
7
|
+
*/
|
|
8
|
+
export declare function trackCliEvent(event: CliTrackEvent): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracking.d.ts","sourceRoot":"","sources":["../../src/core/tracking.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBvE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PackListItem, TemplateSlot } from '../types/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Resolved variant choices for a template's slots, keyed by family id. Built
|
|
4
|
+
* from the template's slots plus the user's picks (or the slot defaults). The
|
|
5
|
+
* CLI uses this to swap a pack's same-family dependencies for the chosen
|
|
6
|
+
* variant before building the install graph, so e.g. a layout that declares a
|
|
7
|
+
* dependency on `starter-saas-workos` still resolves when the user picks
|
|
8
|
+
* `starter-saas-better-auth`.
|
|
9
|
+
*/
|
|
10
|
+
export interface VariantContext {
|
|
11
|
+
/** family id -> chosen pack name */
|
|
12
|
+
chosen: Map<string, string>;
|
|
13
|
+
/** pack name -> family id (only packs that are members of a swappable family) */
|
|
14
|
+
familyOf: Map<string, string>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Build the variant context from a template's slots and the user's per-family
|
|
18
|
+
* choices. Missing choices fall back to the slot's default variant.
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildVariantContext(slots: TemplateSlot[], choices?: Record<string, string>): VariantContext;
|
|
21
|
+
/**
|
|
22
|
+
* Expand a template into the concrete pack names to install: one chosen variant
|
|
23
|
+
* per slot, plus the template's fixed feature packs. Order is slots first (so
|
|
24
|
+
* starters/layouts land before features in the resolved plan), matching how the
|
|
25
|
+
* compose picker groups them.
|
|
26
|
+
*/
|
|
27
|
+
export declare function expandTemplate(slots: TemplateSlot[], fixedPacks: string[], ctx: VariantContext): string[];
|
|
28
|
+
/** Swap a pack for the chosen variant of its family, or return it unchanged when it is not in a family. */
|
|
29
|
+
export declare function substitutePack(pack: string, ctx: VariantContext): string;
|
|
30
|
+
/**
|
|
31
|
+
* Build a {@link VariantContext} from a pack list and the user's selection, so the plain
|
|
32
|
+
* `compose` flow (which has no template slots) can still remap same-family dependencies to
|
|
33
|
+
* the chosen variant. `familyOf` covers every pack the backend flagged as a family member;
|
|
34
|
+
* `chosen` records the single selected variant per family. A family with no selection, or with
|
|
35
|
+
* more than one selected variant, is left out of `chosen` so its dependency edges stay as
|
|
36
|
+
* authored (the default is pulled when nothing is chosen, and an explicit multi-variant
|
|
37
|
+
* selection is respected rather than silently collapsed).
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildVariantContextFromPacks(packs: PackListItem[], selected: string[]): VariantContext;
|
|
40
|
+
/**
|
|
41
|
+
* Rewrite a pack list so every same-family dependency points at the chosen
|
|
42
|
+
* variant. Returns new items; the input is not mutated. The pack names
|
|
43
|
+
* themselves are left alone (the selected list already uses the chosen
|
|
44
|
+
* variants via `expandTemplate`), only their `dependencies` edges are remapped.
|
|
45
|
+
*/
|
|
46
|
+
export declare function substitutePackList(packs: PackListItem[], ctx: VariantContext): PackListItem[];
|
|
47
|
+
//# sourceMappingURL=variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../src/core/variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,oCAAoC;IACpC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,iFAAiF;IACjF,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAAG,cAAc,CAa/G;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,EAAE,CAGzG;AAED,2GAA2G;AAC3G,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,MAAM,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,CAmBtG;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,GAAG,EAAE,cAAc,GAAG,YAAY,EAAE,CAK7F"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./cli-
|
|
2
|
-
export {
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./cli-B_p3GdS8.js";
|
|
2
|
+
export { t as composeCommand, a as createCommand, o as createProgram, e as ensureInit, r as initCommand, i as loginCommand, n as logoutCommand };
|