@auto-engineer/cli 0.5.20 → 0.6.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 +11 -0
- package/LICENSE +10 -0
- package/README.md +185 -151
- package/dist/src/index.js +254 -93
- package/dist/src/index.js.map +1 -1
- package/dist/src/manifest-types.d.ts +21 -0
- package/dist/src/manifest-types.d.ts.map +1 -0
- package/dist/src/manifest-types.js +2 -0
- package/dist/src/manifest-types.js.map +1 -0
- package/dist/src/plugin-loader.d.ts +49 -0
- package/dist/src/plugin-loader.d.ts.map +1 -0
- package/dist/src/plugin-loader.js +383 -0
- package/dist/src/plugin-loader.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -28
- package/dist/src/commands/check-client.d.ts +0 -6
- package/dist/src/commands/check-client.d.ts.map +0 -1
- package/dist/src/commands/check-client.js +0 -69
- package/dist/src/commands/check-client.js.map +0 -1
- package/dist/src/commands/check-lint.d.ts +0 -5
- package/dist/src/commands/check-lint.d.ts.map +0 -1
- package/dist/src/commands/check-lint.js +0 -96
- package/dist/src/commands/check-lint.js.map +0 -1
- package/dist/src/commands/check-tests.d.ts +0 -5
- package/dist/src/commands/check-tests.d.ts.map +0 -1
- package/dist/src/commands/check-tests.js +0 -87
- package/dist/src/commands/check-tests.js.map +0 -1
- package/dist/src/commands/check-types.d.ts +0 -5
- package/dist/src/commands/check-types.d.ts.map +0 -1
- package/dist/src/commands/check-types.js +0 -83
- package/dist/src/commands/check-types.js.map +0 -1
- package/dist/src/commands/copy-example.d.ts +0 -5
- package/dist/src/commands/copy-example.d.ts.map +0 -1
- package/dist/src/commands/copy-example.js +0 -54
- package/dist/src/commands/copy-example.js.map +0 -1
- package/dist/src/commands/create-example.d.ts +0 -5
- package/dist/src/commands/create-example.d.ts.map +0 -1
- package/dist/src/commands/create-example.js +0 -60
- package/dist/src/commands/create-example.js.map +0 -1
- package/dist/src/commands/export-schema.d.ts +0 -5
- package/dist/src/commands/export-schema.d.ts.map +0 -1
- package/dist/src/commands/export-schema.js +0 -49
- package/dist/src/commands/export-schema.js.map +0 -1
- package/dist/src/commands/generate-client.d.ts +0 -5
- package/dist/src/commands/generate-client.d.ts.map +0 -1
- package/dist/src/commands/generate-client.js +0 -77
- package/dist/src/commands/generate-client.js.map +0 -1
- package/dist/src/commands/generate-gql-schema.d.ts +0 -5
- package/dist/src/commands/generate-gql-schema.d.ts.map +0 -1
- package/dist/src/commands/generate-gql-schema.js +0 -57
- package/dist/src/commands/generate-gql-schema.js.map +0 -1
- package/dist/src/commands/generate-ia.d.ts +0 -5
- package/dist/src/commands/generate-ia.d.ts.map +0 -1
- package/dist/src/commands/generate-ia.js +0 -54
- package/dist/src/commands/generate-ia.js.map +0 -1
- package/dist/src/commands/generate-server.d.ts +0 -5
- package/dist/src/commands/generate-server.d.ts.map +0 -1
- package/dist/src/commands/generate-server.js +0 -50
- package/dist/src/commands/generate-server.js.map +0 -1
- package/dist/src/commands/implement-client.d.ts +0 -5
- package/dist/src/commands/implement-client.d.ts.map +0 -1
- package/dist/src/commands/implement-client.js +0 -70
- package/dist/src/commands/implement-client.js.map +0 -1
- package/dist/src/commands/implement-server.d.ts +0 -5
- package/dist/src/commands/implement-server.d.ts.map +0 -1
- package/dist/src/commands/implement-server.js +0 -69
- package/dist/src/commands/implement-server.js.map +0 -1
- package/dist/src/commands/import-design-system.d.ts +0 -5
- package/dist/src/commands/import-design-system.d.ts.map +0 -1
- package/dist/src/commands/import-design-system.js +0 -62
- package/dist/src/commands/import-design-system.js.map +0 -1
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
export const createCreateExampleCommand = (config, analytics) => {
|
|
5
|
-
const output = createOutput(config);
|
|
6
|
-
const command = new Command('create:example');
|
|
7
|
-
command
|
|
8
|
-
.description('Create an example project')
|
|
9
|
-
.argument('<example-name>', 'Name of the example to create')
|
|
10
|
-
.option('--directory <path>', 'Target directory (defaults to current directory)')
|
|
11
|
-
.action(async (exampleName, options) => {
|
|
12
|
-
try {
|
|
13
|
-
await analytics.track({ command: 'create:example:start', success: true });
|
|
14
|
-
const targetDirectory = options.directory ?? process.cwd();
|
|
15
|
-
output.info(`Creating example "${exampleName}" in ${targetDirectory}...`);
|
|
16
|
-
// Import the handler
|
|
17
|
-
const { handleCreateExampleCommand } = await import('@auto-engineer/flowlang');
|
|
18
|
-
const createCommand = {
|
|
19
|
-
type: 'CreateExample',
|
|
20
|
-
data: {
|
|
21
|
-
exampleName,
|
|
22
|
-
targetDirectory,
|
|
23
|
-
},
|
|
24
|
-
timestamp: new Date(),
|
|
25
|
-
requestId: `create-example-${Date.now()}`,
|
|
26
|
-
};
|
|
27
|
-
// TODO use the bus
|
|
28
|
-
const result = await handleCreateExampleCommand(createCommand);
|
|
29
|
-
if (result.type === 'ExampleCreated') {
|
|
30
|
-
output.success(`✅ Example "${exampleName}" created successfully!`);
|
|
31
|
-
// output.info('');
|
|
32
|
-
// output.info('Files created:');
|
|
33
|
-
// result.data.filesCreated.forEach((file: string) => {
|
|
34
|
-
// output.info(` - ${file}`);
|
|
35
|
-
// });
|
|
36
|
-
output.info('');
|
|
37
|
-
output.info('Next steps:');
|
|
38
|
-
output.info('1. Review the generated files');
|
|
39
|
-
output.info('2. Install dependencies: npm install');
|
|
40
|
-
output.info('3. Start development: npm run dev');
|
|
41
|
-
await analytics.track({ command: 'create:example', success: true });
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
output.error(`❌ Failed to create example: ${result.data.error}`);
|
|
45
|
-
await analytics.track({ command: 'create:example', success: false, errorCode: result.data.error });
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
await analytics.track({
|
|
51
|
-
command: 'create:example',
|
|
52
|
-
success: false,
|
|
53
|
-
errorCode: error instanceof Error ? error.message : String(error),
|
|
54
|
-
});
|
|
55
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return command;
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=create-example.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-example.js","sourceRoot":"","sources":["../../../src/commands/create-example.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAAc,EAAE,SAAoB,EAAW,EAAE;IAC1F,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE9C,OAAO;SACJ,WAAW,CAAC,2BAA2B,CAAC;SACxC,QAAQ,CAAC,gBAAgB,EAAE,+BAA+B,CAAC;SAC3D,MAAM,CAAC,oBAAoB,EAAE,kDAAkD,CAAC;SAChF,MAAM,CAAC,KAAK,EAAE,WAAmB,EAAE,OAA+B,EAAE,EAAE;QACrE,IAAI,CAAC;YACH,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAE1E,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAE3D,MAAM,CAAC,IAAI,CAAC,qBAAqB,WAAW,QAAQ,eAAe,KAAK,CAAC,CAAC;YAE1E,qBAAqB;YACrB,MAAM,EAAE,0BAA0B,EAAE,GAAG,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;YAE/E,MAAM,aAAa,GA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BACpB,OAAO,EAAE,gBAAgB;gBACzB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAClE,CAAC,CAAC;YACH,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createExportSchemaCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=export-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-schema.d.ts","sourceRoot":"","sources":["../../../src/commands/export-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,yBAAyB,WAAY,MAAM,aAAa,SAAS,KAAG,OAoDhF,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
export const createExportSchemaCommand = (config, analytics) => {
|
|
5
|
-
const output = createOutput(config);
|
|
6
|
-
const command = new Command('export:schema');
|
|
7
|
-
command
|
|
8
|
-
.description('Export flow schema to .context/schema.json')
|
|
9
|
-
.option('--directory <path>', 'Target directory (defaults to current directory)')
|
|
10
|
-
.action(async (options) => {
|
|
11
|
-
try {
|
|
12
|
-
await analytics.track({ command: 'export:schema:start', success: true });
|
|
13
|
-
const directory = options.directory ?? process.cwd();
|
|
14
|
-
output.info(`Exporting flow schema from ${directory}/flows...`);
|
|
15
|
-
// Import dynamically to avoid TypeScript module resolution issues
|
|
16
|
-
const { handleExportSchemaCommand } = await import('@auto-engineer/flowlang');
|
|
17
|
-
const exportCommand = {
|
|
18
|
-
type: 'ExportSchema',
|
|
19
|
-
data: {
|
|
20
|
-
directory,
|
|
21
|
-
},
|
|
22
|
-
timestamp: new Date(),
|
|
23
|
-
requestId: `export-schema-${Date.now()}`,
|
|
24
|
-
};
|
|
25
|
-
// TODO use the bus
|
|
26
|
-
const result = await handleExportSchemaCommand(exportCommand);
|
|
27
|
-
if (result.type === 'SchemaExported') {
|
|
28
|
-
output.success(`✅ Flow schema exported successfully!`);
|
|
29
|
-
output.info(`Schema written to: ${result.data.outputPath}`);
|
|
30
|
-
await analytics.track({ command: 'export:schema', success: true });
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
output.error(`❌ Failed to export schema: ${result.data.error}`);
|
|
34
|
-
await analytics.track({ command: 'export:schema', success: false, errorCode: result.data.error });
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
await analytics.track({
|
|
40
|
-
command: 'export:schema',
|
|
41
|
-
success: false,
|
|
42
|
-
errorCode: error instanceof Error ? error.message : String(error),
|
|
43
|
-
});
|
|
44
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
return command;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=export-schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"export-schema.js","sourceRoot":"","sources":["../../../src/commands/export-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAA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I,CAAC,sBAAsB,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBAE5D,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACrE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,KAAK,CAAC,8BAA8B,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBAChE,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBAClG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,KAAK,CAAC;gBACpB,OAAO,EAAE,eAAe;gBACxB,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAClE,CAAC,CAAC;YACH,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createGenerateClientCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=generate-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-client.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,eAAO,MAAM,2BAA2B,WAAY,MAAM,aAAa,SAAS,KAAG,OA2FlF,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import createDebug from 'debug';
|
|
6
|
-
const debug = createDebug('cli:generate-client');
|
|
7
|
-
export const createGenerateClientCommand = (config, analytics) => {
|
|
8
|
-
const output = createOutput(config);
|
|
9
|
-
const command = new Command('generate:client');
|
|
10
|
-
command
|
|
11
|
-
.description('Generate client application from IA schema and GraphQL schema')
|
|
12
|
-
.argument('<starterDir>', 'Path to the starter template directory')
|
|
13
|
-
.argument('<targetDir>', 'Target directory for the generated client')
|
|
14
|
-
.argument('<iaSchemaPath>', 'Path to the IA schema JSON file')
|
|
15
|
-
.argument('<gqlSchemaPath>', 'Path to the GraphQL schema file')
|
|
16
|
-
.argument('<figmaVariablesPath>', 'Path to the Figma variables file')
|
|
17
|
-
.action(async (starterDir, targetDir, iaSchemaPath, gqlSchemaPath, figmaVariablesPath) => {
|
|
18
|
-
debug('Command started with args - starter: %s, target: %s, ia: %s, gql: %s, figma: %s', starterDir, targetDir, iaSchemaPath, gqlSchemaPath, figmaVariablesPath);
|
|
19
|
-
try {
|
|
20
|
-
await analytics.track({ command: 'generate:client:start', success: true });
|
|
21
|
-
debug('Analytics tracked');
|
|
22
|
-
// Resolve paths
|
|
23
|
-
const resolvedStarterDir = path.resolve(starterDir);
|
|
24
|
-
const resolvedTargetDir = path.resolve(targetDir);
|
|
25
|
-
const resolvedIASchemaPath = path.resolve(iaSchemaPath);
|
|
26
|
-
const resolvedGQLSchemaPath = path.resolve(gqlSchemaPath);
|
|
27
|
-
debug('Paths resolved');
|
|
28
|
-
output.info(`Generating client application`);
|
|
29
|
-
output.info(`Starter template: ${resolvedStarterDir}`);
|
|
30
|
-
output.info(`Target directory: ${resolvedTargetDir}`);
|
|
31
|
-
output.info(`IA schema: ${resolvedIASchemaPath}`);
|
|
32
|
-
output.info(`GraphQL schema: ${resolvedGQLSchemaPath}`);
|
|
33
|
-
output.info(`Figma Variables: ${figmaVariablesPath}`);
|
|
34
|
-
// Import the handler
|
|
35
|
-
debug('Importing react-graphql-generator handler');
|
|
36
|
-
const { handleGenerateClientCommand } = await import('@auto-engineer/react-graphql-generator');
|
|
37
|
-
debug('Handler imported successfully');
|
|
38
|
-
const generateCommand = {
|
|
39
|
-
type: 'GenerateClient',
|
|
40
|
-
data: {
|
|
41
|
-
starterDir: resolvedStarterDir,
|
|
42
|
-
targetDir: resolvedTargetDir,
|
|
43
|
-
iaSchemaPath: resolvedIASchemaPath,
|
|
44
|
-
gqlSchemaPath: resolvedGQLSchemaPath,
|
|
45
|
-
figmaVariablesPath: figmaVariablesPath,
|
|
46
|
-
},
|
|
47
|
-
timestamp: new Date(),
|
|
48
|
-
requestId: `generate-client-${Date.now()}`,
|
|
49
|
-
};
|
|
50
|
-
debug('Calling handleGenerateClientCommand with request ID: %s', generateCommand.requestId);
|
|
51
|
-
const result = await handleGenerateClientCommand(generateCommand);
|
|
52
|
-
debug('Command handler returned result type: %s', result.type);
|
|
53
|
-
if (result.type === 'ClientGenerated') {
|
|
54
|
-
debug('Client generation successful');
|
|
55
|
-
output.success(`✅ Client generated at: ${result.data.targetDir}`);
|
|
56
|
-
await analytics.track({ command: 'generate:client', success: true });
|
|
57
|
-
debug('Success analytics tracked');
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
debug('Client generation failed: %s', result.data.error);
|
|
61
|
-
output.error(`❌ Failed to generate client: ${result.data.error}`);
|
|
62
|
-
await analytics.track({ command: 'generate:client', success: false, errorCode: result.data.error });
|
|
63
|
-
debug('Failure analytics tracked, exiting with code 1');
|
|
64
|
-
process.exit(1);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
debug('Exception caught: %O', error);
|
|
69
|
-
await analytics.track({ command: 'generate:client', success: false, errorCode: 'exception' });
|
|
70
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
71
|
-
debug('Error handled, exiting with code 1');
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
return command;
|
|
76
|
-
};
|
|
77
|
-
//# sourceMappingURL=generate-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-client.js","sourceRoot":"","sources":["../../../src/commands/generate-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,WAAW,MAAM,OAAO,CAAC;AAEhC,MAAM,KAAK,GAAG,WAAW,CAAC,qBAAqB,CAAC,CAAC;AAEjD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,SAAoB,EAAW,EAAE;IAC3F,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE/C,OAAO;SACJ,WAAW,CAAC,+DAA+D,CAAC;SAC5E,QAAQ,CAAC,cAAc,EAAE,wCAAwC,CAAC;SAClE,QAAQ,CAAC,aAAa,EAAE,2CAA2C,CAAC;SACpE,QAAQ,CAAC,gBAAgB,EAAE,iCAAiC,CAAC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SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACpG,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACrC,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;YAC9F,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;IAEJ,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createGenerateGQLSchemaCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=generate-gql-schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-gql-schema.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-gql-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAK/C,eAAO,MAAM,8BAA8B,WAAY,MAAM,aAAa,SAAS,KAAG,OAwDrF,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
import { execa } from 'execa';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
import { existsSync } from 'fs';
|
|
7
|
-
export const createGenerateGQLSchemaCommand = (config, analytics) => {
|
|
8
|
-
const output = createOutput(config);
|
|
9
|
-
const command = new Command('generate:gql-schema');
|
|
10
|
-
command
|
|
11
|
-
.description('Generate GraphQL schema from server resolvers')
|
|
12
|
-
.argument('<serverPath>', 'Path to the server directory')
|
|
13
|
-
.action(async (serverPath) => {
|
|
14
|
-
try {
|
|
15
|
-
await analytics.track({ command: 'generate:gql-schema:start', success: true });
|
|
16
|
-
const absServerPath = path.resolve(serverPath);
|
|
17
|
-
// Check if server directory exists
|
|
18
|
-
if (!existsSync(absServerPath)) {
|
|
19
|
-
output.error(`❌ Server directory not found: ${absServerPath}`);
|
|
20
|
-
await analytics.track({ command: 'generate:gql-schema', success: false, errorCode: 'server_not_found' });
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
// Check if generate-schema script exists
|
|
24
|
-
const schemaScriptPath = path.join(absServerPath, 'scripts', 'generate-schema.ts');
|
|
25
|
-
if (!existsSync(schemaScriptPath)) {
|
|
26
|
-
output.error(`❌ GraphQL schema generation script not found at: ${schemaScriptPath}`);
|
|
27
|
-
output.info('Please ensure the server was generated with generate:server command first');
|
|
28
|
-
await analytics.track({ command: 'generate:gql-schema', success: false, errorCode: 'script_not_found' });
|
|
29
|
-
process.exit(1);
|
|
30
|
-
}
|
|
31
|
-
output.info(`🔄 Generating GraphQL schema from: ${absServerPath}`);
|
|
32
|
-
try {
|
|
33
|
-
// Run the schema generation script
|
|
34
|
-
await execa('npx', ['tsx', 'scripts/generate-schema.ts'], {
|
|
35
|
-
cwd: absServerPath,
|
|
36
|
-
stdio: 'inherit',
|
|
37
|
-
});
|
|
38
|
-
output.success(`✅ GraphQL schema generated successfully`);
|
|
39
|
-
await analytics.track({ command: 'generate:gql-schema', success: true });
|
|
40
|
-
}
|
|
41
|
-
catch (execError) {
|
|
42
|
-
output.error(`❌ Failed to generate GraphQL schema`);
|
|
43
|
-
if (execError instanceof Error) {
|
|
44
|
-
output.error(execError.message);
|
|
45
|
-
}
|
|
46
|
-
await analytics.track({ command: 'generate:gql-schema', success: false, errorCode: 'generation_failed' });
|
|
47
|
-
process.exit(1);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
await analytics.track({ command: 'generate:gql-schema', success: false, errorCode: 'exception' });
|
|
52
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
return command;
|
|
56
|
-
};
|
|
57
|
-
//# sourceMappingURL=generate-gql-schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-gql-schema.js","sourceRoot":"","sources":["../../../src/commands/generate-gql-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAc,EAAE,SAAoB,EAAW,EAAE;IAC9F,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAEnD,OAAO;SACJ,WAAW,CAAC,+CAA+C,CAAC;SAC5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AAE,4BAA4B,CAAC,EAAE;oBACxD,GAAG,EAAE,aAAa;oBAClB,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAC;gBAEH,MAAM,CAAC,OAAO,CAAC,yCAAyC,CAAC,CAAC;gBAC1D,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC3E,CAAC;YAAC,OAAO,SAAS,EAAE,CAAC;gBACnB,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;gBACpD,IAAI,SAAS,YAAY,KAAK,EAAE,CAAC;oBAC/B,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;gBAClC,CAAC;gBACD,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;gBAC1G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;YAClG,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createGenerateIACommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=generate-ia.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-ia.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-ia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,eAAO,MAAM,uBAAuB,WAAY,MAAM,aAAa,SAAS,KAAG,OAwD9E,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
export const createGenerateIACommand = (config, analytics) => {
|
|
6
|
-
const output = createOutput(config);
|
|
7
|
-
const command = new Command('generate:ia');
|
|
8
|
-
command
|
|
9
|
-
.description('Generate Information Architecture schema from flow files')
|
|
10
|
-
.argument('<outputDir>', 'Output directory for the IA schema')
|
|
11
|
-
.argument('[flowFiles...]', 'Flow files to process')
|
|
12
|
-
.action(async (outputDir, flowFiles) => {
|
|
13
|
-
try {
|
|
14
|
-
await analytics.track({ command: 'generate:ia:start', success: true });
|
|
15
|
-
if (flowFiles.length === 0) {
|
|
16
|
-
output.error('❌ No flow files provided');
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
// Resolve paths
|
|
20
|
-
const resolvedOutputDir = path.resolve(outputDir);
|
|
21
|
-
const resolvedFlowFiles = flowFiles.map((f) => path.resolve(f));
|
|
22
|
-
output.info(`Generating IA schema from ${flowFiles.length} flow file(s)`);
|
|
23
|
-
output.info(`Output directory: ${resolvedOutputDir}`);
|
|
24
|
-
// Import the handler
|
|
25
|
-
const { handleGenerateIACommand } = await import('@auto-engineer/information-architect');
|
|
26
|
-
const generateCommand = {
|
|
27
|
-
type: 'GenerateIA',
|
|
28
|
-
data: {
|
|
29
|
-
outputDir: resolvedOutputDir,
|
|
30
|
-
flowFiles: resolvedFlowFiles,
|
|
31
|
-
},
|
|
32
|
-
timestamp: new Date(),
|
|
33
|
-
requestId: `generate-ia-${Date.now()}`,
|
|
34
|
-
};
|
|
35
|
-
const result = await handleGenerateIACommand(generateCommand);
|
|
36
|
-
if (result.type === 'IAGenerated') {
|
|
37
|
-
output.success(`✅ IA schema generated at: ${result.data.outputPath}`);
|
|
38
|
-
await analytics.track({ command: 'generate:ia', success: true });
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
output.error(`❌ Failed to generate IA schema: ${result.data.error}`);
|
|
42
|
-
await analytics.track({ command: 'generate:ia', success: false, errorCode: result.data.error });
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
await analytics.track({ command: 'generate:ia', success: false, errorCode: 'exception' });
|
|
48
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
return command;
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=generate-ia.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-ia.js","sourceRoot":"","sources":["../../../src/commands/generate-ia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAc,EAAE,SAAoB,EAAW,EAAE;IACvF,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,OAAO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AM,uBAAuB,CAAC,eAAe,CAAC,CAAC;YAE9D,IAAI,MAAM,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;gBAClC,MAAM,CAAC,OAAO,CAAC,6BAA6B,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;gBACtE,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YACnE,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,KAAK,CAAC,mCAAmC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACrE,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBAChG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;YAC1F,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createGenerateServerCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=generate-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-server.d.ts","sourceRoot":"","sources":["../../../src/commands/generate-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,eAAO,MAAM,2BAA2B,WAAY,MAAM,aAAa,SAAS,KAAG,OAmDlF,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
export const createGenerateServerCommand = (config, analytics) => {
|
|
5
|
-
const output = createOutput(config);
|
|
6
|
-
const command = new Command('generate:server');
|
|
7
|
-
command
|
|
8
|
-
.description('Generate server implementation from schema.json into ./server')
|
|
9
|
-
.argument('<schemaPath>', 'Path to .context/schema.json')
|
|
10
|
-
.option('--destination <path>', 'Destination project root (default: current directory)')
|
|
11
|
-
.action(async (schemaPath, options) => {
|
|
12
|
-
try {
|
|
13
|
-
await analytics.track({ command: 'generate:server:start', success: true });
|
|
14
|
-
const destination = options.destination ?? process.cwd();
|
|
15
|
-
output.info(`Generating server from schema: ${schemaPath}`);
|
|
16
|
-
output.info(`Destination: ${destination}`);
|
|
17
|
-
// Import the handler
|
|
18
|
-
const { handleGenerateServerCommand } = await import('@auto-engineer/emmett-generator');
|
|
19
|
-
const generateCommand = {
|
|
20
|
-
type: 'GenerateServer',
|
|
21
|
-
data: {
|
|
22
|
-
schemaPath,
|
|
23
|
-
destination,
|
|
24
|
-
},
|
|
25
|
-
timestamp: new Date(),
|
|
26
|
-
requestId: `generate-server-${Date.now()}`,
|
|
27
|
-
};
|
|
28
|
-
const result = await handleGenerateServerCommand(generateCommand);
|
|
29
|
-
if (result.type === 'ServerGenerated') {
|
|
30
|
-
output.success(`✅ Server generated at: ${result.data.serverDir}`);
|
|
31
|
-
const schemaOut = result.data.contextSchemaGraphQL;
|
|
32
|
-
if (typeof schemaOut === 'string' && schemaOut.length > 0) {
|
|
33
|
-
output.info(`GraphQL schema: ${schemaOut}`);
|
|
34
|
-
}
|
|
35
|
-
await analytics.track({ command: 'generate:server', success: true });
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
output.error(`❌ Failed to generate server: ${result.data.error}`);
|
|
39
|
-
await analytics.track({ command: 'generate:server', success: false, errorCode: result.data.error });
|
|
40
|
-
process.exit(1);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
await analytics.track({ command: 'generate:server', success: false, errorCode: 'exception' });
|
|
45
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return command;
|
|
49
|
-
};
|
|
50
|
-
//# sourceMappingURL=generate-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-server.js","sourceRoot":"","sources":["../../../src/commands/generate-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,MAAc,EAAE,SAAoB,EAAW,EAAE;IAC3F,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAE/C,OAAO;SACJ,WAAW,CAAC,+DAA+D,CAAC;SAC5E,QAAQ,CAAC,cAAc,EAAE,8BAA8B,CAAC;SACxD,MAAM,CAAC,sBAAsB,EAAE,uDAAuD,CAAC;SACvF,MAAM,CAA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iBAAM,CAAC;gBACN,MAAM,CAAC,KAAK,CAAC,gCAAgC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBAClE,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACpG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;YAC9F,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { Config } from '../utils/config';
|
|
3
|
-
import { Analytics } from '../utils/analytics';
|
|
4
|
-
export declare const createImplementClientCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=implement-client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"implement-client.d.ts","sourceRoot":"","sources":["../../../src/commands/implement-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C,eAAO,MAAM,4BAA4B,WAAY,MAAM,aAAa,SAAS,KAAG,OA+EnF,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createOutput } from '../utils/terminal.js';
|
|
3
|
-
import { handleError } from '../utils/errors.js';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import createDebug from 'debug';
|
|
6
|
-
const debug = createDebug('cli:implement-client');
|
|
7
|
-
export const createImplementClientCommand = (config, analytics) => {
|
|
8
|
-
const output = createOutput(config);
|
|
9
|
-
const command = new Command('implement:client');
|
|
10
|
-
command
|
|
11
|
-
.description('Use AI to implement the client application based on IA schema')
|
|
12
|
-
.argument('<projectDir>', 'Client project directory to implement')
|
|
13
|
-
.argument('<iaSchemeDir>', 'Directory containing the IA schema')
|
|
14
|
-
.argument('<designSystemPath>', 'Path to design system markdown file')
|
|
15
|
-
.action(async (projectDir, iaSchemeDir, designSystemPath) => {
|
|
16
|
-
debug('Command started with args - projectDir: %s, iaSchemeDir: %s, designSystemPath: %s', projectDir, iaSchemeDir, designSystemPath);
|
|
17
|
-
try {
|
|
18
|
-
await analytics.track({ command: 'implement:client:start', success: true });
|
|
19
|
-
debug('Analytics tracked');
|
|
20
|
-
// Resolve paths
|
|
21
|
-
const resolvedProjectDir = path.resolve(projectDir);
|
|
22
|
-
const resolvedIASchemeDir = path.resolve(iaSchemeDir);
|
|
23
|
-
const resolvedDesignSystemPath = path.resolve(designSystemPath);
|
|
24
|
-
debug('Resolved paths - project: %s, IA: %s, design: %s', resolvedProjectDir, resolvedIASchemeDir, resolvedDesignSystemPath);
|
|
25
|
-
output.info(`Implementing client application`);
|
|
26
|
-
output.info(`Project directory: ${resolvedProjectDir}`);
|
|
27
|
-
output.info(`IA schema directory: ${resolvedIASchemeDir}`);
|
|
28
|
-
output.info(`Design system: ${resolvedDesignSystemPath}`);
|
|
29
|
-
// Import the handler
|
|
30
|
-
debug('Importing frontend-implementation handler');
|
|
31
|
-
const { handleImplementClientCommand } = await import('@auto-engineer/frontend-implementation');
|
|
32
|
-
debug('Handler imported successfully');
|
|
33
|
-
const implementCommand = {
|
|
34
|
-
type: 'ImplementClient',
|
|
35
|
-
data: {
|
|
36
|
-
projectDir: resolvedProjectDir,
|
|
37
|
-
iaSchemeDir: resolvedIASchemeDir,
|
|
38
|
-
designSystemPath: resolvedDesignSystemPath,
|
|
39
|
-
},
|
|
40
|
-
timestamp: new Date(),
|
|
41
|
-
requestId: `implement-client-${Date.now()}`,
|
|
42
|
-
};
|
|
43
|
-
debug('Calling handleImplementClientCommand with request ID: %s', implementCommand.requestId);
|
|
44
|
-
const result = await handleImplementClientCommand(implementCommand);
|
|
45
|
-
debug('Command handler returned result type: %s', result.type);
|
|
46
|
-
if (result.type === 'ClientImplemented') {
|
|
47
|
-
debug('Client implementation successful');
|
|
48
|
-
output.success(`✅ Client implemented successfully at: ${result.data.projectDir}`);
|
|
49
|
-
await analytics.track({ command: 'implement:client', success: true });
|
|
50
|
-
debug('Success analytics tracked');
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
debug('Client implementation failed: %s', result.data.error);
|
|
54
|
-
output.error(`❌ Failed to implement client: ${result.data.error}`);
|
|
55
|
-
await analytics.track({ command: 'implement:client', success: false, errorCode: result.data.error });
|
|
56
|
-
debug('Failure analytics tracked, exiting with code 1');
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
debug('Exception caught: %O', error);
|
|
62
|
-
await analytics.track({ command: 'implement:client', success: false, errorCode: 'exception' });
|
|
63
|
-
handleError(error instanceof Error ? error : new Error(String(error)));
|
|
64
|
-
debug('Error handled, exiting with code 1');
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return command;
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=implement-client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"implement-client.js","sourceRoot":"","sources":["../../../src/commands/implement-client.ts"],"names":[],"mapp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CAAC;gBACtE,KAAK,CAAC,2BAA2B,CAAC,CAAC;YACrC,CAAC;iBAAM,CAAC;gBACN,KAAK,CAAC,kCAAkC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC7D,MAAM,CAAC,KAAK,CAAC,iCAAiC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACnE,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;gBACrG,KAAK,CAAC,gDAAgD,CAAC,CAAC;gBACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;YACrC,MAAM,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAC;YAC/F,WAAW,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACvE,KAAK,CAAC,oCAAoC,CAAC,CAAC;YAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import type { Analytics } from '../utils/analytics';
|
|
3
|
-
import { Config } from '../utils/config';
|
|
4
|
-
export declare const createImplementServerCommand: (config: Config, analytics: Analytics) => Command;
|
|
5
|
-
//# sourceMappingURL=implement-server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"implement-server.d.ts","sourceRoot":"","sources":["../../../src/commands/implement-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAiDzC,eAAO,MAAM,4BAA4B,WAAY,MAAM,aAAa,SAAS,KAAG,OAgCnF,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { createOutput } from '../utils/terminal.js';
|
|
4
|
-
import { handleError } from '../utils/errors.js';
|
|
5
|
-
const determineServerDirectory = (serverDirectoryArg, options) => {
|
|
6
|
-
let serverDirectory = './server';
|
|
7
|
-
if (serverDirectoryArg !== undefined && serverDirectoryArg !== null && serverDirectoryArg.trim() !== '') {
|
|
8
|
-
serverDirectory = serverDirectoryArg;
|
|
9
|
-
}
|
|
10
|
-
else if (options?.directory !== undefined && options.directory !== null && options.directory.trim() !== '') {
|
|
11
|
-
serverDirectory = options.directory;
|
|
12
|
-
}
|
|
13
|
-
return path.resolve(serverDirectory);
|
|
14
|
-
};
|
|
15
|
-
const handleServerImplementation = async (resolvedDirectory, output, analytics) => {
|
|
16
|
-
output.info(`🚀 Implementing server flows in: ${resolvedDirectory}`);
|
|
17
|
-
// Dynamic import to avoid circular dependency issues
|
|
18
|
-
const { handleImplementServerCommand } = await import('@auto-engineer/server-implementer');
|
|
19
|
-
const implementCommand = {
|
|
20
|
-
type: 'ImplementServer',
|
|
21
|
-
data: {
|
|
22
|
-
serverDirectory: resolvedDirectory,
|
|
23
|
-
},
|
|
24
|
-
timestamp: new Date(),
|
|
25
|
-
requestId: `implement-server-${Date.now()}`,
|
|
26
|
-
correlationId: `implement-server-${Date.now()}`,
|
|
27
|
-
};
|
|
28
|
-
const result = await handleImplementServerCommand(implementCommand);
|
|
29
|
-
if (result.type === 'ServerImplemented') {
|
|
30
|
-
output.success('✅ Server implementation completed successfully');
|
|
31
|
-
if (result.data.flowsImplemented > 0) {
|
|
32
|
-
output.info(` ${result.data.flowsImplemented} flows implemented`);
|
|
33
|
-
}
|
|
34
|
-
await analytics.track({ command: 'implement:server:complete', success: true });
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
output.error(`❌ Server implementation failed: ${result.data.error}`);
|
|
38
|
-
await analytics.track({ command: 'implement:server:failed', success: false });
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
export const createImplementServerCommand = (config, analytics) => {
|
|
43
|
-
const output = createOutput(config);
|
|
44
|
-
const command = new Command('implement:server');
|
|
45
|
-
command
|
|
46
|
-
.description('Implement server flows using AI')
|
|
47
|
-
.argument('[server-directory]', 'Path to the server directory (defaults to ./server)')
|
|
48
|
-
.option('-d, --directory <path>', 'Server directory path (alternative to argument)')
|
|
49
|
-
.action(async (serverDirectoryArg, options) => {
|
|
50
|
-
try {
|
|
51
|
-
await analytics.track({ command: 'implement:server:start', success: true });
|
|
52
|
-
const resolvedDirectory = determineServerDirectory(serverDirectoryArg, options);
|
|
53
|
-
await handleServerImplementation(resolvedDirectory, output, analytics);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
await analytics.track({ command: 'implement:server:error', success: false });
|
|
57
|
-
handleError(error);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
command.addHelpText('after', `
|
|
62
|
-
Examples:
|
|
63
|
-
$ auto-engineer implement:server
|
|
64
|
-
$ auto-engineer implement:server ./my-server
|
|
65
|
-
$ auto-engineer implement:server --directory ./backend/server
|
|
66
|
-
`);
|
|
67
|
-
return command;
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=implement-server.js.map
|