@launch77/cli 1.7.2 → 1.7.4

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.
Files changed (145) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/infrastructure/package-resolver.test.js +9 -7
  3. package/dist/infrastructure/package-resolver.test.js.map +1 -1
  4. package/dist/modules/app/commands/create-app.d.ts.map +1 -1
  5. package/dist/modules/app/commands/create-app.js +1 -1
  6. package/dist/modules/app/commands/create-app.js.map +1 -1
  7. package/dist/modules/app/commands/delete-app.d.ts.map +1 -1
  8. package/dist/modules/app/commands/delete-app.js +1 -1
  9. package/dist/modules/app/commands/delete-app.js.map +1 -1
  10. package/dist/modules/app/lib/app-template-resolver.d.ts +1 -1
  11. package/dist/modules/app/lib/app-template-resolver.d.ts.map +1 -1
  12. package/dist/modules/app/lib/app-template-resolver.js +1 -1
  13. package/dist/modules/app/lib/app-template-resolver.js.map +1 -1
  14. package/dist/modules/app/services/app-svc.d.ts +1 -0
  15. package/dist/modules/app/services/app-svc.d.ts.map +1 -1
  16. package/dist/modules/app/services/app-svc.js +4 -4
  17. package/dist/modules/app/services/app-svc.js.map +1 -1
  18. package/dist/modules/app/services/manifest-svc.d.ts +1 -1
  19. package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
  20. package/dist/modules/catalog/commands/scan.d.ts.map +1 -1
  21. package/dist/modules/catalog/commands/scan.js +1 -1
  22. package/dist/modules/catalog/commands/scan.js.map +1 -1
  23. package/dist/modules/catalog/services/catalog-svc.d.ts.map +1 -1
  24. package/dist/modules/deploy/commands/deploy-init-action.js +1 -1
  25. package/dist/modules/deploy/commands/deploy-init-action.js.map +1 -1
  26. package/dist/modules/deploy/commands/deploy-logs-action.js +1 -1
  27. package/dist/modules/deploy/commands/deploy-logs-action.js.map +1 -1
  28. package/dist/modules/deploy/commands/deploy-status-action.js +1 -1
  29. package/dist/modules/deploy/commands/deploy-status-action.js.map +1 -1
  30. package/dist/modules/git/commands/git-connect.d.ts.map +1 -1
  31. package/dist/modules/git/commands/git-connect.js +3 -3
  32. package/dist/modules/git/commands/git-connect.js.map +1 -1
  33. package/dist/modules/library/commands/create-library.d.ts.map +1 -1
  34. package/dist/modules/library/commands/create-library.js +1 -1
  35. package/dist/modules/library/commands/create-library.js.map +1 -1
  36. package/dist/modules/library/commands/delete-library.d.ts.map +1 -1
  37. package/dist/modules/library/commands/delete-library.js +1 -1
  38. package/dist/modules/library/commands/delete-library.js.map +1 -1
  39. package/dist/modules/library/services/library-create-svc.js +1 -1
  40. package/dist/modules/library/services/library-create-svc.js.map +1 -1
  41. package/dist/modules/library/services/library-svc.d.ts +1 -0
  42. package/dist/modules/library/services/library-svc.d.ts.map +1 -1
  43. package/dist/modules/library/services/library-svc.js +3 -2
  44. package/dist/modules/library/services/library-svc.js.map +1 -1
  45. package/dist/modules/plugin/commands/delete-plugin.d.ts.map +1 -1
  46. package/dist/modules/plugin/commands/delete-plugin.js +1 -2
  47. package/dist/modules/plugin/commands/delete-plugin.js.map +1 -1
  48. package/dist/modules/plugin/commands/plugin-create.d.ts.map +1 -1
  49. package/dist/modules/plugin/commands/plugin-create.js +1 -1
  50. package/dist/modules/plugin/commands/plugin-create.js.map +1 -1
  51. package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -1
  52. package/dist/modules/plugin/commands/plugin-install.js +1 -2
  53. package/dist/modules/plugin/commands/plugin-install.js.map +1 -1
  54. package/dist/modules/plugin/index.d.ts +3 -3
  55. package/dist/modules/plugin/index.d.ts.map +1 -1
  56. package/dist/modules/plugin/index.js +2 -3
  57. package/dist/modules/plugin/index.js.map +1 -1
  58. package/dist/modules/plugin/lib/plugin-resolver.test.js +10 -6
  59. package/dist/modules/plugin/lib/plugin-resolver.test.js.map +1 -1
  60. package/dist/modules/plugin/services/plugin-create-service.d.ts +1 -0
  61. package/dist/modules/plugin/services/plugin-create-service.d.ts.map +1 -1
  62. package/dist/modules/plugin/services/plugin-create-service.js +4 -3
  63. package/dist/modules/plugin/services/plugin-create-service.js.map +1 -1
  64. package/dist/modules/plugin/services/plugin-svc.test.js +34 -30
  65. package/dist/modules/plugin/services/plugin-svc.test.js.map +1 -1
  66. package/dist/modules/release/commands/release-init.d.ts.map +1 -1
  67. package/dist/modules/release/commands/release-init.js +2 -2
  68. package/dist/modules/release/commands/release-init.js.map +1 -1
  69. package/dist/modules/release/services/release-service.d.ts.map +1 -1
  70. package/dist/modules/release/services/release-service.js +3 -3
  71. package/dist/modules/release/services/release-service.js.map +1 -1
  72. package/dist/modules/workspace/services/workspace-service.d.ts +1 -0
  73. package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -1
  74. package/dist/modules/workspace/services/workspace-service.js +3 -2
  75. package/dist/modules/workspace/services/workspace-service.js.map +1 -1
  76. package/dist/templates/plugin/README.md.hbs +10 -0
  77. package/dist/templates/plugin/package.json.hbs +1 -1
  78. package/dist/templates/plugin/scripts/validate-plugin-json.js +13 -2
  79. package/dist/templates/workspace/.eslintignore +2 -1
  80. package/package.json +3 -3
  81. package/src/infrastructure/package-resolver.test.ts +9 -8
  82. package/src/modules/app/commands/create-app.ts +1 -1
  83. package/src/modules/app/commands/delete-app.ts +1 -1
  84. package/src/modules/app/lib/app-template-resolver.ts +1 -2
  85. package/src/modules/app/services/app-svc.ts +6 -7
  86. package/src/modules/app/services/manifest-svc.ts +1 -1
  87. package/src/modules/catalog/commands/scan.ts +1 -2
  88. package/src/modules/catalog/services/catalog-svc.ts +1 -1
  89. package/src/modules/deploy/commands/deploy-init-action.ts +1 -1
  90. package/src/modules/deploy/commands/deploy-logs-action.ts +1 -1
  91. package/src/modules/deploy/commands/deploy-status-action.ts +1 -1
  92. package/src/modules/git/commands/git-connect.ts +3 -3
  93. package/src/modules/library/commands/create-library.ts +1 -1
  94. package/src/modules/library/commands/delete-library.ts +1 -1
  95. package/src/modules/library/services/library-create-svc.ts +1 -1
  96. package/src/modules/library/services/library-svc.ts +3 -2
  97. package/src/modules/plugin/commands/delete-plugin.ts +1 -3
  98. package/src/modules/plugin/commands/plugin-create.ts +1 -1
  99. package/src/modules/plugin/commands/plugin-install.ts +1 -3
  100. package/src/modules/plugin/index.ts +4 -6
  101. package/src/modules/plugin/lib/plugin-resolver.test.ts +10 -7
  102. package/src/modules/plugin/services/plugin-create-service.ts +4 -3
  103. package/src/modules/plugin/services/plugin-svc.test.ts +52 -32
  104. package/src/modules/release/commands/release-init.ts +2 -2
  105. package/src/modules/release/services/release-service.ts +4 -3
  106. package/src/modules/workspace/services/workspace-service.ts +3 -2
  107. package/templates/plugin/README.md.hbs +10 -0
  108. package/templates/plugin/package.json.hbs +1 -1
  109. package/templates/plugin/scripts/validate-plugin-json.js +13 -2
  110. package/templates/workspace/.eslintignore +2 -1
  111. package/dist/infrastructure/npm-package.d.ts +0 -42
  112. package/dist/infrastructure/npm-package.d.ts.map +0 -1
  113. package/dist/infrastructure/npm-package.js +0 -46
  114. package/dist/infrastructure/npm-package.js.map +0 -1
  115. package/dist/infrastructure/npm.d.ts +0 -9
  116. package/dist/infrastructure/npm.d.ts.map +0 -1
  117. package/dist/infrastructure/npm.js +0 -17
  118. package/dist/infrastructure/npm.js.map +0 -1
  119. package/dist/infrastructure/package-resolver.d.ts +0 -117
  120. package/dist/infrastructure/package-resolver.d.ts.map +0 -1
  121. package/dist/infrastructure/package-resolver.js +0 -170
  122. package/dist/infrastructure/package-resolver.js.map +0 -1
  123. package/dist/modules/plugin/errors/plugin-errors.d.ts +0 -51
  124. package/dist/modules/plugin/errors/plugin-errors.d.ts.map +0 -1
  125. package/dist/modules/plugin/errors/plugin-errors.js +0 -130
  126. package/dist/modules/plugin/errors/plugin-errors.js.map +0 -1
  127. package/dist/modules/plugin/lib/plugin-resolver.d.ts +0 -14
  128. package/dist/modules/plugin/lib/plugin-resolver.d.ts.map +0 -1
  129. package/dist/modules/plugin/lib/plugin-resolver.js +0 -36
  130. package/dist/modules/plugin/lib/plugin-resolver.js.map +0 -1
  131. package/dist/modules/plugin/services/plugin-svc.d.ts +0 -42
  132. package/dist/modules/plugin/services/plugin-svc.d.ts.map +0 -1
  133. package/dist/modules/plugin/services/plugin-svc.js +0 -257
  134. package/dist/modules/plugin/services/plugin-svc.js.map +0 -1
  135. package/dist/modules/plugin/types/plugin-types.d.ts +0 -25
  136. package/dist/modules/plugin/types/plugin-types.d.ts.map +0 -1
  137. package/dist/modules/plugin/types/plugin-types.js +0 -2
  138. package/dist/modules/plugin/types/plugin-types.js.map +0 -1
  139. package/src/infrastructure/npm-package.ts +0 -73
  140. package/src/infrastructure/npm.ts +0 -18
  141. package/src/infrastructure/package-resolver.ts +0 -223
  142. package/src/modules/plugin/errors/plugin-errors.ts +0 -145
  143. package/src/modules/plugin/lib/plugin-resolver.ts +0 -41
  144. package/src/modules/plugin/services/plugin-svc.ts +0 -303
  145. package/src/modules/plugin/types/plugin-types.ts +0 -29
