@c15t/cli 1.8.3 → 2.0.0-rc.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 (187) hide show
  1. package/dist/760.mjs +1720 -0
  2. package/dist/__tests__/auth/config-store.test.d.ts +2 -0
  3. package/dist/__tests__/auth/config-store.test.d.ts.map +1 -0
  4. package/dist/__tests__/constants.test.d.ts +2 -0
  5. package/dist/__tests__/constants.test.d.ts.map +1 -0
  6. package/dist/__tests__/detection/layout.test.d.ts +2 -0
  7. package/dist/__tests__/detection/layout.test.d.ts.map +1 -0
  8. package/dist/__tests__/mocks/prompts.d.ts +25 -0
  9. package/dist/__tests__/mocks/prompts.d.ts.map +1 -0
  10. package/dist/__tests__/utils/validation.test.d.ts +2 -0
  11. package/dist/__tests__/utils/validation.test.d.ts.map +1 -0
  12. package/dist/auth/config-store.d.ts +63 -0
  13. package/dist/auth/config-store.d.ts.map +1 -0
  14. package/dist/auth/device-flow.d.ts +41 -0
  15. package/dist/auth/device-flow.d.ts.map +1 -0
  16. package/dist/auth/index.d.ts +7 -0
  17. package/dist/auth/index.d.ts.map +1 -0
  18. package/dist/auth/types.d.ts +90 -0
  19. package/dist/auth/types.d.ts.map +1 -0
  20. package/dist/commands/auth/index.d.ts +21 -0
  21. package/dist/commands/auth/index.d.ts.map +1 -0
  22. package/dist/commands/generate/index.d.ts +23 -2
  23. package/dist/commands/generate/index.d.ts.map +1 -1
  24. package/dist/commands/generate/options/c15t-mode.d.ts.map +1 -1
  25. package/dist/commands/generate/options/custom-mode.d.ts +3 -1
  26. package/dist/commands/generate/options/custom-mode.d.ts.map +1 -1
  27. package/dist/commands/generate/options/offline-mode.d.ts.map +1 -1
  28. package/dist/commands/generate/options/self-hosted-mode.d.ts.map +1 -1
  29. package/dist/commands/generate/options/shared/backend-options.d.ts +26 -0
  30. package/dist/commands/generate/options/shared/backend-options.d.ts.map +1 -0
  31. package/dist/commands/generate/options/shared/dev-tools.d.ts +9 -0
  32. package/dist/commands/generate/options/shared/dev-tools.d.ts.map +1 -0
  33. package/dist/commands/generate/options/shared/frontend-ui-options.d.ts +44 -0
  34. package/dist/commands/generate/options/shared/frontend-ui-options.d.ts.map +1 -0
  35. package/dist/commands/generate/options/shared/index.d.ts +9 -0
  36. package/dist/commands/generate/options/shared/index.d.ts.map +1 -0
  37. package/dist/commands/generate/options/shared/ssr.d.ts +21 -0
  38. package/dist/commands/generate/options/shared/ssr.d.ts.map +1 -0
  39. package/dist/commands/generate/options/utils/generate-files.d.ts +10 -2
  40. package/dist/commands/generate/options/utils/generate-files.d.ts.map +1 -1
  41. package/dist/commands/generate/preflight.d.ts +31 -0
  42. package/dist/commands/generate/preflight.d.ts.map +1 -0
  43. package/dist/commands/generate/prompts/expanded-theme.d.ts +46 -0
  44. package/dist/commands/generate/prompts/expanded-theme.d.ts.map +1 -0
  45. package/dist/commands/generate/prompts/index.d.ts +10 -0
  46. package/dist/commands/generate/prompts/index.d.ts.map +1 -0
  47. package/dist/commands/generate/prompts/instance.d.ts +33 -0
  48. package/dist/commands/generate/prompts/instance.d.ts.map +1 -0
  49. package/dist/commands/generate/prompts/mode-select.d.ts +42 -0
  50. package/dist/commands/generate/prompts/mode-select.d.ts.map +1 -0
  51. package/dist/commands/generate/prompts/scripts.d.ts +66 -0
  52. package/dist/commands/generate/prompts/scripts.d.ts.map +1 -0
  53. package/dist/commands/generate/prompts/theme.d.ts +46 -0
  54. package/dist/commands/generate/prompts/theme.d.ts.map +1 -0
  55. package/dist/commands/generate/prompts/ui-style.d.ts +36 -0
  56. package/dist/commands/generate/prompts/ui-style.d.ts.map +1 -0
  57. package/dist/commands/generate/summary.d.ts +37 -0
  58. package/dist/commands/generate/summary.d.ts.map +1 -0
  59. package/dist/commands/generate/templates/config.d.ts +7 -6
  60. package/dist/commands/generate/templates/config.d.ts.map +1 -1
  61. package/dist/commands/generate/templates/css.d.ts +12 -0
  62. package/dist/commands/generate/templates/css.d.ts.map +1 -0
  63. package/dist/commands/generate/templates/index.d.ts +1 -1
  64. package/dist/commands/generate/templates/index.d.ts.map +1 -1
  65. package/dist/commands/generate/templates/layout.d.ts +7 -0
  66. package/dist/commands/generate/templates/layout.d.ts.map +1 -1
  67. package/dist/commands/generate/templates/next/app/layout.d.ts +9 -2
  68. package/dist/commands/generate/templates/next/app/layout.d.ts.map +1 -1
  69. package/dist/commands/generate/templates/next/index.d.ts +7 -0
  70. package/dist/commands/generate/templates/next/index.d.ts.map +1 -1
  71. package/dist/commands/generate/templates/next/pages/layout.d.ts +3 -1
  72. package/dist/commands/generate/templates/next/pages/layout.d.ts.map +1 -1
  73. package/dist/commands/generate/templates/shared/components.d.ts +69 -0
  74. package/dist/commands/generate/templates/shared/components.d.ts.map +1 -0
  75. package/dist/commands/generate/templates/shared/directory.d.ts +71 -0
  76. package/dist/commands/generate/templates/shared/directory.d.ts.map +1 -0
  77. package/dist/commands/generate/templates/shared/expanded-components.d.ts +50 -0
  78. package/dist/commands/generate/templates/shared/expanded-components.d.ts.map +1 -0
  79. package/dist/commands/generate/templates/shared/framework-config.d.ts +18 -0
  80. package/dist/commands/generate/templates/shared/framework-config.d.ts.map +1 -0
  81. package/dist/commands/generate/templates/shared/layout-pipeline.d.ts +47 -0
  82. package/dist/commands/generate/templates/shared/layout-pipeline.d.ts.map +1 -0
  83. package/dist/commands/generate/templates/shared/module-specifier.d.ts +68 -0
  84. package/dist/commands/generate/templates/shared/module-specifier.d.ts.map +1 -0
  85. package/dist/commands/generate/templates/shared/options.d.ts +37 -20
  86. package/dist/commands/generate/templates/shared/options.d.ts.map +1 -1
  87. package/dist/commands/generate/templates/shared/scripts.d.ts +62 -0
  88. package/dist/commands/generate/templates/shared/scripts.d.ts.map +1 -0
  89. package/dist/commands/generate/templates/shared/server-components.d.ts +38 -0
  90. package/dist/commands/generate/templates/shared/server-components.d.ts.map +1 -0
  91. package/dist/commands/index.d.ts +8 -0
  92. package/dist/commands/index.d.ts.map +1 -0
  93. package/dist/commands/instances/index.d.ts +22 -0
  94. package/dist/commands/instances/index.d.ts.map +1 -0
  95. package/dist/commands/self-host/migrate/migrator-result.d.ts +1 -1
  96. package/dist/commands/self-host/migrate/migrator-result.d.ts.map +1 -1
  97. package/dist/commands/self-host/migrate/orm-result.d.ts +1 -1
  98. package/dist/commands/self-host/migrate/orm-result.d.ts.map +1 -1
  99. package/dist/commands/self-host/migrate/read-config.d.ts +1 -1
  100. package/dist/commands/self-host/migrate/read-config.d.ts.map +1 -1
  101. package/dist/constants.d.ts +101 -0
  102. package/dist/constants.d.ts.map +1 -0
  103. package/dist/context/framework-detection.d.ts +1 -0
  104. package/dist/context/framework-detection.d.ts.map +1 -1
  105. package/dist/context/types.d.ts +3 -3
  106. package/dist/context/types.d.ts.map +1 -1
  107. package/dist/core/context.d.ts +24 -0
  108. package/dist/core/context.d.ts.map +1 -0
  109. package/dist/core/errors.d.ts +214 -0
  110. package/dist/core/errors.d.ts.map +1 -0
  111. package/dist/core/index.d.ts +9 -0
  112. package/dist/core/index.d.ts.map +1 -0
  113. package/dist/core/logger.d.ts +50 -0
  114. package/dist/core/logger.d.ts.map +1 -0
  115. package/dist/core/parser.d.ts +35 -0
  116. package/dist/core/parser.d.ts.map +1 -0
  117. package/dist/core/telemetry.d.ts +78 -0
  118. package/dist/core/telemetry.d.ts.map +1 -0
  119. package/dist/detection/framework.d.ts +31 -0
  120. package/dist/detection/framework.d.ts.map +1 -0
  121. package/dist/detection/index.d.ts +7 -0
  122. package/dist/detection/index.d.ts.map +1 -0
  123. package/dist/detection/layout.d.ts +36 -0
  124. package/dist/detection/layout.d.ts.map +1 -0
  125. package/dist/detection/package-manager.d.ts +31 -0
  126. package/dist/detection/package-manager.d.ts.map +1 -0
  127. package/dist/index.d.ts +9 -0
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.mjs +2066 -1836
  130. package/dist/machines/generate/actions.d.ts +116 -0
  131. package/dist/machines/generate/actions.d.ts.map +1 -0
  132. package/dist/machines/generate/actors/dependencies.d.ts +43 -0
  133. package/dist/machines/generate/actors/dependencies.d.ts.map +1 -0
  134. package/dist/machines/generate/actors/file-generation.d.ts +54 -0
  135. package/dist/machines/generate/actors/file-generation.d.ts.map +1 -0
  136. package/dist/machines/generate/actors/preflight.d.ts +46 -0
  137. package/dist/machines/generate/actors/preflight.d.ts.map +1 -0
  138. package/dist/machines/generate/actors/prompts.d.ts +122 -0
  139. package/dist/machines/generate/actors/prompts.d.ts.map +1 -0
  140. package/dist/machines/generate/guards.d.ts +180 -0
  141. package/dist/machines/generate/guards.d.ts.map +1 -0
  142. package/dist/machines/generate/machine.d.ts +250 -0
  143. package/dist/machines/generate/machine.d.ts.map +1 -0
  144. package/dist/machines/generate/runner.d.ts +40 -0
  145. package/dist/machines/generate/runner.d.ts.map +1 -0
  146. package/dist/machines/generate/types.d.ts +189 -0
  147. package/dist/machines/generate/types.d.ts.map +1 -0
  148. package/dist/machines/index.d.ts +20 -0
  149. package/dist/machines/index.d.ts.map +1 -0
  150. package/dist/machines/persistence.d.ts +65 -0
  151. package/dist/machines/persistence.d.ts.map +1 -0
  152. package/dist/machines/telemetry-plugin.d.ts +54 -0
  153. package/dist/machines/telemetry-plugin.d.ts.map +1 -0
  154. package/dist/machines/types.d.ts +104 -0
  155. package/dist/machines/types.d.ts.map +1 -0
  156. package/dist/mcp/client.d.ts +61 -0
  157. package/dist/mcp/client.d.ts.map +1 -0
  158. package/dist/mcp/index.d.ts +6 -0
  159. package/dist/mcp/index.d.ts.map +1 -0
  160. package/dist/mcp/types.d.ts +84 -0
  161. package/dist/mcp/types.d.ts.map +1 -0
  162. package/dist/types.d.ts +238 -0
  163. package/dist/types.d.ts.map +1 -0
  164. package/dist/utils/formatter.d.ts +71 -0
  165. package/dist/utils/formatter.d.ts.map +1 -0
  166. package/dist/utils/fs.d.ts +80 -0
  167. package/dist/utils/fs.d.ts.map +1 -0
  168. package/dist/utils/index.d.ts +8 -0
  169. package/dist/utils/index.d.ts.map +1 -0
  170. package/dist/utils/spinner.d.ts +60 -0
  171. package/dist/utils/spinner.d.ts.map +1 -0
  172. package/dist/utils/telemetry.d.ts +4 -0
  173. package/dist/utils/telemetry.d.ts.map +1 -1
  174. package/dist/utils/validation.d.ts +68 -0
  175. package/dist/utils/validation.d.ts.map +1 -0
  176. package/package.json +63 -64
  177. package/LICENSE.md +0 -595
  178. package/dist/commands/generate/options/utils/shared-frontend.d.ts +0 -14
  179. package/dist/commands/generate/options/utils/shared-frontend.d.ts.map +0 -1
  180. package/dist/commands/generate/templates/backend.d.ts +0 -10
  181. package/dist/commands/generate/templates/backend.d.ts.map +0 -1
  182. package/dist/commands/generate/templates/next/app/components.d.ts +0 -44
  183. package/dist/commands/generate/templates/next/app/components.d.ts.map +0 -1
  184. package/dist/commands/generate/templates/next/pages/components.d.ts +0 -22
  185. package/dist/commands/generate/templates/next/pages/components.d.ts.map +0 -1
  186. package/dist/commands/generate/templates/react/components.d.ts +0 -21
  187. package/dist/commands/generate/templates/react/components.d.ts.map +0 -1
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Expanded theme selection prompts
3
+ * Allows users to choose a theme preset when using expanded UI components
4
+ */
5
+ import type { CliContext } from '../../../context/types';
6
+ /**
7
+ * Available expanded theme options
8
+ */
9
+ export type ExpandedTheme = 'none' | 'minimal' | 'dark' | 'tailwind';
10
+ /**
11
+ * Expanded theme option definitions with user-friendly labels
12
+ */
13
+ export declare const EXPANDED_THEME_OPTIONS: readonly [{
14
+ readonly value: "none";
15
+ readonly label: "None";
16
+ readonly hint: "No preset styling";
17
+ readonly description: "No preset styling - you control the theme completely";
18
+ }, {
19
+ readonly value: "minimal";
20
+ readonly label: "Minimal";
21
+ readonly hint: "Clean light theme";
22
+ readonly description: "Clean, light theme with subtle grays and refined typography - uses standard CSS";
23
+ }, {
24
+ readonly value: "dark";
25
+ readonly label: "Dark";
26
+ readonly hint: "High contrast dark mode";
27
+ readonly description: "Vercel-style black and white high contrast theme - stays dark regardless of system preference";
28
+ }, {
29
+ readonly value: "tailwind";
30
+ readonly label: "Tailwind";
31
+ readonly hint: "Uses Tailwind utility classes";
32
+ readonly description: "Standard Tailwind colors (blue/slate), backdrop blur effects, utility class-based styling";
33
+ }];
34
+ /**
35
+ * Get expanded theme display info
36
+ */
37
+ export declare function getExpandedThemeInfo(theme: ExpandedTheme): (typeof EXPANDED_THEME_OPTIONS)[number] | undefined;
38
+ /**
39
+ * Prompt user to select expanded theme preset
40
+ *
41
+ * @param context - CLI context
42
+ * @param handleCancel - Function to handle prompt cancellations
43
+ * @returns The selected expanded theme ('none', 'minimal', 'dark', or 'tailwind')
44
+ */
45
+ export declare function promptForExpandedTheme(context: CliContext, handleCancel?: (value: unknown) => boolean): Promise<ExpandedTheme>;
46
+ //# sourceMappingURL=expanded-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expanded-theme.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/expanded-theme.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;EA4BzB,CAAC;AAEX;;GAEG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,aAAa,GAClB,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAErD;AAED;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,UAAU,EACnB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GACxC,OAAO,CAAC,aAAa,CAAC,CAwBxB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Generate command prompts exports
3
+ */
4
+ export { EXPANDED_THEME_OPTIONS, type ExpandedTheme, getExpandedThemeInfo, promptForExpandedTheme, } from './expanded-theme';
5
+ export { type InstanceSelectionResult, promptForInstance, } from './instance';
6
+ export { explainMode, getModeInfo, MODE_OPTIONS, promptForMode, } from './mode-select';
7
+ export { generateScriptConfig, getScriptInfo, hasGoogleConsentMode, promptForScripts, SCRIPT_OPTIONS, type ScriptId, } from './scripts';
8
+ export { generateThemeConfig, getThemeCssImport, getThemeInfo, promptForTheme, THEME_OPTIONS, type ThemeId, } from './theme';
9
+ export { getUIStyleInfo, promptForUIStyle, UI_STYLE_OPTIONS, type UIStyle, } from './ui-style';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,sBAAsB,EACtB,KAAK,aAAa,EAClB,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACN,KAAK,uBAAuB,EAC5B,iBAAiB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACN,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,KAAK,QAAQ,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,aAAa,EACb,KAAK,OAAO,GACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,OAAO,GACZ,MAAM,YAAY,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Instance selection prompts for c15t mode
3
+ */
4
+ import type { CliContext } from '../../../context/types';
5
+ /**
6
+ * Instance type
7
+ */
8
+ interface Instance {
9
+ id: string;
10
+ name: string;
11
+ url: string;
12
+ status: 'active' | 'inactive' | 'pending';
13
+ }
14
+ /**
15
+ * Instance selection result
16
+ */
17
+ export interface InstanceSelectionResult {
18
+ /** Selected instance or null if manual URL */
19
+ instance: Instance | null;
20
+ /** Backend URL to use */
21
+ backendUrl: string;
22
+ /** Whether user wants to sign up */
23
+ wantSignup?: boolean;
24
+ }
25
+ /**
26
+ * Prompt for c15t instance selection
27
+ *
28
+ * If logged in, shows instance picker.
29
+ * If not logged in, offers: login / manual URL / signup
30
+ */
31
+ export declare function promptForInstance(context: CliContext): Promise<InstanceSelectionResult>;
32
+ export {};
33
+ //# sourceMappingURL=instance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/instance.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;GAEG;AACH,UAAU,QAAQ;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;CAC1C;AA4ED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,8CAA8C;IAC9C,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,yBAAyB;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,uBAAuB,CAAC,CAgElC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Storage mode selection prompts
3
+ */
4
+ import type { CliContext } from '../../../context/types';
5
+ import { type StorageMode } from '../../../constants';
6
+ /**
7
+ * Mode option definitions with user-friendly labels
8
+ */
9
+ export declare const MODE_OPTIONS: readonly [{
10
+ readonly value: "c15t";
11
+ readonly label: "Cloud Hosted";
12
+ readonly hint: "Managed by consent.io (Recommended)";
13
+ readonly description: "Store consent data securely in the cloud with zero infrastructure";
14
+ }, {
15
+ readonly value: "offline";
16
+ readonly label: "Browser-Only";
17
+ readonly hint: "No backend needed";
18
+ readonly description: "Store consent in browser cookies/localStorage (GDPR-compatible)";
19
+ }, {
20
+ readonly value: "self-hosted";
21
+ readonly label: "Self-Hosted";
22
+ readonly hint: "Your own server";
23
+ readonly description: "Run your own c15t backend for full control";
24
+ }, {
25
+ readonly value: "custom";
26
+ readonly label: "Custom Backend";
27
+ readonly hint: "Existing API";
28
+ readonly description: "Connect to your existing consent management API";
29
+ }];
30
+ /**
31
+ * Get mode display info
32
+ */
33
+ export declare function getModeInfo(mode: StorageMode): (typeof MODE_OPTIONS)[number] | undefined;
34
+ /**
35
+ * Prompt user to select storage mode
36
+ */
37
+ export declare function promptForMode(context: CliContext): Promise<StorageMode>;
38
+ /**
39
+ * Display mode explanation
40
+ */
41
+ export declare function explainMode(context: CliContext, mode: StorageMode): void;
42
+ //# sourceMappingURL=mode-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mode-select.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/mode-select.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;EA2Bf,CAAC;AAEX;;GAEG;AACH,wBAAgB,WAAW,CAC1B,IAAI,EAAE,WAAW,GACf,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAE3C;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,CAqB7E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAQxE"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Script configuration prompts
3
+ */
4
+ import type { CliContext } from '../../../context/types';
5
+ /**
6
+ * Available script options
7
+ */
8
+ export declare const SCRIPT_OPTIONS: readonly [{
9
+ readonly value: "gtm";
10
+ readonly label: "Google Tag Manager";
11
+ readonly hint: "GTM with consent mode v2";
12
+ readonly category: "analytics";
13
+ }, {
14
+ readonly value: "ga4";
15
+ readonly label: "Google Analytics";
16
+ readonly hint: "GA4 integration";
17
+ readonly category: "analytics";
18
+ }, {
19
+ readonly value: "posthog";
20
+ readonly label: "PostHog";
21
+ readonly hint: "Product analytics";
22
+ readonly category: "analytics";
23
+ }, {
24
+ readonly value: "meta";
25
+ readonly label: "Meta Pixel";
26
+ readonly hint: "Facebook/Instagram";
27
+ readonly category: "marketing";
28
+ }, {
29
+ readonly value: "linkedin";
30
+ readonly label: "LinkedIn Insights";
31
+ readonly hint: "B2B tracking";
32
+ readonly category: "marketing";
33
+ }, {
34
+ readonly value: "hotjar";
35
+ readonly label: "Hotjar";
36
+ readonly hint: "Heatmaps & recordings";
37
+ readonly category: "analytics";
38
+ }, {
39
+ readonly value: "clarity";
40
+ readonly label: "Microsoft Clarity";
41
+ readonly hint: "Session replay";
42
+ readonly category: "analytics";
43
+ }, {
44
+ readonly value: "intercom";
45
+ readonly label: "Intercom";
46
+ readonly hint: "Customer messaging";
47
+ readonly category: "functionality";
48
+ }];
49
+ export type ScriptId = (typeof SCRIPT_OPTIONS)[number]['value'];
50
+ /**
51
+ * Get script info by ID
52
+ */
53
+ export declare function getScriptInfo(id: ScriptId): (typeof SCRIPT_OPTIONS)[number] | undefined;
54
+ /**
55
+ * Prompt user to select scripts to configure
56
+ */
57
+ export declare function promptForScripts(context: CliContext): Promise<ScriptId[]>;
58
+ /**
59
+ * Check if scripts include Google Consent Mode
60
+ */
61
+ export declare function hasGoogleConsentMode(scripts: ScriptId[]): boolean;
62
+ /**
63
+ * Generate script configuration code
64
+ */
65
+ export declare function generateScriptConfig(scripts: ScriptId[]): string;
66
+ //# sourceMappingURL=scripts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/scripts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiDjB,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAEhE;;GAEG;AACH,wBAAgB,aAAa,CAC5B,EAAE,EAAE,QAAQ,GACV,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAE7C;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,UAAU,GACjB,OAAO,CAAC,QAAQ,EAAE,CAAC,CAwBrB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,OAAO,CAEjE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,CAuFhE"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Theme selection prompts
3
+ */
4
+ import type { CliContext } from '../../../context/types';
5
+ /**
6
+ * Theme preset options
7
+ */
8
+ export declare const THEME_OPTIONS: readonly [{
9
+ readonly value: "default";
10
+ readonly label: "Default";
11
+ readonly hint: "c15t branded theme";
12
+ readonly description: "Modern look with c15t branding";
13
+ }, {
14
+ readonly value: "minimal";
15
+ readonly label: "Minimal";
16
+ readonly hint: "Clean, simple styling";
17
+ readonly description: "Clean design that fits any site";
18
+ }, {
19
+ readonly value: "system";
20
+ readonly label: "System";
21
+ readonly hint: "Follows OS light/dark mode";
22
+ readonly description: "Automatically matches your users' system preference";
23
+ }, {
24
+ readonly value: "none";
25
+ readonly label: "Unstyled";
26
+ readonly hint: "BYO CSS";
27
+ readonly description: "No styles included - bring your own CSS";
28
+ }];
29
+ export type ThemeId = (typeof THEME_OPTIONS)[number]['value'];
30
+ /**
31
+ * Get theme info by ID
32
+ */
33
+ export declare function getThemeInfo(id: ThemeId): (typeof THEME_OPTIONS)[number] | undefined;
34
+ /**
35
+ * Prompt user to select a theme
36
+ */
37
+ export declare function promptForTheme(context: CliContext): Promise<ThemeId>;
38
+ /**
39
+ * Generate theme configuration
40
+ */
41
+ export declare function generateThemeConfig(theme: ThemeId): string;
42
+ /**
43
+ * Generate CSS import for theme
44
+ */
45
+ export declare function getThemeCssImport(theme: ThemeId): string | null;
46
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/theme.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;EAyBhB,CAAC;AAEX,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE9D;;GAEG;AACH,wBAAgB,YAAY,CAC3B,EAAE,EAAE,OAAO,GACT,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAE5C;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAsB1E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA2B1D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAa/D"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * UI style selection prompts
3
+ * Allows users to choose between prebuilt components (single file) or expanded components (directory structure)
4
+ */
5
+ import type { CliContext } from '../../../context/types';
6
+ /**
7
+ * Available UI style options
8
+ */
9
+ export type UIStyle = 'prebuilt' | 'expanded';
10
+ /**
11
+ * UI style option definitions with user-friendly labels
12
+ */
13
+ export declare const UI_STYLE_OPTIONS: readonly [{
14
+ readonly value: "prebuilt";
15
+ readonly label: "Prebuilt (Recommended)";
16
+ readonly hint: "Ready-to-use components";
17
+ readonly description: "Single file with ConsentBanner component - simple to set up and customize";
18
+ }, {
19
+ readonly value: "expanded";
20
+ readonly label: "Compound components";
21
+ readonly hint: "Full customization control";
22
+ readonly description: "Separate files in consent-manager/ directory using compound components - full customization control";
23
+ }];
24
+ /**
25
+ * Get UI style display info
26
+ */
27
+ export declare function getUIStyleInfo(style: UIStyle): (typeof UI_STYLE_OPTIONS)[number] | undefined;
28
+ /**
29
+ * Prompt user to select UI component style
30
+ *
31
+ * @param context - CLI context
32
+ * @param handleCancel - Function to handle prompt cancellations
33
+ * @returns The selected UI style ('prebuilt' or 'expanded')
34
+ */
35
+ export declare function promptForUIStyle(context: CliContext, handleCancel?: (value: unknown) => boolean): Promise<UIStyle>;
36
+ //# sourceMappingURL=ui-style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-style.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/prompts/ui-style.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9C;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;EAenB,CAAC;AAEX;;GAEG;AACH,wBAAgB,cAAc,CAC7B,KAAK,EAAE,OAAO,GACZ,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,CAE/C;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,UAAU,EACnB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GACxC,OAAO,CAAC,OAAO,CAAC,CA0BlB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Summary displays for the generate command
3
+ *
4
+ * Shows execution plan before changes and completion summary after.
5
+ */
6
+ import type { CliContext } from '../../context/types';
7
+ import { type StorageMode } from '../../constants';
8
+ /**
9
+ * Execution plan
10
+ */
11
+ export interface ExecutionPlan {
12
+ mode: StorageMode;
13
+ backendUrl?: string;
14
+ filesToCreate: string[];
15
+ filesToModify: string[];
16
+ dependencies: string[];
17
+ devDependencies?: string[];
18
+ }
19
+ /**
20
+ * Display the execution plan and ask for confirmation
21
+ */
22
+ export declare function displayExecutionPlan(context: CliContext, plan: ExecutionPlan): Promise<boolean>;
23
+ /**
24
+ * Display completion summary
25
+ */
26
+ export declare function displayCompletionSummary(context: CliContext, options: {
27
+ mode: StorageMode;
28
+ backendUrl?: string;
29
+ filesCreated: string[];
30
+ filesModified: string[];
31
+ dependenciesInstalled: boolean;
32
+ }): void;
33
+ /**
34
+ * Display GitHub star prompt
35
+ */
36
+ export declare function promptGitHubStar(context: CliContext): Promise<void>;
37
+ //# sourceMappingURL=summary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/commands/generate/summary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAiB,KAAK,WAAW,EAAQ,MAAM,iBAAiB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,aAAa,GACjB,OAAO,CAAC,OAAO,CAAC,CAsElB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACvC,OAAO,EAAE,UAAU,EACnB,OAAO,EAAE;IACR,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;CAC/B,GACC,IAAI,CA2DN;AAuED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBzE"}
@@ -1,12 +1,13 @@
1
- import type { CliLogger } from '../../../utils/logger';
2
1
  /**
3
- * Generates client configuration file content based on storage mode
2
+ * Configuration file templates
3
+ */
4
+ /**
5
+ * Generate the consent manager configuration based on storage mode
4
6
  *
5
- * @param mode - The storage mode ('c15t', 'offline', or 'custom')
6
- * @param backendURL - URL for the c15t backend/API (for 'c15t' mode)
7
+ * @param mode - The storage mode
8
+ * @param backendURL - URL for the c15t backend/API
7
9
  * @param useEnvFile - Whether to use environment variable for backendURL
8
- * @param logger - Optional logger instance
9
10
  * @returns The generated configuration file content
10
11
  */
