@c15t/cli 0.0.1-rc.24 → 1.0.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 (106) hide show
  1. package/README.md +93 -0
  2. package/dist/actions/get-config/config-extraction.d.ts +37 -0
  3. package/dist/actions/get-config/config-extraction.d.ts.map +1 -0
  4. package/dist/actions/get-config/config-validation.d.ts +7 -0
  5. package/dist/actions/get-config/config-validation.d.ts.map +1 -0
  6. package/dist/actions/get-config/constants.d.ts +13 -0
  7. package/dist/actions/get-config/constants.d.ts.map +1 -0
  8. package/dist/actions/get-config/directory-search.d.ts +6 -0
  9. package/dist/actions/get-config/directory-search.d.ts.map +1 -0
  10. package/dist/actions/get-config/jiti-options.d.ts +9 -0
  11. package/dist/actions/get-config/jiti-options.d.ts.map +1 -0
  12. package/dist/actions/get-config.d.ts +13 -0
  13. package/dist/actions/get-config.d.ts.map +1 -0
  14. package/dist/actions/load-config-and-onboard.d.ts +9 -0
  15. package/dist/actions/load-config-and-onboard.d.ts.map +1 -0
  16. package/dist/actions/show-help-menu.d.ts +11 -0
  17. package/dist/actions/show-help-menu.d.ts.map +1 -0
  18. package/dist/commands/generate/actions/handle-existing-file.d.ts +7 -0
  19. package/dist/commands/generate/actions/handle-existing-file.d.ts.map +1 -0
  20. package/dist/commands/generate/actions/handle-new-file.d.ts +7 -0
  21. package/dist/commands/generate/actions/handle-new-file.d.ts.map +1 -0
  22. package/dist/commands/generate/actions/perform-write-action.d.ts +6 -0
  23. package/dist/commands/generate/actions/perform-write-action.d.ts.map +1 -0
  24. package/dist/commands/generate/generators/drizzle.d.ts.map +1 -0
  25. package/dist/{generators → commands/generate/generators}/index.d.ts +2 -1
  26. package/dist/commands/generate/generators/index.d.ts.map +1 -0
  27. package/dist/commands/generate/generators/kysely.d.ts.map +1 -0
  28. package/dist/commands/generate/generators/prisma.d.ts.map +1 -0
  29. package/dist/commands/generate/generators/types.d.ts.map +1 -0
  30. package/dist/commands/generate/schema.d.ts +10 -0
  31. package/dist/commands/generate/schema.d.ts.map +1 -0
  32. package/dist/commands/generate/setup.d.ts +13 -0
  33. package/dist/commands/generate/setup.d.ts.map +1 -0
  34. package/dist/commands/generate/write.d.ts +8 -0
  35. package/dist/commands/generate/write.d.ts.map +1 -0
  36. package/dist/commands/generate.d.ts +5 -3
  37. package/dist/commands/generate.d.ts.map +1 -1
  38. package/dist/commands/migrate/execute.d.ts +7 -0
  39. package/dist/commands/migrate/execute.d.ts.map +1 -0
  40. package/dist/commands/migrate/plan.d.ts +12 -0
  41. package/dist/commands/migrate/plan.d.ts.map +1 -0
  42. package/dist/commands/migrate/setup.d.ts +12 -0
  43. package/dist/commands/migrate/setup.d.ts.map +1 -0
  44. package/dist/commands/migrate.d.ts +2 -3
  45. package/dist/commands/migrate.d.ts.map +1 -1
  46. package/dist/components/intro.d.ts +9 -0
  47. package/dist/components/intro.d.ts.map +1 -0
  48. package/dist/context/config-management.d.ts +20 -0
  49. package/dist/context/config-management.d.ts.map +1 -0
  50. package/dist/context/creator.d.ts +11 -0
  51. package/dist/context/creator.d.ts.map +1 -0
  52. package/dist/context/error-handlers.d.ts +18 -0
  53. package/dist/context/error-handlers.d.ts.map +1 -0
  54. package/dist/context/file-system.d.ts +11 -0
  55. package/dist/context/file-system.d.ts.map +1 -0
  56. package/dist/context/parser.d.ts +11 -0
  57. package/dist/context/parser.d.ts.map +1 -0
  58. package/dist/context/types.d.ts +54 -0
  59. package/dist/context/types.d.ts.map +1 -0
  60. package/dist/context/user-interaction.d.ts +14 -0
  61. package/dist/context/user-interaction.d.ts.map +1 -0
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.mjs +1883 -746
  65. package/dist/onboarding/dependencies.d.ts +20 -0
  66. package/dist/onboarding/dependencies.d.ts.map +1 -0
  67. package/dist/onboarding/detection.d.ts +33 -0
  68. package/dist/onboarding/detection.d.ts.map +1 -0
  69. package/dist/onboarding/index.d.ts +11 -0
  70. package/dist/onboarding/index.d.ts.map +1 -0
  71. package/dist/onboarding/storage-modes/c15t-mode.d.ts +22 -0
  72. package/dist/onboarding/storage-modes/c15t-mode.d.ts.map +1 -0
  73. package/dist/onboarding/storage-modes/custom-mode.d.ts +18 -0
  74. package/dist/onboarding/storage-modes/custom-mode.d.ts.map +1 -0
  75. package/dist/onboarding/storage-modes/index.d.ts +5 -0
  76. package/dist/onboarding/storage-modes/index.d.ts.map +1 -0
  77. package/dist/onboarding/storage-modes/offline-mode.d.ts +19 -0
  78. package/dist/onboarding/storage-modes/offline-mode.d.ts.map +1 -0
  79. package/dist/onboarding/storage-modes/self-hosted-mode.d.ts +22 -0
  80. package/dist/onboarding/storage-modes/self-hosted-mode.d.ts.map +1 -0
  81. package/dist/onboarding/templates.d.ts +30 -0
  82. package/dist/onboarding/templates.d.ts.map +1 -0
  83. package/dist/onboarding.d.ts +15 -0
  84. package/dist/onboarding.d.ts.map +1 -0
  85. package/dist/utils/logger.d.ts +29 -2
  86. package/dist/utils/logger.d.ts.map +1 -1
  87. package/dist/utils/telemetry.d.ts +140 -0
  88. package/dist/utils/telemetry.d.ts.map +1 -0
  89. package/package.json +13 -11
  90. package/dist/commands/secret.d.ts +0 -3
  91. package/dist/commands/secret.d.ts.map +0 -1
  92. package/dist/generators/drizzle.d.ts.map +0 -1
  93. package/dist/generators/index.d.ts.map +0 -1
  94. package/dist/generators/kysely.d.ts.map +0 -1
  95. package/dist/generators/prisma.d.ts.map +0 -1
  96. package/dist/generators/types.d.ts.map +0 -1
  97. package/dist/utils/add-svelte-kit-env-modules.d.ts +0 -4
  98. package/dist/utils/add-svelte-kit-env-modules.d.ts.map +0 -1
  99. package/dist/utils/get-config.d.ts +0 -11
  100. package/dist/utils/get-config.d.ts.map +0 -1
  101. package/dist/utils/get-package-info.d.ts +0 -2
  102. package/dist/utils/get-package-info.d.ts.map +0 -1
  103. /package/dist/{generators → commands/generate/generators}/drizzle.d.ts +0 -0
  104. /package/dist/{generators → commands/generate/generators}/kysely.d.ts +0 -0
  105. /package/dist/{generators → commands/generate/generators}/prisma.d.ts +0 -0
  106. /package/dist/{generators → commands/generate/generators}/types.d.ts +0 -0
