@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.
- package/CHANGELOG.md +17 -0
- package/dist/cli.js +16 -17
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/package-resolver.d.ts +12 -2
- package/dist/infrastructure/package-resolver.d.ts.map +1 -1
- package/dist/infrastructure/package-resolver.js +29 -2
- package/dist/infrastructure/package-resolver.js.map +1 -1
- package/dist/infrastructure/package-resolver.test.js +3 -3
- package/dist/infrastructure/package-resolver.test.js.map +1 -1
- package/dist/infrastructure/template.d.ts +0 -1
- package/dist/infrastructure/template.d.ts.map +1 -1
- package/dist/infrastructure/template.js.map +1 -1
- package/dist/modules/app/commands/create-app.d.ts +1 -1
- package/dist/modules/app/commands/create-app.d.ts.map +1 -1
- package/dist/modules/app/commands/create-app.js +9 -14
- package/dist/modules/app/commands/create-app.js.map +1 -1
- package/dist/modules/app/commands/delete-app.d.ts +1 -1
- package/dist/modules/app/commands/delete-app.js +2 -2
- package/dist/modules/app/commands/delete-app.js.map +1 -1
- package/dist/modules/app/index.d.ts +3 -5
- package/dist/modules/app/index.d.ts.map +1 -1
- package/dist/modules/app/index.js +2 -4
- package/dist/modules/app/index.js.map +1 -1
- package/dist/modules/app/lib/app-template-resolver.d.ts.map +1 -1
- package/dist/modules/app/lib/app-template-resolver.js +15 -0
- package/dist/modules/app/lib/app-template-resolver.js.map +1 -1
- package/dist/modules/app/lib/manifest-schema.d.ts +0 -7
- package/dist/modules/app/lib/manifest-schema.d.ts.map +1 -1
- package/dist/modules/app/lib/manifest-schema.js +0 -2
- package/dist/modules/app/lib/manifest-schema.js.map +1 -1
- package/dist/modules/app/services/app-svc.d.ts.map +1 -1
- package/dist/modules/app/services/app-svc.js +36 -6
- package/dist/modules/app/services/app-svc.js.map +1 -1
- package/dist/modules/app/services/manifest-svc.d.ts +2 -2
- package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
- package/dist/modules/app/services/manifest-svc.js +9 -50
- package/dist/modules/app/services/manifest-svc.js.map +1 -1
- package/dist/modules/app/types/app-types.d.ts +2 -5
- package/dist/modules/app/types/app-types.d.ts.map +1 -1
- package/dist/modules/app/types/app-types.js +1 -4
- package/dist/modules/app/types/app-types.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 +4 -4
- package/dist/modules/catalog/commands/scan.js.map +1 -1
- package/dist/modules/catalog/services/catalog-svc.d.ts +2 -2
- package/dist/modules/catalog/services/catalog-svc.d.ts.map +1 -1
- package/dist/modules/catalog/services/catalog-svc.js +2 -2
- package/dist/modules/catalog/services/catalog-svc.js.map +1 -1
- package/dist/modules/deploy/commands/deploy-init-action.d.ts.map +1 -1
- package/dist/modules/deploy/commands/deploy-init-action.js +21 -20
- package/dist/modules/deploy/commands/deploy-init-action.js.map +1 -1
- package/dist/modules/deploy/commands/deploy-logs-action.d.ts.map +1 -1
- package/dist/modules/deploy/commands/deploy-logs-action.js +16 -13
- package/dist/modules/deploy/commands/deploy-logs-action.js.map +1 -1
- package/dist/modules/deploy/commands/deploy-status-action.d.ts.map +1 -1
- package/dist/modules/deploy/commands/deploy-status-action.js +16 -13
- package/dist/modules/deploy/commands/deploy-status-action.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/lib/plugin-resolver.d.ts.map +1 -1
- package/dist/modules/plugin/lib/plugin-resolver.js +13 -2
- package/dist/modules/plugin/lib/plugin-resolver.js.map +1 -1
- package/dist/modules/plugin/lib/plugin-resolver.test.js +2 -0
- package/dist/modules/plugin/lib/plugin-resolver.test.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 +44 -3
- package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
- package/dist/modules/plugin/services/plugin-svc.test.js +12 -6
- package/dist/modules/plugin/services/plugin-svc.test.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/dist/templates/plugin/package.json.hbs +1 -1
- package/dist/templates/plugin/plugin.json.hbs +1 -3
- package/dist/utils/validation.d.ts +3 -7
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +7 -31
- package/dist/utils/validation.js.map +1 -1
- package/package.json +1 -1
- package/src/cli.ts +16 -17
- package/src/infrastructure/package-resolver.test.ts +3 -3
- package/src/infrastructure/package-resolver.ts +31 -2
- package/src/infrastructure/template.ts +0 -1
- package/src/modules/app/commands/create-app.ts +9 -17
- package/src/modules/app/commands/delete-app.ts +2 -2
- package/src/modules/app/index.ts +3 -5
- package/src/modules/app/lib/app-template-resolver.ts +16 -0
- package/src/modules/app/lib/manifest-schema.ts +0 -5
- package/src/modules/app/services/app-svc.ts +46 -7
- package/src/modules/app/services/manifest-svc.ts +8 -57
- package/src/modules/app/types/app-types.ts +2 -9
- package/src/modules/catalog/commands/generate.ts +1 -1
- package/src/modules/catalog/commands/scan.ts +4 -4
- package/src/modules/catalog/services/catalog-svc.ts +4 -4
- package/src/modules/deploy/commands/deploy-init-action.ts +23 -20
- package/src/modules/deploy/commands/deploy-logs-action.ts +19 -13
- package/src/modules/deploy/commands/deploy-status-action.ts +19 -13
- 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/lib/plugin-resolver.test.ts +2 -0
- package/src/modules/plugin/lib/plugin-resolver.ts +13 -2
- package/src/modules/plugin/services/plugin-svc.test.ts +12 -6
- package/src/modules/plugin/services/plugin-svc.ts +55 -5
- package/src/modules/plugin/types/plugin-types.ts +8 -0
- package/src/utils/validation.ts +10 -38
- package/templates/plugin/package.json.hbs +1 -1
- package/templates/plugin/plugin.json.hbs +1 -3
- package/dist/modules/app/commands/generate-manifest.d.ts +0 -3
- package/dist/modules/app/commands/generate-manifest.d.ts.map +0 -1
- package/dist/modules/app/commands/generate-manifest.js +0 -62
- package/dist/modules/app/commands/generate-manifest.js.map +0 -1
- 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 -68
- package/dist/modules/app/commands/validate-manifest.js.map +0 -1
- package/dist/modules/startup/commands/create-startup.d.ts +0 -3
- package/dist/modules/startup/commands/create-startup.d.ts.map +0 -1
- package/dist/modules/startup/commands/create-startup.js +0 -43
- package/dist/modules/startup/commands/create-startup.js.map +0 -1
- package/dist/modules/startup/errors/startup-errors.d.ts +0 -13
- package/dist/modules/startup/errors/startup-errors.d.ts.map +0 -1
- package/dist/modules/startup/errors/startup-errors.js +0 -25
- package/dist/modules/startup/errors/startup-errors.js.map +0 -1
- package/dist/modules/startup/index.d.ts +0 -5
- package/dist/modules/startup/index.d.ts.map +0 -1
- package/dist/modules/startup/index.js +0 -7
- package/dist/modules/startup/index.js.map +0 -1
- package/dist/modules/startup/services/startup-service.d.ts +0 -7
- package/dist/modules/startup/services/startup-service.d.ts.map +0 -1
- package/dist/modules/startup/services/startup-service.js +0 -43
- package/dist/modules/startup/services/startup-service.js.map +0 -1
- package/dist/modules/startup/types/startup-types.d.ts +0 -8
- package/dist/modules/startup/types/startup-types.d.ts.map +0 -1
- package/dist/modules/startup/types/startup-types.js +0 -2
- package/dist/modules/startup/types/startup-types.js.map +0 -1
- package/dist/modules/startup/utils/startup-validators.d.ts +0 -8
- package/dist/modules/startup/utils/startup-validators.d.ts.map +0 -1
- package/dist/modules/startup/utils/startup-validators.js +0 -17
- package/dist/modules/startup/utils/startup-validators.js.map +0 -1
- package/dist/templates/startup/apps/.gitkeep +0 -8
- package/dist/utils/monorepo.d.ts +0 -19
- package/dist/utils/monorepo.d.ts.map +0 -1
- package/dist/utils/monorepo.js +0 -100
- package/dist/utils/monorepo.js.map +0 -1
- package/src/modules/app/commands/generate-manifest.ts +0 -75
- package/src/modules/app/commands/validate-manifest.ts +0 -78
- package/src/modules/startup/commands/create-startup.ts +0 -53
- package/src/modules/startup/errors/startup-errors.ts +0 -23
- package/src/modules/startup/index.ts +0 -11
- package/src/modules/startup/services/startup-service.ts +0 -57
- package/src/modules/startup/types/startup-types.ts +0 -8
- package/src/modules/startup/utils/startup-validators.ts +0 -19
- package/src/utils/monorepo.ts +0 -137
- package/templates/startup/apps/.gitkeep +0 -8
package/src/utils/monorepo.ts
DELETED
|
@@ -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
|
-
}
|