@launch77/cli 1.4.4 → 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.
Files changed (195) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cli.js +16 -17
  3. package/dist/cli.js.map +1 -1
  4. package/dist/infrastructure/package-resolver.d.ts +12 -2
  5. package/dist/infrastructure/package-resolver.d.ts.map +1 -1
  6. package/dist/infrastructure/package-resolver.js +29 -2
  7. package/dist/infrastructure/package-resolver.js.map +1 -1
  8. package/dist/infrastructure/package-resolver.test.js +3 -3
  9. package/dist/infrastructure/package-resolver.test.js.map +1 -1
  10. package/dist/infrastructure/template.d.ts +0 -1
  11. package/dist/infrastructure/template.d.ts.map +1 -1
  12. package/dist/infrastructure/template.js.map +1 -1
  13. package/dist/modules/app/commands/create-app.d.ts +1 -1
  14. package/dist/modules/app/commands/create-app.d.ts.map +1 -1
  15. package/dist/modules/app/commands/create-app.js +9 -14
  16. package/dist/modules/app/commands/create-app.js.map +1 -1
  17. package/dist/modules/app/commands/delete-app.d.ts +1 -1
  18. package/dist/modules/app/commands/delete-app.js +2 -2
  19. package/dist/modules/app/commands/delete-app.js.map +1 -1
  20. package/dist/modules/app/index.d.ts +3 -5
  21. package/dist/modules/app/index.d.ts.map +1 -1
  22. package/dist/modules/app/index.js +2 -4
  23. package/dist/modules/app/index.js.map +1 -1
  24. package/dist/modules/app/lib/app-template-resolver.d.ts.map +1 -1
  25. package/dist/modules/app/lib/app-template-resolver.js +15 -0
  26. package/dist/modules/app/lib/app-template-resolver.js.map +1 -1
  27. package/dist/modules/app/lib/manifest-schema.d.ts +0 -7
  28. package/dist/modules/app/lib/manifest-schema.d.ts.map +1 -1
  29. package/dist/modules/app/lib/manifest-schema.js +0 -2
  30. package/dist/modules/app/lib/manifest-schema.js.map +1 -1
  31. package/dist/modules/app/services/app-svc.d.ts.map +1 -1
  32. package/dist/modules/app/services/app-svc.js +36 -6
  33. package/dist/modules/app/services/app-svc.js.map +1 -1
  34. package/dist/modules/app/services/manifest-svc.d.ts +2 -2
  35. package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
  36. package/dist/modules/app/services/manifest-svc.js +9 -50
  37. package/dist/modules/app/services/manifest-svc.js.map +1 -1
  38. package/dist/modules/app/types/app-types.d.ts +2 -5
  39. package/dist/modules/app/types/app-types.d.ts.map +1 -1
  40. package/dist/modules/app/types/app-types.js +1 -4
  41. package/dist/modules/app/types/app-types.js.map +1 -1
  42. package/dist/modules/catalog/commands/generate.d.ts +1 -1
  43. package/dist/modules/catalog/commands/generate.d.ts.map +1 -1
  44. package/dist/modules/catalog/commands/generate.js +1 -1
  45. package/dist/modules/catalog/commands/generate.js.map +1 -1
  46. package/dist/modules/catalog/commands/scan.d.ts +1 -1
  47. package/dist/modules/catalog/commands/scan.d.ts.map +1 -1
  48. package/dist/modules/catalog/commands/scan.js +4 -4
  49. package/dist/modules/catalog/commands/scan.js.map +1 -1
  50. package/dist/modules/catalog/services/catalog-svc.d.ts +2 -2
  51. package/dist/modules/catalog/services/catalog-svc.d.ts.map +1 -1
  52. package/dist/modules/catalog/services/catalog-svc.js +2 -2
  53. package/dist/modules/catalog/services/catalog-svc.js.map +1 -1
  54. package/dist/modules/deploy/commands/deploy-init-action.d.ts.map +1 -1
  55. package/dist/modules/deploy/commands/deploy-init-action.js +21 -20
  56. package/dist/modules/deploy/commands/deploy-init-action.js.map +1 -1
  57. package/dist/modules/deploy/commands/deploy-logs-action.d.ts.map +1 -1
  58. package/dist/modules/deploy/commands/deploy-logs-action.js +16 -13
  59. package/dist/modules/deploy/commands/deploy-logs-action.js.map +1 -1
  60. package/dist/modules/deploy/commands/deploy-status-action.d.ts.map +1 -1
  61. package/dist/modules/deploy/commands/deploy-status-action.js +16 -13
  62. package/dist/modules/deploy/commands/deploy-status-action.js.map +1 -1
  63. package/dist/modules/library/commands/delete-library.d.ts +3 -0
  64. package/dist/modules/library/commands/delete-library.d.ts.map +1 -0
  65. package/dist/modules/library/commands/delete-library.js +111 -0
  66. package/dist/modules/library/commands/delete-library.js.map +1 -0
  67. package/dist/modules/library/errors/library-errors.d.ts +7 -0
  68. package/dist/modules/library/errors/library-errors.d.ts.map +1 -0
  69. package/dist/modules/library/errors/library-errors.js +13 -0
  70. package/dist/modules/library/errors/library-errors.js.map +1 -0
  71. package/dist/modules/library/index.d.ts +5 -0
  72. package/dist/modules/library/index.d.ts.map +1 -0
  73. package/dist/modules/library/index.js +7 -0
  74. package/dist/modules/library/index.js.map +1 -0
  75. package/dist/modules/library/services/library-svc.d.ts +9 -0
  76. package/dist/modules/library/services/library-svc.d.ts.map +1 -0
  77. package/dist/modules/library/services/library-svc.js +38 -0
  78. package/dist/modules/library/services/library-svc.js.map +1 -0
  79. package/dist/modules/library/types/library-types.d.ts +7 -0
  80. package/dist/modules/library/types/library-types.d.ts.map +1 -0
  81. package/dist/modules/library/types/library-types.js +2 -0
  82. package/dist/modules/library/types/library-types.js.map +1 -0
  83. package/dist/modules/plugin/commands/delete-plugin.d.ts +3 -0
  84. package/dist/modules/plugin/commands/delete-plugin.d.ts.map +1 -0
  85. package/dist/modules/plugin/commands/delete-plugin.js +113 -0
  86. package/dist/modules/plugin/commands/delete-plugin.js.map +1 -0
  87. package/dist/modules/plugin/errors/plugin-errors.d.ts +12 -0
  88. package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -1
  89. package/dist/modules/plugin/errors/plugin-errors.js +18 -0
  90. package/dist/modules/plugin/errors/plugin-errors.js.map +1 -1
  91. package/dist/modules/plugin/index.d.ts +1 -0
  92. package/dist/modules/plugin/index.d.ts.map +1 -1
  93. package/dist/modules/plugin/index.js +1 -0
  94. package/dist/modules/plugin/index.js.map +1 -1
  95. package/dist/modules/plugin/lib/plugin-resolver.d.ts.map +1 -1
  96. package/dist/modules/plugin/lib/plugin-resolver.js +13 -2
  97. package/dist/modules/plugin/lib/plugin-resolver.js.map +1 -1
  98. package/dist/modules/plugin/lib/plugin-resolver.test.js +2 -0
  99. package/dist/modules/plugin/lib/plugin-resolver.test.js.map +1 -1
  100. package/dist/modules/plugin/services/plugin-svc.d.ts +5 -1
  101. package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -1
  102. package/dist/modules/plugin/services/plugin-svc.js +44 -3
  103. package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
  104. package/dist/modules/plugin/services/plugin-svc.test.js +12 -6
  105. package/dist/modules/plugin/services/plugin-svc.test.js.map +1 -1
  106. package/dist/modules/plugin/types/plugin-types.d.ts +6 -0
  107. package/dist/modules/plugin/types/plugin-types.d.ts.map +1 -1
  108. package/dist/templates/plugin/package.json.hbs +1 -1
  109. package/dist/templates/plugin/plugin.json.hbs +1 -3
  110. package/dist/utils/validation.d.ts +3 -7
  111. package/dist/utils/validation.d.ts.map +1 -1
  112. package/dist/utils/validation.js +7 -31
  113. package/dist/utils/validation.js.map +1 -1
  114. package/package.json +1 -1
  115. package/src/cli.ts +16 -17
  116. package/src/infrastructure/package-resolver.test.ts +3 -3
  117. package/src/infrastructure/package-resolver.ts +31 -2
  118. package/src/infrastructure/template.ts +0 -1
  119. package/src/modules/app/commands/create-app.ts +9 -17
  120. package/src/modules/app/commands/delete-app.ts +2 -2
  121. package/src/modules/app/index.ts +3 -5
  122. package/src/modules/app/lib/app-template-resolver.ts +16 -0
  123. package/src/modules/app/lib/manifest-schema.ts +0 -5
  124. package/src/modules/app/services/app-svc.ts +46 -7
  125. package/src/modules/app/services/manifest-svc.ts +8 -57
  126. package/src/modules/app/types/app-types.ts +2 -9
  127. package/src/modules/catalog/commands/generate.ts +1 -1
  128. package/src/modules/catalog/commands/scan.ts +4 -4
  129. package/src/modules/catalog/services/catalog-svc.ts +4 -4
  130. package/src/modules/deploy/commands/deploy-init-action.ts +23 -20
  131. package/src/modules/deploy/commands/deploy-logs-action.ts +19 -13
  132. package/src/modules/deploy/commands/deploy-status-action.ts +19 -13
  133. package/src/modules/library/commands/delete-library.ts +126 -0
  134. package/src/modules/library/errors/library-errors.ts +13 -0
  135. package/src/modules/library/index.ts +11 -0
  136. package/src/modules/library/services/library-svc.ts +50 -0
  137. package/src/modules/library/types/library-types.ts +7 -0
  138. package/src/modules/plugin/commands/delete-plugin.ts +128 -0
  139. package/src/modules/plugin/errors/plugin-errors.ts +20 -0
  140. package/src/modules/plugin/index.ts +1 -0
  141. package/src/modules/plugin/lib/plugin-resolver.test.ts +2 -0
  142. package/src/modules/plugin/lib/plugin-resolver.ts +13 -2
  143. package/src/modules/plugin/services/plugin-svc.test.ts +12 -6
  144. package/src/modules/plugin/services/plugin-svc.ts +55 -5
  145. package/src/modules/plugin/types/plugin-types.ts +8 -0
  146. package/src/utils/validation.ts +10 -38
  147. package/templates/plugin/package.json.hbs +1 -1
  148. package/templates/plugin/plugin.json.hbs +1 -3
  149. package/dist/modules/app/commands/generate-manifest.d.ts +0 -3
  150. package/dist/modules/app/commands/generate-manifest.d.ts.map +0 -1
  151. package/dist/modules/app/commands/generate-manifest.js +0 -62
  152. package/dist/modules/app/commands/generate-manifest.js.map +0 -1
  153. package/dist/modules/app/commands/validate-manifest.d.ts +0 -3
  154. package/dist/modules/app/commands/validate-manifest.d.ts.map +0 -1
  155. package/dist/modules/app/commands/validate-manifest.js +0 -68
  156. package/dist/modules/app/commands/validate-manifest.js.map +0 -1
  157. package/dist/modules/startup/commands/create-startup.d.ts +0 -3
  158. package/dist/modules/startup/commands/create-startup.d.ts.map +0 -1
  159. package/dist/modules/startup/commands/create-startup.js +0 -43
  160. package/dist/modules/startup/commands/create-startup.js.map +0 -1
  161. package/dist/modules/startup/errors/startup-errors.d.ts +0 -13
  162. package/dist/modules/startup/errors/startup-errors.d.ts.map +0 -1
  163. package/dist/modules/startup/errors/startup-errors.js +0 -25
  164. package/dist/modules/startup/errors/startup-errors.js.map +0 -1
  165. package/dist/modules/startup/index.d.ts +0 -5
  166. package/dist/modules/startup/index.d.ts.map +0 -1
  167. package/dist/modules/startup/index.js +0 -7
  168. package/dist/modules/startup/index.js.map +0 -1
  169. package/dist/modules/startup/services/startup-service.d.ts +0 -7
  170. package/dist/modules/startup/services/startup-service.d.ts.map +0 -1
  171. package/dist/modules/startup/services/startup-service.js +0 -43
  172. package/dist/modules/startup/services/startup-service.js.map +0 -1
  173. package/dist/modules/startup/types/startup-types.d.ts +0 -8
  174. package/dist/modules/startup/types/startup-types.d.ts.map +0 -1
  175. package/dist/modules/startup/types/startup-types.js +0 -2
  176. package/dist/modules/startup/types/startup-types.js.map +0 -1
  177. package/dist/modules/startup/utils/startup-validators.d.ts +0 -8
  178. package/dist/modules/startup/utils/startup-validators.d.ts.map +0 -1
  179. package/dist/modules/startup/utils/startup-validators.js +0 -17
  180. package/dist/modules/startup/utils/startup-validators.js.map +0 -1
  181. package/dist/templates/startup/apps/.gitkeep +0 -8
  182. package/dist/utils/monorepo.d.ts +0 -19
  183. package/dist/utils/monorepo.d.ts.map +0 -1
  184. package/dist/utils/monorepo.js +0 -100
  185. package/dist/utils/monorepo.js.map +0 -1
  186. package/src/modules/app/commands/generate-manifest.ts +0 -75
  187. package/src/modules/app/commands/validate-manifest.ts +0 -78
  188. package/src/modules/startup/commands/create-startup.ts +0 -53
  189. package/src/modules/startup/errors/startup-errors.ts +0 -23
  190. package/src/modules/startup/index.ts +0 -11
  191. package/src/modules/startup/services/startup-service.ts +0 -57
  192. package/src/modules/startup/types/startup-types.ts +0 -8
  193. package/src/modules/startup/utils/startup-validators.ts +0 -19
  194. package/src/utils/monorepo.ts +0 -137
  195. package/templates/startup/apps/.gitkeep +0 -8
