@launch77/cli 1.3.0 → 1.4.0
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/dist/cli.js +6 -3
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/template-generator.d.ts +1 -1
- package/dist/infrastructure/template-generator.d.ts.map +1 -1
- package/dist/infrastructure/template.d.ts +5 -0
- package/dist/infrastructure/template.d.ts.map +1 -1
- package/dist/infrastructure/template.js +11 -0
- package/dist/infrastructure/template.js.map +1 -1
- package/dist/modules/app/commands/create-app.js +1 -1
- package/dist/modules/app/commands/create-app.js.map +1 -1
- package/dist/modules/app/commands/delete-app.js +1 -1
- package/dist/modules/app/commands/delete-app.js.map +1 -1
- package/dist/modules/app/services/app-svc.d.ts +1 -1
- package/dist/modules/app/services/app-svc.d.ts.map +1 -1
- package/dist/modules/app/services/manifest-svc.d.ts +1 -1
- package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
- package/dist/modules/catalog/config/catalog-config.test.js +1 -1
- package/dist/modules/catalog/config/catalog-config.test.js.map +1 -1
- package/dist/modules/git/commands/git-connect.js +2 -2
- package/dist/modules/git/commands/git-connect.js.map +1 -1
- package/dist/modules/git/errors/git-errors.d.ts +3 -0
- package/dist/modules/git/errors/git-errors.d.ts.map +1 -1
- package/dist/modules/git/errors/git-errors.js +6 -0
- package/dist/modules/git/errors/git-errors.js.map +1 -1
- package/dist/modules/git/index.d.ts +3 -1
- package/dist/modules/git/index.d.ts.map +1 -1
- package/dist/modules/git/index.js +6 -1
- package/dist/modules/git/index.js.map +1 -1
- package/dist/modules/git/services/git-service.d.ts +5 -0
- package/dist/modules/git/services/git-service.d.ts.map +1 -1
- package/dist/modules/git/services/git-service.js +11 -1
- package/dist/modules/git/services/git-service.js.map +1 -1
- package/dist/modules/plugin/commands/plugin-create.d.ts +3 -0
- package/dist/modules/plugin/commands/plugin-create.d.ts.map +1 -0
- package/dist/modules/plugin/commands/plugin-create.js +59 -0
- package/dist/modules/plugin/commands/plugin-create.js.map +1 -0
- package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -1
- package/dist/modules/plugin/commands/plugin-install.js +9 -24
- package/dist/modules/plugin/commands/plugin-install.js.map +1 -1
- package/dist/modules/plugin/errors/plugin-errors.d.ts +24 -1
- package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -1
- package/dist/modules/plugin/errors/plugin-errors.js +79 -6
- package/dist/modules/plugin/errors/plugin-errors.js.map +1 -1
- package/dist/modules/plugin/index.d.ts +4 -2
- package/dist/modules/plugin/index.d.ts.map +1 -1
- package/dist/modules/plugin/index.js +4 -2
- package/dist/modules/plugin/index.js.map +1 -1
- package/dist/modules/plugin/lib/plugin-registry.d.ts +6 -12
- package/dist/modules/plugin/lib/plugin-registry.d.ts.map +1 -1
- package/dist/modules/plugin/lib/plugin-registry.js +13 -30
- package/dist/modules/plugin/lib/plugin-registry.js.map +1 -1
- package/dist/modules/plugin/lib/plugin-resolver.d.ts +76 -0
- package/dist/modules/plugin/lib/plugin-resolver.d.ts.map +1 -0
- package/dist/modules/plugin/lib/plugin-resolver.js +128 -0
- package/dist/modules/plugin/lib/plugin-resolver.js.map +1 -0
- package/dist/modules/plugin/lib/plugin-resolver.test.d.ts +2 -0
- package/dist/modules/plugin/lib/plugin-resolver.test.d.ts.map +1 -0
- package/dist/modules/plugin/lib/plugin-resolver.test.js +175 -0
- package/dist/modules/plugin/lib/plugin-resolver.test.js.map +1 -0
- package/dist/modules/plugin/services/plugin-create-service.d.ts +16 -0
- package/dist/modules/plugin/services/plugin-create-service.d.ts.map +1 -0
- package/dist/modules/plugin/services/plugin-create-service.js +47 -0
- package/dist/modules/plugin/services/plugin-create-service.js.map +1 -0
- package/dist/modules/plugin/services/plugin-svc.d.ts +8 -3
- package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -1
- package/dist/modules/plugin/services/plugin-svc.js +96 -15
- package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
- package/dist/modules/release/commands/release-init.d.ts +3 -0
- package/dist/modules/release/commands/release-init.d.ts.map +1 -0
- package/dist/modules/release/commands/release-init.js +92 -0
- package/dist/modules/release/commands/release-init.js.map +1 -0
- package/dist/modules/release/errors/release-errors.d.ts +7 -0
- package/dist/modules/release/errors/release-errors.d.ts.map +1 -0
- package/dist/modules/release/errors/release-errors.js +13 -0
- package/dist/modules/release/errors/release-errors.js.map +1 -0
- package/dist/modules/release/index.d.ts +4 -0
- package/dist/modules/release/index.d.ts.map +1 -0
- package/dist/modules/release/index.js +7 -0
- package/dist/modules/release/index.js.map +1 -0
- package/dist/modules/release/services/release-service.d.ts +34 -0
- package/dist/modules/release/services/release-service.d.ts.map +1 -0
- package/dist/modules/release/services/release-service.js +154 -0
- package/dist/modules/release/services/release-service.js.map +1 -0
- package/dist/templates/plugin/README.md.hbs +39 -0
- package/dist/templates/plugin/package.json.hbs +34 -0
- package/dist/templates/plugin/plugin.json.hbs +7 -0
- package/dist/templates/plugin/src/generator.ts.hbs +64 -0
- package/dist/templates/plugin/templates/src/.gitkeep +0 -0
- package/dist/templates/plugin/tsconfig.json +10 -0
- package/dist/templates/plugin/tsup.config.ts +9 -0
- package/dist/templates/workspace/.github/workflows/ci.yml +8 -5
- package/dist/templates/workspace/package.json +1 -0
- package/dist/templates/workspace/turbo.json +5 -0
- package/dist/utils/launch77-context.d.ts +1 -1
- package/dist/utils/launch77-context.d.ts.map +1 -1
- package/dist/utils/launch77-context.js +25 -2
- package/dist/utils/launch77-context.js.map +1 -1
- package/dist/utils/launch77-validation.d.ts +1 -1
- package/dist/utils/launch77-validation.d.ts.map +1 -1
- package/dist/utils/string.d.ts +13 -0
- package/dist/utils/string.d.ts.map +1 -0
- package/dist/utils/string.js +18 -0
- package/dist/utils/string.js.map +1 -0
- package/package.json +6 -9
- package/src/cli.ts +7 -3
- package/src/infrastructure/template-generator.ts +1 -1
- package/src/infrastructure/template.ts +14 -0
- package/src/modules/app/commands/create-app.ts +1 -1
- package/src/modules/app/commands/delete-app.ts +1 -1
- package/src/modules/app/services/app-svc.ts +1 -1
- package/src/modules/app/services/manifest-svc.ts +1 -1
- package/src/modules/catalog/config/catalog-config.test.ts +1 -1
- package/src/modules/git/commands/git-connect.ts +2 -2
- package/src/modules/git/errors/git-errors.ts +7 -0
- package/src/modules/git/index.ts +8 -1
- package/src/modules/git/services/git-service.ts +12 -1
- package/src/modules/plugin/commands/plugin-create.ts +68 -0
- package/src/modules/plugin/commands/plugin-install.ts +9 -26
- package/src/modules/plugin/errors/plugin-errors.ts +87 -6
- package/src/modules/plugin/index.ts +4 -2
- package/src/modules/plugin/lib/plugin-registry.ts +14 -37
- package/src/modules/plugin/lib/plugin-resolver.test.ts +215 -0
- package/src/modules/plugin/lib/plugin-resolver.ts +160 -0
- package/src/modules/plugin/services/plugin-create-service.ts +69 -0
- package/src/modules/plugin/services/plugin-svc.ts +108 -15
- package/src/modules/release/commands/release-init.ts +102 -0
- package/src/modules/release/errors/release-errors.ts +13 -0
- package/src/modules/release/index.ts +8 -0
- package/src/modules/release/services/release-service.ts +170 -0
- package/src/utils/launch77-context.ts +29 -3
- package/src/utils/launch77-validation.ts +1 -1
- package/src/utils/string.ts +17 -0
- package/templates/plugin/README.md.hbs +39 -0
- package/templates/plugin/package.json.hbs +34 -0
- package/templates/plugin/plugin.json.hbs +7 -0
- package/templates/plugin/src/generator.ts.hbs +64 -0
- package/templates/plugin/templates/src/.gitkeep +0 -0
- package/templates/plugin/tsconfig.json +10 -0
- package/templates/plugin/tsup.config.ts +9 -0
- package/templates/workspace/.github/workflows/ci.yml +8 -5
- package/templates/workspace/package.json +1 -0
- package/templates/workspace/turbo.json +5 -0
- package/tests/integration/cli.test.ts +25 -0
- package/tests/integration/setup.ts +20 -0
- package/vitest.config.ts +9 -0
- package/vitest.integration.config.ts +9 -0
- package/dist/modules/git/commands/git-setup-releases.d.ts +0 -3
- package/dist/modules/git/commands/git-setup-releases.d.ts.map +0 -1
- package/dist/modules/git/commands/git-setup-releases.js +0 -128
- package/dist/modules/git/commands/git-setup-releases.js.map +0 -1
- package/launch77-cli-1.2.0.tgz +0 -0
- package/src/modules/git/commands/git-setup-releases.ts +0 -148
- package/src/modules/plugin/lib/launch77-workspace.code-workspace +0 -14
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { GitHubService } from '../../git/index.js';
|
|
2
|
+
export declare class ReleaseService {
|
|
3
|
+
private githubService;
|
|
4
|
+
constructor(githubService?: GitHubService);
|
|
5
|
+
/**
|
|
6
|
+
* Validate GitHub Personal Access Token format
|
|
7
|
+
*/
|
|
8
|
+
validateReleaseToken(token: string): void;
|
|
9
|
+
/**
|
|
10
|
+
* Explain what RELEASE_TOKEN is and why it's needed
|
|
11
|
+
*/
|
|
12
|
+
explainReleaseToken(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Prompt user for RELEASE_TOKEN
|
|
15
|
+
*/
|
|
16
|
+
promptForReleaseToken(): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Setup RELEASE_TOKEN secret in GitHub repository
|
|
19
|
+
*/
|
|
20
|
+
setupReleaseToken(owner: string, repo: string, token: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Fix changeset config to set access to "public"
|
|
23
|
+
*/
|
|
24
|
+
fixChangesetAccess(workspaceRoot: string): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Explain npm Trusted Publishing (OIDC)
|
|
27
|
+
*/
|
|
28
|
+
explainNpmTrustedPublishing(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Show success summary for release setup
|
|
31
|
+
*/
|
|
32
|
+
showSuccessSummary(): void;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=release-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/release/services/release-service.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGlD,qBAAa,cAAc;IACb,OAAO,CAAC,aAAa;gBAAb,aAAa,GAAE,aAAmC;IAEtE;;OAEG;IACH,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAWzC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAoB3B;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,MAAM,CAAC;IAkB9C;;OAEG;IACG,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0BlF;;OAEG;IACG,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA4BjE;;OAEG;IACH,2BAA2B,IAAI,IAAI;IAsBnC;;OAEG;IACH,kBAAkB,IAAI,IAAI;CAW3B"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { password, confirm } from '@inquirer/prompts';
|
|
3
|
+
import ora from 'ora';
|
|
4
|
+
import fs from 'fs/promises';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { GitHubService } from '../../git/index.js';
|
|
7
|
+
import { InvalidReleaseTokenError, ChangesetNotInitializedError } from '../errors/release-errors.js';
|
|
8
|
+
export class ReleaseService {
|
|
9
|
+
githubService;
|
|
10
|
+
constructor(githubService = new GitHubService()) {
|
|
11
|
+
this.githubService = githubService;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Validate GitHub Personal Access Token format
|
|
15
|
+
*/
|
|
16
|
+
validateReleaseToken(token) {
|
|
17
|
+
if (!token || token.trim().length === 0) {
|
|
18
|
+
throw new InvalidReleaseTokenError('Token cannot be empty');
|
|
19
|
+
}
|
|
20
|
+
// GitHub PATs start with specific prefixes
|
|
21
|
+
if (!token.startsWith('ghp_') && !token.startsWith('github_pat_')) {
|
|
22
|
+
throw new InvalidReleaseTokenError('Invalid token format. GitHub PATs should start with "ghp_" or "github_pat_"');
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Explain what RELEASE_TOKEN is and why it's needed
|
|
27
|
+
*/
|
|
28
|
+
explainReleaseToken() {
|
|
29
|
+
console.log(chalk.cyan('\n📋 About RELEASE_TOKEN:\n'));
|
|
30
|
+
console.log(chalk.white('The RELEASE_TOKEN is a GitHub Personal Access Token (PAT) that allows'));
|
|
31
|
+
console.log(chalk.white('the Changesets action to create Pull Requests for version updates.\n'));
|
|
32
|
+
console.log(chalk.white('Why is this needed?'));
|
|
33
|
+
console.log(chalk.gray(' • The default GITHUB_TOKEN has limited permissions'));
|
|
34
|
+
console.log(chalk.gray(' • Creating PRs that trigger CI requires a PAT'));
|
|
35
|
+
console.log(chalk.gray(' • This enables automated release workflows\n'));
|
|
36
|
+
console.log(chalk.white('Required permissions:'));
|
|
37
|
+
console.log(chalk.gray(' • Contents: Read and write'));
|
|
38
|
+
console.log(chalk.gray(' • Pull requests: Read and write\n'));
|
|
39
|
+
// Provide link to create PAT
|
|
40
|
+
const tokenUrl = 'https://github.com/settings/personal-access-tokens/new';
|
|
41
|
+
console.log(chalk.cyan('🔗 Create your token:'));
|
|
42
|
+
console.log(chalk.gray(` ${chalk.cyan(tokenUrl)}`));
|
|
43
|
+
console.log(chalk.gray(` Name: Launch77 Release Token`));
|
|
44
|
+
console.log(chalk.gray(` Permissions: Contents (Read and write), Pull requests (Read and write)\n`));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Prompt user for RELEASE_TOKEN
|
|
48
|
+
*/
|
|
49
|
+
async promptForReleaseToken() {
|
|
50
|
+
return password({
|
|
51
|
+
message: 'Paste your Personal Access Token (PAT):',
|
|
52
|
+
mask: '*',
|
|
53
|
+
validate: (value) => {
|
|
54
|
+
try {
|
|
55
|
+
this.validateReleaseToken(value);
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
if (error instanceof InvalidReleaseTokenError) {
|
|
60
|
+
return error.message;
|
|
61
|
+
}
|
|
62
|
+
return 'Invalid token';
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Setup RELEASE_TOKEN secret in GitHub repository
|
|
69
|
+
*/
|
|
70
|
+
async setupReleaseToken(owner, repo, token) {
|
|
71
|
+
this.validateReleaseToken(token);
|
|
72
|
+
// Confirm before setting
|
|
73
|
+
console.log(chalk.yellow('\n⚠ Note: This will overwrite any existing RELEASE_TOKEN secret\n'));
|
|
74
|
+
const shouldContinue = await confirm({
|
|
75
|
+
message: 'Continue and set RELEASE_TOKEN?',
|
|
76
|
+
default: true,
|
|
77
|
+
});
|
|
78
|
+
if (!shouldContinue) {
|
|
79
|
+
console.log(chalk.green('\n✅ No changes made.\n'));
|
|
80
|
+
process.exit(0);
|
|
81
|
+
}
|
|
82
|
+
// Set the secret
|
|
83
|
+
const setSpinner = ora('Setting RELEASE_TOKEN secret...').start();
|
|
84
|
+
try {
|
|
85
|
+
await this.githubService.setRepositorySecret(owner, repo, 'RELEASE_TOKEN', token);
|
|
86
|
+
setSpinner.succeed('RELEASE_TOKEN configured successfully!');
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
setSpinner.fail('Failed to set RELEASE_TOKEN');
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Fix changeset config to set access to "public"
|
|
95
|
+
*/
|
|
96
|
+
async fixChangesetAccess(workspaceRoot) {
|
|
97
|
+
const configPath = path.join(workspaceRoot, '.changeset', 'config.json');
|
|
98
|
+
try {
|
|
99
|
+
// Check if config exists
|
|
100
|
+
const configContent = await fs.readFile(configPath, 'utf-8');
|
|
101
|
+
const config = JSON.parse(configContent);
|
|
102
|
+
// Check if already public
|
|
103
|
+
if (config.access === 'public') {
|
|
104
|
+
return false; // No change needed
|
|
105
|
+
}
|
|
106
|
+
// Update to public
|
|
107
|
+
config.access = 'public';
|
|
108
|
+
// Write back
|
|
109
|
+
await fs.writeFile(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
|
|
110
|
+
return true; // Changed
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
if (error.code === 'ENOENT') {
|
|
114
|
+
throw new ChangesetNotInitializedError();
|
|
115
|
+
}
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Explain npm Trusted Publishing (OIDC)
|
|
121
|
+
*/
|
|
122
|
+
explainNpmTrustedPublishing() {
|
|
123
|
+
console.log(chalk.cyan('\n📦 Setting up npm publishing with Trusted Publishers (OIDC):\n'));
|
|
124
|
+
console.log(chalk.white('Trusted Publishing uses OpenID Connect (OIDC) for secure, token-free publishing.'));
|
|
125
|
+
console.log(chalk.white('This is the recommended approach (no tokens to manage or expire).\n'));
|
|
126
|
+
console.log(chalk.white('Steps to configure:'));
|
|
127
|
+
console.log(chalk.gray(' 1. Visit: https://www.npmjs.com/settings/~/publishers'));
|
|
128
|
+
console.log(chalk.gray(' 2. Click "Add a trusted publisher"'));
|
|
129
|
+
console.log(chalk.gray(' 3. Select "GitHub Actions"'));
|
|
130
|
+
console.log(chalk.gray(' 4. Enter your repository information:'));
|
|
131
|
+
console.log(chalk.gray(' - Repository owner (your GitHub username or org)'));
|
|
132
|
+
console.log(chalk.gray(' - Repository name'));
|
|
133
|
+
console.log(chalk.gray(' - Workflow file: .github/workflows/ci.yml'));
|
|
134
|
+
console.log(chalk.gray(' 5. Save the configuration\n'));
|
|
135
|
+
console.log(chalk.white('Your GitHub workflow already has the required permission:'));
|
|
136
|
+
console.log(chalk.gray(' ✓ id-token: write\n'));
|
|
137
|
+
console.log(chalk.cyan('📚 Learn more:'));
|
|
138
|
+
console.log(chalk.gray(' https://docs.npmjs.com/trusted-publishers/\n'));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Show success summary for release setup
|
|
142
|
+
*/
|
|
143
|
+
showSuccessSummary() {
|
|
144
|
+
console.log(chalk.green('\n✅ Release automation is ready!\n'));
|
|
145
|
+
console.log(chalk.white('What happens now:'));
|
|
146
|
+
console.log(chalk.gray(' • When you push to main, CI runs as usual'));
|
|
147
|
+
console.log(chalk.gray(' • Changesets detects version changes'));
|
|
148
|
+
console.log(chalk.gray(' • A "Version Packages" PR is created automatically'));
|
|
149
|
+
console.log(chalk.gray(' • Merge the PR to publish your packages\n'));
|
|
150
|
+
console.log(chalk.cyan('📚 Learn more:'));
|
|
151
|
+
console.log(chalk.gray(` ${chalk.cyan('https://github.com/changesets/changesets')}\n`));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=release-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-service.js","sourceRoot":"","sources":["../../../../src/modules/release/services/release-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,MAAM,aAAa,CAAA;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAEpG,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,gBAA+B,IAAI,aAAa,EAAE;QAAlD,kBAAa,GAAb,aAAa,CAAqC;IAAG,CAAC;IAE1E;;OAEG;IACH,oBAAoB,CAAC,KAAa;QAChC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,wBAAwB,CAAC,uBAAuB,CAAC,CAAA;QAC7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GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAA;QACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC,CAAA;IAC5E,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAA;QAC9D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAA;QAC7C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC,CAAA;QACtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC,CAAA;QACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sDAAsD,CAAC,CAAC,CAAA;QAC/E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC,CAAA;QAEtE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAA;QACzC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,0CAA0C,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3F,CAAC;CACF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# {{pluginNamePascal}} Plugin
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
launch77 plugin:install {{pluginName}}
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
After installation, the plugin will:
|
|
14
|
+
|
|
15
|
+
- TODO: Describe what the plugin does
|
|
16
|
+
- TODO: List any files created or modified
|
|
17
|
+
- TODO: Explain configuration options
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
### Building
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run build
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run typecheck
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Template Files
|
|
34
|
+
|
|
35
|
+
The `templates/` directory contains files that will be copied to the target application when this plugin is installed. Add any template files your plugin needs here.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
UNLICENSED
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{workspaceName}}/plugin-{{pluginName}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": true,
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/generator.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"generate": "./dist/generator.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/",
|
|
14
|
+
"templates/",
|
|
15
|
+
"plugin.json"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"dev": "tsup --watch",
|
|
20
|
+
"typecheck": "tsc --noEmit"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@launch77/plugin-runtime": "^0.1.0",
|
|
24
|
+
"chalk": "^5.3.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^20.10.0",
|
|
28
|
+
"tsup": "^8.0.0",
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
import { StandardGenerator } from '@launch77/plugin-runtime'
|
|
5
|
+
import type { GeneratorContext } from '@launch77/plugin-runtime'
|
|
6
|
+
|
|
7
|
+
export class {{pluginNamePascal}}Generator extends StandardGenerator {
|
|
8
|
+
constructor(context: GeneratorContext) {
|
|
9
|
+
super(context)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
protected async injectCode(): Promise<void> {
|
|
13
|
+
console.log(chalk.cyan('🔧 Setting up {{pluginName}} plugin...\n'))
|
|
14
|
+
|
|
15
|
+
// TODO: Add your plugin's code injection logic here
|
|
16
|
+
// Examples:
|
|
17
|
+
// - Copy template files to the app
|
|
18
|
+
// - Modify package.json
|
|
19
|
+
// - Update configuration files
|
|
20
|
+
|
|
21
|
+
console.log(chalk.green(' ✓ Plugin setup complete\n'))
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
protected showNextSteps(): void {
|
|
25
|
+
console.log(chalk.white('\n' + '─'.repeat(60) + '\n'))
|
|
26
|
+
console.log(chalk.cyan('📋 {{pluginNamePascal}} Plugin Installed!\n'))
|
|
27
|
+
console.log(chalk.white('Next Steps:\n'))
|
|
28
|
+
|
|
29
|
+
console.log(chalk.gray('1. TODO: Add your first step'))
|
|
30
|
+
console.log(chalk.cyan(' npm run <command>\n'))
|
|
31
|
+
|
|
32
|
+
console.log(chalk.gray('2. TODO: Add your second step'))
|
|
33
|
+
console.log(chalk.cyan(' npm run <command>\n'))
|
|
34
|
+
|
|
35
|
+
console.log(chalk.white('Documentation:\n'))
|
|
36
|
+
console.log(chalk.gray('See README.md for detailed instructions.\n'))
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// CLI entry point
|
|
41
|
+
async function main() {
|
|
42
|
+
const args = process.argv.slice(2)
|
|
43
|
+
const appPath = args.find((arg) => arg.startsWith('--appPath='))?.split('=')[1]
|
|
44
|
+
const appName = args.find((arg) => arg.startsWith('--appName='))?.split('=')[1]
|
|
45
|
+
const workspaceName = args.find((arg) => arg.startsWith('--workspaceName='))?.split('=')[1]
|
|
46
|
+
const pluginPath = args.find((arg) => arg.startsWith('--pluginPath='))?.split('=')[1]
|
|
47
|
+
|
|
48
|
+
if (!appPath || !appName || !workspaceName || !pluginPath) {
|
|
49
|
+
console.error(chalk.red('Error: Missing required arguments'))
|
|
50
|
+
console.error(chalk.gray('Usage: --appPath=<path> --appName=<name> --workspaceName=<name> --pluginPath=<path>'))
|
|
51
|
+
process.exit(1)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const generator = new {{pluginNamePascal}}Generator({ appPath, appName, workspaceName, pluginPath })
|
|
55
|
+
await generator.run()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
59
|
+
main().catch((error) => {
|
|
60
|
+
console.error(chalk.red('\n❌ Error during plugin setup:'))
|
|
61
|
+
console.error(error)
|
|
62
|
+
process.exit(1)
|
|
63
|
+
})
|
|
64
|
+
}
|
|
File without changes
|
|
@@ -31,20 +31,23 @@ jobs:
|
|
|
31
31
|
cache: 'npm'
|
|
32
32
|
|
|
33
33
|
- name: Install dependencies
|
|
34
|
-
run: npm
|
|
34
|
+
run: npm install
|
|
35
35
|
|
|
36
36
|
- name: Run linting
|
|
37
37
|
run: npm run lint
|
|
38
38
|
|
|
39
|
-
- name: Run type checking
|
|
40
|
-
run: npm run typecheck
|
|
41
|
-
|
|
42
39
|
- name: Build packages
|
|
43
40
|
run: npm run build
|
|
44
41
|
|
|
42
|
+
- name: Run type checking
|
|
43
|
+
run: npm run typecheck
|
|
44
|
+
|
|
45
45
|
- name: Run tests
|
|
46
46
|
run: npm run test
|
|
47
47
|
|
|
48
|
+
- name: Run integration tests
|
|
49
|
+
run: npm run test:integration
|
|
50
|
+
|
|
48
51
|
quality-checks:
|
|
49
52
|
runs-on: ubuntu-latest
|
|
50
53
|
|
|
@@ -58,7 +61,7 @@ jobs:
|
|
|
58
61
|
cache: 'npm'
|
|
59
62
|
|
|
60
63
|
- name: Install dependencies
|
|
61
|
-
run: npm
|
|
64
|
+
run: npm install
|
|
62
65
|
|
|
63
66
|
- name: Check for dependency vulnerabilities
|
|
64
67
|
run: npm audit --audit-level=high
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Launch77LocationType = 'workspace-root' | 'workspace-app' | 'unknown';
|
|
1
|
+
export type Launch77LocationType = 'workspace-root' | 'workspace-app' | 'workspace-library' | 'workspace-plugin' | 'workspace-app-template' | 'unknown';
|
|
2
2
|
export interface Launch77Context {
|
|
3
3
|
isValid: boolean;
|
|
4
4
|
locationType: Launch77LocationType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch77-context.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-context.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"launch77-context.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-context.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,eAAe,GAAG,mBAAmB,GAAG,kBAAkB,GAAG,wBAAwB,GAAG,SAAS,CAAA;AAEvJ,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,oBAAoB,CAAA;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;CACpB;AAsGD;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAyDjF"}
|
|
@@ -34,6 +34,9 @@ async function findWorkspaceRoot(startDir) {
|
|
|
34
34
|
* Parse the directory structure to determine location context
|
|
35
35
|
* Based on patterns:
|
|
36
36
|
* - apps/[name] → workspace-app
|
|
37
|
+
* - libraries/[name] → workspace-library
|
|
38
|
+
* - plugins/[name] → workspace-plugin
|
|
39
|
+
* - app-templates/[name] → workspace-app-template
|
|
37
40
|
* - (empty or root) → workspace-root
|
|
38
41
|
*/
|
|
39
42
|
function parseLocationFromPath(cwdPath, workspaceRoot) {
|
|
@@ -50,8 +53,28 @@ function parseLocationFromPath(cwdPath, workspaceRoot) {
|
|
|
50
53
|
appName: parts[1],
|
|
51
54
|
};
|
|
52
55
|
}
|
|
53
|
-
//
|
|
54
|
-
|
|
56
|
+
// libraries/[lib-name]/...
|
|
57
|
+
if (parts[0] === 'libraries' && parts.length >= 2) {
|
|
58
|
+
return {
|
|
59
|
+
locationType: 'workspace-library',
|
|
60
|
+
appName: parts[1],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
// plugins/[plugin-name]/...
|
|
64
|
+
if (parts[0] === 'plugins' && parts.length >= 2) {
|
|
65
|
+
return {
|
|
66
|
+
locationType: 'workspace-plugin',
|
|
67
|
+
appName: parts[1],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// app-templates/[template-name]/...
|
|
71
|
+
if (parts[0] === 'app-templates' && parts.length >= 2) {
|
|
72
|
+
return {
|
|
73
|
+
locationType: 'workspace-app-template',
|
|
74
|
+
appName: parts[1],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// Somewhere else in workspace
|
|
55
78
|
return { locationType: 'workspace-root' };
|
|
56
79
|
}
|
|
57
80
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch77-context.js","sourceRoot":"","sources":["../../src/utils/launch77-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,MAAM,UA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AA0B;IAC1B,IAAI,QAA2B,CAAA;IAC/B,IAAI,CAAC;QACH,QAAQ,GAAG,MAAM,qBAAqB,CAAC,aAAa,CAAC,CAAA;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,qDAAqD;QACrD,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,SAAS;YACvB,aAAa,EAAE,EAAE;YACjB,OAAO,EAAE,EAAE;YACX,gBAAgB,EAAE,EAAE;YACpB,aAAa,EAAE,EAAE;YACjB,WAAW,EAAE,EAAE;SAChB,CAAA;IACH,CAAC;IAED,sDAAsD;IACtD,MAAM,MAAM,GAAG,qBAAqB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;IAEhE,uCAAuC;IACvC,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;IAElD,gDAAgD;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAA;IAEhD,uDAAuD;IACvD,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAE/E,OAAO;QACL,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,aAAa;QACb,OAAO;QACP,gBAAgB,EAAE,QAAQ,CAAC,OAAO;QAClC,aAAa;QACb,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW;KACZ,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launch77-validation.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"launch77-validation.d.ts","sourceRoot":"","sources":["../../src/utils/launch77-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAgBnF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAwB7E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a kebab-case or snake_case string to PascalCase
|
|
3
|
+
*
|
|
4
|
+
* @param str - The string to convert (e.g., "my-plugin" or "my_plugin")
|
|
5
|
+
* @returns PascalCase string (e.g., "MyPlugin")
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* toPascalCase('my-plugin') // 'MyPlugin'
|
|
9
|
+
* toPascalCase('release') // 'Release'
|
|
10
|
+
* toPascalCase('my-awesome-plugin') // 'MyAwesomePlugin'
|
|
11
|
+
*/
|
|
12
|
+
export declare function toPascalCase(str: string): string;
|
|
13
|
+
//# sourceMappingURL=string.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKhD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a kebab-case or snake_case string to PascalCase
|
|
3
|
+
*
|
|
4
|
+
* @param str - The string to convert (e.g., "my-plugin" or "my_plugin")
|
|
5
|
+
* @returns PascalCase string (e.g., "MyPlugin")
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* toPascalCase('my-plugin') // 'MyPlugin'
|
|
9
|
+
* toPascalCase('release') // 'Release'
|
|
10
|
+
* toPascalCase('my-awesome-plugin') // 'MyAwesomePlugin'
|
|
11
|
+
*/
|
|
12
|
+
export function toPascalCase(str) {
|
|
13
|
+
return str
|
|
14
|
+
.split(/[-_]/)
|
|
15
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
|
16
|
+
.join('');
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../../src/utils/string.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,GAAG;SACP,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SACzE,IAAI,CAAC,EAAE,CAAC,CAAA;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@launch77/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Launch77 Platform CLI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
"dev": "tsx src/cli.ts",
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
17
|
"lint": "eslint src/**/*.ts",
|
|
18
|
-
"lint:fix": "eslint src/**/*.ts --fix"
|
|
18
|
+
"lint:fix": "eslint src/**/*.ts --fix",
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"test:integration": "vitest run --config vitest.integration.config.ts"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
23
|
+
"@launch77/plugin-runtime": "*",
|
|
21
24
|
"@types/inquirer": "^9.0.9",
|
|
22
25
|
"chalk": "^5.3.0",
|
|
23
26
|
"commander": "^11.1.0",
|
|
@@ -38,11 +41,5 @@
|
|
|
38
41
|
"tsx": "^4.7.0",
|
|
39
42
|
"typescript": "^5.3.3",
|
|
40
43
|
"vitest": "^4.0.16"
|
|
41
|
-
}
|
|
42
|
-
"workspaces": [
|
|
43
|
-
"apps/*",
|
|
44
|
-
"libraries/*",
|
|
45
|
-
"plugins/*",
|
|
46
|
-
"app-templates/*"
|
|
47
|
-
]
|
|
44
|
+
}
|
|
48
45
|
}
|
package/src/cli.ts
CHANGED
|
@@ -5,8 +5,9 @@ import { Command } from 'commander'
|
|
|
5
5
|
import { createAppCommand, deleteAppCommand, generateManifestCommand, validateManifestCommand } from './modules/app/index.js'
|
|
6
6
|
import { scanCommand, createGenerateCommand } from './modules/catalog/index.js'
|
|
7
7
|
import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js'
|
|
8
|
-
import { gitConnectCommand
|
|
9
|
-
import { pluginInstallCommand } from './modules/plugin/index.js'
|
|
8
|
+
import { gitConnectCommand } from './modules/git/index.js'
|
|
9
|
+
import { pluginInstallCommand, pluginCreateCommand } from './modules/plugin/index.js'
|
|
10
|
+
import { releaseInitCommand } from './modules/release/index.js'
|
|
10
11
|
import { createStartupCommand } from './modules/startup/index.js'
|
|
11
12
|
import { getPackageVersion } from './utils/version.js'
|
|
12
13
|
import { initWorkspaceCommand } from './modules/workspace/index.js'
|
|
@@ -24,12 +25,15 @@ program.addCommand(deleteAppCommand())
|
|
|
24
25
|
program.addCommand(generateManifestCommand())
|
|
25
26
|
program.addCommand(validateManifestCommand())
|
|
26
27
|
program.addCommand(pluginInstallCommand())
|
|
28
|
+
program.addCommand(pluginCreateCommand())
|
|
27
29
|
program.addCommand(scanCommand())
|
|
28
30
|
program.addCommand(createGenerateCommand())
|
|
29
31
|
|
|
30
32
|
// Git commands
|
|
31
33
|
program.addCommand(gitConnectCommand())
|
|
32
|
-
|
|
34
|
+
|
|
35
|
+
// Release commands
|
|
36
|
+
program.addCommand(releaseInitCommand())
|
|
33
37
|
|
|
34
38
|
// Deploy commands
|
|
35
39
|
program.addCommand(deployInitCommand())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getTemplatePath, processTemplate, templateExists } from './template.js'
|
|
2
2
|
|
|
3
|
-
import type { Launch77Context } from '
|
|
3
|
+
import type { Launch77Context } from '@launch77/plugin-runtime'
|
|
4
4
|
|
|
5
5
|
export interface GenerateFromTemplateOptions {
|
|
6
6
|
port?: string
|