@launch77/cli 1.5.0 → 1.6.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 +6 -0
- package/dist/cli.js +16 -14
- package/dist/cli.js.map +1 -1
- package/dist/modules/app/commands/create-app.d.ts +1 -1
- package/dist/modules/app/commands/create-app.js +1 -1
- package/dist/modules/app/commands/delete-app.d.ts +1 -1
- package/dist/modules/app/commands/delete-app.js +1 -1
- package/dist/modules/app/index.d.ts +2 -3
- package/dist/modules/app/index.d.ts.map +1 -1
- package/dist/modules/app/index.js +2 -3
- package/dist/modules/app/index.js.map +1 -1
- package/dist/modules/catalog/commands/generate.d.ts +1 -1
- package/dist/modules/catalog/commands/generate.d.ts.map +1 -1
- package/dist/modules/catalog/commands/generate.js +1 -1
- package/dist/modules/catalog/commands/generate.js.map +1 -1
- package/dist/modules/catalog/commands/scan.d.ts +1 -1
- package/dist/modules/catalog/commands/scan.d.ts.map +1 -1
- package/dist/modules/catalog/commands/scan.js +1 -1
- package/dist/modules/catalog/commands/scan.js.map +1 -1
- package/dist/modules/library/commands/delete-library.d.ts +3 -0
- package/dist/modules/library/commands/delete-library.d.ts.map +1 -0
- package/dist/modules/library/commands/delete-library.js +111 -0
- package/dist/modules/library/commands/delete-library.js.map +1 -0
- package/dist/modules/library/errors/library-errors.d.ts +7 -0
- package/dist/modules/library/errors/library-errors.d.ts.map +1 -0
- package/dist/modules/library/errors/library-errors.js +13 -0
- package/dist/modules/library/errors/library-errors.js.map +1 -0
- package/dist/modules/library/index.d.ts +5 -0
- package/dist/modules/library/index.d.ts.map +1 -0
- package/dist/modules/library/index.js +7 -0
- package/dist/modules/library/index.js.map +1 -0
- package/dist/modules/library/services/library-svc.d.ts +9 -0
- package/dist/modules/library/services/library-svc.d.ts.map +1 -0
- package/dist/modules/library/services/library-svc.js +38 -0
- package/dist/modules/library/services/library-svc.js.map +1 -0
- package/dist/modules/library/types/library-types.d.ts +7 -0
- package/dist/modules/library/types/library-types.d.ts.map +1 -0
- package/dist/modules/library/types/library-types.js +2 -0
- package/dist/modules/library/types/library-types.js.map +1 -0
- package/dist/modules/plugin/commands/delete-plugin.d.ts +3 -0
- package/dist/modules/plugin/commands/delete-plugin.d.ts.map +1 -0
- package/dist/modules/plugin/commands/delete-plugin.js +113 -0
- package/dist/modules/plugin/commands/delete-plugin.js.map +1 -0
- package/dist/modules/plugin/errors/plugin-errors.d.ts +12 -0
- package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -1
- package/dist/modules/plugin/errors/plugin-errors.js +18 -0
- package/dist/modules/plugin/errors/plugin-errors.js.map +1 -1
- package/dist/modules/plugin/index.d.ts +1 -0
- package/dist/modules/plugin/index.d.ts.map +1 -1
- package/dist/modules/plugin/index.js +1 -0
- package/dist/modules/plugin/index.js.map +1 -1
- package/dist/modules/plugin/services/plugin-svc.d.ts +5 -1
- package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -1
- package/dist/modules/plugin/services/plugin-svc.js +34 -1
- package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
- package/dist/modules/plugin/types/plugin-types.d.ts +6 -0
- package/dist/modules/plugin/types/plugin-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +16 -14
- package/src/modules/app/commands/create-app.ts +1 -1
- package/src/modules/app/commands/delete-app.ts +1 -1
- package/src/modules/app/index.ts +2 -3
- package/src/modules/catalog/commands/generate.ts +1 -1
- package/src/modules/catalog/commands/scan.ts +1 -1
- package/src/modules/library/commands/delete-library.ts +126 -0
- package/src/modules/library/errors/library-errors.ts +13 -0
- package/src/modules/library/index.ts +11 -0
- package/src/modules/library/services/library-svc.ts +50 -0
- package/src/modules/library/types/library-types.ts +7 -0
- package/src/modules/plugin/commands/delete-plugin.ts +128 -0
- package/src/modules/plugin/errors/plugin-errors.ts +20 -0
- package/src/modules/plugin/index.ts +1 -0
- package/src/modules/plugin/services/plugin-svc.ts +43 -2
- package/src/modules/plugin/types/plugin-types.ts +8 -0
- package/dist/modules/app/commands/validate-manifest.d.ts +0 -3
- package/dist/modules/app/commands/validate-manifest.d.ts.map +0 -1
- package/dist/modules/app/commands/validate-manifest.js +0 -67
- package/dist/modules/app/commands/validate-manifest.js.map +0 -1
- package/src/modules/app/commands/validate-manifest.ts +0 -77
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @launch77/cli
|
|
2
2
|
|
|
3
|
+
## 1.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 231f581: Added new delete commands, removed uneccessary commands around manifest files, and commented out commands for deploying until we come back and fix issues here
|
|
8
|
+
|
|
3
9
|
## 1.5.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/cli.js
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js'
|
|
3
|
+
import { appCreateCommand, appDeleteCommand } from './modules/app/index.js';
|
|
4
|
+
// import { catalogScanCommand, catalogGenerateCommand } from './modules/catalog/index.js'
|
|
5
|
+
// import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js'
|
|
6
6
|
import { gitConnectCommand } from './modules/git/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { libraryDeleteCommand } from './modules/library/index.js';
|
|
8
|
+
import { pluginInstallCommand, pluginCreateCommand, pluginDeleteCommand } from './modules/plugin/index.js';
|
|
8
9
|
import { releaseInitCommand } from './modules/release/index.js';
|
|
9
|
-
import { getPackageVersion } from './utils/version.js';
|
|
10
10
|
import { initWorkspaceCommand } from './modules/workspace/index.js';
|
|
11
|
+
import { getPackageVersion } from './utils/version.js';
|
|
11
12
|
const program = new Command()
|
|
12
13
|
.name('launch77')
|
|
13
14
|
.description('Launch77 Platform CLI')
|
|
14
15
|
.version(getPackageVersion(import.meta.url));
|
|
15
16
|
// Register module commands
|
|
16
17
|
program.addCommand(initWorkspaceCommand());
|
|
17
|
-
program.addCommand(
|
|
18
|
-
program.addCommand(
|
|
19
|
-
program.addCommand(
|
|
20
|
-
program.addCommand(pluginInstallCommand());
|
|
18
|
+
program.addCommand(appCreateCommand());
|
|
19
|
+
program.addCommand(appDeleteCommand());
|
|
20
|
+
program.addCommand(libraryDeleteCommand());
|
|
21
21
|
program.addCommand(pluginCreateCommand());
|
|
22
|
-
program.addCommand(
|
|
23
|
-
program.addCommand(
|
|
22
|
+
program.addCommand(pluginDeleteCommand());
|
|
23
|
+
program.addCommand(pluginInstallCommand());
|
|
24
|
+
// program.addCommand(catalogGenerateCommand())
|
|
25
|
+
// program.addCommand(catalogScanCommand())
|
|
24
26
|
// Git commands
|
|
25
27
|
program.addCommand(gitConnectCommand());
|
|
26
28
|
// Release commands
|
|
27
29
|
program.addCommand(releaseInitCommand());
|
|
28
30
|
// Deploy commands
|
|
29
|
-
program.addCommand(deployInitCommand())
|
|
30
|
-
program.addCommand(deployStatusCommand())
|
|
31
|
-
program.addCommand(deployLogsCommand())
|
|
31
|
+
// program.addCommand(deployInitCommand())
|
|
32
|
+
// program.addCommand(deployStatusCommand())
|
|
33
|
+
// program.addCommand(deployLogsCommand())
|
|
32
34
|
program.parse();
|
|
33
35
|
//# sourceMappingURL=cli.js.map
|
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,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO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,0CAA0C;AAC1C,4CAA4C;AAC5C,0CAA0C;AAE1C,OAAO,CAAC,KAAK,EAAE,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { Command } from 'commander';
|
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
import { detectLaunch77Context } from '@launch77/plugin-runtime';
|
|
7
7
|
import { AppService } from '../services/app-svc.js';
|
|
8
|
-
export function
|
|
8
|
+
export function appCreateCommand() {
|
|
9
9
|
const command = new Command('app:create')
|
|
10
10
|
.argument('<template>', 'App template name (e.g., webapp, api, marketing-site)')
|
|
11
11
|
.argument('<app-name>', 'Name of the application')
|
|
@@ -6,7 +6,7 @@ import inquirer from 'inquirer';
|
|
|
6
6
|
import ora from 'ora';
|
|
7
7
|
import { detectLaunch77Context } from '@launch77/plugin-runtime';
|
|
8
8
|
import { AppService } from '../services/app-svc.js';
|
|
9
|
-
export function
|
|
9
|
+
export function appDeleteCommand() {
|
|
10
10
|
const command = new Command('app:delete')
|
|
11
11
|
.argument('<app-name>', 'Name of the app to delete')
|
|
12
12
|
.description('Delete an app from the workspace (requires confirmation)')
|
|
@@ -3,7 +3,6 @@ export { ManifestService } from './services/manifest-svc.js';
|
|
|
3
3
|
export type { CreateAppRequest, CreateAppResult, DeleteAppRequest, DeleteAppResult } from './types/app-types.js';
|
|
4
4
|
export type { AppManifest, DeploymentConfig } from './lib/manifest-schema.js';
|
|
5
5
|
export { AppAlreadyExistsError, AppNotFoundError, InvalidAppNameError, TemplateNotFoundError, ManifestNotFoundError, InvalidManifestError } from './errors/app-errors.js';
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { validateManifestCommand } from './commands/validate-manifest.js';
|
|
6
|
+
export { appCreateCommand } from './commands/create-app.js';
|
|
7
|
+
export { appDeleteCommand } from './commands/delete-app.js';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/app/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAChH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAG7E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGzK,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/app/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAG5D,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAChH,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAG7E,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGzK,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -4,7 +4,6 @@ export { ManifestService } from './services/manifest-svc.js';
|
|
|
4
4
|
// Errors
|
|
5
5
|
export { AppAlreadyExistsError, AppNotFoundError, InvalidAppNameError, TemplateNotFoundError, ManifestNotFoundError, InvalidManifestError } from './errors/app-errors.js';
|
|
6
6
|
// Commands
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export { validateManifestCommand } from './commands/validate-manifest.js';
|
|
7
|
+
export { appCreateCommand } from './commands/create-app.js';
|
|
8
|
+
export { appDeleteCommand } from './commands/delete-app.js';
|
|
10
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/app/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAM5D,SAAS;AACT,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEzK,WAAW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/app/index.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAM5D,SAAS;AACT,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEzK,WAAW;AACX,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/generate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAanC;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/generate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAanC;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAqBhD"}
|
|
@@ -11,7 +11,7 @@ import { printQualityReport } from '../utils/quality-reporter.js';
|
|
|
11
11
|
/**
|
|
12
12
|
* Create the catalog:generate command
|
|
13
13
|
*/
|
|
14
|
-
export function
|
|
14
|
+
export function catalogGenerateCommand() {
|
|
15
15
|
const command = new Command('catalog:generate')
|
|
16
16
|
.description('Generate catalog metadata for a component library')
|
|
17
17
|
.option('-l, --library <path>', 'Library directory path', process.cwd())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/generate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAQjE;;GAEG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/generate.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,KAAK,MAAM,OA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QAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC,CAAA;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,WAAW;IACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,iBAAiB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAA;IAC/D,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC,aAAa,CAAC,YAAY,GAAG,GAAG,CAAC,CAAC,CAAA;IACtF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAA;IAEtF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;IACpE,CAAC;IAED,OAAO,CAAC,GAAG,EAAE,CAAA;AACf,CAAC"}
|
|
@@ -5,5 +5,5 @@ import { Command } from 'commander';
|
|
|
5
5
|
* Scans UI components, libraries, plugins, and utilities from the Launch77 monorepo
|
|
6
6
|
* and generates a machine-readable catalog for AI discovery.
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function catalogScanCommand(): Command;
|
|
9
9
|
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/scan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC;;;;;GAKG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/scan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAmC5C"}
|
|
@@ -8,7 +8,7 @@ import { CatalogService } from '../services/catalog-svc.js';
|
|
|
8
8
|
* Scans UI components, libraries, plugins, and utilities from the Launch77 monorepo
|
|
9
9
|
* and generates a machine-readable catalog for AI discovery.
|
|
10
10
|
*/
|
|
11
|
-
export function
|
|
11
|
+
export function catalogScanCommand() {
|
|
12
12
|
const command = new Command('catalog:scan')
|
|
13
13
|
.description('Scan Launch77 artifacts and generate catalog.json')
|
|
14
14
|
.option('--no-strict', 'Skip validation errors and generate catalog anyway')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../../../src/modules/catalog/commands/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC;SACxC,WAAW,CAAC,mDAAmD,CAAC;SAChE,MAAM,CAAC,aAAa,EAAE,o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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-library.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/commands/delete-library.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,wBAAgB,oBAAoB,IAAI,OAAO,CAkH9C"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
import { detectLaunch77Context } from '@launch77/plugin-runtime';
|
|
8
|
+
import { LibraryService } from '../services/library-svc.js';
|
|
9
|
+
export function libraryDeleteCommand() {
|
|
10
|
+
const command = new Command('library:delete')
|
|
11
|
+
.argument('<library-name>', 'Name of the library to delete')
|
|
12
|
+
.description('Delete a library from the workspace (requires confirmation)')
|
|
13
|
+
.action(async (libraryName) => {
|
|
14
|
+
try {
|
|
15
|
+
console.log(chalk.yellow(`\n⚠️ WARNING: You are about to delete the library '${libraryName}'\n`));
|
|
16
|
+
// Detect context
|
|
17
|
+
const context = await detectLaunch77Context(process.cwd());
|
|
18
|
+
// Create library service
|
|
19
|
+
const libraryService = new LibraryService();
|
|
20
|
+
// Get library path for display (before deletion)
|
|
21
|
+
const libraryPath = path.join(context.workspaceRoot, 'libraries', libraryName);
|
|
22
|
+
// Display what will be deleted
|
|
23
|
+
console.log(chalk.red('Library location:'), libraryPath);
|
|
24
|
+
console.log(chalk.red('\nThis will permanently delete:'));
|
|
25
|
+
console.log(chalk.gray(' • All source code and configuration files'));
|
|
26
|
+
console.log(chalk.gray(' • All node_modules (will be cleaned from monorepo)'));
|
|
27
|
+
console.log(chalk.gray(' • All build artifacts'));
|
|
28
|
+
console.log(chalk.yellow('\n⚠️ Important notes:'));
|
|
29
|
+
console.log(chalk.gray(' • Check if other packages depend on this library'));
|
|
30
|
+
console.log(chalk.gray(' • If published to npm, you may want to deprecate/unpublish it manually'));
|
|
31
|
+
console.log(chalk.gray(' • Update import statements in dependent packages manually'));
|
|
32
|
+
console.log(chalk.red('\n⚠️ THIS ACTION CANNOT BE UNDONE!\n'));
|
|
33
|
+
// First confirmation: Type library name
|
|
34
|
+
const { confirmName } = await inquirer.prompt([
|
|
35
|
+
{
|
|
36
|
+
type: 'input',
|
|
37
|
+
name: 'confirmName',
|
|
38
|
+
message: `Type the library name to confirm:`,
|
|
39
|
+
validate: (input) => {
|
|
40
|
+
if (input === libraryName) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return `Please type '${libraryName}' exactly to confirm`;
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
47
|
+
if (confirmName !== libraryName) {
|
|
48
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
// Second confirmation: Type DELETE
|
|
52
|
+
const { confirmDelete } = await inquirer.prompt([
|
|
53
|
+
{
|
|
54
|
+
type: 'input',
|
|
55
|
+
name: 'confirmDelete',
|
|
56
|
+
message: 'Type DELETE (all caps) to confirm permanent deletion:',
|
|
57
|
+
validate: (input) => {
|
|
58
|
+
if (input === 'DELETE') {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
return 'Please type DELETE (all caps) to confirm';
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
]);
|
|
65
|
+
if (confirmDelete !== 'DELETE') {
|
|
66
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
// Delete the library
|
|
70
|
+
const deleteSpinner = ora('Deleting library directory...').start();
|
|
71
|
+
try {
|
|
72
|
+
await libraryService.deleteLibrary({ libraryName }, context);
|
|
73
|
+
deleteSpinner.succeed('Library directory deleted');
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
deleteSpinner.fail('Failed to delete library directory');
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
// Update dependencies
|
|
80
|
+
const installSpinner = ora('Updating workspace dependencies...').start();
|
|
81
|
+
try {
|
|
82
|
+
// This is already done by library service, just show spinner for consistency
|
|
83
|
+
installSpinner.succeed('Dependencies updated (package-lock.json cleaned)');
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
installSpinner.fail('Failed to update dependencies');
|
|
87
|
+
console.log(chalk.yellow('\n⚠️ You may need to run "npm install" manually at the workspace root\n'));
|
|
88
|
+
}
|
|
89
|
+
// Success message
|
|
90
|
+
console.log(chalk.green(`\n✅ Library '${libraryName}' has been deleted\n`));
|
|
91
|
+
// Reminder about cleanup
|
|
92
|
+
console.log(chalk.yellow('📝 Remember to:'));
|
|
93
|
+
console.log(chalk.gray(' • Check and update dependent packages (remove from dependencies)'));
|
|
94
|
+
console.log(chalk.gray(' • Update import statements in code that used this library'));
|
|
95
|
+
console.log(chalk.gray(' • Consider deprecating/unpublishing from npm if published'));
|
|
96
|
+
console.log();
|
|
97
|
+
// Reminder about Git
|
|
98
|
+
console.log(chalk.yellow('📝 Remember to commit the deletion:'));
|
|
99
|
+
console.log(chalk.gray(' git add -A'));
|
|
100
|
+
console.log(chalk.gray(` git commit -m "Remove ${libraryName} library"`));
|
|
101
|
+
console.log();
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
105
|
+
console.error(chalk.red('Error:'), message);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return command;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=delete-library.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-library.js","sourceRoot":"","sources":["../../../../src/modules/library/commands/delete-library.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO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AI5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class LibraryNotFoundError extends Error {
|
|
2
|
+
constructor(libraryName, expectedPath) {
|
|
3
|
+
super(`Library '${libraryName}' does not exist.\n\n` + `Expected location: ${expectedPath}\n\n` + `Available libraries:\n` + ` cd libraries/\n` + ` ls`);
|
|
4
|
+
this.name = 'LibraryNotFoundError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export class InvalidLibraryNameError extends Error {
|
|
8
|
+
constructor(message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.name = 'InvalidLibraryNameError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=library-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-errors.js","sourceRoot":"","sources":["../../../../src/modules/library/errors/library-errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,WAAmB,EAAE,YAAoB;QACnD,KAAK,CAAC,YAAY,WAAW,uBAAuB,GAAG,sBAAsB,YAAY,MAAM,GAAG,wBAAwB,GAAG,mBAAmB,GAAG,MAAM,CAAC,CAAA;QAC1J,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { LibraryService } from './services/library-svc.js';
|
|
2
|
+
export type { DeleteLibraryRequest, DeleteLibraryResult } from './types/library-types.js';
|
|
3
|
+
export { LibraryNotFoundError, InvalidLibraryNameError } from './errors/library-errors.js';
|
|
4
|
+
export { libraryDeleteCommand } from './commands/delete-library.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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;AAG1D,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAGzF,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Services
|
|
2
|
+
export { LibraryService } from './services/library-svc.js';
|
|
3
|
+
// Errors
|
|
4
|
+
export { LibraryNotFoundError, InvalidLibraryNameError } from './errors/library-errors.js';
|
|
5
|
+
// Commands
|
|
6
|
+
export { libraryDeleteCommand } from './commands/delete-library.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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;AAK1D,SAAS;AACT,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AAE1F,WAAW;AACX,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeleteLibraryRequest, DeleteLibraryResult } from '../types/library-types.js';
|
|
2
|
+
import type { Launch77Context } from '@launch77/plugin-runtime';
|
|
3
|
+
export declare class LibraryService {
|
|
4
|
+
/**
|
|
5
|
+
* Delete a library from the workspace
|
|
6
|
+
*/
|
|
7
|
+
deleteLibrary(request: DeleteLibraryRequest, context: Launch77Context): Promise<DeleteLibraryResult>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=library-svc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-svc.d.ts","sourceRoot":"","sources":["../../../../src/modules/library/services/library-svc.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAE/D,qBAAa,cAAc;IACzB;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAiC3G"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import * as npm from '../../../infrastructure/npm.js';
|
|
4
|
+
import { validateWorkspaceContext } from '../../../utils/launch77-validation.js';
|
|
5
|
+
import { validateAppName } from '../../../utils/validation.js';
|
|
6
|
+
import { LibraryNotFoundError, InvalidLibraryNameError } from '../errors/library-errors.js';
|
|
7
|
+
export class LibraryService {
|
|
8
|
+
/**
|
|
9
|
+
* Delete a library from the workspace
|
|
10
|
+
*/
|
|
11
|
+
async deleteLibrary(request, context) {
|
|
12
|
+
const { libraryName } = request;
|
|
13
|
+
// 1. Validate library name (reusing app name validation since format is the same)
|
|
14
|
+
const nameValidation = validateAppName(libraryName);
|
|
15
|
+
if (!nameValidation.valid) {
|
|
16
|
+
throw new InvalidLibraryNameError(nameValidation.errorMessage || 'Invalid library name');
|
|
17
|
+
}
|
|
18
|
+
// 2. Validate workspace context
|
|
19
|
+
const contextValidation = validateWorkspaceContext(context);
|
|
20
|
+
if (!contextValidation.valid) {
|
|
21
|
+
throw new Error(contextValidation.errorMessage || 'Invalid workspace context');
|
|
22
|
+
}
|
|
23
|
+
// 3. Determine library path
|
|
24
|
+
const libraryPath = path.join(context.workspaceRoot, 'libraries', libraryName);
|
|
25
|
+
// 4. Check if library exists
|
|
26
|
+
if (!(await fs.pathExists(libraryPath))) {
|
|
27
|
+
throw new LibraryNotFoundError(libraryName, libraryPath);
|
|
28
|
+
}
|
|
29
|
+
// 5. Delete the library directory
|
|
30
|
+
await fs.remove(libraryPath);
|
|
31
|
+
// 6. Update dependencies
|
|
32
|
+
await npm.install(context.workspaceRoot);
|
|
33
|
+
return {
|
|
34
|
+
libraryName,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=library-svc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-svc.js","sourceRoot":"","sources":["../../../../src/modules/library/services/library-svc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAA;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAK3F,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,OAAwB;QACzE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;QAE/B,kFAAkF;QAClF,MAAM,cAAc,GAAG,eAAe,CAAC,WAAW,CAAC,CAAA;QACnD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,IAAI,uBAAuB,CAAC,cAAc,CAAC,YAAY,IAAI,sBAAsB,CAAC,CAAA;QAC1F,CAAC;QAED,gCAAgC;QAChC,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAA;QAC3D,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,YAAY,IAAI,2BAA2B,CAAC,CAAA;QAChF,CAAC;QAED,4BAA4B;QAC5B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,WAAW,CAAC,CAAA;QAE9E,6BAA6B;QAC7B,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA;QAC1D,CAAC;QAED,kCAAkC;QAClC,MAAM,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QAE5B,yBAAyB;QACzB,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAExC,OAAO;YACL,WAAW;SACZ,CAAA;IACH,CAAC;CACF"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"library-types.js","sourceRoot":"","sources":["../../../../src/modules/library/types/library-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-plugin.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/delete-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAOnC,wBAAgB,mBAAmB,IAAI,OAAO,CAoH7C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import ora from 'ora';
|
|
7
|
+
import { detectLaunch77Context } from '@launch77/plugin-runtime';
|
|
8
|
+
import { PluginService } from '../services/plugin-svc.js';
|
|
9
|
+
export function pluginDeleteCommand() {
|
|
10
|
+
const command = new Command('plugin:delete')
|
|
11
|
+
.argument('<plugin-name>', 'Name of the plugin to delete')
|
|
12
|
+
.description('Delete a plugin from the workspace (requires confirmation)')
|
|
13
|
+
.action(async (pluginName) => {
|
|
14
|
+
try {
|
|
15
|
+
console.log(chalk.yellow(`\n⚠️ WARNING: You are about to delete the plugin '${pluginName}'\n`));
|
|
16
|
+
// Detect context
|
|
17
|
+
const context = await detectLaunch77Context(process.cwd());
|
|
18
|
+
// Create plugin service
|
|
19
|
+
const pluginService = new PluginService();
|
|
20
|
+
// Get plugin path for display (before deletion)
|
|
21
|
+
const pluginPath = path.join(context.workspaceRoot, 'plugins', pluginName);
|
|
22
|
+
// Display what will be deleted
|
|
23
|
+
console.log(chalk.red('Plugin location:'), pluginPath);
|
|
24
|
+
console.log(chalk.red('\nThis will permanently delete:'));
|
|
25
|
+
console.log(chalk.gray(' • All source code and configuration files'));
|
|
26
|
+
console.log(chalk.gray(' • All node_modules (will be cleaned from monorepo)'));
|
|
27
|
+
console.log(chalk.gray(' • All build artifacts'));
|
|
28
|
+
console.log(chalk.gray(' • Plugin templates and generators'));
|
|
29
|
+
console.log(chalk.yellow('\n⚠️ Important notes:'));
|
|
30
|
+
console.log(chalk.gray(' • Check if plugin is installed in other packages'));
|
|
31
|
+
console.log(chalk.gray(' • If published to npm, you may want to deprecate/unpublish it manually'));
|
|
32
|
+
console.log(chalk.gray(' • Remove plugin from launch77.installedPlugins in dependent packages manually'));
|
|
33
|
+
console.log(chalk.red('\n⚠️ THIS ACTION CANNOT BE UNDONE!\n'));
|
|
34
|
+
// First confirmation: Type plugin name
|
|
35
|
+
const { confirmName } = await inquirer.prompt([
|
|
36
|
+
{
|
|
37
|
+
type: 'input',
|
|
38
|
+
name: 'confirmName',
|
|
39
|
+
message: `Type the plugin name to confirm:`,
|
|
40
|
+
validate: (input) => {
|
|
41
|
+
if (input === pluginName) {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
return `Please type '${pluginName}' exactly to confirm`;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
]);
|
|
48
|
+
if (confirmName !== pluginName) {
|
|
49
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Second confirmation: Type DELETE
|
|
53
|
+
const { confirmDelete } = await inquirer.prompt([
|
|
54
|
+
{
|
|
55
|
+
type: 'input',
|
|
56
|
+
name: 'confirmDelete',
|
|
57
|
+
message: 'Type DELETE (all caps) to confirm permanent deletion:',
|
|
58
|
+
validate: (input) => {
|
|
59
|
+
if (input === 'DELETE') {
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
return 'Please type DELETE (all caps) to confirm';
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
if (confirmDelete !== 'DELETE') {
|
|
67
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
// Delete the plugin
|
|
71
|
+
const deleteSpinner = ora('Deleting plugin directory...').start();
|
|
72
|
+
try {
|
|
73
|
+
await pluginService.deletePlugin({ pluginName }, context);
|
|
74
|
+
deleteSpinner.succeed('Plugin directory deleted');
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
deleteSpinner.fail('Failed to delete plugin directory');
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
// Update dependencies
|
|
81
|
+
const installSpinner = ora('Updating workspace dependencies...').start();
|
|
82
|
+
try {
|
|
83
|
+
// This is already done by plugin service, just show spinner for consistency
|
|
84
|
+
installSpinner.succeed('Dependencies updated (package-lock.json cleaned)');
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
installSpinner.fail('Failed to update dependencies');
|
|
88
|
+
console.log(chalk.yellow('\n⚠️ You may need to run "npm install" manually at the workspace root\n'));
|
|
89
|
+
}
|
|
90
|
+
// Success message
|
|
91
|
+
console.log(chalk.green(`\n✅ Plugin '${pluginName}' has been deleted\n`));
|
|
92
|
+
// Reminder about cleanup
|
|
93
|
+
console.log(chalk.yellow('📝 Remember to:'));
|
|
94
|
+
console.log(chalk.gray(' • Check packages that had this plugin installed'));
|
|
95
|
+
console.log(chalk.gray(' • Remove plugin from launch77.installedPlugins in package.json files'));
|
|
96
|
+
console.log(chalk.gray(' • Remove any plugin-generated files if needed'));
|
|
97
|
+
console.log(chalk.gray(' • Consider deprecating/unpublishing from npm if published'));
|
|
98
|
+
console.log();
|
|
99
|
+
// Reminder about Git
|
|
100
|
+
console.log(chalk.yellow('📝 Remember to commit the deletion:'));
|
|
101
|
+
console.log(chalk.gray(' git add -A'));
|
|
102
|
+
console.log(chalk.gray(` git commit -m "Remove ${pluginName} plugin"`));
|
|
103
|
+
console.log();
|
|
104
|
+
}
|
|
105
|
+
catch (error) {
|
|
106
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
107
|
+
console.error(chalk.red('Error:'), message);
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
return command;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=delete-plugin.js.map
|