@@ -1,137 +0,0 @@
1
- import * as path from 'path'
2
-
3
- import fs from 'fs-extra'
4
-
5
- export type LocationType = 'monorepo-root' | 'startup-root' | 'startup-app' | 'unknown'
6
-
7
- export interface MonorepoContext {
8
- isValid: boolean
9
- location: LocationType
10
- monorepoRoot: string
11
- appsDir: string | null
12
- // Specific context info
13
- startupName?: string
14
- appName?: string
15
- packageName?: string
16
- }
17
-
18
- const MONOREPO_ROOT_MARKER = '.launch-monorepo-root.md'
19
-
20
- /**
21
- * Check if a directory is the monorepo root by looking for the marker file
22
- */
23
- async function isMonorepoRoot(dir: string): Promise<boolean> {
24
- const markerPath = path.join(dir, MONOREPO_ROOT_MARKER)
25
- return await fs.pathExists(markerPath)
26
- }
27
-
28
- /**
29
- * Find the monorepo root by traversing up from a starting directory
30
- * Looks for .launch-monorepo-root.md marker file
31
- */
32
- async function findMonorepoRoot(startDir: string): Promise<string | null> {
33
- let currentDir = path.resolve(startDir)
34
- const rootDir = path.parse(currentDir).root
35
-
36
- while (currentDir !== rootDir) {
37
- if (await isMonorepoRoot(currentDir)) {
38
- return currentDir
39
- }
40
- currentDir = path.dirname(currentDir)
41
- }
42
-
43
- return null
44
- }
45
-
46
- interface ParsedLocation {
47
- location: LocationType
48
- startupName?: string
49
- appName?: string
50
- }
51
-
52
- /**
53
- * Parse the directory structure to determine location context
54
- * Based on patterns:
55
- * - startups/[name] → startup-root
56
- * - startups/[name]/apps/[app] → startup-app
57
- * - (empty or root) → monorepo-root
58
- */
59
- function parseLocationFromPath(cwdPath: string, monorepoRoot: string): ParsedLocation {
60
- const relativePath = path.relative(monorepoRoot, cwdPath)
61
-
62
- // At monorepo root
63
- if (!relativePath || relativePath === '.') {
64
- return { location: 'monorepo-root' }
65
- }
66
-
67
- const parts = relativePath.split(path.sep)
68
-
69
- // startups/[name]/...
70
- if (parts[0] === 'startups' && parts.length >= 2) {
71
- const startupName = parts[1]
72
-
73
- // startups/[name]/apps/[app]
74
- if (parts.length >= 4 && parts[2] === 'apps') {
75
- return {
76
- location: 'startup-app',
77
- startupName,
78
- appName: parts[3],
79
- }
80
- }
81
-
82
- // startups/[name]
83
- return {
84
- location: 'startup-root',
85
- startupName,
86
- }
87
- }
88
-
89
- return { location: 'unknown' }
90
- }
91
-
92
- /**
93
- * Determine the apps directory based on location context
94
- * Returns null for invalid locations (e.g., monorepo-root, unknown)
95
- */
96
- function getAppsDir(monorepoRoot: string, location: LocationType, startupName?: string): string | null {
97
- if (location === 'startup-root' || location === 'startup-app') {
98
- return path.join(monorepoRoot, 'startups', startupName!, 'apps')
99
- }
100
- return null
101
- }
102
-
103
- /**
104
- * Detect the monorepo context from the current working directory
105
- *
106
- * @deprecated Use detectLaunch77Context() from launch77-context.ts instead.
107
- * This function is maintained for legacy monorepo structure only.
108
- * New workspaces created with `launch77 init` should use the new context system.
109
- */
110
- export async function detectMonorepoContext(cwd: string): Promise<MonorepoContext> {
111
- const resolvedCwd = path.resolve(cwd)
112
-
113
- // Find the monorepo root
114
- const monorepoRoot = await findMonorepoRoot(resolvedCwd)
115
-
116
- if (!monorepoRoot) {
117
- return {
118
- isValid: false,
119
- location: 'unknown',
120
- monorepoRoot: '',
121
- appsDir: null,
122
- }
123
- }
124
-
125
- // Parse the directory structure to determine location
126
- const parsed = parseLocationFromPath(resolvedCwd, monorepoRoot)
127
- const appsDir = getAppsDir(monorepoRoot, parsed.location, parsed.startupName)
128
-
129
- return {
130
- isValid: true,
131
- location: parsed.location,
132
- monorepoRoot,
133
- appsDir,
134
- startupName: parsed.startupName,
135
- appName: parsed.appName,
136
- }
137
- }
@@ -1,8 +0,0 @@
1
- # Apps Directory
2
-
3
- This directory will contain all applications for this startup.
4
-
5
- Create new apps using:
6
- ```bash
7
- launch77 create-app marketing-site <app-name>
8
- ```