@auto-engineer/frontend-generator-react-graphql 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +156 -0
- package/LICENSE +10 -0
- package/README.md +362 -0
- package/dist/builder.d.ts +7 -0
- package/dist/builder.d.ts.map +1 -0
- package/dist/builder.js +189 -0
- package/dist/builder.js.map +1 -0
- package/dist/cli-manifest.d.ts +3 -0
- package/dist/cli-manifest.d.ts.map +1 -0
- package/dist/cli-manifest.js +10 -0
- package/dist/cli-manifest.js.map +1 -0
- package/dist/commands/copy-example.d.ts +59 -0
- package/dist/commands/copy-example.d.ts.map +1 -0
- package/dist/commands/copy-example.js +118 -0
- package/dist/commands/copy-example.js.map +1 -0
- package/dist/commands/generate-client.d.ts +60 -0
- package/dist/commands/generate-client.d.ts.map +1 -0
- package/dist/commands/generate-client.js +110 -0
- package/dist/commands/generate-client.js.map +1 -0
- package/dist/configure-starter.d.ts +2 -0
- package/dist/configure-starter.d.ts.map +1 -0
- package/dist/configure-starter.js +40 -0
- package/dist/configure-starter.js.map +1 -0
- package/dist/delete-directory.d.ts +2 -0
- package/dist/delete-directory.d.ts.map +1 -0
- package/dist/delete-directory.js +17 -0
- package/dist/delete-directory.js.map +1 -0
- package/dist/figma-helpers.d.ts +33 -0
- package/dist/figma-helpers.d.ts.map +1 -0
- package/dist/figma-helpers.js +99 -0
- package/dist/figma-helpers.js.map +1 -0
- package/dist/generator/generateComponents.d.ts +3 -0
- package/dist/generator/generateComponents.d.ts.map +1 -0
- package/dist/generator/generateComponents.js +111 -0
- package/dist/generator/generateComponents.js.map +1 -0
- package/dist/generator/templates/app.ejs +22 -0
- package/dist/generator/templates/component.ejs +18 -0
- package/dist/generator/templates/page.ejs +15 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/run-codegen.d.ts +2 -0
- package/dist/run-codegen.d.ts.map +1 -0
- package/dist/run-codegen.js +84 -0
- package/dist/run-codegen.js.map +1 -0
- package/dist/scaffold-gql-operations.d.ts +3 -0
- package/dist/scaffold-gql-operations.d.ts.map +1 -0
- package/dist/scaffold-gql-operations.js +77 -0
- package/dist/scaffold-gql-operations.js.map +1 -0
- package/dist/templates/createFile.d.ts +8 -0
- package/dist/templates/createFile.d.ts.map +1 -0
- package/dist/templates/createFile.js +66 -0
- package/dist/templates/createFile.js.map +1 -0
- package/dist/types.d.ts +62 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/write-graphql-schema.d.ts +2 -0
- package/dist/write-graphql-schema.d.ts.map +1 -0
- package/dist/write-graphql-schema.js +14 -0
- package/dist/write-graphql-schema.js.map +1 -0
- package/package.json +47 -0
package/dist/builder.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import * as fs from 'fs/promises';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import createDebug from 'debug';
|
|
4
|
+
const debug = createDebug('frontend-generator-react-graphql:builder');
|
|
5
|
+
const debugFiles = createDebug('frontend-generator-react-graphql:builder:files');
|
|
6
|
+
const debugBuild = createDebug('frontend-generator-react-graphql:builder:build');
|
|
7
|
+
export class FrontendScaffoldBuilder {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.starterFiles = new Map();
|
|
10
|
+
}
|
|
11
|
+
async cloneStarter(_starterDir) {
|
|
12
|
+
debug('Cloning starter from: %s', _starterDir);
|
|
13
|
+
// If the path is already absolute, use it as is, otherwise resolve relative to current working directory
|
|
14
|
+
const starterDir = path.isAbsolute(_starterDir) ? _starterDir : path.resolve(process.cwd(), _starterDir);
|
|
15
|
+
debug('Resolved starter directory: %s', starterDir);
|
|
16
|
+
await this.collectFiles(starterDir, '');
|
|
17
|
+
debug('Starter files collected: %d files', this.starterFiles.size);
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
async collectFiles(dir, relative) {
|
|
21
|
+
debugFiles('Collecting files from: %s (relative: %s)', dir, relative || '/');
|
|
22
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
23
|
+
debugFiles('Found %d entries in directory', entries.length);
|
|
24
|
+
for (const entry of entries) {
|
|
25
|
+
const absPath = path.join(dir, entry.name);
|
|
26
|
+
const relPath = path.join(relative, entry.name);
|
|
27
|
+
if (entry.isDirectory()) {
|
|
28
|
+
debugFiles('Entering directory: %s', relPath);
|
|
29
|
+
await this.collectFiles(absPath, relPath);
|
|
30
|
+
}
|
|
31
|
+
else if (entry.isFile()) {
|
|
32
|
+
const content = await fs.readFile(absPath);
|
|
33
|
+
this.starterFiles.set(relPath, content);
|
|
34
|
+
debugFiles('Added file: %s (%d bytes)', relPath, content.length);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// async configureStarter(variablesDir: string): Promise<void> {
|
|
39
|
+
// for (const [relPath, content] of Array.from(this.starterFiles.entries())) {
|
|
40
|
+
// if (relPath.endsWith('.ejs')) {
|
|
41
|
+
// const targetPath = relPath.slice(0, -4);
|
|
42
|
+
// const cssVariables = {
|
|
43
|
+
// tokens: {
|
|
44
|
+
// radius: '0.5rem',
|
|
45
|
+
//
|
|
46
|
+
// background: '',
|
|
47
|
+
// foreground: '',
|
|
48
|
+
//
|
|
49
|
+
// card: '',
|
|
50
|
+
// 'card-foreground': '',
|
|
51
|
+
//
|
|
52
|
+
// popover: '',
|
|
53
|
+
// 'popover-foreground': '',
|
|
54
|
+
//
|
|
55
|
+
// primary: '',
|
|
56
|
+
// 'primary-foreground': '',
|
|
57
|
+
//
|
|
58
|
+
// secondary: '',
|
|
59
|
+
// 'secondary-foreground': '',
|
|
60
|
+
//
|
|
61
|
+
// muted: '',
|
|
62
|
+
// 'muted-foreground': '',
|
|
63
|
+
//
|
|
64
|
+
// accent: '',
|
|
65
|
+
// 'accent-foreground': '',
|
|
66
|
+
//
|
|
67
|
+
// destructive: '',
|
|
68
|
+
// 'destructive-foreground': '',
|
|
69
|
+
//
|
|
70
|
+
// border: '',
|
|
71
|
+
// input: '',
|
|
72
|
+
// ring: '',
|
|
73
|
+
//
|
|
74
|
+
// 'chart-1': '',
|
|
75
|
+
// 'chart-2': '',
|
|
76
|
+
// 'chart-3': '',
|
|
77
|
+
// 'chart-4': '',
|
|
78
|
+
// 'chart-5': '',
|
|
79
|
+
//
|
|
80
|
+
// sidebar: '',
|
|
81
|
+
// 'sidebar-foreground': '',
|
|
82
|
+
// 'sidebar-primary': '',
|
|
83
|
+
// 'sidebar-primary-foreground': '',
|
|
84
|
+
// 'sidebar-accent': '',
|
|
85
|
+
// 'sidebar-accent-foreground': '',
|
|
86
|
+
// 'sidebar-border': '',
|
|
87
|
+
// 'sidebar-ring': '',
|
|
88
|
+
// },
|
|
89
|
+
// darkTokens: {
|
|
90
|
+
// background: '',
|
|
91
|
+
// foreground: '',
|
|
92
|
+
//
|
|
93
|
+
// card: '',
|
|
94
|
+
// 'card-foreground': '',
|
|
95
|
+
//
|
|
96
|
+
// popover: '',
|
|
97
|
+
// 'popover-foreground': '',
|
|
98
|
+
//
|
|
99
|
+
// primary: '',
|
|
100
|
+
// 'primary-foreground': '',
|
|
101
|
+
//
|
|
102
|
+
// secondary: '',
|
|
103
|
+
// 'secondary-foreground': '',
|
|
104
|
+
//
|
|
105
|
+
// muted: '',
|
|
106
|
+
// 'muted-foreground': '',
|
|
107
|
+
//
|
|
108
|
+
// accent: '',
|
|
109
|
+
// 'accent-foreground': '',
|
|
110
|
+
//
|
|
111
|
+
// destructive: '',
|
|
112
|
+
// 'destructive-foreground': '',
|
|
113
|
+
//
|
|
114
|
+
// border: '',
|
|
115
|
+
// input: '',
|
|
116
|
+
// ring: '',
|
|
117
|
+
//
|
|
118
|
+
// sidebar: '',
|
|
119
|
+
// 'sidebar-foreground': '',
|
|
120
|
+
// 'sidebar-primary': '',
|
|
121
|
+
// 'sidebar-primary-foreground': '',
|
|
122
|
+
// 'sidebar-accent': '',
|
|
123
|
+
// 'sidebar-accent-foreground': '',
|
|
124
|
+
// 'sidebar-border': '',
|
|
125
|
+
// 'sidebar-ring': '',
|
|
126
|
+
// },
|
|
127
|
+
// };
|
|
128
|
+
//
|
|
129
|
+
// const figmaVariables = readFileSync(variablesDir, 'utf-8');
|
|
130
|
+
// const extractedVariables = flattenFigmaVariables(JSON.parse(figmaVariables));
|
|
131
|
+
//
|
|
132
|
+
// console.log(JSON.stringify(extractedVariables, null, 2));
|
|
133
|
+
// // return
|
|
134
|
+
//
|
|
135
|
+
// const aiResponse = await generateTextWithAI(
|
|
136
|
+
// `
|
|
137
|
+
// I have these strictly named css variables: ${JSON.stringify(cssVariables)}
|
|
138
|
+
// I also have these figma variables: ${JSON.stringify(extractedVariables)}
|
|
139
|
+
//
|
|
140
|
+
// INSTRUCTIONS:
|
|
141
|
+
// - don't include the \`\`\`json prefix, just the actual JSON data
|
|
142
|
+
// - return a JSON output ONLY, of the given css variables, and try your best to match all the figma variables to it.
|
|
143
|
+
// - if there is not a match make sure to reset that value to a zero-like value.
|
|
144
|
+
// - if the variable doesn't have a dark mode, map the same light mode to the dark mode as well.
|
|
145
|
+
// - IMPORTANT: some of these given values are in hsl format, don't modify them, and make sure you always assign the value of the tokens as given to you. Sometimes values can consist of more that one value like this: 48 100% 50%
|
|
146
|
+
// - return in the format:
|
|
147
|
+
// {
|
|
148
|
+
// "tokens": { ... },
|
|
149
|
+
// "tokensDark": { ... }
|
|
150
|
+
// }
|
|
151
|
+
// `,
|
|
152
|
+
// AIProvider.OpenAI,
|
|
153
|
+
// { maxTokens: 4000 },
|
|
154
|
+
// );
|
|
155
|
+
//
|
|
156
|
+
// console.log('Ai Response', JSON.stringify(aiResponse, null, 2));
|
|
157
|
+
//
|
|
158
|
+
// const { tokens, tokensDark } = JSON.parse(aiResponse) as { tokens: object; tokensDark: object };
|
|
159
|
+
//
|
|
160
|
+
// const renderedContent = ejs.render(content.toString(), { tokens, tokensDark });
|
|
161
|
+
//
|
|
162
|
+
// this.starterFiles.set(targetPath, Buffer.from(renderedContent));
|
|
163
|
+
//
|
|
164
|
+
// this.starterFiles.delete(relPath);
|
|
165
|
+
// }
|
|
166
|
+
// }
|
|
167
|
+
// }
|
|
168
|
+
async build(outputDir) {
|
|
169
|
+
debugBuild('Building to output directory: %s', outputDir);
|
|
170
|
+
if (!this.starterFiles.size) {
|
|
171
|
+
debugBuild('ERROR: No starter files loaded');
|
|
172
|
+
throw new Error('Starter files not loaded. Call cloneStarter() first.');
|
|
173
|
+
}
|
|
174
|
+
debugBuild('Creating output directory: %s', outputDir);
|
|
175
|
+
await fs.mkdir(outputDir, { recursive: true });
|
|
176
|
+
debugBuild('Writing %d files to output', this.starterFiles.size);
|
|
177
|
+
let filesWritten = 0;
|
|
178
|
+
for (const [relPath, content] of this.starterFiles.entries()) {
|
|
179
|
+
const outPath = path.join(outputDir, relPath);
|
|
180
|
+
await fs.mkdir(path.dirname(outPath), { recursive: true });
|
|
181
|
+
await fs.writeFile(outPath, content);
|
|
182
|
+
filesWritten++;
|
|
183
|
+
debugBuild('Written file %d/%d: %s', filesWritten, this.starterFiles.size, relPath);
|
|
184
|
+
}
|
|
185
|
+
debugBuild('Build complete - %d files written', filesWritten);
|
|
186
|
+
console.log(`Build complete. Output at: ${outputDir}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,0CAA0C,CAAC,CAAC;AACtE,MAAM,UAAU,GAAG,WAAW,CAAC,gDAAgD,CAAC,CAAC;AACjF,MAAM,UAAU,GAAG,WAAW,CAAC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AE,SAAS,CAAC,CAAC;QACvD,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAE/C,UAAU,CAAC,4BAA4B,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,YAAY,GAAG,CAAC,CAAC;QACrB,KAAK,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;YAC7D,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;YAC9C,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3D,MAAM,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACrC,YAAY,EAAE,CAAC;YACf,UAAU,CAAC,wBAAwB,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtF,CAAC;QAED,UAAU,CAAC,mCAAmC,EAAE,YAAY,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,8BAA8B,SAAS,EAAE,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.d.ts","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAIrE,eAAO,MAAM,YAAY,EAAE,WAM1B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { generateClientManifest } from './commands/generate-client.js';
|
|
2
|
+
import { copyExampleManifest } from './commands/copy-example.js';
|
|
3
|
+
export const CLI_MANIFEST = {
|
|
4
|
+
category: '@auto-engineer/frontend-generator-react-graphql',
|
|
5
|
+
commands: {
|
|
6
|
+
'generate:client': generateClientManifest,
|
|
7
|
+
'copy:example': copyExampleManifest,
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=cli-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-manifest.js","sourceRoot":"","sources":["../src/cli-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAgB;IACvC,QAAQ,EAAE,iDAAiD;IAC3D,QAAQ,EAAE;QACR,iBAAiB,EAAE,sBAAsB;QACzC,cAAc,EAAE,mBAAmB;KACpC;CACF,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
+
export declare const copyExampleManifest: {
|
|
3
|
+
handler: () => Promise<{
|
|
4
|
+
default: CommandHandler<Readonly<{
|
|
5
|
+
type: "CopyExample";
|
|
6
|
+
data: Readonly<{
|
|
7
|
+
starterName: string;
|
|
8
|
+
targetDir: string;
|
|
9
|
+
}>;
|
|
10
|
+
timestamp?: Date;
|
|
11
|
+
requestId?: string;
|
|
12
|
+
correlationId?: string;
|
|
13
|
+
}>, Readonly<{
|
|
14
|
+
type: "ExampleCopied";
|
|
15
|
+
data: {
|
|
16
|
+
starterName: string;
|
|
17
|
+
targetDir: string;
|
|
18
|
+
};
|
|
19
|
+
timestamp?: Date;
|
|
20
|
+
requestId?: string;
|
|
21
|
+
correlationId?: string;
|
|
22
|
+
}> | Readonly<{
|
|
23
|
+
type: "ExampleCopyFailed";
|
|
24
|
+
data: {
|
|
25
|
+
error: string;
|
|
26
|
+
starterName: string;
|
|
27
|
+
targetDir: string;
|
|
28
|
+
};
|
|
29
|
+
timestamp?: Date;
|
|
30
|
+
requestId?: string;
|
|
31
|
+
correlationId?: string;
|
|
32
|
+
}>>;
|
|
33
|
+
}>;
|
|
34
|
+
description: string;
|
|
35
|
+
usage: string;
|
|
36
|
+
examples: string[];
|
|
37
|
+
args: {
|
|
38
|
+
name: string;
|
|
39
|
+
description: string;
|
|
40
|
+
required: boolean;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
export type CopyExampleCommand = Command<'CopyExample', {
|
|
44
|
+
starterName: string;
|
|
45
|
+
targetDir: string;
|
|
46
|
+
}>;
|
|
47
|
+
export type ExampleCopiedEvent = Event<'ExampleCopied', {
|
|
48
|
+
starterName: string;
|
|
49
|
+
targetDir: string;
|
|
50
|
+
}>;
|
|
51
|
+
export type ExampleCopyFailedEvent = Event<'ExampleCopyFailed', {
|
|
52
|
+
error: string;
|
|
53
|
+
starterName: string;
|
|
54
|
+
targetDir: string;
|
|
55
|
+
}>;
|
|
56
|
+
export declare function handleCopyExampleCommand(command: CopyExampleCommand): Promise<ExampleCopiedEvent | ExampleCopyFailedEvent>;
|
|
57
|
+
export declare const copyExampleCommandHandler: CommandHandler<CopyExampleCommand, ExampleCopiedEvent | ExampleCopyFailedEvent>;
|
|
58
|
+
export default copyExampleCommandHandler;
|
|
59
|
+
//# sourceMappingURL=copy-example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copy-example.d.ts","sourceRoot":"","sources":["../../src/commands/copy-example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAQ3F,eAAO,MAAM,mBAAmB;;;;;6BAcf,MAAM;2BACR,MAAM;;;;;;;;6BAOJ,MAAM;2BACR,MAAM;;;;;;;;uBAOV,MAAM;6BACA,MAAM;2BACR,MAAM;;;;;;;;;;;;;;;CAvBpB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CACtC,aAAa,EACb;IACE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,KAAK,CACpC,eAAe,EACf;IACE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,KAAK,CACxC,mBAAmB,EACnB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAkBF,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,GAAG,sBAAsB,CAAC,CA+EtD;AAED,eAAO,MAAM,yBAAyB,EAAE,cAAc,CACpD,kBAAkB,EAClB,kBAAkB,GAAG,sBAAsB,CAY5C,CAAC;AAGF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import createDebug from 'debug';
|
|
5
|
+
const debug = createDebug('frontend-generator-react-graphql:copy-example');
|
|
6
|
+
export const copyExampleManifest = {
|
|
7
|
+
handler: () => Promise.resolve({ default: copyExampleCommandHandler }),
|
|
8
|
+
description: 'Copy example React GraphQL template',
|
|
9
|
+
usage: 'copy:example <example-name> <destination>',
|
|
10
|
+
examples: ['$ auto copy:example shadcn-starter ./my-starter'],
|
|
11
|
+
args: [
|
|
12
|
+
{ name: 'example-name', description: 'Name of the example template', required: true },
|
|
13
|
+
{ name: 'destination', description: 'Destination directory', required: true },
|
|
14
|
+
],
|
|
15
|
+
};
|
|
16
|
+
async function copyDirectory(src, dest) {
|
|
17
|
+
await fs.mkdir(dest, { recursive: true });
|
|
18
|
+
const entries = await fs.readdir(src, { withFileTypes: true });
|
|
19
|
+
for (const entry of entries) {
|
|
20
|
+
const srcPath = path.join(src, entry.name);
|
|
21
|
+
const destPath = path.join(dest, entry.name);
|
|
22
|
+
if (entry.isDirectory()) {
|
|
23
|
+
await copyDirectory(srcPath, destPath);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
await fs.copyFile(srcPath, destPath);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export async function handleCopyExampleCommand(command) {
|
|
31
|
+
const { starterName, targetDir } = command.data;
|
|
32
|
+
try {
|
|
33
|
+
// Get the package directory where this command is located
|
|
34
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
35
|
+
const __dirname = path.dirname(__filename);
|
|
36
|
+
const packageDir = path.dirname(path.dirname(__dirname));
|
|
37
|
+
// Define available starters
|
|
38
|
+
const availableStarters = ['shadcn-starter', 'mui-starter'];
|
|
39
|
+
if (!availableStarters.includes(starterName)) {
|
|
40
|
+
return {
|
|
41
|
+
type: 'ExampleCopyFailed',
|
|
42
|
+
data: {
|
|
43
|
+
error: `Invalid starter name. Available starters: ${availableStarters.join(', ')}`,
|
|
44
|
+
starterName,
|
|
45
|
+
targetDir,
|
|
46
|
+
},
|
|
47
|
+
timestamp: new Date(),
|
|
48
|
+
requestId: command.requestId,
|
|
49
|
+
correlationId: command.correlationId,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
const starterPath = path.join(packageDir, starterName);
|
|
53
|
+
const autoDir = path.join(targetDir, '.auto');
|
|
54
|
+
const finalTargetDir = path.join(autoDir, starterName);
|
|
55
|
+
// Check if starter exists
|
|
56
|
+
try {
|
|
57
|
+
await fs.access(starterPath);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return {
|
|
61
|
+
type: 'ExampleCopyFailed',
|
|
62
|
+
data: {
|
|
63
|
+
error: `Starter "${starterName}" not found at ${starterPath}`,
|
|
64
|
+
starterName,
|
|
65
|
+
targetDir,
|
|
66
|
+
},
|
|
67
|
+
timestamp: new Date(),
|
|
68
|
+
requestId: command.requestId,
|
|
69
|
+
correlationId: command.correlationId,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
// Create .auto directory if it doesn't exist
|
|
73
|
+
await fs.mkdir(autoDir, { recursive: true });
|
|
74
|
+
// Copy the starter
|
|
75
|
+
await copyDirectory(starterPath, finalTargetDir);
|
|
76
|
+
return {
|
|
77
|
+
type: 'ExampleCopied',
|
|
78
|
+
data: {
|
|
79
|
+
starterName,
|
|
80
|
+
targetDir: finalTargetDir,
|
|
81
|
+
},
|
|
82
|
+
timestamp: new Date(),
|
|
83
|
+
requestId: command.requestId,
|
|
84
|
+
correlationId: command.correlationId,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
89
|
+
debug('Failed to copy example: %O', error);
|
|
90
|
+
return {
|
|
91
|
+
type: 'ExampleCopyFailed',
|
|
92
|
+
data: {
|
|
93
|
+
error: errorMessage,
|
|
94
|
+
starterName,
|
|
95
|
+
targetDir,
|
|
96
|
+
},
|
|
97
|
+
timestamp: new Date(),
|
|
98
|
+
requestId: command.requestId,
|
|
99
|
+
correlationId: command.correlationId,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export const copyExampleCommandHandler = {
|
|
104
|
+
name: 'CopyExample',
|
|
105
|
+
handle: async (command) => {
|
|
106
|
+
const result = await handleCopyExampleCommand(command);
|
|
107
|
+
if (result.type === 'ExampleCopied') {
|
|
108
|
+
debug('Starter "%s" copied successfully to %s', result.data.starterName, result.data.targetDir);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
debug('Failed to copy starter: %s', result.data.error);
|
|
112
|
+
}
|
|
113
|
+
return result;
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
// Default export is the command handler
|
|
117
|
+
export default copyExampleCommandHandler;
|
|
118
|
+
//# sourceMappingURL=cop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nB,WAAW;gBACX,SAAS;aACV;YACD,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAGlC;IACF,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,KAAK,EAAE,OAA2B,EAAwD,EAAE;QAClG,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACvD,IAAI,MAAM,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YACpC,KAAK,CAAC,wCAAwC,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClG,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,4BAA4B,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAEF,wCAAwC;AACxC,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type CommandHandler, type Command, type Event } from '@auto-engineer/message-bus';
|
|
2
|
+
export declare const generateClientManifest: {
|
|
3
|
+
handler: () => Promise<{
|
|
4
|
+
default: CommandHandler<Readonly<{
|
|
5
|
+
type: "GenerateClient";
|
|
6
|
+
data: Readonly<{
|
|
7
|
+
starterDir: string;
|
|
8
|
+
targetDir: string;
|
|
9
|
+
iaSchemaPath: string;
|
|
10
|
+
gqlSchemaPath: string;
|
|
11
|
+
figmaVariablesPath: string;
|
|
12
|
+
}>;
|
|
13
|
+
timestamp?: Date;
|
|
14
|
+
requestId?: string;
|
|
15
|
+
correlationId?: string;
|
|
16
|
+
}>, Readonly<{
|
|
17
|
+
type: "ClientGenerated";
|
|
18
|
+
data: {
|
|
19
|
+
targetDir: string;
|
|
20
|
+
};
|
|
21
|
+
timestamp?: Date;
|
|
22
|
+
requestId?: string;
|
|
23
|
+
correlationId?: string;
|
|
24
|
+
}> | Readonly<{
|
|
25
|
+
type: "ClientGenerationFailed";
|
|
26
|
+
data: {
|
|
27
|
+
error: string;
|
|
28
|
+
targetDir: string;
|
|
29
|
+
};
|
|
30
|
+
timestamp?: Date;
|
|
31
|
+
requestId?: string;
|
|
32
|
+
correlationId?: string;
|
|
33
|
+
}>>;
|
|
34
|
+
}>;
|
|
35
|
+
description: string;
|
|
36
|
+
usage: string;
|
|
37
|
+
examples: string[];
|
|
38
|
+
args: {
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
required: boolean;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
export type GenerateClientCommand = Command<'GenerateClient', {
|
|
45
|
+
starterDir: string;
|
|
46
|
+
targetDir: string;
|
|
47
|
+
iaSchemaPath: string;
|
|
48
|
+
gqlSchemaPath: string;
|
|
49
|
+
figmaVariablesPath: string;
|
|
50
|
+
}>;
|
|
51
|
+
export type ClientGeneratedEvent = Event<'ClientGenerated', {
|
|
52
|
+
targetDir: string;
|
|
53
|
+
}>;
|
|
54
|
+
export type ClientGenerationFailedEvent = Event<'ClientGenerationFailed', {
|
|
55
|
+
error: string;
|
|
56
|
+
targetDir: string;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const generateClientCommandHandler: CommandHandler<GenerateClientCommand, ClientGeneratedEvent | ClientGenerationFailedEvent>;
|
|
59
|
+
export default generateClientCommandHandler;
|
|
60
|
+
//# sourceMappingURL=generate-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-client.d.ts","sourceRoot":"","sources":["../../src/commands/generate-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAe3F,eAAO,MAAM,sBAAsB;;;;;4BAiBnB,MAAM;2BACP,MAAM;8BACH,MAAM;+BACL,MAAM;oCACD,MAAM;;;;;;;;2BAOf,MAAM;;;;;;;;uBAOV,MAAM;2BACF,MAAM;;;;;;;;;;;;;;;CAxBpB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,gBAAgB,EAChB;IACE,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CACF,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,KAAK,CACtC,iBAAiB,EACjB;IACE,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,wBAAwB,EACxB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CACF,CAAC;AAyFF,eAAO,MAAM,4BAA4B,EAAE,cAAc,CACvD,qBAAqB,EACrB,oBAAoB,GAAG,2BAA2B,CAenD,CAAC;AAGF,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { promises as fs } from 'fs';
|
|
2
|
+
import { FrontendScaffoldBuilder } from '../builder.js';
|
|
3
|
+
import { generateComponents } from '../generator/generateComponents.js';
|
|
4
|
+
import { writeGqlOperationsToFolder } from '../scaffold-gql-operations.js';
|
|
5
|
+
import { generateSchemaFile } from '../write-graphql-schema.js';
|
|
6
|
+
import { runCodegen } from '../run-codegen.js';
|
|
7
|
+
import { configureStarter } from '../configure-starter.js';
|
|
8
|
+
import createDebug from 'debug';
|
|
9
|
+
const debug = createDebug('frontend-generator-react-graphql:command');
|
|
10
|
+
const debugBuilder = createDebug('frontend-generator-react-graphql:command:builder');
|
|
11
|
+
const debugGeneration = createDebug('frontend-generator-react-graphql:command:generation');
|
|
12
|
+
export const generateClientManifest = {
|
|
13
|
+
handler: () => Promise.resolve({ default: generateClientCommandHandler }),
|
|
14
|
+
description: 'Generate React client app',
|
|
15
|
+
usage: 'generate:client <starter> <client> <ia> <gql> [vars]',
|
|
16
|
+
examples: ['$ auto generate:client ./shadcn-starter ./client ./auto-ia.json ./schema.graphql ./figma-vars.json'],
|
|
17
|
+
args: [
|
|
18
|
+
{ name: 'starter', description: 'Starter template path', required: true },
|
|
19
|
+
{ name: 'client', description: 'Client output directory', required: true },
|
|
20
|
+
{ name: 'ia', description: 'Information architecture JSON file', required: true },
|
|
21
|
+
{ name: 'gql', description: 'GraphQL schema file', required: true },
|
|
22
|
+
{ name: 'vars', description: 'Figma variables JSON file', required: false },
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
async function handleGenerateClientCommandInternal(command) {
|
|
26
|
+
const { starterDir, targetDir, iaSchemaPath, gqlSchemaPath, figmaVariablesPath } = command.data;
|
|
27
|
+
debug('Handling GenerateClient command - requestId: %s, correlationId: %s', command.requestId, command.correlationId);
|
|
28
|
+
debug('Command data - starterDir: %s, targetDir: %s, iaSchemaPath: %s, gqlSchemaPath: %s, figmaVariablesPath: %s', starterDir, targetDir, iaSchemaPath, gqlSchemaPath, figmaVariablesPath);
|
|
29
|
+
try {
|
|
30
|
+
// Build frontend scaffold
|
|
31
|
+
debugBuilder('Creating FrontendScaffoldBuilder');
|
|
32
|
+
const builder = new FrontendScaffoldBuilder();
|
|
33
|
+
debugBuilder('Cloning starter from: %s', starterDir);
|
|
34
|
+
await builder.cloneStarter(starterDir);
|
|
35
|
+
debugBuilder('Building to target: %s', targetDir);
|
|
36
|
+
await builder.build(targetDir);
|
|
37
|
+
debugBuilder('Build complete');
|
|
38
|
+
// Read and parse IA schema
|
|
39
|
+
debugGeneration('Reading IA schema from: %s', iaSchemaPath);
|
|
40
|
+
const iaSchemeJsonFile = await fs.readFile(iaSchemaPath, 'utf-8');
|
|
41
|
+
debugGeneration('IA schema file size: %d bytes', iaSchemeJsonFile.length);
|
|
42
|
+
const iaSchemeJson = JSON.parse(iaSchemeJsonFile);
|
|
43
|
+
debugGeneration('IA schema parsed successfully');
|
|
44
|
+
// Generate components from IA schema
|
|
45
|
+
debugGeneration('Generating components to: %s/src', targetDir);
|
|
46
|
+
generateComponents(iaSchemeJson, `${targetDir}/src`);
|
|
47
|
+
debugGeneration('Components generated');
|
|
48
|
+
// Write GraphQL operations
|
|
49
|
+
debugGeneration('Writing GraphQL operations to: %s/src', targetDir);
|
|
50
|
+
writeGqlOperationsToFolder(iaSchemeJson, `${targetDir}/src`);
|
|
51
|
+
debugGeneration('GraphQL operations written');
|
|
52
|
+
// Generate GraphQL schema file
|
|
53
|
+
debugGeneration('Generating GraphQL schema from: %s', gqlSchemaPath);
|
|
54
|
+
generateSchemaFile(gqlSchemaPath, targetDir);
|
|
55
|
+
debugGeneration('GraphQL schema generated');
|
|
56
|
+
// Run codegen
|
|
57
|
+
debugGeneration('Running codegen in: %s', targetDir);
|
|
58
|
+
runCodegen(targetDir);
|
|
59
|
+
debugGeneration('Codegen complete');
|
|
60
|
+
// Configure starter
|
|
61
|
+
debugGeneration('Configuring starter with Figma variables: %s', figmaVariablesPath);
|
|
62
|
+
configureStarter(figmaVariablesPath, targetDir);
|
|
63
|
+
debugGeneration('Starter configured');
|
|
64
|
+
debug('Client generation successful for target: %s', targetDir);
|
|
65
|
+
return {
|
|
66
|
+
type: 'ClientGenerated',
|
|
67
|
+
data: {
|
|
68
|
+
targetDir,
|
|
69
|
+
},
|
|
70
|
+
timestamp: new Date(),
|
|
71
|
+
requestId: command.requestId,
|
|
72
|
+
correlationId: command.correlationId,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
77
|
+
debug('ERROR: Client generation failed - %s', errorMessage);
|
|
78
|
+
debug('Error details: %O', error);
|
|
79
|
+
debug('Failed to generate client: %O', error);
|
|
80
|
+
return {
|
|
81
|
+
type: 'ClientGenerationFailed',
|
|
82
|
+
data: {
|
|
83
|
+
error: errorMessage,
|
|
84
|
+
targetDir,
|
|
85
|
+
},
|
|
86
|
+
timestamp: new Date(),
|
|
87
|
+
requestId: command.requestId,
|
|
88
|
+
correlationId: command.correlationId,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export const generateClientCommandHandler = {
|
|
93
|
+
name: 'GenerateClient',
|
|
94
|
+
handle: async (command) => {
|
|
95
|
+
debug('Command handler invoked for GenerateClient');
|
|
96
|
+
const result = await handleGenerateClientCommandInternal(command);
|
|
97
|
+
if (result.type === 'ClientGenerated') {
|
|
98
|
+
debug('Handler completed successfully');
|
|
99
|
+
debug('Client generated successfully');
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
debug('Handler failed with error: %s', result.data.error);
|
|
103
|
+
debug('Failed: %s', result.data.error);
|
|
104
|
+
}
|
|
105
|
+
return result;
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
// Default export is the command handler
|
|
109
|
+
export default generateClientCommandHandler;
|
|
110
|
+
//# sourceMappingURL=generate-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-client.js","sourceRoot":"","sources":["../../src/commands/generate-client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,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CAAmC,CAAC,OAAO,CAAC,CAAC;QAClE,IAAI,MAAM,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;YACtC,KAAK,CAAC,gCAAgC,CAAC,CAAC;YACxC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,+BAA+B,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC1D,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC;AAEF,wCAAwC;AACxC,eAAe,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-starter.d.ts","sourceRoot":"","sources":["../src/configure-starter.ts"],"names":[],"mappings":"AAiBA,wBAAgB,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAwBtF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
function runCommand(cmd, cwd) {
|
|
5
|
+
try {
|
|
6
|
+
return execSync(cmd, { cwd, encoding: 'utf-8', stdio: 'pipe' });
|
|
7
|
+
}
|
|
8
|
+
catch (e) {
|
|
9
|
+
const error = e;
|
|
10
|
+
let output = '';
|
|
11
|
+
if (error.stdout)
|
|
12
|
+
output += error.stdout.toString();
|
|
13
|
+
if (error.stderr)
|
|
14
|
+
output += error.stderr.toString();
|
|
15
|
+
if (!output && error.message != null)
|
|
16
|
+
output = error.message;
|
|
17
|
+
return output;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function configureStarter(figmaVariablesPath, projectPath) {
|
|
21
|
+
const resolvedPath = path.resolve(projectPath);
|
|
22
|
+
if (!fs.existsSync(resolvedPath)) {
|
|
23
|
+
throw new Error(`❌ Project path does not exist: ${resolvedPath}`);
|
|
24
|
+
}
|
|
25
|
+
const configureScript = path.join(resolvedPath, 'auto-configure.ts');
|
|
26
|
+
if (!fs.existsSync(configureScript)) {
|
|
27
|
+
console.log('⚠️ No auto-configure.ts found in starter. Skipping configuration.');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const absoluteFigmaPath = path.isAbsolute(figmaVariablesPath)
|
|
31
|
+
? figmaVariablesPath
|
|
32
|
+
: path.resolve(process.cwd(), figmaVariablesPath);
|
|
33
|
+
console.log('FIGMA PATH', absoluteFigmaPath);
|
|
34
|
+
console.log('▶ Running starter configuration in', resolvedPath);
|
|
35
|
+
// const output = runCommand('npx pnpm codegen', resolvedPath);
|
|
36
|
+
const output = runCommand(`npx pnpm auto-configure`, resolvedPath);
|
|
37
|
+
console.log(output);
|
|
38
|
+
console.log('✅ Starter configuration completed.');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=configure-starter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure-starter.js","sourceRoot":"","sources":["../src/configure-starter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,SAAS,UAAU,CAAC,GAAW,EAAE,GAAW;IAC1C,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAClE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,CAA2D,CAAC;QAC1E,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,IAAI,KAAK,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,QAAQ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