package/README.md ADDED
@@ -0,0 +1,93 @@
1
+ # c15t CLI
2
+
3
+ The Command Line Interface for managing c15t consent management projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @c15t/cli
9
+ ```
10
+
11
+ Or using yarn:
12
+
13
+ ```bash
14
+ yarn add @c15t/cli
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ The CLI can be invoked directly if installed globally:
20
+
21
+ ```bash
22
+ c15t [command] [options]
23
+ ```
24
+
25
+ Or with npx:
26
+
27
+ ```bash
28
+ npx @c15t/cli [command] [options]
29
+ ```
30
+
31
+ ## Commands
32
+
33
+ - `generate` - Generate schema/code based on your c15t config
34
+ - `migrate` - Run database migrations based on your c15t config
35
+ - `github` - Open the c15t GitHub repository
36
+ - `docs` - Open the c15t documentation in your browser
37
+
38
+ ## Options
39
+
40
+ - `--help, -h` - Show the help menu
41
+ - `--version, -v` - Show the CLI version
42
+ - `--logger` - Set log level (fatal, error, warn, info, debug)
43
+ - `--config` - Specify path to configuration file
44
+ - `-y` - Skip confirmation prompts (use with caution)
45
+ - `--no-telemetry` - Disable telemetry data collection
46
+
47
+ ## Telemetry
48
+
49
+ The c15t CLI collects anonymous telemetry data to help us understand how the CLI is being used and improve the tool. This data is completely anonymous and does not contain any personal information.
50
+
51
+ ### What we collect
52
+
53
+ We collect structured events with descriptive names following a `category.action` pattern such as:
54
+
55
+ - **CLI lifecycle events**: `cli.invoked`, `cli.completed`, `cli.exited`
56
+ - **Command events**: `command.executed`, `command.succeeded`, `command.failed`, `command.unknown`
57
+ - **UI events**: `ui.menu.opened`, `ui.menu.exited`
58
+ - **Configuration events**: `config.loaded`, `config.error`
59
+ - **Help and version events**: `help.displayed`, `version.displayed`
60
+ - **Onboarding events**: `onboarding.started`, `onboarding.completed`
61
+ - **Error events**: `error.occurred`
62
+
63
+ Each event includes relevant contextual information, but never includes sensitive data such as:
64
+ - Personal information
65
+ - Configuration file contents
66
+ - File paths
67
+ - Project-specific data
68
+
69
+ ### Disabling Telemetry
70
+
71
+ You can disable telemetry in any of the following ways:
72
+
73
+ 1. Use the `--no-telemetry` flag when running a command:
74
+ ```bash
75
+ c15t generate --no-telemetry
76
+ ```
77
+
78
+ 2. Set the environment variable `C15T_TELEMETRY_DISABLED`:
79
+ ```bash
80
+ # In your shell
81
+ export C15T_TELEMETRY_DISABLED=1
82
+
83
+ # Or for a single command
84
+ C15T_TELEMETRY_DISABLED=1 c15t generate
85
+ ```
86
+
87
+ ## Documentation
88
+
89
+ For more detailed documentation, visit [https://c15t.com](https://c15t.com).
90
+
91
+ ## License
92
+
93
+ MIT
@@ -0,0 +1,37 @@
1
+ import type { C15TOptions } from '@c15t/backend';
2
+ import type { ConsentManagerOptions } from '@c15t/react';
3
+ type MaybeC15TOptions = Partial<C15TOptions>;
4
+ type MaybeClientOptions = Partial<ConsentManagerOptions>;
5
+ type MaybeC15TFunc = (...args: unknown[]) => unknown;
6
+ export type LoadedConfig = {
7
+ c15t?: MaybeC15TOptions | MaybeC15TFunc | {
8
+ options?: MaybeC15TOptions;
9
+ };
10
+ default?: MaybeC15TOptions | MaybeC15TFunc | {
11
+ options?: MaybeC15TOptions;
12
+ };
13
+ c15tInstance?: MaybeC15TOptions | MaybeC15TFunc | {
14
+ options?: MaybeC15TOptions;
15
+ };
16
+ c15tConfig?: MaybeClientOptions;
17
+ c15tOptions?: MaybeClientOptions;
18
+ consent?: MaybeC15TOptions | MaybeC15TFunc | {
19
+ options?: MaybeC15TOptions;
20
+ };
21
+ instance?: {
22
+ options?: MaybeC15TOptions;
23
+ };
24
+ config?: {
25
+ options?: MaybeC15TOptions;
26
+ };
27
+ [key: string]: unknown;
28
+ };
29
+ export declare function isC15TOptions(obj: unknown): obj is C15TOptions;
30
+ export declare function isClientOptions(obj: unknown): obj is ConsentManagerOptions;
31
+ /**
32
+ * Extract c15t options from a loaded config object.
33
+ * Looks for various common export names for the c15t instance or options.
34
+ */
35
+ export declare function extractOptionsFromConfig(config: LoadedConfig): C15TOptions | ConsentManagerOptions | null;
36
+ export {};
37
+ //# sourceMappingURL=config-extraction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-extraction.d.ts","sourceRoot":"","sources":["../../../src/actions/get-config/config-extraction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,KAAK,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAC7C,KAAK,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACzD,KAAK,aAAa,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAErD,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IACzE,OAAO,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAC5E,YAAY,CAAC,EACV,gBAAgB,GAChB,aAAa,GACb;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,OAAO,CAAC,EAAE,gBAAgB,GAAG,aAAa,GAAG;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAC5E,QAAQ,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAC1C,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,gBAAgB,CAAA;KAAE,CAAC;IAGxC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB,CAAC;AAGF,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAE9D;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB,CAM1E;AAkBD;;;GAGG;AACH,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,YAAY,GAClB,WAAW,GAAG,qBAAqB,GAAG,IAAI,CAqH5C"}
@@ -0,0 +1,7 @@
1
+ import type { C15TOptions } from '@c15t/backend';
2
+ import type { ConsentManagerOptions } from '@c15t/react';
3
+ /**
4
+ * Validate the extracted config object (either client or backend).
5
+ */
6
+ export declare function validateConfig(config: C15TOptions | ConsentManagerOptions | null): boolean;
7
+ //# sourceMappingURL=config-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../../../src/actions/get-config/config-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIzD;;GAEG;AACH,wBAAgB,cAAc,CAC7B,MAAM,EAAE,WAAW,GAAG,qBAAqB,GAAG,IAAI,GAChD,OAAO,CA8BT"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * List of possible config file names and locations to search.
3
+ * Priority order:
4
+ * 1. c15t.config.ts - Primary frontend configuration (recommended)
5
+ * 2. c15t.backend.ts - Optional backend configuration (recommended)
6
+ * 3. Legacy/alternative names for backward compatibility
7
+ */
8
+ export declare const configFileNames: string[];
9
+ export declare const extensions: string[];
10
+ export declare let possiblePaths: string[];
11
+ export declare const directories: string[];
12
+ export declare const monorepoSubdirs: string[];
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/actions/get-config/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,UAc3B,CAAC;AAEF,eAAO,MAAM,UAAU,UAiBtB,CAAC;AAGF,eAAO,IAAI,aAAa,UAEvB,CAAC;AAGF,eAAO,MAAM,WAAW,UASvB,CAAC;AAQF,eAAO,MAAM,eAAe,UAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Find all directories that match the glob pattern(s) relative to the CWD.
3
+ * Only supports simple prefix* patterns (e.g., 'packages/*').
4
+ */
5
+ export declare function findDirectories(cwd: string, patterns: string[]): string[];
6
+ //# sourceMappingURL=directory-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"directory-search.d.ts","sourceRoot":"","sources":["../../../src/actions/get-config/directory-search.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAuCzE"}
@@ -0,0 +1,9 @@
1
+ import type { CliContext } from '../../context/types';
2
+ /**
3
+ * Get Jiti options for transpiling TypeScript/JSX
4
+ */
5
+ export declare const jitiOptions: (context: CliContext, cwd: string) => {
6
+ extensions: string[];
7
+ alias: Record<string, string>;
8
+ };
9
+ //# sourceMappingURL=jiti-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jiti-options.d.ts","sourceRoot":"","sources":["../../../src/actions/get-config/jiti-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,SAAS,UAAU,EAAE,KAAK,MAAM;;;CAM3D,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { C15TOptions } from '@c15t/backend';
2
+ import type { ConsentManagerOptions } from '@c15t/react';
3
+ import type { CliContext } from '../context/types';
4
+ /**
5
+ * Gets the configuration for the CLI.
6
+ * @param contextOrOptions Either a CliContext object or a simplified object with just cwd and configPath
7
+ * @returns The loaded configuration or null if it could not be loaded
8
+ */
9
+ export declare function getConfig(contextOrOptions: CliContext | {
10
+ cwd: string;
11
+ configPath?: string;
12
+ }): Promise<C15TOptions | ConsentManagerOptions | null>;
13
+ //# sourceMappingURL=get-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-config.d.ts","sourceRoot":"","sources":["../../src/actions/get-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAUnD;;;;GAIG;AACH,wBAAsB,SAAS,CAC9B,gBAAgB,EAAE,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACjE,OAAO,CAAC,WAAW,GAAG,qBAAqB,GAAG,IAAI,CAAC,CA6IrD"}
@@ -0,0 +1,9 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import type { CliContext } from '../context/types';
3
+ /**
4
+ * Loads the c15t configuration, triggering onboarding if necessary.
5
+ * Exits the process if loading fails or after onboarding is triggered.
6
+ * Returns the loaded config if found.
7
+ */
8
+ export declare function loadConfigAndOnboard(context: CliContext): Promise<C15TOptions<C15TPlugin[]>>;
9
+ //# sourceMappingURL=load-config-and-onboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"load-config-and-onboard.d.ts","sourceRoot":"","sources":["../../src/actions/load-config-and-onboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CA4BpC"}
@@ -0,0 +1,11 @@
1
+ import type { CliCommand, CliContext, CliFlag } from '../context/types';
2
+ /**
3
+ * Displays the CLI help menu, generating commands and options dynamically.
4
+ *
5
+ * @param context The CLI context
6
+ * @param version The current CLI version.
7
+ * @param commands The array of available CLI commands.
8
+ * @param flags The array of available global CLI flags.
9
+ */
10
+ export declare function showHelpMenu(context: CliContext, version: string, commands: CliCommand[], flags: CliFlag[]): void;
11
+ //# sourceMappingURL=show-help-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"show-help-menu.d.ts","sourceRoot":"","sources":["../../src/actions/show-help-menu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,UAAU,EAAE,EACtB,KAAK,EAAE,OAAO,EAAE,GACd,IAAI,CAgCN"}
@@ -0,0 +1,7 @@
1
+ import type { CliContext } from '../../../context/types';
2
+ import type { SchemaResult } from '../schema';
3
+ /**
4
+ * Handles the logic for confirming and overwriting/appending to an existing schema file.
5
+ */
6
+ export declare function handleExistingFile(context: CliContext, schema: SchemaResult, filePath: string): Promise<void>;
7
+ //# sourceMappingURL=handle-existing-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-existing-file.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/actions/handle-existing-file.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C;;GAEG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA6Ef"}
@@ -0,0 +1,7 @@
1
+ import type { CliContext } from '../../../context/types';
2
+ import type { SchemaResult } from '../schema';
3
+ /**
4
+ * Handles the logic for confirming and writing a new schema file.
5
+ */
6
+ export declare function handleNewFile(context: CliContext, schema: SchemaResult, filePath: string): Promise<void>;
7
+ //# sourceMappingURL=handle-new-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handle-new-file.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/actions/handle-new-file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAG9C;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,YAAY,EACpB,QAAQ,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAiCf"}
@@ -0,0 +1,6 @@
1
+ import type { CliContext } from '../../../context/types';
2
+ /**
3
+ * Helper to perform the actual file write operation
4
+ */
5
+ export declare function performWriteAction(context: CliContext, filePath: string, code: string, actionDescription: string, successMessage: string): Promise<void>;
6
+ //# sourceMappingURL=perform-write-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"perform-write-action.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/actions/perform-write-action.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,UAAU,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAoBf"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drizzle.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/generators/drizzle.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,UAM7C;AAED,eAAO,MAAM,qBAAqB,EAAE,eA6KnC,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import type { C15TOptions } from '@c15t/backend';
2
2
  import type { Adapter } from '@c15t/backend/pkgs/db-adapters';
3
+ import type { CliContext } from '../../../context/types';
3
4
  export declare const adapters: {
4
5
  prisma: import("./types").SchemaGenerator;
5
6
  drizzle: import("./types").SchemaGenerator;
6
7
  kysely: import("./types").SchemaGenerator;
7
8
  };
8
- export declare const getGenerator: (opts: {
9
+ export declare const getGenerator: (context: CliContext, opts: {
9
10
  adapter: Adapter;
10
11
  file?: string;
11
12
  options: C15TOptions;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/generators/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAKlD,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC;AAEF,eAAO,MAAM,YAAY,GACxB,SAAS,UAAU,EACnB,MAAM;IACL,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,WAAW,CAAC;CACrB;;;;;EAYD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kysely.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/generators/kysely.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAoN/C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,EAAE,eAgDhC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/generators/prisma.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO/C,eAAO,MAAM,oBAAoB,EAAE,eAuNlC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/generators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,WAAW,CAAC;CACrB,KAAK,OAAO,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import type { Adapter } from '@c15t/backend/pkgs/db-adapters';
3
+ import type { CliContext } from '../../context/types';
4
+ import { getGenerator } from './generators';
5
+ export type SchemaResult = Awaited<ReturnType<typeof getGenerator>>;
6
+ /**
7
+ * Calls the schema generator and handles associated errors.
8
+ */
9
+ export declare function generateSchema(context: CliContext, adapter: Adapter, config: C15TOptions<C15TPlugin[]>): Promise<SchemaResult | null>;
10
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/commands/generate/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC;AAEpE;;GAEG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,GAC/B,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CA2B9B"}
@@ -0,0 +1,13 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import { type Adapter } from '@c15t/backend/pkgs/db-adapters';
3
+ import type { ConsentManagerOptions } from '@c15t/react';
4
+ import type { CliContext } from '../../context/types';
5
+ /**
6
+ * Handles config loading, onboarding, and adapter setup using the context.
7
+ * Returns the loaded config (if any) and adapter.
8
+ */
9
+ export declare function setupGenerateEnvironment(context: CliContext): Promise<{
10
+ config: C15TOptions<C15TPlugin[]> | ConsentManagerOptions | null;
11
+ adapter: Adapter;
12
+ }>;
13
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/commands/generate/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;GAGG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;IAC5E,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,qBAAqB,GAAG,IAAI,CAAC;IACjE,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC,CAyED"}
@@ -0,0 +1,8 @@
1
+ import type { CliContext } from '../../context/types';
2
+ import type { SchemaResult } from './schema';
3
+ /**
4
+ * Handles confirming and writing the generated schema to a file.
5
+ * Acts as a decision tree, delegating to action handlers.
6
+ */
7
+ export declare function writeSchemaFile(context: CliContext, schema: SchemaResult): Promise<void>;
8
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../../src/commands/generate/write.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;GAGG;AACH,wBAAsB,eAAe,CACpC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
@@ -1,4 +1,6 @@
1
- import { Command } from 'commander';
2
- export declare function generateAction(opts: unknown): Promise<void>;
3
- export declare const generate: Command;
1
+ import type { CliContext } from '../context/types';
2
+ /**
3
+ * Generate command - loads config, allows updating via onboarding, then generates artifacts.
4
+ */
5
+ export declare function generate(context: CliContext): Promise<undefined>;
4
6
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAsB,cAAc,CAAC,IAAI,EAAE,OAAO,iBAmHjD;AAED,eAAO,MAAM,QAAQ,SAYG,CAAC"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAUlD;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,UAAU,sBA2HjD"}
@@ -0,0 +1,7 @@
1
+ import type { MigrationResult } from '@c15t/backend/pkgs/migrations';
2
+ import type { CliContext } from '../../context/types';
3
+ /**
4
+ * Executes the provided runMigrations function with spinner and error handling.
5
+ */
6
+ export declare function executeMigrations(context: CliContext, runMigrationsFn: MigrationResult['runMigrations']): Promise<void>;
7
+ //# sourceMappingURL=execute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/execute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;GAEG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,UAAU,EACnB,eAAe,EAAE,eAAe,CAAC,eAAe,CAAC,GAC/C,OAAO,CAAC,IAAI,CAAC,CA+Bf"}
@@ -0,0 +1,12 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import { type MigrationResult } from '@c15t/backend/pkgs/migrations';
3
+ import type { CliContext } from '../../context/types';
4
+ /**
5
+ * Fetches migrations, displays the plan, and asks for confirmation.
6
+ * Returns whether to proceed and the function to run migrations.
7
+ */
8
+ export declare function planMigrations(context: CliContext, config: C15TOptions<C15TPlugin[]>, skipConfirmation: boolean): Promise<{
9
+ shouldRun: boolean;
10
+ runMigrationsFn: MigrationResult['runMigrations'] | null;
11
+ }>;
12
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACN,KAAK,eAAe,EAEpB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;GAGG;AACH,wBAAsB,cAAc,CACnC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,EACjC,gBAAgB,EAAE,OAAO,GACvB,OAAO,CAAC;IACV,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;CACzD,CAAC,CA2ED"}
@@ -0,0 +1,12 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import { type Adapter } from '@c15t/backend/pkgs/db-adapters';
3
+ import type { CliContext } from '../../context/types';
4
+ /**
5
+ * Loads config, checks for onboarding, initializes and validates the DB adapter using context.
6
+ * Returns the config and adapter if successful, otherwise handles exit/errors.
7
+ */
8
+ export declare function setupEnvironment(context: CliContext): Promise<{
9
+ config: C15TOptions<C15TPlugin[]>;
10
+ adapter: Adapter;
11
+ }>;
12
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/commands/migrate/setup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,gCAAgC,CAAC;AAE1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAgClD;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;IACpE,MAAM,EAAE,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC,CA8BD"}
@@ -1,4 +1,3 @@
1
- import { Command } from 'commander';
2
- export declare function migrateAction(opts: unknown): Promise<void>;
3
- export declare const migrate: Command;
1
+ import type { CliContext } from '../context/types';
2
+ export declare function migrate(context: CliContext): Promise<void>;
4
3
  //# sourceMappingURL=migrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,iBAgGhD;AAED,eAAO,MAAM,OAAO,SAeG,CAAC"}
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAMlD,wBAAsB,OAAO,CAAC,OAAO,EAAE,UAAU,iBAwDhD"}
@@ -0,0 +1,9 @@
1
+ import type { CliContext } from '../context/types';
2
+ /**
3
+ * Displays the CLI introduction sequence, including
4
+ * welcome message, figlet art, version, and docs link.
5
+ * @param context - The CLI context
6
+ * @param version - The CLI version string.
7
+ */
8
+ export declare function displayIntro(context: CliContext, version: string): Promise<void>;
9
+ //# sourceMappingURL=intro.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intro.d.ts","sourceRoot":"","sources":["../../src/components/intro.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;GAKG;AACH,wBAAsB,YAAY,CACjC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAwFf"}
@@ -0,0 +1,20 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import type { CliContext } from './types';
3
+ /**
4
+ * Creates configuration management utilities for the CLI context
5
+ */
6
+ export declare function createConfigManagement(context: CliContext): {
7
+ /**
8
+ * Load configuration, returns null if not found
9
+ */
10
+ loadConfig: () => Promise<C15TOptions<C15TPlugin[]> | null>;
11
+ /**
12
+ * Load configuration and throw an error if not found
13
+ */
14
+ requireConfig: () => Promise<C15TOptions<C15TPlugin[]>>;
15
+ /**
16
+ * Extract path aliases from tsconfig.json or jsconfig.json
17
+ */
18
+ getPathAliases: (configDir?: string) => Record<string, string> | null;
19
+ };
20
+ //# sourceMappingURL=config-management.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-management.d.ts","sourceRoot":"","sources":["../../src/context/config-management.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,UAAU;IAIxD;;OAEG;sBACmB,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC;IAoB/D;;OAEG;yBACsB,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;IAa3D;;OAEG;iCAC0B,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;EA2BpE"}
@@ -0,0 +1,11 @@
1
+ import type { CliCommand, CliContext } from './types';
2
+ /**
3
+ * Parses arguments, creates the logger, and returns the application context.
4
+ *
5
+ * @param rawArgs - The raw command line arguments (process.argv.slice(2)).
6
+ * @param cwd - The current working directory (process.cwd()).
7
+ * @param commands - The list of available CLI commands.
8
+ * @returns The CLI context object.
9
+ */
10
+ export declare function createCliContext(rawArgs: string[], cwd: string, commands: CliCommand[]): CliContext;
11
+ //# sourceMappingURL=creator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"creator.d.ts","sourceRoot":"","sources":["../../src/context/creator.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGtD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EAAE,EACjB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,UAAU,EAAE,GACpB,UAAU,CAwEZ"}
@@ -0,0 +1,18 @@
1
+ import type { CliContext } from './types';
2
+ /**
3
+ * Creates error handling utilities for the CLI context
4
+ */
5
+ export declare function createErrorHandlers(context: CliContext): {
6
+ /**
7
+ * Handles errors in a consistent way across the CLI
8
+ * @param error The error that occurred
9
+ * @param message A message describing the error context
10
+ */
11
+ handleError: (error: unknown, message: string) => never;
12
+ /**
13
+ * Handles user cancellation in a consistent way
14
+ * @param message Optional message to display when cancelling
15
+ */
16
+ handleCancel: (message?: string) => never;
17
+ };
18
+ //# sourceMappingURL=error-handlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-handlers.d.ts","sourceRoot":"","sources":["../../src/context/error-handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,UAAU;IAIrD;;;;OAIG;yBACkB,OAAO,WAAW,MAAM,KAAG,KAAK;IAgBrD;;;OAGG;wCAC+C,KAAK;EAQxD"}
@@ -0,0 +1,11 @@
1
+ import type { CliContext, PackageInfo } from './types';
2
+ /**
3
+ * Creates file system utilities for the CLI context
4
+ */
5
+ export declare function createFileSystem(context: CliContext): {
6
+ /**
7
+ * Reads and returns the content of the package.json in the current directory
8
+ */
9
+ getPackageInfo: () => PackageInfo;
10
+ };
11
+ //# sourceMappingURL=file-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system.d.ts","sourceRoot":"","sources":["../../src/context/file-system.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEvD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,UAAU;IAIlD;;OAEG;0BACiB,WAAW;EA2BhC"}
@@ -0,0 +1,11 @@
1
+ import type { CliCommand, CliFlag, ParsedArgs } from './types';
2
+ export declare const globalFlags: CliFlag[];
3
+ /**
4
+ * Parses raw command line arguments into structured flags, command name, and command args.
5
+ *
6
+ * @param rawArgs - Raw arguments from process.argv.slice(2).
7
+ * @param commands - The list of available CLI commands (needed to identify command name).
8
+ * @returns A ParsedArgs object.
9
+ */
10
+ export declare function parseCliArgs(rawArgs: string[], commands: CliCommand[]): ParsedArgs;
11
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/context/parser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/D,eAAO,MAAM,WAAW,EAAE,OAAO,EAqChC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC3B,OAAO,EAAE,MAAM,EAAE,EACjB,QAAQ,EAAE,UAAU,EAAE,GACpB,UAAU,CAoEZ"}
@@ -0,0 +1,54 @@
1
+ import type { C15TOptions, C15TPlugin } from '@c15t/backend';
2
+ import type { Logger } from '@c15t/backend/pkgs/logger';
3
+ import type { CliExtensions } from '../utils/logger';
4
+ import type { Telemetry } from '../utils/telemetry';
5
+ export type { Logger };
6
+ export interface CliCommand {
7
+ name: string;
8
+ label: string;
9
+ hint: string;
10
+ description: string;
11
+ action: (context: CliContext) => Promise<void>;
12
+ }
13
+ export type FlagType = 'boolean' | 'string' | 'special';
14
+ export interface CliFlag {
15
+ names: string[];
16
+ description: string;
17
+ type: FlagType;
18
+ expectsValue: boolean;
19
+ }
20
+ export interface ParsedArgs {
21
+ commandName: string | undefined;
22
+ commandArgs: string[];
23
+ parsedFlags: Record<string, string | boolean | undefined>;
24
+ }
25
+ export interface PackageInfo {
26
+ name: string;
27
+ version: string;
28
+ [key: string]: unknown;
29
+ }
30
+ export interface ErrorHandlers {
31
+ handleError: (error: unknown, message: string) => never;
32
+ handleCancel: (message?: string) => never;
33
+ }
34
+ export interface ConfigManagement {
35
+ loadConfig: () => Promise<C15TOptions<C15TPlugin[]> | null>;
36
+ requireConfig: () => Promise<C15TOptions<C15TPlugin[]>>;
37
+ getPathAliases: (configPath?: string) => Record<string, string> | null;
38
+ }
39
+ export interface FileSystemUtils {
40
+ getPackageInfo: () => PackageInfo;
41
+ }
42
+ export interface CliContext {
43
+ logger: Logger & CliExtensions;
44
+ flags: ParsedArgs['parsedFlags'];
45
+ commandName: string | undefined;
46
+ commandArgs: string[];
47
+ cwd: string;
48
+ error: ErrorHandlers;
49
+ config: ConfigManagement;
50
+ fs: FileSystemUtils;
51
+ telemetry: Telemetry;
52
+ confirm: (message: string, initialValue: boolean) => Promise<boolean>;
53
+ }
54
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/context/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,YAAY,EAAE,MAAM,EAAE,CAAC;AAGvB,MAAM,WAAW,UAAU;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAGD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;CACtB;AAGD,MAAM,WAAW,UAAU;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC1D;AAGD,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACvB;AAGD,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC;IACxD,YAAY,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC;CAC1C;AAGD,MAAM,WAAW,gBAAgB;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5D,aAAa,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACxD,cAAc,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CACvE;AAGD,MAAM,WAAW,eAAe;IAC/B,cAAc,EAAE,MAAM,WAAW,CAAC;CAClC;AAGD,MAAM,WAAW,UAAU;IAC1B,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACjC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,aAAa,CAAC;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,EAAE,EAAE,eAAe,CAAC;IAGpB,SAAS,EAAE,SAAS,CAAC;IAGrB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACtE"}