@launch77/cli 1.6.0 → 1.7.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 +14 -0
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/template.d.ts +5 -1
- package/dist/infrastructure/template.d.ts.map +1 -1
- package/dist/infrastructure/template.js +11 -1
- package/dist/infrastructure/template.js.map +1 -1
- package/dist/modules/library/commands/create-library.d.ts +3 -0
- package/dist/modules/library/commands/create-library.d.ts.map +1 -0
- package/dist/modules/library/commands/create-library.js +61 -0
- package/dist/modules/library/commands/create-library.js.map +1 -0
- package/dist/modules/library/index.d.ts +3 -1
- package/dist/modules/library/index.d.ts.map +1 -1
- package/dist/modules/library/index.js +2 -0
- package/dist/modules/library/index.js.map +1 -1
- package/dist/modules/library/services/library-create-svc.d.ts +17 -0
- package/dist/modules/library/services/library-create-svc.d.ts.map +1 -0
- package/dist/modules/library/services/library-create-svc.js +51 -0
- package/dist/modules/library/services/library-create-svc.js.map +1 -0
- package/dist/modules/library/types/library-types.d.ts +9 -0
- package/dist/modules/library/types/library-types.d.ts.map +1 -1
- package/dist/templates/library/README.md.hbs +80 -0
- package/dist/templates/library/package.json.hbs +31 -0
- package/dist/templates/library/src/index.d.ts.hbs +14 -0
- package/dist/templates/library/src/index.js +11 -0
- package/dist/templates/library/tsconfig.json +31 -0
- package/package.json +1 -1
- package/src/cli.ts +2 -1
- package/src/infrastructure/template.ts +14 -1
- package/src/modules/library/commands/create-library.ts +70 -0
- package/src/modules/library/index.ts +3 -1
- package/src/modules/library/services/library-create-svc.ts +75 -0
- package/src/modules/library/types/library-types.ts +11 -0
- package/templates/library/README.md.hbs +80 -0
- package/templates/library/package.json.hbs +31 -0
- package/templates/library/src/index.d.ts.hbs +14 -0
- package/templates/library/src/index.js +11 -0
- package/templates/library/tsconfig.json +31 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @launch77/cli
|
|
2
2
|
|
|
3
|
+
## 1.7.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4faa93d: Added validation step to plugin build to prevent deploying a differnet version of a library than plugin was built with
|
|
8
|
+
- Updated dependencies [4faa93d]
|
|
9
|
+
- @launch77/plugin-runtime@0.3.1
|
|
10
|
+
|
|
11
|
+
## 1.7.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- a282a71: Added command to delete libraries
|
|
16
|
+
|
|
3
17
|
## 1.6.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -4,7 +4,7 @@ import { appCreateCommand, appDeleteCommand } from './modules/app/index.js';
|
|
|
4
4
|
// import { catalogScanCommand, catalogGenerateCommand } from './modules/catalog/index.js'
|
|
5
5
|
// import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js'
|
|
6
6
|
import { gitConnectCommand } from './modules/git/index.js';
|
|
7
|
-
import { libraryDeleteCommand } from './modules/library/index.js';
|
|
7
|
+
import { libraryCreateCommand, libraryDeleteCommand } from './modules/library/index.js';
|
|
8
8
|
import { pluginInstallCommand, pluginCreateCommand, pluginDeleteCommand } from './modules/plugin/index.js';
|
|
9
9
|
import { releaseInitCommand } from './modules/release/index.js';
|
|
10
10
|
import { initWorkspaceCommand } from './modules/workspace/index.js';
|
|
@@ -17,6 +17,7 @@ const program = new Command()
|
|
|
17
17
|
program.addCommand(initWorkspaceCommand());
|
|
18
18
|
program.addCommand(appCreateCommand());
|
|
19
19
|
program.addCommand(appDeleteCommand());
|
|
20
|
+
program.addCommand(libraryCreateCommand());
|
|
20
21
|
program.addCommand(libraryDeleteCommand());
|
|
21
22
|
program.addCommand(pluginCreateCommand());
|
|
22
23
|
program.addCommand(pluginDeleteCommand());
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,0FAA0F;AAC1F,wGAAwG;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC3E,0FAA0F;AAC1F,wGAAwG;AACxG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACvF,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,uBAAuB,CAAC;KACpC,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAE9C,2BAA2B;AAC3B,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAC1C,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAA;AACtC,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,CAAC,CAAA;AACtC,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAC1C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAC1C,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAA;AAC1C,+CAA+C;AAC/C,2CAA2C;AAE3C,eAAe;AACf,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AAEvC,mBAAmB;AACnB,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAA;AAExC,kBAAkB;AAClB,0CAA0C;AAC1C,4CAA4C;AAC5C,0CAA0C;AAE1C,OAAO,CAAC,KAAK,EAAE,CAAA"}
|
|
@@ -9,7 +9,6 @@ export interface TemplateContext {
|
|
|
9
9
|
export declare function processTemplate(templatePath: string, destinationPath: string, context: TemplateContext): Promise<void>;
|
|
10
10
|
/**
|
|
11
11
|
* Get the path to a template directory
|
|
12
|
-
* Templates are always in dist/app-templates/ (copied during build)
|
|
13
12
|
*/
|
|
14
13
|
export declare function getTemplatePath(templateName: string): string;
|
|
15
14
|
/**
|
|
@@ -17,6 +16,11 @@ export declare function getTemplatePath(templateName: string): string;
|
|
|
17
16
|
* Plugin templates are in dist/templates/ (copied during build)
|
|
18
17
|
*/
|
|
19
18
|
export declare function getPluginTemplatePath(templateName: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get the path to a library template directory
|
|
21
|
+
* Library templates are in dist/templates/ (copied during build)
|
|
22
|
+
*/
|
|
23
|
+
export declare function getLibraryTemplatePath(templateName: string): string;
|
|
20
24
|
/**
|
|
21
25
|
* Check if a template exists
|
|
22
26
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/infrastructure/template.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACrD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B5H;AAED
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/infrastructure/template.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CACrD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B5H;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQlE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQnE;AAED;;GAEG;AACH,wBAAsB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG3E"}
|
|
@@ -34,7 +34,6 @@ export async function processTemplate(templatePath, destinationPath, context) {
|
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* Get the path to a template directory
|
|
37
|
-
* Templates are always in dist/app-templates/ (copied during build)
|
|
38
37
|
*/
|
|
39
38
|
export function getTemplatePath(templateName) {
|
|
40
39
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -54,6 +53,17 @@ export function getPluginTemplatePath(templateName) {
|
|
|
54
53
|
const baseDir = path.join(__dirname, '../templates');
|
|
55
54
|
return path.join(baseDir, templateName);
|
|
56
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the path to a library template directory
|
|
58
|
+
* Library templates are in dist/templates/ (copied during build)
|
|
59
|
+
*/
|
|
60
|
+
export function getLibraryTemplatePath(templateName) {
|
|
61
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
62
|
+
const __dirname = path.dirname(__filename);
|
|
63
|
+
// From dist/infrastructure/ to dist/templates/
|
|
64
|
+
const baseDir = path.join(__dirname, '../templates');
|
|
65
|
+
return path.join(baseDir, templateName);
|
|
66
|
+
}
|
|
57
67
|
/**
|
|
58
68
|
* Check if a template exists
|
|
59
69
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/infrastructure/template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,EAAE,MAAM,UAAU,CAAA;AACzB,OAAO,UAAU,MAAM,YAAY,CAAA;AAQnC;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,YAAoB,EAAE,eAAuB,EAAE,OAAwB;IAC3G,4BAA4B;IAC5B,MAAM,EAAE,CAAC,SAAS,CAAC,eAAe,CAAC,CAAA;IAEnC,uCAAuC;IACvC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;IAErE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU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AAY,CAAC,CAAA;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,YAAoB;IACvD,MAAM,YAAY,GAAG,eAAe,CAAC,YAAY,CAAC,CAAA;IAClD,OAAO,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-library.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/commands/create-library.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,wBAAgB,oBAAoB,IAAI,OAAO,CA2D9C"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import ora from 'ora';
|
|
6
|
+
import { detectLaunch77Context } from '@launch77/plugin-runtime';
|
|
7
|
+
import { LibraryCreateService } from '../services/library-create-svc.js';
|
|
8
|
+
export function libraryCreateCommand() {
|
|
9
|
+
const command = new Command('library:create')
|
|
10
|
+
.argument('<library-name>', 'Name of the library to create (e.g., ui, marketing-ui)')
|
|
11
|
+
.option('-d, --description <description>', 'Library description')
|
|
12
|
+
.description('Create a new library from template')
|
|
13
|
+
.action(async (libraryName, options) => {
|
|
14
|
+
try {
|
|
15
|
+
console.log(chalk.blue(`\n📚 Creating library: ${libraryName}\n`));
|
|
16
|
+
// Detect context
|
|
17
|
+
const context = await detectLaunch77Context(process.cwd());
|
|
18
|
+
// Create library service
|
|
19
|
+
const libraryCreateService = new LibraryCreateService();
|
|
20
|
+
// Create library
|
|
21
|
+
const spinner = ora('Generating library structure...').start();
|
|
22
|
+
let result;
|
|
23
|
+
try {
|
|
24
|
+
result = await libraryCreateService.createLibrary({
|
|
25
|
+
libraryName,
|
|
26
|
+
description: options.description,
|
|
27
|
+
}, context);
|
|
28
|
+
spinner.succeed('Library structure generated');
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
spinner.fail('Failed to generate library structure');
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
// Success message
|
|
35
|
+
const relativePath = path.relative(process.cwd(), result.libraryPath);
|
|
36
|
+
const displayPath = relativePath.startsWith('..') ? result.libraryPath : relativePath;
|
|
37
|
+
console.log(chalk.green(`\n✅ Library created successfully at ${displayPath}`));
|
|
38
|
+
// Next steps
|
|
39
|
+
console.log(chalk.white('\n' + '─'.repeat(60) + '\n'));
|
|
40
|
+
console.log(chalk.cyan('📋 Next Steps:\n'));
|
|
41
|
+
const cdPath = path.relative(process.cwd(), result.libraryPath);
|
|
42
|
+
console.log(chalk.gray('1. Navigate to your library directory:'));
|
|
43
|
+
console.log(chalk.cyan(` cd ${cdPath}\n`));
|
|
44
|
+
console.log(chalk.gray('2. Add your library code to src/\n'));
|
|
45
|
+
console.log(chalk.gray('3. Update package.json with proper exports and dependencies\n'));
|
|
46
|
+
console.log(chalk.gray('4. Configure build system if needed (tsup, tsc, etc.)\n'));
|
|
47
|
+
console.log(chalk.gray('5. Add README.md documentation\n'));
|
|
48
|
+
console.log(chalk.gray('6. Run type checking:'));
|
|
49
|
+
console.log(chalk.cyan(' npm run typecheck\n'));
|
|
50
|
+
console.log(chalk.gray('7. Build your library:'));
|
|
51
|
+
console.log(chalk.cyan(' npm run build\n'));
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
55
|
+
console.error(chalk.red('Error:'), message);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return command;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=create-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-library.js","sourceRoot":"","sources":["../../../../src/modules/library/commands/create-library.ts"],"names":[],"mappings":"AAAA,+B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CAAC,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAA;YAChD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAA;YACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAA;YACjD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAA;QAC/C,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACtE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAA;YAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { LibraryService } from './services/library-svc.js';
|
|
2
|
-
export
|
|
2
|
+
export { LibraryCreateService } from './services/library-create-svc.js';
|
|
3
|
+
export type { CreateLibraryRequest, CreateLibraryResult, DeleteLibraryRequest, DeleteLibraryResult } from './types/library-types.js';
|
|
3
4
|
export { LibraryNotFoundError, InvalidLibraryNameError } from './errors/library-errors.js';
|
|
5
|
+
export { libraryCreateCommand } from './commands/create-library.js';
|
|
4
6
|
export { libraryDeleteCommand } from './commands/delete-library.js';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/library/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/library/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAGvE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAGpI,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Services
|
|
2
2
|
export { LibraryService } from './services/library-svc.js';
|
|
3
|
+
export { LibraryCreateService } from './services/library-create-svc.js';
|
|
3
4
|
// Errors
|
|
4
5
|
export { LibraryNotFoundError, InvalidLibraryNameError } from './errors/library-errors.js';
|
|
5
6
|
// Commands
|
|
7
|
+
export { libraryCreateCommand } from './commands/create-library.js';
|
|
6
8
|
export { libraryDeleteCommand } from './commands/delete-library.js';
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/library/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/library/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAKvE,SAAS;AACT,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAE1F,WAAW;AACX,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Launch77Context } from '@launch77/plugin-runtime';
|
|
2
|
+
export interface CreateLibraryRequest {
|
|
3
|
+
libraryName: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateLibraryResult {
|
|
7
|
+
libraryName: string;
|
|
8
|
+
libraryPath: string;
|
|
9
|
+
packageName: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class LibraryCreateService {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new library from template
|
|
14
|
+
*/
|
|
15
|
+
createLibrary(request: CreateLibraryRequest, context: Launch77Context): Promise<CreateLibraryResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=library-create-svc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-create-svc.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/services/library-create-svc.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,qBAAa,oBAAoB;IAC/B;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAiD3G"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import { processTemplate, getLibraryTemplatePath } from '../../../infrastructure/template.js';
|
|
4
|
+
import { validateAppName } from '../../../utils/validation.js';
|
|
5
|
+
import { toPascalCase } from '../../../utils/string.js';
|
|
6
|
+
export class LibraryCreateService {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new library from template
|
|
9
|
+
*/
|
|
10
|
+
async createLibrary(request, context) {
|
|
11
|
+
const { libraryName, description } = request;
|
|
12
|
+
// 1. Validate library name (same validation as app/plugin names)
|
|
13
|
+
const nameValidation = validateAppName(libraryName);
|
|
14
|
+
if (!nameValidation.valid) {
|
|
15
|
+
throw new Error(nameValidation.errorMessage || 'Invalid library name');
|
|
16
|
+
}
|
|
17
|
+
// 2. Validate workspace context
|
|
18
|
+
if (!context.isValid) {
|
|
19
|
+
throw new Error('Must be run from within a Launch77 workspace');
|
|
20
|
+
}
|
|
21
|
+
// 3. Determine library path
|
|
22
|
+
const libraryPath = path.join(context.workspaceRoot, 'libraries', libraryName);
|
|
23
|
+
// 4. Check if library already exists
|
|
24
|
+
if (await fs.pathExists(libraryPath)) {
|
|
25
|
+
throw new Error(`Library '${libraryName}' already exists at ${libraryPath}`);
|
|
26
|
+
}
|
|
27
|
+
// 5. Get library template path
|
|
28
|
+
const templatePath = getLibraryTemplatePath('library');
|
|
29
|
+
// 6. Check if template exists
|
|
30
|
+
if (!(await fs.pathExists(templatePath))) {
|
|
31
|
+
throw new Error(`Library template not found at ${templatePath}`);
|
|
32
|
+
}
|
|
33
|
+
// 7. Build package name
|
|
34
|
+
const packageName = `@${context.workspaceName}/lib-${libraryName}`;
|
|
35
|
+
// 8. Process template with context
|
|
36
|
+
await processTemplate(templatePath, libraryPath, {
|
|
37
|
+
appName: libraryName, // Required by TemplateContext but not semantically used for libraries
|
|
38
|
+
libraryName,
|
|
39
|
+
libraryNamePascal: toPascalCase(libraryName),
|
|
40
|
+
workspaceName: context.workspaceName,
|
|
41
|
+
packageName,
|
|
42
|
+
description: description || `Launch77 library for ${libraryName}`,
|
|
43
|
+
});
|
|
44
|
+
return {
|
|
45
|
+
libraryName,
|
|
46
|
+
libraryPath,
|
|
47
|
+
packageName,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=library-create-svc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-create-svc.js","sourceRoot":"","sources":["../../../../src/modules/library/services/library-create-svc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC7F,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAevD,MAAM,OAAO,oBAAoB;IAC/B;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,OAAwB;QACzE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAE5C,iEAAiE;QACjE,MAAM,cAAc,GAAG,eAAe,CAAC,WAAW,CAAC,CAAA;QACnD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,YAAY,IAAI,sBAAsB,CAAC,CAAA;QACxE,CAAC;QAED,gCAAgC;QAChC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;QACjE,CAAC;QAED,4BAA4B;QAC5B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;QAE9E,qCAAqC;QACrC,IAAI,MAAM,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,YAAY,WAAW,uBAAuB,WAAW,EAAE,CAAC,CAAA;QAC9E,CAAC;QAED,+BAA+B;QAC/B,MAAM,YAAY,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAA;QAEtD,8BAA8B;QAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,iCAAiC,YAAY,EAAE,CAAC,CAAA;QAClE,CAAC;QAED,wBAAwB;QACxB,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,aAAa,QAAQ,WAAW,EAAE,CAAA;QAElE,mCAAmC;QACnC,MAAM,eAAe,CAAC,YAAY,EAAE,WAAW,EAAE;YAC/C,OAAO,EAAE,WAAW,EAAE,sEAAsE;YAC5F,WAAW;YACX,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAAC;YAC5C,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,WAAW;YACX,WAAW,EAAE,WAAW,IAAI,wBAAwB,WAAW,EAAE;SAClE,CAAC,CAAA;QAEF,OAAO;YACL,WAAW;YACX,WAAW;YACX,WAAW;SACZ,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export interface CreateLibraryRequest {
|
|
2
|
+
libraryName: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CreateLibraryResult {
|
|
6
|
+
libraryName: string;
|
|
7
|
+
libraryPath: string;
|
|
8
|
+
packageName: string;
|
|
9
|
+
}
|
|
1
10
|
export interface DeleteLibraryRequest {
|
|
2
11
|
libraryName: string;
|
|
3
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library-types.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/types/library-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;CACpB"}
|
|
1
|
+
{"version":3,"file":"library-types.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/types/library-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;CACpB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @{{workspaceName}}/lib-{{libraryName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This library is part of the {{workspaceName}} monorepo workspace.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @{{workspaceName}}/lib-{{libraryName}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { /* exports */ } from '@{{workspaceName}}/lib-{{libraryName}}'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
### Type Checking
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run typecheck
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Building
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Component Documentation
|
|
40
|
+
|
|
41
|
+
If this library contains UI components, use Launch77 annotations for catalog generation:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
/**
|
|
45
|
+
* @launch77-component
|
|
46
|
+
* @category your-category
|
|
47
|
+
* @description What this component does
|
|
48
|
+
* @whenToUse Use for...
|
|
49
|
+
* @whenNotToUse Don't use for...
|
|
50
|
+
* @tags tag1, tag2, tag3
|
|
51
|
+
* @example
|
|
52
|
+
* <YourComponent prop="value" />
|
|
53
|
+
*/
|
|
54
|
+
export const YourComponent = () => { ... }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Annotation Reference
|
|
58
|
+
|
|
59
|
+
| Tag | Required | Purpose |
|
|
60
|
+
|-----|----------|---------|
|
|
61
|
+
| `@launch77-component` | Yes | Identifies component for catalog |
|
|
62
|
+
| `@category` | Yes | Component category (e.g., "forms", "marketing") |
|
|
63
|
+
| `@description` | Yes | Brief description of what the component does |
|
|
64
|
+
| `@whenToUse` | Recommended | Guidance on when to use this component |
|
|
65
|
+
| `@whenNotToUse` | Recommended | Anti-patterns and when not to use |
|
|
66
|
+
| `@tags` | Optional | Comma-separated searchable keywords |
|
|
67
|
+
| `@example` | Optional | Code example showing usage |
|
|
68
|
+
|
|
69
|
+
To exclude a component from the catalog:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
/**
|
|
73
|
+
* @launch77-ignore
|
|
74
|
+
* @reason Not ready for production use
|
|
75
|
+
*/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
UNLICENSED - Private package
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{workspaceName}}/lib-{{libraryName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": true,
|
|
7
|
+
"main": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"default": "./src/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src/",
|
|
17
|
+
"docs/"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "echo 'Configure build for your library type (tsup, tsc, etc.)'",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"test": "echo 'No tests configured yet'"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.0.0",
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your type exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent, type MyComponentProps } from './components/MyComponent'
|
|
8
|
+
* export { myUtility } from './utils/myUtility'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your type exports here
|
|
12
|
+
declare module '@{{workspaceName}}/lib-{{libraryName}}' {
|
|
13
|
+
// Add declarations here
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main entry point for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your library exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent } from './components/MyComponent.js'
|
|
8
|
+
* export { myUtility } from './utils/myUtility.js'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your exports here
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"checkJs": false,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["./src/*"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
|
|
31
|
+
}
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { appCreateCommand, appDeleteCommand } from './modules/app/index.js'
|
|
|
6
6
|
// import { catalogScanCommand, catalogGenerateCommand } from './modules/catalog/index.js'
|
|
7
7
|
// import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js'
|
|
8
8
|
import { gitConnectCommand } from './modules/git/index.js'
|
|
9
|
-
import { libraryDeleteCommand } from './modules/library/index.js'
|
|
9
|
+
import { libraryCreateCommand, libraryDeleteCommand } from './modules/library/index.js'
|
|
10
10
|
import { pluginInstallCommand, pluginCreateCommand, pluginDeleteCommand } from './modules/plugin/index.js'
|
|
11
11
|
import { releaseInitCommand } from './modules/release/index.js'
|
|
12
12
|
import { initWorkspaceCommand } from './modules/workspace/index.js'
|
|
@@ -21,6 +21,7 @@ const program = new Command()
|
|
|
21
21
|
program.addCommand(initWorkspaceCommand())
|
|
22
22
|
program.addCommand(appCreateCommand())
|
|
23
23
|
program.addCommand(appDeleteCommand())
|
|
24
|
+
program.addCommand(libraryCreateCommand())
|
|
24
25
|
program.addCommand(libraryDeleteCommand())
|
|
25
26
|
program.addCommand(pluginCreateCommand())
|
|
26
27
|
program.addCommand(pluginDeleteCommand())
|
|
@@ -44,7 +44,6 @@ export async function processTemplate(templatePath: string, destinationPath: str
|
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Get the path to a template directory
|
|
47
|
-
* Templates are always in dist/app-templates/ (copied during build)
|
|
48
47
|
*/
|
|
49
48
|
export function getTemplatePath(templateName: string): string {
|
|
50
49
|
const __filename = fileURLToPath(import.meta.url)
|
|
@@ -70,6 +69,20 @@ export function getPluginTemplatePath(templateName: string): string {
|
|
|
70
69
|
return path.join(baseDir, templateName)
|
|
71
70
|
}
|
|
72
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Get the path to a library template directory
|
|
74
|
+
* Library templates are in dist/templates/ (copied during build)
|
|
75
|
+
*/
|
|
76
|
+
export function getLibraryTemplatePath(templateName: string): string {
|
|
77
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
78
|
+
const __dirname = path.dirname(__filename)
|
|
79
|
+
|
|
80
|
+
// From dist/infrastructure/ to dist/templates/
|
|
81
|
+
const baseDir = path.join(__dirname, '../templates')
|
|
82
|
+
|
|
83
|
+
return path.join(baseDir, templateName)
|
|
84
|
+
}
|
|
85
|
+
|
|
73
86
|
/**
|
|
74
87
|
* Check if a template exists
|
|
75
88
|
*/
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
|
|
4
|
+
import chalk from 'chalk'
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
import ora from 'ora'
|
|
7
|
+
|
|
8
|
+
import { detectLaunch77Context } from '@launch77/plugin-runtime'
|
|
9
|
+
import { LibraryCreateService } from '../services/library-create-svc.js'
|
|
10
|
+
|
|
11
|
+
export function libraryCreateCommand(): Command {
|
|
12
|
+
const command = new Command('library:create')
|
|
13
|
+
.argument('<library-name>', 'Name of the library to create (e.g., ui, marketing-ui)')
|
|
14
|
+
.option('-d, --description <description>', 'Library description')
|
|
15
|
+
.description('Create a new library from template')
|
|
16
|
+
.action(async (libraryName: string, options) => {
|
|
17
|
+
try {
|
|
18
|
+
console.log(chalk.blue(`\n📚 Creating library: ${libraryName}\n`))
|
|
19
|
+
|
|
20
|
+
// Detect context
|
|
21
|
+
const context = await detectLaunch77Context(process.cwd())
|
|
22
|
+
|
|
23
|
+
// Create library service
|
|
24
|
+
const libraryCreateService = new LibraryCreateService()
|
|
25
|
+
|
|
26
|
+
// Create library
|
|
27
|
+
const spinner = ora('Generating library structure...').start()
|
|
28
|
+
let result
|
|
29
|
+
try {
|
|
30
|
+
result = await libraryCreateService.createLibrary(
|
|
31
|
+
{
|
|
32
|
+
libraryName,
|
|
33
|
+
description: options.description,
|
|
34
|
+
},
|
|
35
|
+
context
|
|
36
|
+
)
|
|
37
|
+
spinner.succeed('Library structure generated')
|
|
38
|
+
} catch (error) {
|
|
39
|
+
spinner.fail('Failed to generate library structure')
|
|
40
|
+
throw error
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Success message
|
|
44
|
+
const relativePath = path.relative(process.cwd(), result.libraryPath)
|
|
45
|
+
const displayPath = relativePath.startsWith('..') ? result.libraryPath : relativePath
|
|
46
|
+
console.log(chalk.green(`\n✅ Library created successfully at ${displayPath}`))
|
|
47
|
+
|
|
48
|
+
// Next steps
|
|
49
|
+
console.log(chalk.white('\n' + '─'.repeat(60) + '\n'))
|
|
50
|
+
console.log(chalk.cyan('📋 Next Steps:\n'))
|
|
51
|
+
const cdPath = path.relative(process.cwd(), result.libraryPath)
|
|
52
|
+
console.log(chalk.gray('1. Navigate to your library directory:'))
|
|
53
|
+
console.log(chalk.cyan(` cd ${cdPath}\n`))
|
|
54
|
+
console.log(chalk.gray('2. Add your library code to src/\n'))
|
|
55
|
+
console.log(chalk.gray('3. Update package.json with proper exports and dependencies\n'))
|
|
56
|
+
console.log(chalk.gray('4. Configure build system if needed (tsup, tsc, etc.)\n'))
|
|
57
|
+
console.log(chalk.gray('5. Add README.md documentation\n'))
|
|
58
|
+
console.log(chalk.gray('6. Run type checking:'))
|
|
59
|
+
console.log(chalk.cyan(' npm run typecheck\n'))
|
|
60
|
+
console.log(chalk.gray('7. Build your library:'))
|
|
61
|
+
console.log(chalk.cyan(' npm run build\n'))
|
|
62
|
+
} catch (error) {
|
|
63
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
64
|
+
console.error(chalk.red('Error:'), message)
|
|
65
|
+
process.exit(1)
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
return command
|
|
70
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
// Services
|
|
2
2
|
export { LibraryService } from './services/library-svc.js'
|
|
3
|
+
export { LibraryCreateService } from './services/library-create-svc.js'
|
|
3
4
|
|
|
4
5
|
// Types
|
|
5
|
-
export type { DeleteLibraryRequest, DeleteLibraryResult } from './types/library-types.js'
|
|
6
|
+
export type { CreateLibraryRequest, CreateLibraryResult, DeleteLibraryRequest, DeleteLibraryResult } from './types/library-types.js'
|
|
6
7
|
|
|
7
8
|
// Errors
|
|
8
9
|
export { LibraryNotFoundError, InvalidLibraryNameError } from './errors/library-errors.js'
|
|
9
10
|
|
|
10
11
|
// Commands
|
|
12
|
+
export { libraryCreateCommand } from './commands/create-library.js'
|
|
11
13
|
export { libraryDeleteCommand } from './commands/delete-library.js'
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as path from 'path'
|
|
2
|
+
|
|
3
|
+
import fs from 'fs-extra'
|
|
4
|
+
|
|
5
|
+
import { processTemplate, getLibraryTemplatePath } from '../../../infrastructure/template.js'
|
|
6
|
+
import { validateAppName } from '../../../utils/validation.js'
|
|
7
|
+
import { toPascalCase } from '../../../utils/string.js'
|
|
8
|
+
|
|
9
|
+
import type { Launch77Context } from '@launch77/plugin-runtime'
|
|
10
|
+
|
|
11
|
+
export interface CreateLibraryRequest {
|
|
12
|
+
libraryName: string
|
|
13
|
+
description?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface CreateLibraryResult {
|
|
17
|
+
libraryName: string
|
|
18
|
+
libraryPath: string
|
|
19
|
+
packageName: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export class LibraryCreateService {
|
|
23
|
+
/**
|
|
24
|
+
* Create a new library from template
|
|
25
|
+
*/
|
|
26
|
+
async createLibrary(request: CreateLibraryRequest, context: Launch77Context): Promise<CreateLibraryResult> {
|
|
27
|
+
const { libraryName, description } = request
|
|
28
|
+
|
|
29
|
+
// 1. Validate library name (same validation as app/plugin names)
|
|
30
|
+
const nameValidation = validateAppName(libraryName)
|
|
31
|
+
if (!nameValidation.valid) {
|
|
32
|
+
throw new Error(nameValidation.errorMessage || 'Invalid library name')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 2. Validate workspace context
|
|
36
|
+
if (!context.isValid) {
|
|
37
|
+
throw new Error('Must be run from within a Launch77 workspace')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 3. Determine library path
|
|
41
|
+
const libraryPath = path.join(context.workspaceRoot, 'libraries', libraryName)
|
|
42
|
+
|
|
43
|
+
// 4. Check if library already exists
|
|
44
|
+
if (await fs.pathExists(libraryPath)) {
|
|
45
|
+
throw new Error(`Library '${libraryName}' already exists at ${libraryPath}`)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 5. Get library template path
|
|
49
|
+
const templatePath = getLibraryTemplatePath('library')
|
|
50
|
+
|
|
51
|
+
// 6. Check if template exists
|
|
52
|
+
if (!(await fs.pathExists(templatePath))) {
|
|
53
|
+
throw new Error(`Library template not found at ${templatePath}`)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 7. Build package name
|
|
57
|
+
const packageName = `@${context.workspaceName}/lib-${libraryName}`
|
|
58
|
+
|
|
59
|
+
// 8. Process template with context
|
|
60
|
+
await processTemplate(templatePath, libraryPath, {
|
|
61
|
+
appName: libraryName, // Required by TemplateContext but not semantically used for libraries
|
|
62
|
+
libraryName,
|
|
63
|
+
libraryNamePascal: toPascalCase(libraryName),
|
|
64
|
+
workspaceName: context.workspaceName,
|
|
65
|
+
packageName,
|
|
66
|
+
description: description || `Launch77 library for ${libraryName}`,
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
libraryName,
|
|
71
|
+
libraryPath,
|
|
72
|
+
packageName,
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
export interface CreateLibraryRequest {
|
|
2
|
+
libraryName: string
|
|
3
|
+
description?: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface CreateLibraryResult {
|
|
7
|
+
libraryName: string
|
|
8
|
+
libraryPath: string
|
|
9
|
+
packageName: string
|
|
10
|
+
}
|
|
11
|
+
|
|
1
12
|
export interface DeleteLibraryRequest {
|
|
2
13
|
libraryName: string
|
|
3
14
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @{{workspaceName}}/lib-{{libraryName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This library is part of the {{workspaceName}} monorepo workspace.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @{{workspaceName}}/lib-{{libraryName}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { /* exports */ } from '@{{workspaceName}}/lib-{{libraryName}}'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
### Type Checking
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run typecheck
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Building
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Component Documentation
|
|
40
|
+
|
|
41
|
+
If this library contains UI components, use Launch77 annotations for catalog generation:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
/**
|
|
45
|
+
* @launch77-component
|
|
46
|
+
* @category your-category
|
|
47
|
+
* @description What this component does
|
|
48
|
+
* @whenToUse Use for...
|
|
49
|
+
* @whenNotToUse Don't use for...
|
|
50
|
+
* @tags tag1, tag2, tag3
|
|
51
|
+
* @example
|
|
52
|
+
* <YourComponent prop="value" />
|
|
53
|
+
*/
|
|
54
|
+
export const YourComponent = () => { ... }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Annotation Reference
|
|
58
|
+
|
|
59
|
+
| Tag | Required | Purpose |
|
|
60
|
+
|-----|----------|---------|
|
|
61
|
+
| `@launch77-component` | Yes | Identifies component for catalog |
|
|
62
|
+
| `@category` | Yes | Component category (e.g., "forms", "marketing") |
|
|
63
|
+
| `@description` | Yes | Brief description of what the component does |
|
|
64
|
+
| `@whenToUse` | Recommended | Guidance on when to use this component |
|
|
65
|
+
| `@whenNotToUse` | Recommended | Anti-patterns and when not to use |
|
|
66
|
+
| `@tags` | Optional | Comma-separated searchable keywords |
|
|
67
|
+
| `@example` | Optional | Code example showing usage |
|
|
68
|
+
|
|
69
|
+
To exclude a component from the catalog:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
/**
|
|
73
|
+
* @launch77-ignore
|
|
74
|
+
* @reason Not ready for production use
|
|
75
|
+
*/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
UNLICENSED - Private package
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{workspaceName}}/lib-{{libraryName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": true,
|
|
7
|
+
"main": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"default": "./src/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src/",
|
|
17
|
+
"docs/"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "echo 'Configure build for your library type (tsup, tsc, etc.)'",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"test": "echo 'No tests configured yet'"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.0.0",
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your type exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent, type MyComponentProps } from './components/MyComponent'
|
|
8
|
+
* export { myUtility } from './utils/myUtility'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your type exports here
|
|
12
|
+
declare module '@{{workspaceName}}/lib-{{libraryName}}' {
|
|
13
|
+
// Add declarations here
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main entry point for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your library exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent } from './components/MyComponent.js'
|
|
8
|
+
* export { myUtility } from './utils/myUtility.js'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your exports here
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"checkJs": false,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["./src/*"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
|
|
31
|
+
}
|