@c15t/cli 2.0.0-rc.5 → 2.0.0-rc.6
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/145.mjs +6509 -0
- package/dist/generate-files.mjs +1797 -0
- package/dist/index.mjs +1 -6311
- package/dist-types/commands/codemods/add-stylesheet-imports.d.ts +54 -0
- package/dist-types/commands/generate/prompts/theme.d.ts +1 -1
- package/dist-types/commands/generate/templates/shared/framework-config.d.ts +4 -0
- package/dist-types/commands/instances/index.d.ts +1 -1
- package/package.json +11 -11
- package/dist/642.mjs +0 -1804
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface CodemodRunOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Absolute or relative project root to scan for source files.
|
|
4
|
+
*/
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
/**
|
|
7
|
+
* Whether to skip saving transformed files.
|
|
8
|
+
*/
|
|
9
|
+
dryRun: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Result summary for a codemod run.
|
|
13
|
+
*/
|
|
14
|
+
export interface CodemodRunResult {
|
|
15
|
+
/**
|
|
16
|
+
* Number of source files scanned.
|
|
17
|
+
*/
|
|
18
|
+
totalFiles: number;
|
|
19
|
+
/**
|
|
20
|
+
* Per-file transformation summaries.
|
|
21
|
+
*/
|
|
22
|
+
changedFiles: Array<{
|
|
23
|
+
filePath: string;
|
|
24
|
+
operations: number;
|
|
25
|
+
summaries: string[];
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Non-fatal per-file transform errors.
|
|
29
|
+
*/
|
|
30
|
+
errors: Array<{
|
|
31
|
+
filePath: string;
|
|
32
|
+
error: string;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Runs the add-stylesheet-imports codemod across project source files.
|
|
37
|
+
*
|
|
38
|
+
* Detects whether the project uses styled c15t UI components and adds the
|
|
39
|
+
* required CSS import(s) to the appropriate root entrypoint file.
|
|
40
|
+
*
|
|
41
|
+
* @param options Codemod execution options.
|
|
42
|
+
* @returns Summary with changed files and non-fatal per-file errors.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const result = await runAddStylesheetImportsCodemod({
|
|
47
|
+
* projectRoot: process.cwd(),
|
|
48
|
+
* dryRun: true,
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @throws Propagates unexpected setup failures such as directory traversal errors.
|
|
53
|
+
*/
|
|
54
|
+
export declare function runAddStylesheetImportsCodemod(options: CodemodRunOptions): Promise<CodemodRunResult>;
|
|
@@ -42,4 +42,4 @@ export declare function generateThemeConfig(theme: ThemeId): string;
|
|
|
42
42
|
/**
|
|
43
43
|
* Generate CSS import for theme
|
|
44
44
|
*/
|
|
45
|
-
export declare function getThemeCssImport(theme: ThemeId): string | null;
|
|
45
|
+
export declare function getThemeCssImport(theme: ThemeId, framework?: 'react' | 'nextjs'): string | null;
|
|
@@ -12,6 +12,10 @@ export interface FrameworkConfig {
|
|
|
12
12
|
docsSlug: string;
|
|
13
13
|
envVarPrefix: string;
|
|
14
14
|
hasSSRProps: boolean;
|
|
15
|
+
/** CSS stylesheet import path for prebuilt (styled) components, or null for unstyled. */
|
|
16
|
+
stylesheetImport: string | null;
|
|
17
|
+
/** CSS stylesheet import path for IAB components, or null if IAB is not applicable. */
|
|
18
|
+
iabStylesheetImport: string | null;
|
|
15
19
|
}
|
|
16
20
|
export declare const NEXTJS_CONFIG: FrameworkConfig;
|
|
17
21
|
export declare const REACT_CONFIG: FrameworkConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c15t/cli",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.6",
|
|
4
4
|
"description": "CLI for rapid c15t setup. Scaffold React and Next.js cookie banners and a preferences centre, generate types and config, and run migration tooling for self-hosted deployments.",
|
|
5
5
|
"homepage": "https://v2.c15t.com",
|
|
6
6
|
"repository": {
|
|
@@ -33,21 +33,21 @@
|
|
|
33
33
|
"test:watch": "vitest"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@c15t/backend": "2.0.0-rc.
|
|
36
|
+
"@c15t/backend": "2.0.0-rc.6",
|
|
37
37
|
"@c15t/logger": "1.0.2-rc.0",
|
|
38
|
-
"@clack/prompts": "
|
|
39
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
40
|
-
"c12": "3.3.
|
|
41
|
-
"dotenv": "17.
|
|
42
|
-
"figlet": "1.
|
|
43
|
-
"fs-extra": "11.3.
|
|
38
|
+
"@clack/prompts": "1.1.0",
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
40
|
+
"c12": "3.3.3",
|
|
41
|
+
"dotenv": "17.3.1",
|
|
42
|
+
"figlet": "1.11.0",
|
|
43
|
+
"fs-extra": "11.3.4",
|
|
44
44
|
"open": "11.0.0",
|
|
45
45
|
"package-manager-detector": "1.6.0",
|
|
46
46
|
"picocolors": "1.1.1",
|
|
47
|
-
"posthog-node": "5.
|
|
47
|
+
"posthog-node": "5.28.9",
|
|
48
48
|
"ts-morph": "27.0.2",
|
|
49
|
-
"xstate": "^5.
|
|
50
|
-
"zod": "4.
|
|
49
|
+
"xstate": "^5.30.0",
|
|
50
|
+
"zod": "4.3.6"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@c15t/typescript-config": "0.0.1-beta.1",
|