11
- export declare function generateClientConfigContent(mode: string, backendURL?: string, useEnvFile?: boolean, logger?: CliLogger): string;
12
+ export declare function generateClientConfigContent(mode: string, backendURL?: string, useEnvFile?: boolean, enableDevTools?: boolean): string;
12
13
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,OAAO,EACpB,MAAM,CAAC,EAAE,SAAS,GAChB,MAAM,CAuER"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAC1C,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,OAAO,EACpB,cAAc,UAAQ,GACpB,MAAM,CAaR"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Updates the project's CSS file for Tailwind v3 compatibility if needed
3
+ *
4
+ * @param projectRoot - The root directory of the project
5
+ * @param tailwindVersion - The detected Tailwind version
6
+ * @returns Object indicating if the update was successful and the file path
7
+ */
8
+ export declare function updateTailwindCss(projectRoot: string, tailwindVersion: string | null): Promise<{
9
+ updated: boolean;
10
+ filePath: string | null;
11
+ }>;
12
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/css.ts"],"names":[],"mappings":"AAmBA;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACtC,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GAAG,IAAI,GAC5B,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAmDxD"}
@@ -3,5 +3,5 @@ export { updateReactLayout } from './layout';
3
3
  export { updateNextLayout } from './next';
4
4
  export { updateAppLayout } from './next/app/layout';
