@promptui-lib/cli 0.1.6 → 0.1.7
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.
|
@@ -10,10 +10,12 @@ export interface IGenerateOptions {
|
|
|
10
10
|
framework?: FrameworkType;
|
|
11
11
|
preview?: boolean;
|
|
12
12
|
noMeta?: boolean;
|
|
13
|
+
all?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare function generateCommand(input: string, options: IGenerateOptions): Promise<void>;
|
|
15
16
|
/**
|
|
16
17
|
* Gera todos os componentes marcados com # no arquivo Figma
|
|
18
|
+
* Se --all for passado, exporta todos os frames de nível superior
|
|
17
19
|
*/
|
|
18
20
|
export declare function generateAllCommand(options: IGenerateOptions): Promise<void>;
|
|
19
21
|
//# sourceMappingURL=generate.cmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.cmd.d.ts","sourceRoot":"","sources":["../../src/commands/generate.cmd.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAapF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.cmd.d.ts","sourceRoot":"","sources":["../../src/commands/generate.cmd.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAc,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAapF,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AA0ED,wBAAsB,eAAe,CACnC,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAqJf;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkGjF"}
|
|
@@ -187,9 +187,16 @@ export async function generateCommand(input, options) {
|
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* Gera todos os componentes marcados com # no arquivo Figma
|
|
190
|
+
* Se --all for passado, exporta todos os frames de nível superior
|
|
190
191
|
*/
|
|
191
192
|
export async function generateAllCommand(options) {
|
|
192
|
-
|
|
193
|
+
const exportAll = options.all;
|
|
194
|
+
if (exportAll) {
|
|
195
|
+
console.log('[PromptUI] Generating ALL top-level frames (--all mode)...');
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
console.log('[PromptUI] Generating all exportable components...');
|
|
199
|
+
}
|
|
193
200
|
// Carrega config
|
|
194
201
|
const config = await loadConfig();
|
|
195
202
|
const resolved = resolveConfig(config);
|
|
@@ -205,24 +212,35 @@ export async function generateAllCommand(options) {
|
|
|
205
212
|
try {
|
|
206
213
|
const client = createFigmaClient({ token: resolved.figmaToken });
|
|
207
214
|
const file = await client.getFile(resolved.figmaFileId);
|
|
208
|
-
// Encontra todos os nodes exportáveis
|
|
215
|
+
// Encontra todos os nodes exportáveis
|
|
209
216
|
const exportableNodes = [];
|
|
210
|
-
function findExportable(node) {
|
|
211
|
-
|
|
217
|
+
function findExportable(node, depth = 0) {
|
|
218
|
+
// Se --all, exporta frames de nível superior (depth <= 2 = document > page > frame)
|
|
219
|
+
// Se não, apenas os que começam com #
|
|
220
|
+
const isTopLevelFrame = depth === 2 && (node.type === 'FRAME' || node.type === 'COMPONENT');
|
|
221
|
+
const isMarkedForExport = node.name.startsWith('#');
|
|
222
|
+
if (exportAll ? isTopLevelFrame : isMarkedForExport) {
|
|
212
223
|
exportableNodes.push(node);
|
|
213
224
|
}
|
|
225
|
+
// Continua buscando em profundidade (para encontrar # em qualquer nível)
|
|
214
226
|
if (node.children) {
|
|
215
227
|
for (const child of node.children) {
|
|
216
|
-
findExportable(child);
|
|
228
|
+
findExportable(child, depth + 1);
|
|
217
229
|
}
|
|
218
230
|
}
|
|
219
231
|
}
|
|
220
232
|
if (file.document) {
|
|
221
|
-
findExportable(file.document);
|
|
233
|
+
findExportable(file.document, 0);
|
|
222
234
|
}
|
|
223
235
|
console.log(`[PromptUI] Found ${exportableNodes.length} exportable components`);
|
|
224
236
|
if (exportableNodes.length === 0) {
|
|
225
|
-
|
|
237
|
+
if (exportAll) {
|
|
238
|
+
console.log('[PromptUI] No top-level frames found in the file.');
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
console.log('[PromptUI] No components found. Mark frames with # prefix to export.');
|
|
242
|
+
console.log('[PromptUI] Or use --all flag to export all top-level frames.');
|
|
243
|
+
}
|
|
226
244
|
return;
|
|
227
245
|
}
|
|
228
246
|
let successCount = 0;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAyEH,wBAAsB,GAAG,CAAC,IAAI,GAAE,MAAM,EAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAoH/E"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ Commands:
|
|
|
18
18
|
init Initialize configuration file
|
|
19
19
|
agent Start the MCP agent server
|
|
20
20
|
generate Generate all #marked components (React + SCSS)
|
|
21
|
+
generate --all Generate ALL top-level frames (no # required)
|
|
21
22
|
generate mui Generate all #marked components (Material UI)
|
|
22
23
|
generate tailwind Generate all #marked components (Tailwind CSS)
|
|
23
24
|
generate bootstrap Generate all #marked components (Bootstrap)
|
|
@@ -37,6 +38,7 @@ Options:
|
|
|
37
38
|
--layer, -l Force layer (atoms|molecules|organisms)
|
|
38
39
|
--preview, -p Preview output without writing files
|
|
39
40
|
--no-meta Skip generating meta.json
|
|
41
|
+
--all, -a Export all top-level frames (no # prefix required)
|
|
40
42
|
|
|
41
43
|
Frameworks:
|
|
42
44
|
react React + SCSS with BEM methodology (default)
|
|
@@ -49,9 +51,10 @@ Frameworks:
|
|
|
49
51
|
Examples:
|
|
50
52
|
promptui init # Create promptui.config.json
|
|
51
53
|
promptui agent # Start agent on port 17890
|
|
52
|
-
promptui generate # Generate all
|
|
54
|
+
promptui generate # Generate all #marked components
|
|
55
|
+
promptui generate --all # Generate ALL frames (no # needed)
|
|
53
56
|
promptui generate mui # Generate all (Material UI)
|
|
54
|
-
promptui generate tailwind
|
|
57
|
+
promptui generate tailwind --all # Generate ALL frames (Tailwind)
|
|
55
58
|
promptui generate bootstrap # Generate all (Bootstrap)
|
|
56
59
|
promptui generate flutter # Generate all (Flutter)
|
|
57
60
|
promptui generate swiftui # Generate all (SwiftUI)
|
|
@@ -79,6 +82,7 @@ export async function run(args = process.argv.slice(2)) {
|
|
|
79
82
|
framework: { type: 'string', short: 'F' },
|
|
80
83
|
preview: { type: 'boolean', short: 'p' },
|
|
81
84
|
'no-meta': { type: 'boolean' },
|
|
85
|
+
all: { type: 'boolean', short: 'a' },
|
|
82
86
|
},
|
|
83
87
|
allowPositionals: true,
|
|
84
88
|
});
|
|
@@ -121,8 +125,9 @@ export async function run(args = process.argv.slice(2)) {
|
|
|
121
125
|
framework,
|
|
122
126
|
preview: values.preview,
|
|
123
127
|
noMeta: values['no-meta'],
|
|
128
|
+
all: values.all,
|
|
124
129
|
};
|
|
125
|
-
if (generateAll) {
|
|
130
|
+
if (generateAll || values.all) {
|
|
126
131
|
await generateAllCommand(generateOptions);
|
|
127
132
|
}
|
|
128
133
|
else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptui-lib/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI for PromptUI - Figma to React code generator",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"bin"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@promptui-lib/core": "0.1.
|
|
49
|
-
"@promptui-lib/figma-parser": "0.1.
|
|
50
|
-
"@promptui-lib/codegen": "0.1.
|
|
51
|
-
"@promptui-lib/mcp-agent": "0.1.
|
|
48
|
+
"@promptui-lib/core": "0.1.7",
|
|
49
|
+
"@promptui-lib/figma-parser": "0.1.7",
|
|
50
|
+
"@promptui-lib/codegen": "0.1.7",
|
|
51
|
+
"@promptui-lib/mcp-agent": "0.1.7"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^20.0.0",
|