@@ -1,130 +0,0 @@
1
- export class PluginNotFoundError extends Error {
2
- constructor(pluginName) {
3
- super(`Plugin '${pluginName}' not found.
4
-
5
- Run 'launch77 plugin:list' to see available plugins.`);
6
- this.name = 'PluginNotFoundError';
7
- }
8
- }
9
- export class InvalidPluginContextError extends Error {
10
- constructor(message) {
11
- super(message);
12
- this.name = 'InvalidPluginContextError';
13
- }
14
- }
15
- /**
16
- * Factory function to create standardized InvalidPluginContextError
17
- * for when plugin:install is run outside of a package directory
18
- */
19
- export function createInvalidContextError(currentLocation) {
20
- return new InvalidPluginContextError(`plugin:install must be run from within a package directory.
21
-
22
- Current location: ${currentLocation}
23
- Expected: apps/<name>/, libraries/<name>/, plugins/<name>/, or app-templates/<name>/
24
-
25
- Navigate to a package directory:
26
- cd apps/<app-name>/
27
- cd libraries/<lib-name>/
28
- cd plugins/<plugin-name>/
29
- cd app-templates/<template-name>/`);
30
- }
31
- /**
32
- * Error when plugin.json is missing the required 'targets' field
33
- */
34
- export class MissingPluginTargetsError extends Error {
35
- constructor(pluginName) {
36
- super(`Plugin '${pluginName}' is missing the required 'targets' field in plugin.json.
37
-
38
- The plugin.json file must include a 'targets' array specifying which package types
39
- the plugin can be installed into.
40
-
41
- Example plugin.json:
42
- {
43
- "name": "${pluginName}",
44
- "version": "1.0.0",
45
- "targets": ["app", "library", "plugin", "app-template"],
46
- "pluginDependencies": {},
47
- "libraryDependencies": {}
48
- }`);
49
- this.name = 'MissingPluginTargetsError';
50
- }
51
- }
52
- /**
53
- * Factory function to create error when plugin targets don't match current location
54
- */
55
- export function createInvalidTargetError(pluginName, currentTarget, allowedTargets) {
56
- const targetLocations = allowedTargets.map((target) => {
57
- switch (target) {
58
- case 'app':
59
- return 'apps/<name>/';
60
- case 'library':
61
- return 'libraries/<name>/';
62
- case 'plugin':
63
- return 'plugins/<name>/';
64
- case 'app-template':
65
- return 'app-templates/<name>/';
66
- default:
67
- return target;
68
- }
69
- });
70
- return new InvalidPluginContextError(`Plugin '${pluginName}' cannot be installed in a '${currentTarget}' package.
71
-
72
- This plugin can only be installed in: ${allowedTargets.join(', ')}
73
-
74
- Allowed locations:
75
- ${targetLocations.map((loc) => ` ${loc}`).join('\n')}`);
76
- }
77
- export class PluginInstallationError extends Error {
78
- cause;
79
- constructor(message, cause) {
80
- super(message);
81
- this.cause = cause;
82
- this.name = 'PluginInstallationError';
83
- }
84
- }
85
- /**
86
- * Error when plugin resolution fails
87
- */
88
- export class PluginResolutionError extends Error {
89
- constructor(pluginName, reason) {
90
- super(`Failed to resolve plugin '${pluginName}': ${reason}`);
91
- this.name = 'PluginResolutionError';
92
- }
93
- }
94
- /**
95
- * Error when npm package installation fails
96
- */
97
- export class NpmInstallationError extends Error {
98
- cause;
99
- constructor(packageName, cause) {
100
- super(`Failed to install npm package '${packageName}'.
101
-
102
- Please check:
103
- - Your internet connection
104
- - npm registry access (https://registry.npmjs.org)
105
- - Package exists: https://www.npmjs.com/package/${packageName}
106
-
107
- ${cause ? `\nOriginal error: ${cause.message}` : ''}`);
108
- this.cause = cause;
109
- this.name = 'NpmInstallationError';
110
- }
111
- }
112
- /**
113
- * Error when plugin directory is not found for deletion
114
- */
115
- export class PluginDirectoryNotFoundError extends Error {
116
- constructor(pluginName, expectedPath) {
117
- super(`Plugin '${pluginName}' does not exist.\n\n` + `Expected location: ${expectedPath}\n\n` + `Available plugins:\n` + ` cd plugins/\n` + ` ls`);
118
- this.name = 'PluginDirectoryNotFoundError';
119
- }
120
- }
121
- /**
122
- * Error when plugin name validation fails
123
- */
124
- export class InvalidPluginNameError extends Error {
125
- constructor(message) {
126
- super(message);
127
- this.name = 'InvalidPluginNameError';
128
- }
129
- }
130
- //# sourceMappingURL=plugin-errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-errors.js","sourceRoot":"","sources":["../../../../src/modules/plugin/errors/plugin-errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,UAAkB;QAC5B,KAAK,CAAC,WAAW,UAAU;;qDAEsB,CAAC,CAAA;QAClD,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;IACzC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,eAAuB;IAC/D,OAAO,IAAI,yBAAyB,CAClC;;oBAEgB,eAAe;;;;;;;oCAOC,CACjC,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,YAAY,UAAkB;QAC5B,KAAK,CAAC,WAAW,UAAU;;;;;;;aAOlB,UAAU;;;;;EAKrB,CAAC,CAAA;QACC,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAA;IACzC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,UAAkB,EAAE,aAAqB,EAAE,cAAwB;IAC1G,MAAM,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EAAE,CAAC,CAAA;QATlC,UAAK,GAAL,KAAK,CAAQ;QAU7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IACrD,YAAY,UAAkB,EAAE,YAAoB;QAClD,KAAK,CAAC,WAAW,UAAU,uBAAuB,GAAG,sBAAsB,YAAY,MAAM,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,MAAM,CAAC,CAAA;QACpJ,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAA;IAC5C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;IACtC,CAAC;CACF"}
@@ -1,14 +0,0 @@
1
- import { PackageResolver } from '../../../infrastructure/package-resolver.js';
2
- /**
3
- * Plugin resolver implementation
4
- *
5
- * Resolves plugins from:
6
- * - Local workspace plugins/ directory
7
- * - npm packages with @launch77-shared/plugin- prefix
8
- */
9
- export declare class PluginResolver extends PackageResolver {
10
- protected getFolderName(): string;
11
- protected getPackagePrefix(): string;
12
- protected verify(localPath: string): Promise<boolean>;
13
- }
14
- //# sourceMappingURL=plugin-resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-resolver.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/lib/plugin-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAE7E;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,eAAe;IACjD,SAAS,CAAC,aAAa,IAAI,MAAM;IAIjC,SAAS,CAAC,gBAAgB,IAAI,MAAM;cAIpB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAkB5D"}
@@ -1,36 +0,0 @@
1
- import * as path from 'path';
2
- import fs from 'fs-extra';
3
- import { PackageResolver } from '../../../infrastructure/package-resolver.js';
4
- /**
5
- * Plugin resolver implementation
6
- *
7
- * Resolves plugins from:
8
- * - Local workspace plugins/ directory
9
- * - npm packages with @launch77-shared/plugin- prefix
10
- */
11
- export class PluginResolver extends PackageResolver {
12
- getFolderName() {
13
- return 'plugins';
14
- }
15
- getPackagePrefix() {
16
- return '@launch77-shared/plugin-';
17
- }
18
- async verify(localPath) {
19
- // Verify it's a valid plugin (has plugin.json, dist/generator.js, and package.json with version)
20
- const hasPluginJson = await fs.pathExists(path.join(localPath, 'plugin.json'));
21
- const hasGenerator = await fs.pathExists(path.join(localPath, 'dist/generator.js'));
22
- const hasPackageJson = await fs.pathExists(path.join(localPath, 'package.json'));
23
- if (!hasPluginJson || !hasGenerator || !hasPackageJson) {
24
- return false;
25
- }
26
- // Verify package.json has a version field
27
- try {
28
- const packageJson = await fs.readJson(path.join(localPath, 'package.json'));
29
- return !!packageJson.version;
30
- }
31
- catch {
32
- return false;
33
- }
34
- }
35
- }
36
- //# sourceMappingURL=plugin-resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-resolver.js","sourceRoot":"","sources":["../../../../src/modules/plugin/lib/plugin-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,MAAM,UAAU,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAA;AAE7E;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,eAAe;IACvC,aAAa;QACrB,OAAO,SAAS,CAAA;IAClB,CAAC;IAES,gBAAgB;QACxB,OAAO,0BAA0B,CAAA;IACnC,CAAC;IAES,KAAK,CAAC,MAAM,CAAC,SAAiB;QACtC,iGAAiG;QACjG,MAAM,aAAa,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,CAAA;QAC9E,MAAM,YAAY,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC,CAAA;QACnF,MAAM,cAAc,GAAG,MAAM,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAA;QAEhF,IAAI,CAAC,aAAa,IAAI,CAAC,YAAY,IAAI,CAAC,cAAc,EAAE,CAAC;YACvD,OAAO,KAAK,CAAA;QACd,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC,CAAA;YAC3E,OAAO,CAAC,CAAC,WAAW,CAAC,OAAO,CAAA;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;CACF"}
@@ -1,42 +0,0 @@
1
- import type { Launch77Context } from '@launch77/plugin-runtime';
2
- import type { InstallPluginRequest, InstallPluginResult, DeletePluginRequest, DeletePluginResult } from '../types/plugin-types.js';
3
- export declare class PluginService {
4
- private pluginResolver;
5
- constructor();
6
- /**
7
- * Validate that we're in a valid package directory and return the target type
8
- */
9
- private validateContext;
10
- /**
11
- * Validate plugin name, resolve its location, and download if needed
12
- */
13
- private validateAndResolvePlugin;
14
- /**
15
- * Read plugin metadata and validate it supports the current target
16
- */
17
- private validatePluginTargets;
18
- /**
19
- * Check if plugin is already installed and return early-exit result if so
20
- */
21
- private checkExistingInstallation;
22
- /**
23
- * Install a plugin to the current package
24
- */
25
- installPlugin(request: InstallPluginRequest, context: Launch77Context, logger?: (message: string) => void): Promise<InstallPluginResult>;
26
- /**
27
- * Download and install an npm plugin package
28
- */
29
- private downloadNpmPlugin;
30
- private getPackagePath;
31
- private runGenerator;
32
- private isPluginInstalled;
33
- /**
34
- * Write plugin installation metadata to the target package's package.json
35
- */
36
- private writePluginManifest;
37
- /**
38
- * Delete a plugin from the workspace
39
- */
40
- deletePlugin(request: DeletePluginRequest, context: Launch77Context): Promise<DeletePluginResult>;
41
- }
42
- //# sourceMappingURL=plugin-svc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-svc.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/services/plugin-svc.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,eAAe,EAA0F,MAAM,0BAA0B,CAAA;AACvJ,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAoBlI,qBAAa,aAAa;IACxB,OAAO,CAAC,cAAc,CAAgB;;IAMtC;;OAEG;IACH,OAAO,CAAC,eAAe;IAOvB;;OAEG;YACW,wBAAwB;IA2CtC;;OAEG;YACW,qBAAqB;IAcnC;;OAEG;YACW,yBAAyB;IAmBvC;;OAEG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA6B3J;;OAEG;YACW,iBAAiB;IAW/B,OAAO,CAAC,cAAc;YAgBR,YAAY;YAeZ,iBAAiB;IAmB/B;;OAEG;YACW,mBAAmB;IA6BjC;;OAEG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAiCxG"}
@@ -1,257 +0,0 @@
1
- import * as path from 'path';
2
- import * as fs from 'fs/promises';
3
- import chalk from 'chalk';
4
- import { execa } from 'execa';
5
- import fsExtra from 'fs-extra';
6
- import { readPluginMetadata } from '@launch77/plugin-runtime';
7
- import { downloadNpmPackage } from '../../../infrastructure/npm-package.js';
8
- import * as npm from '../../../infrastructure/npm.js';
9
- import { validateWorkspaceContext } from '../../../utils/launch77-validation.js';
10
- import { validateAppName } from '../../../utils/validation.js';
11
- import { PluginInstallationError, InvalidPluginContextError, createInvalidContextError, MissingPluginTargetsError, createInvalidTargetError, PluginResolutionError, PluginDirectoryNotFoundError, InvalidPluginNameError } from '../errors/plugin-errors.js';
12
- import { PluginResolver } from '../lib/plugin-resolver.js';
13
- /**
14
- * Map location type to target string
15
- */
16
- function locationTypeToTarget(locationType) {
17
- switch (locationType) {
18
- case 'workspace-app':
19
- return 'app';
20
- case 'workspace-library':
21
- return 'library';
22
- case 'workspace-plugin':
23
- return 'plugin';
24
- case 'workspace-app-template':
25
- return 'app-template';
26
- default:
27
- return null;
28
- }
29
- }
30
- export class PluginService {
31
- pluginResolver;
32
- constructor() {
33
- this.pluginResolver = new PluginResolver();
34
- }
35
- /**
36
- * Validate that we're in a valid package directory and return the target type
37
- */
38
- validateContext(context) {
39
- const currentTarget = locationTypeToTarget(context.locationType);
40
- if (!currentTarget)
41
- throw createInvalidContextError(context.locationType);
42
- if (!context.appName)
43
- throw new InvalidPluginContextError('Could not determine package name. This is a bug. Please report it.');
44
- return currentTarget;
45
- }
46
- /**
47
- * Validate plugin name, resolve its location, and download if needed
48
- */
49
- async validateAndResolvePlugin(pluginName, workspaceRoot, logger) {
50
- logger(chalk.blue(`\n🔍 Resolving plugin "${pluginName}"...`));
51
- logger(` ├─ Validating plugin name...`);
52
- const validation = this.pluginResolver.validateInput(pluginName);
53
- if (!validation.isValid) {
54
- throw new PluginResolutionError(pluginName, validation.error || 'Invalid plugin name');
55
- }
56
- logger(` │ └─ ${chalk.green('✓')} Valid plugin name`);
57
- logger(` ├─ Checking local workspace: ${chalk.dim(`plugins/${pluginName}`)}`);
58
- const resolution = await this.pluginResolver.resolveLocation(pluginName, workspaceRoot);
59
- let pluginPath;
60
- let version;
61
- if (resolution.source === 'local') {
62
- logger(` │ └─ ${chalk.green('✓')} Found local plugin`);
63
- pluginPath = resolution.localPath;
64
- version = resolution.version; // Local plugins always have version after verification
65
- }
66
- else {
67
- logger(` │ └─ ${chalk.dim('Not found locally')}`);
68
- logger(` ├─ Resolving to npm package: ${chalk.cyan(resolution.npmPackage)}`);
69
- pluginPath = await this.downloadNpmPlugin(resolution.npmPackage, workspaceRoot, logger);
70
- // Read version from downloaded package
71
- const packageJsonPath = path.join(pluginPath, 'package.json');
72
- const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8');
73
- const packageJson = JSON.parse(packageJsonContent);
74
- version = packageJson.version;
75
- }
76
- logger(` └─ ${chalk.green('✓')} Plugin resolved\n`);
77
- return {
78
- pluginPath,
79
- source: resolution.source,
80
- npmPackage: resolution.npmPackage,
81
- version,
82
- };
83
- }
84
- /**
85
- * Read plugin metadata and validate it supports the current target
86
- */
87
- async validatePluginTargets(pluginPath, pluginName, currentTarget) {
88
- const metadata = await readPluginMetadata(pluginPath);
89
- if (!metadata.targets || metadata.targets.length === 0) {
90
- throw new MissingPluginTargetsError(pluginName);
91
- }
92
- if (!metadata.targets.includes(currentTarget)) {
93
- throw createInvalidTargetError(pluginName, currentTarget, metadata.targets);
94
- }
95
- return metadata;
96
- }
97
- /**
98
- * Check if plugin is already installed and return early-exit result if so
99
- */
100
- async checkExistingInstallation(pluginName, packagePath, logger) {
101
- const existingInstallation = await this.isPluginInstalled(pluginName, packagePath);
102
- if (existingInstallation) {
103
- logger(chalk.yellow(`\nℹ️ Plugin '${pluginName}' is already installed in this package.\n`));
104
- logger(`Package: ${chalk.cyan(existingInstallation.package)} (${existingInstallation.source})`);
105
- logger(`Version: ${existingInstallation.version}`);
106
- logger(`Installed: ${existingInstallation.installedAt}\n`);
107
- logger(chalk.gray('To reinstall: Remove from package.json launch77.installedPlugins'));
108
- logger(chalk.gray('(plugin:remove command coming soon)\n'));
109
- return {
110
- pluginName,
111
- filesInstalled: false,
112
- packageJsonUpdated: false,
113
- dependenciesInstalled: false,
114
- };
115
- }
116
- return null;
117
- }
118
- /**
119
- * Install a plugin to the current package
120
- */
121
- async installPlugin(request, context, logger = console.log) {
122
- const { pluginName } = request;
123
- const currentTarget = this.validateContext(context);
124
- const { pluginPath, source, npmPackage, version } = await this.validateAndResolvePlugin(pluginName, context.workspaceRoot, logger);
125
- const metadata = await this.validatePluginTargets(pluginPath, pluginName, currentTarget);
126
- const packagePath = this.getPackagePath(context);
127
- const earlyExit = await this.checkExistingInstallation(pluginName, packagePath, logger);
128
- if (earlyExit)
129
- return earlyExit;
130
- await this.runGenerator(pluginPath, packagePath, context);
131
- const packageName = source === 'npm' ? npmPackage : pluginName;
132
- await this.writePluginManifest(packagePath, {
133
- pluginName,
134
- packageName,
135
- version,
136
- source,
137
- });
138
- return {
139
- pluginName,
140
- filesInstalled: true,
141
- packageJsonUpdated: true,
142
- dependenciesInstalled: true,
143
- };
144
- }
145
- /**
146
- * Download and install an npm plugin package
147
- */
148
- async downloadNpmPlugin(npmPackage, workspaceRoot, logger) {
149
- logger(` └─ Installing from npm: ${chalk.cyan(npmPackage)}...`);
150
- const result = await downloadNpmPackage({
151
- packageName: npmPackage,
152
- workspaceRoot,
153
- });
154
- return result.packagePath;
155
- }
156
- getPackagePath(context) {
157
- // Determine the base directory based on location type
158
- switch (context.locationType) {
159
- case 'workspace-app':
160
- return path.join(context.appsDir, context.appName);
161
- case 'workspace-library':
162
- return path.join(context.workspaceRoot, 'libraries', context.appName);
163
- case 'workspace-plugin':
164
- return path.join(context.workspaceRoot, 'plugins', context.appName);
165
- case 'workspace-app-template':
166
- return path.join(context.workspaceRoot, 'app-templates', context.appName);
167
- default:
168
- throw new InvalidPluginContextError(`Cannot install plugin from ${context.locationType}`);
169
- }
170
- }
171
- async runGenerator(pluginPath, appPath, context) {
172
- try {
173
- const generatorPath = path.join(pluginPath, 'dist/generator.js');
174
- const args = [generatorPath, `--appPath=${appPath}`, `--appName=${context.appName}`, `--workspaceName=${context.workspaceName}`, `--pluginPath=${pluginPath}`];
175
- await execa('node', args, {
176
- cwd: pluginPath,
177
- stdio: 'inherit',
178
- });
179
- }
180
- catch (error) {
181
- throw new PluginInstallationError(`Generator failed: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : undefined);
182
- }
183
- }
184
- async isPluginInstalled(pluginName, packagePath) {
185
- try {
186
- const packageJsonPath = path.join(packagePath, 'package.json');
187
- const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8');
188
- const packageJson = JSON.parse(packageJsonContent);
189
- const manifest = packageJson.launch77;
190
- if (manifest?.installedPlugins?.[pluginName]) {
191
- return manifest.installedPlugins[pluginName];
192
- }
193
- return null;
194
- }
195
- catch (error) {
196
- // If package.json doesn't exist or can't be read, assume not installed
197
- return null;
198
- }
199
- }
200
- /**
201
- * Write plugin installation metadata to the target package's package.json
202
- */
203
- async writePluginManifest(packagePath, installationInfo) {
204
- try {
205
- const packageJsonPath = path.join(packagePath, 'package.json');
206
- const packageJsonContent = await fs.readFile(packageJsonPath, 'utf-8');
207
- const packageJson = JSON.parse(packageJsonContent);
208
- if (!packageJson.launch77) {
209
- packageJson.launch77 = {};
210
- }
211
- if (!packageJson.launch77.installedPlugins) {
212
- packageJson.launch77.installedPlugins = {};
213
- }
214
- const manifest = packageJson.launch77;
215
- manifest.installedPlugins[installationInfo.pluginName] = {
216
- package: installationInfo.packageName,
217
- version: installationInfo.version,
218
- installedAt: new Date().toISOString(),
219
- source: installationInfo.source,
220
- };
221
- await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
222
- }
223
- catch (error) {
224
- throw new PluginInstallationError(`Failed to write plugin manifest: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : undefined);
225
- }
226
- }
227
- /**
228
- * Delete a plugin from the workspace
229
- */
230
- async deletePlugin(request, context) {
231
- const { pluginName } = request;
232
- // 1. Validate plugin name (reusing app name validation since format is the same)
233
- const nameValidation = validateAppName(pluginName);
234
- if (!nameValidation.valid) {
235
- throw new InvalidPluginNameError(nameValidation.errorMessage || 'Invalid plugin name');
236
- }
237
- // 2. Validate workspace context
238
- const contextValidation = validateWorkspaceContext(context);
239
- if (!contextValidation.valid) {
240
- throw new Error(contextValidation.errorMessage || 'Invalid workspace context');
241
- }
242
- // 3. Determine plugin path
243
- const pluginPath = path.join(context.workspaceRoot, 'plugins', pluginName);
244
- // 4. Check if plugin exists
245
- if (!(await fsExtra.pathExists(pluginPath))) {
246
- throw new PluginDirectoryNotFoundError(pluginName, pluginPath);
247
- }
248
- // 5. Delete the plugin directory
249
- await fsExtra.remove(pluginPath);
250
- // 6. Update dependencies
251
- await npm.install(context.workspaceRoot);
252
- return {
253
- pluginName,
254
- };
255
- }
256
- }
257
- //# sourceMappingURL=plugin-svc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-svc.js","sourceRoot":"","sources":["../../../../src/modules/plugin/services/plugin-svc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,OAAO,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,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,uBAAuB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,wBAAwB,EAAwB,qBAAqB,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAClR,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAK1D;;GAEG;AACH,SA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,CAAC,YAAY,CAAC,OAA4B,EAAE,OAAwB;QACvE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QAE9B,iFAAiF;QACjF,MAAM,cAAc,GAAG,eAAe,CAAC,UAAU,CAAC,CAAA;QAClD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;YAC1B,MAAM,IAAI,sBAAsB,CAAC,cAAc,CAAC,YAAY,IAAI,qBAAqB,CAAC,CAAA;QACxF,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,2BAA2B;QAC3B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;QAE1E,4BAA4B;QAC5B,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,4BAA4B,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QAChE,CAAC;QAED,iCAAiC;QACjC,MAAM,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QAEhC,yBAAyB;QACzB,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QAExC,OAAO;YACL,UAAU;SACX,CAAA;IACH,CAAC;CACF"}
@@ -1,25 +0,0 @@
1
- export interface InstallPluginRequest {
2
- pluginName: string;
3
- }
4
- export interface InstallPluginResult {
5
- pluginName: string;
6
- filesInstalled: boolean;
7
- packageJsonUpdated: boolean;
8
- dependenciesInstalled: boolean;
9
- }
10
- export interface PluginMetadata {
11
- dependencies?: Record<string, string>;
12
- devDependencies?: Record<string, string>;
13
- scripts?: Record<string, string>;
14
- }
15
- export interface HookResult {
16
- templateVariables?: Record<string, string>;
17
- hookContext?: Record<string, string>;
18
- }
19
- export interface DeletePluginRequest {
20
- pluginName: string;
21
- }
22
- export interface DeletePluginResult {
23
- pluginName: string;
24
- }
25
- //# sourceMappingURL=plugin-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-types.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/types/plugin-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,qBAAqB,EAAE,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED,MAAM,WAAW,UAAU;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAA;CACnB"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=plugin-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-types.js","sourceRoot":"","sources":["../../../../src/modules/plugin/types/plugin-types.ts"],"names":[],"mappings":""}
@@ -1,73 +0,0 @@
1
- import * as path from 'path'
2
-
3
- import { execa } from 'execa'
4
-
5
- import { NpmInstallationError } from '../modules/plugin/errors/plugin-errors.js'
6
-
7
- /**
8
- * Options for downloading an npm package
9
- */
10
- export interface DownloadNpmPackageOptions {
11
- /** The npm package name to download */
12
- packageName: string
13
- /** The workspace root directory where node_modules will be */
14
- workspaceRoot: string
15
- /** Optional logger function for status messages */
16
- logger?: (message: string) => void
17
- }
18
-
19
- /**
20
- * Result of downloading an npm package
21
- */
22
- export interface DownloadNpmPackageResult {
23
- /** Full path to the downloaded package in node_modules */
24
- packagePath: string
25
- /** The package name that was downloaded */
26
- packageName: string
27
- }
28
-
29
- /**
30
- * Download and install an npm package to workspace node_modules
31
- *
32
- * This function:
33
- * - Runs `npm install {packageName} --save-dev` in the workspace root
34
- * - Adds the package to workspace package.json devDependencies
35
- * - Returns the path to the installed package in node_modules
36
- *
37
- * @param options - Download options
38
- * @returns The path to the installed package
39
- * @throws NpmInstallationError if the download fails
40
- *
41
- * @example
42
- * const result = await downloadNpmPackage({
43
- * packageName: '@launch77-shared/plugin-release',
44
- * workspaceRoot: '/path/to/workspace',
45
- * logger: (msg) => console.log(msg)
46
- * })
47
- * // result.packagePath: '/path/to/workspace/node_modules/@launch77-shared/plugin-release'
48
- */
49
- export async function downloadNpmPackage(options: DownloadNpmPackageOptions): Promise<DownloadNpmPackageResult> {
50
- const { packageName, workspaceRoot, logger } = options
51
-
52
- if (logger) {
53
- logger(`Installing from npm: ${packageName}...`)
54
- }
55
-
56
- try {
57
- // Install the npm package to the workspace
58
- await execa('npm', ['install', packageName, '--save-dev'], {
59
- cwd: workspaceRoot,
60
- stdio: 'pipe', // Capture output for clean logging
61
- })
62
-
63
- // Return path to installed package in node_modules
64
- const packagePath = path.join(workspaceRoot, 'node_modules', packageName)
65
-
66
- return {
67
- packagePath,
68
- packageName,
69
- }
70
- } catch (error) {
71
- throw new NpmInstallationError(packageName, error instanceof Error ? error : undefined)
72
- }
73
- }
@@ -1,18 +0,0 @@
1
- import { execa } from 'execa'
2
-
3
- /**
4
- * Run npm install in a directory
5
- */
6
- export async function runNpmInstall(cwd: string): Promise<void> {
7
- await execa('npm', ['install'], {
8
- cwd,
9
- stdio: 'pipe',
10
- })
11
- }
12
-
13
- /**
14
- * Alias for runNpmInstall
15
- */
16
- export async function install(cwd: string): Promise<void> {
17
- await runNpmInstall(cwd)
18
- }