5
5
  export { updatePagesLayout } from './next/pages/layout';
6
- export { generateOptionsText, getBaseImports, getCustomModeImports, } from './shared/options';
6
+ export { generateOptionsText } from './shared/options';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GACpB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -4,6 +4,7 @@
4
4
  * based on the detected project structure (App Directory vs Pages Directory)
5
5
  */
6
6
  import type { AvailablePackages } from '../../../context/framework-detection';
7
+ import type { ExpandedTheme, UIStyle } from '../prompts';
7
8
  interface UpdateReactLayoutOptions {
8
9
  projectRoot: string;
9
10
  mode: string;
@@ -11,9 +12,15 @@ interface UpdateReactLayoutOptions {
11
12
  useEnvFile?: boolean;
12
13
  pkg: AvailablePackages;
13
14
  proxyNextjs?: boolean;
15
+ enableSSR?: boolean;
16
+ enableDevTools?: boolean;
17
+ uiStyle?: UIStyle;
18
+ expandedTheme?: ExpandedTheme;
19
+ selectedScripts?: string[];
14
20
  }
15
21
  interface ComponentFilePaths {
16
22
  consentManager: string;
23
+ consentManagerDir?: string;
17
24
  }
18
25
  export declare function updateReactLayout(options: UpdateReactLayoutOptions): Promise<{
19
26
  updated: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKvE,UAAU,wBAAwB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;CACvB;AA2UD,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,wBAAwB,GAC/B,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CAkBD"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../src/commands/generate/templates/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAazD,UAAU,wBAAwB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAwRD,wBAAsB,iBAAiB,CACtC,OAAO,EAAE,wBAAwB,GAC/B,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CAkBD"}
@@ -4,6 +4,7 @@
4
4
  * and creates separate consent-manager component files
5
5
  */
6
6
  import type { AvailablePackages } from '../../../../../context/framework-detection';
7
+ import type { ExpandedTheme, UIStyle } from '../../../prompts';
7
8
  interface UpdateAppLayoutOptions {
8
9
  projectRoot: string;
9
10
  mode: string;
@@ -11,10 +12,16 @@ interface UpdateAppLayoutOptions {
11
12
  useEnvFile?: boolean;
12
13
  pkg: AvailablePackages;
13
14
  proxyNextjs?: boolean;
15
+ enableSSR?: boolean;
16
+ enableDevTools?: boolean;
17
+ uiStyle?: UIStyle;
18
+ expandedTheme?: ExpandedTheme;
19
+ selectedScripts?: string[];
14
20
  }
15
21
  interface ComponentFilePaths {
16
22
  consentManager: string;
17
- consentManagerClient: string;
23
+ consentManagerClient?: string;
24
+ consentManagerDir?: string;
18
25
  }
19
26
  /**
20
27
  * Updates Next.js App Directory layout with consent management components
@@ -32,7 +39,7 @@ interface ComponentFilePaths {
32
39
  * 4. Adds ConsentManager import to layout
33
40
  * 5. Wraps layout content with ConsentManager component
34
41
  */
35
- export declare function updateAppLayout({ projectRoot, mode, backendURL, useEnvFile, proxyNextjs, }: UpdateAppLayoutOptions): Promise<{
42
+ export declare function updateAppLayout({ projectRoot, mode, backendURL, useEnvFile, proxyNextjs, enableSSR, enableDevTools, uiStyle, expandedTheme, selectedScripts, }: UpdateAppLayoutOptions): Promise<{
36
43
  updated: boolean;
37
44
  filePath: string | null;
38
45
  alreadyModified: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/templates/next/app/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAYvE,UAAU,sBAAsB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;CAC7B;AAgQD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CAAC,EACrC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,GACX,EAAE,sBAAsB,GAAG,OAAO,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CA6ED"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/templates/next/app/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAmB/D,UAAU,sBAAsB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAyTD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CAAC,EACrC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAiB,EACjB,cAAsB,EACtB,OAAoB,EACpB,aAA0B,EAC1B,eAAe,GACf,EAAE,sBAAsB,GAAG,OAAO,CAAC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CA8BD"}
@@ -4,6 +4,7 @@
4
4
  * and routes to the appropriate implementation
5
5
  */
6
6
  import type { AvailablePackages } from '../../../../context/framework-detection';
7
+ import type { ExpandedTheme, UIStyle } from '../../prompts';
7
8
  interface UpdateNextLayoutOptions {
8
9
  projectRoot: string;
9
10
  mode: string;
@@ -11,6 +12,11 @@ interface UpdateNextLayoutOptions {
11
12
  useEnvFile?: boolean;
12
13
  pkg: AvailablePackages;
13
14
  proxyNextjs?: boolean;
15
+ enableSSR?: boolean;
16
+ enableDevTools?: boolean;
17
+ uiStyle?: UIStyle;
18
+ expandedTheme?: ExpandedTheme;
19
+ selectedScripts?: string[];
14
20
  }
15
21
  type NextStructure = 'app' | 'pages' | null;
16
22
  export declare function updateNextLayout(options: UpdateNextLayoutOptions): Promise<{
@@ -21,6 +27,7 @@ export declare function updateNextLayout(options: UpdateNextLayoutOptions): Prom
21
27
  componentFiles?: {
22
28
  consentManager: string;
23
29
  consentManagerClient?: string;
30
+ consentManagerDir?: string;
24
31
  };
25
32
  }>;
26
33
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/generate/templates/next/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,UAAU,uBAAuB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,KAAK,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC;AAsC5C,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACF,CAAC,CAgCD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/generate/templates/next/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI5D,UAAU,uBAAuB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,KAAK,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,IAAI,CAAC;AAsC5C,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,uBAAuB,GAC9B,OAAO,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,oBAAoB,CAAC,EAAE,MAAM,CAAC;QAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACF,CAAC,CAiCD"}
@@ -11,6 +11,8 @@ interface UpdatePagesLayoutOptions {
11
11
  useEnvFile?: boolean;
12
12
  pkg: AvailablePackages;
13
13
  proxyNextjs?: boolean;
14
+ enableDevTools?: boolean;
15
+ selectedScripts?: string[];
14
16
  }
15
17
  interface ComponentFilePaths {
16
18
  consentManager: string;
@@ -35,7 +37,7 @@ interface ComponentFilePaths {
35
37
  * Unlike App Directory, Pages Directory only needs one component file because
36
38
  * it doesn't use the 'use client' directive pattern.
37
39
  */
38
- export declare function updatePagesLayout({ projectRoot, mode, backendURL, useEnvFile, proxyNextjs, }: UpdatePagesLayoutOptions): Promise<{
40
+ export declare function updatePagesLayout({ projectRoot, mode, backendURL, useEnvFile, proxyNextjs, enableDevTools, selectedScripts, }: UpdatePagesLayoutOptions): Promise<{
39
41
  updated: boolean;
40
42
  filePath: string | null;
41
43
  alreadyModified: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/templates/next/pages/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,UAAU,wBAAwB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;CACvB;AAwSD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CAAC,EACvC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,GACX,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CAoFD"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/generate/templates/next/pages/layout.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAKvE,UAAU,wBAAwB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,iBAAiB,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,UAAU,kBAAkB;IAC3B,cAAc,EAAE,MAAM,CAAC;CACvB;AA+KD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,iBAAiB,CAAC,EACvC,WAAW,EACX,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAsB,EACtB,eAAe,GACf,EAAE,wBAAwB,GAAG,OAAO,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC,CA4BD"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Shared consent component template generator
3
+ * Produces the Provider+Banner+Dialog component used by React, Next.js Pages, and App Dir client
4
+ */
5
+ interface GenerateConsentComponentOptions {
6
+ /** Package to import from: '@c15t/react' or '@c15t/nextjs' */
7
+ importSource: string;
8
+ /** Pre-computed inner options text (mode, backendURL, etc.) */
9
+ optionsText: string;
10
+ /** Selected scripts to include */
11
+ selectedScripts?: string[];
12
+ /** Whether to add initialData prop passed as provider prop (Pages router) */
13
+ initialDataProp?: boolean;
14
+ /** Whether to add 'use client' directive (App Dir client) */
15
+ useClientDirective?: boolean;
16
+ /** Whether to use default export (App Dir client) */
17
+ defaultExport?: boolean;
18
+ /** Whether to add ssrData prop passed inside options object (App Dir client with SSR) */
19
+ ssrDataOption?: boolean;
20
+ /** Whether to add geo override for development (shows banner in non-EU countries) */
21
+ includeOverrides?: boolean;
22
+ /** Whether to add c15t DevTools component */
23
+ enableDevTools?: boolean;
24
+ /** When set, use ConsentManagerProps from this package for props typing (e.g. '@c15t/nextjs') */
25
+ useFrameworkProps?: string;
26
+ /** When true, add theme import from './theme' and include in options */
27
+ includeTheme?: boolean;
28
+ /** Docs slug for @see URL (e.g. 'react', 'nextjs') */
29
+ docsSlug?: string;
30
+ }
31
+ /**
32
+ * Generates a consent manager component with Provider, Banner, and Dialog
33
+ *
34
+ * @param options - Configuration for the generated component
35
+ * @returns The complete component file content as a string
36
+ *
37
+ * @remarks
38
+ * This shared generator covers React, Next.js Pages, and Next.js App Dir client
39
+ * variants. The core JSX pattern is always Provider wrapping Banner + Dialog + children.
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * // React
44
+ * generateConsentComponent({
45
+ * importSource: '@c15t/react',
46
+ * optionsText: "mode: 'offline',",
47
+ * });
48
+ *
49
+ * // Next.js Pages
50
+ * generateConsentComponent({
51
+ * importSource: '@c15t/nextjs',
52
+ * optionsText: "mode: 'c15t',\n\t\t\t\tbackendURL: '/api/c15t',",
53
+ * initialDataProp: true,
54
+ * });
55
+ *
56
+ * // Next.js App Dir client
57
+ * generateConsentComponent({
58
+ * importSource: '@c15t/nextjs',
59
+ * optionsText: "mode: 'c15t',\n\t\t\t\tbackendURL: '/api/c15t',",
60
+ * useClientDirective: true,
61
+ * defaultExport: true,
62
+ * ssrDataOption: true,
63
+ * includeOverrides: true,
64
+ * });
65
+ * ```
66
+ */
67
+ export declare function generateConsentComponent({ importSource, optionsText, selectedScripts, initialDataProp, useClientDirective, defaultExport, ssrDataOption, includeOverrides, enableDevTools, useFrameworkProps, includeTheme, docsSlug, }: GenerateConsentComponentOptions): string;
68
+ export {};
69
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../../../../src/commands/generate/templates/shared/components.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,UAAU,+BAA+B;IACxC,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,6EAA6E;IAC7E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,yFAAyF;IACzF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,wBAAwB,CAAC,EACxC,YAAY,EACZ,WAAW,EACX,eAAoB,EACpB,eAAuB,EACvB,kBAA0B,EAC1B,aAAqB,EACrB,aAAqB,EACrB,gBAAwB,EACxB,cAAsB,EACtB,iBAAiB,EACjB,YAAoB,EACpB,QAAQ,GACR,EAAE,+BAA+B,GAAG,MAAM,CAoH1C"}