@launch77/cli 1.5.0 → 1.7.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 +12 -0
- package/dist/cli.js +17 -14
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/template.d.ts +5 -1
- package/dist/infrastructure/template.d.ts.map +1 -1
- package/dist/infrastructure/template.js +11 -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.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/create-library.d.ts +3 -0
- package/dist/modules/library/commands/create-library.d.ts.map +1 -0
- package/dist/modules/library/commands/create-library.js +61 -0
- package/dist/modules/library/commands/create-library.js.map +1 -0
- 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 +7 -0
- package/dist/modules/library/index.d.ts.map +1 -0
- package/dist/modules/library/index.js +9 -0
- package/dist/modules/library/index.js.map +1 -0
- package/dist/modules/library/services/library-create-svc.d.ts +17 -0
- package/dist/modules/library/services/library-create-svc.d.ts.map +1 -0
- package/dist/modules/library/services/library-create-svc.js +51 -0
- package/dist/modules/library/services/library-create-svc.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 +16 -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/dist/templates/library/README.md.hbs +80 -0
- package/dist/templates/library/package.json.hbs +31 -0
- package/dist/templates/library/src/index.d.ts.hbs +14 -0
- package/dist/templates/library/src/index.js +11 -0
- package/dist/templates/library/tsconfig.json +31 -0
- package/package.json +1 -1
- package/src/cli.ts +17 -14
- package/src/infrastructure/template.ts +14 -1
- 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/create-library.ts +70 -0
- 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 +13 -0
- package/src/modules/library/services/library-create-svc.ts +75 -0
- package/src/modules/library/services/library-svc.ts +50 -0
- package/src/modules/library/types/library-types.ts +18 -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/templates/library/README.md.hbs +80 -0
- package/templates/library/package.json.hbs +31 -0
- package/templates/library/src/index.d.ts.hbs +14 -0
- package/templates/library/src/index.js +11 -0
- package/templates/library/tsconfig.json +31 -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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import * as path from 'path'
|
|
3
|
+
|
|
4
|
+
import chalk from 'chalk'
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
import inquirer from 'inquirer'
|
|
7
|
+
import ora from 'ora'
|
|
8
|
+
|
|
9
|
+
import { detectLaunch77Context } from '@launch77/plugin-runtime'
|
|
10
|
+
import { PluginService } from '../services/plugin-svc.js'
|
|
11
|
+
|
|
12
|
+
export function pluginDeleteCommand(): Command {
|
|
13
|
+
const command = new Command('plugin:delete')
|
|
14
|
+
.argument('<plugin-name>', 'Name of the plugin to delete')
|
|
15
|
+
.description('Delete a plugin from the workspace (requires confirmation)')
|
|
16
|
+
.action(async (pluginName: string) => {
|
|
17
|
+
try {
|
|
18
|
+
console.log(chalk.yellow(`\n⚠️ WARNING: You are about to delete the plugin '${pluginName}'\n`))
|
|
19
|
+
|
|
20
|
+
// Detect context
|
|
21
|
+
const context = await detectLaunch77Context(process.cwd())
|
|
22
|
+
|
|
23
|
+
// Create plugin service
|
|
24
|
+
const pluginService = new PluginService()
|
|
25
|
+
|
|
26
|
+
// Get plugin path for display (before deletion)
|
|
27
|
+
const pluginPath = path.join(context.workspaceRoot, 'plugins', pluginName)
|
|
28
|
+
|
|
29
|
+
// Display what will be deleted
|
|
30
|
+
console.log(chalk.red('Plugin location:'), pluginPath)
|
|
31
|
+
console.log(chalk.red('\nThis will permanently delete:'))
|
|
32
|
+
console.log(chalk.gray(' • All source code and configuration files'))
|
|
33
|
+
console.log(chalk.gray(' • All node_modules (will be cleaned from monorepo)'))
|
|
34
|
+
console.log(chalk.gray(' • All build artifacts'))
|
|
35
|
+
console.log(chalk.gray(' • Plugin templates and generators'))
|
|
36
|
+
|
|
37
|
+
console.log(chalk.yellow('\n⚠️ Important notes:'))
|
|
38
|
+
console.log(chalk.gray(' • Check if plugin is installed in other packages'))
|
|
39
|
+
console.log(chalk.gray(' • If published to npm, you may want to deprecate/unpublish it manually'))
|
|
40
|
+
console.log(chalk.gray(' • Remove plugin from launch77.installedPlugins in dependent packages manually'))
|
|
41
|
+
|
|
42
|
+
console.log(chalk.red('\n⚠️ THIS ACTION CANNOT BE UNDONE!\n'))
|
|
43
|
+
|
|
44
|
+
// First confirmation: Type plugin name
|
|
45
|
+
const { confirmName } = await inquirer.prompt([
|
|
46
|
+
{
|
|
47
|
+
type: 'input',
|
|
48
|
+
name: 'confirmName',
|
|
49
|
+
message: `Type the plugin name to confirm:`,
|
|
50
|
+
validate: (input: string) => {
|
|
51
|
+
if (input === pluginName) {
|
|
52
|
+
return true
|
|
53
|
+
}
|
|
54
|
+
return `Please type '${pluginName}' exactly to confirm`
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
])
|
|
58
|
+
|
|
59
|
+
if (confirmName !== pluginName) {
|
|
60
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'))
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Second confirmation: Type DELETE
|
|
65
|
+
const { confirmDelete } = await inquirer.prompt([
|
|
66
|
+
{
|
|
67
|
+
type: 'input',
|
|
68
|
+
name: 'confirmDelete',
|
|
69
|
+
message: 'Type DELETE (all caps) to confirm permanent deletion:',
|
|
70
|
+
validate: (input: string) => {
|
|
71
|
+
if (input === 'DELETE') {
|
|
72
|
+
return true
|
|
73
|
+
}
|
|
74
|
+
return 'Please type DELETE (all caps) to confirm'
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
if (confirmDelete !== 'DELETE') {
|
|
80
|
+
console.log(chalk.gray('\n✖ Deletion cancelled\n'))
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Delete the plugin
|
|
85
|
+
const deleteSpinner = ora('Deleting plugin directory...').start()
|
|
86
|
+
try {
|
|
87
|
+
await pluginService.deletePlugin({ pluginName }, context)
|
|
88
|
+
deleteSpinner.succeed('Plugin directory deleted')
|
|
89
|
+
} catch (error) {
|
|
90
|
+
deleteSpinner.fail('Failed to delete plugin directory')
|
|
91
|
+
throw error
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Update dependencies
|
|
95
|
+
const installSpinner = ora('Updating workspace dependencies...').start()
|
|
96
|
+
try {
|
|
97
|
+
// This is already done by plugin service, just show spinner for consistency
|
|
98
|
+
installSpinner.succeed('Dependencies updated (package-lock.json cleaned)')
|
|
99
|
+
} catch (error) {
|
|
100
|
+
installSpinner.fail('Failed to update dependencies')
|
|
101
|
+
console.log(chalk.yellow('\n⚠️ You may need to run "npm install" manually at the workspace root\n'))
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Success message
|
|
105
|
+
console.log(chalk.green(`\n✅ Plugin '${pluginName}' has been deleted\n`))
|
|
106
|
+
|
|
107
|
+
// Reminder about cleanup
|
|
108
|
+
console.log(chalk.yellow('📝 Remember to:'))
|
|
109
|
+
console.log(chalk.gray(' • Check packages that had this plugin installed'))
|
|
110
|
+
console.log(chalk.gray(' • Remove plugin from launch77.installedPlugins in package.json files'))
|
|
111
|
+
console.log(chalk.gray(' • Remove any plugin-generated files if needed'))
|
|
112
|
+
console.log(chalk.gray(' • Consider deprecating/unpublishing from npm if published'))
|
|
113
|
+
console.log()
|
|
114
|
+
|
|
115
|
+
// Reminder about Git
|
|
116
|
+
console.log(chalk.yellow('📝 Remember to commit the deletion:'))
|
|
117
|
+
console.log(chalk.gray(' git add -A'))
|
|
118
|
+
console.log(chalk.gray(` git commit -m "Remove ${pluginName} plugin"`))
|
|
119
|
+
console.log()
|
|
120
|
+
} catch (error) {
|
|
121
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
122
|
+
console.error(chalk.red('Error:'), message)
|
|
123
|
+
process.exit(1)
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
return command
|
|
128
|
+
}
|
|
@@ -123,3 +123,23 @@ ${cause ? `\nOriginal error: ${cause.message}` : ''}`)
|
|
|
123
123
|
this.name = 'NpmInstallationError'
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Error when plugin directory is not found for deletion
|
|
129
|
+
*/
|
|
130
|
+
export class PluginDirectoryNotFoundError extends Error {
|
|
131
|
+
constructor(pluginName: string, expectedPath: string) {
|
|
132
|
+
super(`Plugin '${pluginName}' does not exist.\n\n` + `Expected location: ${expectedPath}\n\n` + `Available plugins:\n` + ` cd plugins/\n` + ` ls`)
|
|
133
|
+
this.name = 'PluginDirectoryNotFoundError'
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Error when plugin name validation fails
|
|
139
|
+
*/
|
|
140
|
+
export class InvalidPluginNameError extends Error {
|
|
141
|
+
constructor(message: string) {
|
|
142
|
+
super(message)
|
|
143
|
+
this.name = 'InvalidPluginNameError'
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -11,6 +11,7 @@ export { PluginNotFoundError, InvalidPluginContextError, PluginInstallationError
|
|
|
11
11
|
// Commands
|
|
12
12
|
export { pluginInstallCommand } from './commands/plugin-install.js'
|
|
13
13
|
export { pluginCreateCommand } from './commands/plugin-create.js'
|
|
14
|
+
export { pluginDeleteCommand } from './commands/delete-plugin.js'
|
|
14
15
|
|
|
15
16
|
// Utilities
|
|
16
17
|
export { listAvailablePlugins } from './lib/plugin-registry.js'
|
|
@@ -3,14 +3,18 @@ import * as fs from 'fs/promises'
|
|
|
3
3
|
|
|
4
4
|
import chalk from 'chalk'
|
|
5
5
|
import { execa } from 'execa'
|
|
6
|
+
import fsExtra from 'fs-extra'
|
|
6
7
|
import { readPluginMetadata } from '@launch77/plugin-runtime'
|
|
7
8
|
|
|
8
9
|
import { downloadNpmPackage } from '../../../infrastructure/npm-package.js'
|
|
9
|
-
import
|
|
10
|
+
import * as npm from '../../../infrastructure/npm.js'
|
|
11
|
+
import { validateWorkspaceContext } from '../../../utils/launch77-validation.js'
|
|
12
|
+
import { validateAppName } from '../../../utils/validation.js'
|
|
13
|
+
import { PluginInstallationError, InvalidPluginContextError, createInvalidContextError, MissingPluginTargetsError, createInvalidTargetError, NpmInstallationError, PluginResolutionError, PluginDirectoryNotFoundError, InvalidPluginNameError } from '../errors/plugin-errors.js'
|
|
10
14
|
import { PluginResolver } from '../lib/plugin-resolver.js'
|
|
11
15
|
|
|
12
16
|
import type { Launch77Context, Launch77LocationType, Launch77PackageManifest, InstalledPluginMetadata, PluginMetadata } from '@launch77/plugin-runtime'
|
|
13
|
-
import type { InstallPluginRequest, InstallPluginResult } from '../types/plugin-types.js'
|
|
17
|
+
import type { InstallPluginRequest, InstallPluginResult, DeletePluginRequest, DeletePluginResult } from '../types/plugin-types.js'
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* Map location type to target string
|
|
@@ -259,4 +263,41 @@ export class PluginService {
|
|
|
259
263
|
throw new PluginInstallationError(`Failed to write plugin manifest: ${error instanceof Error ? error.message : String(error)}`, error instanceof Error ? error : undefined)
|
|
260
264
|
}
|
|
261
265
|
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Delete a plugin from the workspace
|
|
269
|
+
*/
|
|
270
|
+
async deletePlugin(request: DeletePluginRequest, context: Launch77Context): Promise<DeletePluginResult> {
|
|
271
|
+
const { pluginName } = request
|
|
272
|
+
|
|
273
|
+
// 1. Validate plugin name (reusing app name validation since format is the same)
|
|
274
|
+
const nameValidation = validateAppName(pluginName)
|
|
275
|
+
if (!nameValidation.valid) {
|
|
276
|
+
throw new InvalidPluginNameError(nameValidation.errorMessage || 'Invalid plugin name')
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// 2. Validate workspace context
|
|
280
|
+
const contextValidation = validateWorkspaceContext(context)
|
|
281
|
+
if (!contextValidation.valid) {
|
|
282
|
+
throw new Error(contextValidation.errorMessage || 'Invalid workspace context')
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// 3. Determine plugin path
|
|
286
|
+
const pluginPath = path.join(context.workspaceRoot, 'plugins', pluginName)
|
|
287
|
+
|
|
288
|
+
// 4. Check if plugin exists
|
|
289
|
+
if (!(await fsExtra.pathExists(pluginPath))) {
|
|
290
|
+
throw new PluginDirectoryNotFoundError(pluginName, pluginPath)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// 5. Delete the plugin directory
|
|
294
|
+
await fsExtra.remove(pluginPath)
|
|
295
|
+
|
|
296
|
+
// 6. Update dependencies
|
|
297
|
+
await npm.install(context.workspaceRoot)
|
|
298
|
+
|
|
299
|
+
return {
|
|
300
|
+
pluginName,
|
|
301
|
+
}
|
|
302
|
+
}
|
|
262
303
|
}
|
|
@@ -19,3 +19,11 @@ export interface HookResult {
|
|
|
19
19
|
templateVariables?: Record<string, string>
|
|
20
20
|
hookContext?: Record<string, string>
|
|
21
21
|
}
|
|
22
|
+
|
|
23
|
+
export interface DeletePluginRequest {
|
|
24
|
+
pluginName: string
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface DeletePluginResult {
|
|
28
|
+
pluginName: string
|
|
29
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @{{workspaceName}}/lib-{{libraryName}}
|
|
2
|
+
|
|
3
|
+
{{description}}
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
This library is part of the {{workspaceName}} monorepo workspace.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @{{workspaceName}}/lib-{{libraryName}}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { /* exports */ } from '@{{workspaceName}}/lib-{{libraryName}}'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Development
|
|
20
|
+
|
|
21
|
+
### Type Checking
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run typecheck
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Testing
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Building
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run build
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Component Documentation
|
|
40
|
+
|
|
41
|
+
If this library contains UI components, use Launch77 annotations for catalog generation:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
/**
|
|
45
|
+
* @launch77-component
|
|
46
|
+
* @category your-category
|
|
47
|
+
* @description What this component does
|
|
48
|
+
* @whenToUse Use for...
|
|
49
|
+
* @whenNotToUse Don't use for...
|
|
50
|
+
* @tags tag1, tag2, tag3
|
|
51
|
+
* @example
|
|
52
|
+
* <YourComponent prop="value" />
|
|
53
|
+
*/
|
|
54
|
+
export const YourComponent = () => { ... }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Annotation Reference
|
|
58
|
+
|
|
59
|
+
| Tag | Required | Purpose |
|
|
60
|
+
|-----|----------|---------|
|
|
61
|
+
| `@launch77-component` | Yes | Identifies component for catalog |
|
|
62
|
+
| `@category` | Yes | Component category (e.g., "forms", "marketing") |
|
|
63
|
+
| `@description` | Yes | Brief description of what the component does |
|
|
64
|
+
| `@whenToUse` | Recommended | Guidance on when to use this component |
|
|
65
|
+
| `@whenNotToUse` | Recommended | Anti-patterns and when not to use |
|
|
66
|
+
| `@tags` | Optional | Comma-separated searchable keywords |
|
|
67
|
+
| `@example` | Optional | Code example showing usage |
|
|
68
|
+
|
|
69
|
+
To exclude a component from the catalog:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
/**
|
|
73
|
+
* @launch77-ignore
|
|
74
|
+
* @reason Not ready for production use
|
|
75
|
+
*/
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
UNLICENSED - Private package
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@{{workspaceName}}/lib-{{libraryName}}",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "{{description}}",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": true,
|
|
7
|
+
"main": "./src/index.js",
|
|
8
|
+
"types": "./src/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./src/index.d.ts",
|
|
12
|
+
"default": "./src/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src/",
|
|
17
|
+
"docs/"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "echo 'Configure build for your library type (tsup, tsc, etc.)'",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"test": "echo 'No tests configured yet'"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@types/node": "^20.0.0",
|
|
29
|
+
"typescript": "^5.3.0"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your type exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent, type MyComponentProps } from './components/MyComponent'
|
|
8
|
+
* export { myUtility } from './utils/myUtility'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your type exports here
|
|
12
|
+
declare module '@{{workspaceName}}/lib-{{libraryName}}' {
|
|
13
|
+
// Add declarations here
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main entry point for @{{workspaceName}}/lib-{{libraryName}}
|
|
3
|
+
*
|
|
4
|
+
* Add your library exports here.
|
|
5
|
+
*
|
|
6
|
+
* Example:
|
|
7
|
+
* export { MyComponent } from './components/MyComponent.js'
|
|
8
|
+
* export { myUtility } from './utils/myUtility.js'
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// Add your exports here
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"lib": ["ES2020", "DOM"],
|
|
6
|
+
"jsx": "react-jsx",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"declarationMap": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"outDir": "./dist",
|
|
11
|
+
"rootDir": "./src",
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"resolveJsonModule": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"checkJs": false,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"esModuleInterop": true,
|
|
23
|
+
"skipLibCheck": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"paths": {
|
|
26
|
+
"@/*": ["./src/*"]
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"include": ["src/**/*"],
|
|
30
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.test.tsx"]
|
|
31
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-manifest.d.ts","sourceRoot":"","sources":["../../../../src/modules/app/commands/validate-manifest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAInC,wBAAgB,uBAAuB,IAAI,OAAO,CAoEjD"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import * as path from 'path';
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { Command } from 'commander';
|
|
5
|
-
import { ManifestService } from '../services/manifest-svc.js';
|
|
6
|
-
export function validateManifestCommand() {
|
|
7
|
-
const command = new Command('app:validate-manifest')
|
|
8
|
-
.description('Validate a Launch77 manifest file')
|
|
9
|
-
.option('--path <folder>', 'Path to search for manifest (defaults to current directory)')
|
|
10
|
-
.action(async (options) => {
|
|
11
|
-
try {
|
|
12
|
-
const searchPath = options.path ? path.resolve(options.path) : process.cwd();
|
|
13
|
-
console.log(chalk.blue('🔍 Searching for Launch77 manifest (.launch/app.json)...\n'));
|
|
14
|
-
const manifestService = new ManifestService();
|
|
15
|
-
const { manifest, manifestPath, appRoot } = await manifestService.loadManifest(searchPath);
|
|
16
|
-
console.log(chalk.green('✅ Valid manifest found!\n'));
|
|
17
|
-
console.log(chalk.gray('Path:'), manifestPath);
|
|
18
|
-
console.log(chalk.gray('App root:'), appRoot);
|
|
19
|
-
console.log();
|
|
20
|
-
console.log(chalk.cyan('Manifest details:'));
|
|
21
|
-
console.log(chalk.gray(' Schema version:'), manifest.schemaVersion);
|
|
22
|
-
console.log(chalk.gray(' Package:'), manifest.package);
|
|
23
|
-
if ('name' in manifest && manifest.name) {
|
|
24
|
-
console.log(chalk.gray(' Name:'), manifest.name);
|
|
25
|
-
}
|
|
26
|
-
// Check if deployment field exists
|
|
27
|
-
if (manifest.deployment) {
|
|
28
|
-
console.log(chalk.gray(' Deployment platform:'), manifest.deployment.platform);
|
|
29
|
-
if (manifest.deployment.connected) {
|
|
30
|
-
console.log(chalk.gray(' Connected:'), 'Yes');
|
|
31
|
-
if (manifest.deployment.projectName) {
|
|
32
|
-
console.log(chalk.gray(' Project:'), manifest.deployment.projectName);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
console.log();
|
|
37
|
-
console.log(chalk.green('✨ Manifest validation successful!'));
|
|
38
|
-
// Exit with success code
|
|
39
|
-
process.exit(0);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error(chalk.red('❌ Manifest validation failed:\n'));
|
|
43
|
-
if (error instanceof Error) {
|
|
44
|
-
// If it's our formatted error with validation issues, print it as-is
|
|
45
|
-
if (error.message.includes('Manifest validation failed:')) {
|
|
46
|
-
console.error(error.message);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
console.error(chalk.red(error.message));
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
console.error(chalk.red('Unknown error occurred'));
|
|
54
|
-
}
|
|
55
|
-
console.log();
|
|
56
|
-
console.log(chalk.gray('To create a new manifest, use:'));
|
|
57
|
-
console.log(chalk.cyan(' launch77 create-app <type> <name>'));
|
|
58
|
-
console.log();
|
|
59
|
-
console.log(chalk.gray('Or create one manually at .launch/app.json following the schema at:'));
|
|
60
|
-
console.log(chalk.cyan(' launch77/cli/schemas/app.launch77.schema.json'));
|
|
61
|
-
// Exit with error code
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return command;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=validate-manifest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validate-manifest.js","sourceRoot":"","sources":["../../../../src/modules/app/commands/validate-manifest.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,MAAM,UAAU,uBAAuB;IACrC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,uBAAuB,CAAC;SACjD,WAAW,CAAC,mCAAmC,CAAC;SAChD,MAAM,CAAC,iBAAiB,EAAE,6DAA6D,CAAC;SACxF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAA;YAE5E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI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AC,GAAG,EAAE,CAAA;YACb,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC,CAAA;YAC9F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC,CAAA;YAE1E,uBAAuB;YACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
import * as path from 'path'
|
|
3
|
-
|
|
4
|
-
import chalk from 'chalk'
|
|
5
|
-
import { Command } from 'commander'
|
|
6
|
-
|
|
7
|
-
import { ManifestService } from '../services/manifest-svc.js'
|
|
8
|
-
|
|
9
|
-
export function validateManifestCommand(): Command {
|
|
10
|
-
const command = new Command('app:validate-manifest')
|
|
11
|
-
.description('Validate a Launch77 manifest file')
|
|
12
|
-
.option('--path <folder>', 'Path to search for manifest (defaults to current directory)')
|
|
13
|
-
.action(async (options) => {
|
|
14
|
-
try {
|
|
15
|
-
const searchPath = options.path ? path.resolve(options.path) : process.cwd()
|
|
16
|
-
|
|
17
|
-
console.log(chalk.blue('🔍 Searching for Launch77 manifest (.launch/app.json)...\n'))
|
|
18
|
-
|
|
19
|
-
const manifestService = new ManifestService()
|
|
20
|
-
const { manifest, manifestPath, appRoot } = await manifestService.loadManifest(searchPath)
|
|
21
|
-
|
|
22
|
-
console.log(chalk.green('✅ Valid manifest found!\n'))
|
|
23
|
-
console.log(chalk.gray('Path:'), manifestPath)
|
|
24
|
-
console.log(chalk.gray('App root:'), appRoot)
|
|
25
|
-
console.log()
|
|
26
|
-
console.log(chalk.cyan('Manifest details:'))
|
|
27
|
-
console.log(chalk.gray(' Schema version:'), manifest.schemaVersion)
|
|
28
|
-
console.log(chalk.gray(' Package:'), manifest.package)
|
|
29
|
-
|
|
30
|
-
if ('name' in manifest && manifest.name) {
|
|
31
|
-
console.log(chalk.gray(' Name:'), manifest.name)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Check if deployment field exists
|
|
35
|
-
if (manifest.deployment) {
|
|
36
|
-
console.log(chalk.gray(' Deployment platform:'), manifest.deployment.platform)
|
|
37
|
-
if (manifest.deployment.connected) {
|
|
38
|
-
console.log(chalk.gray(' Connected:'), 'Yes')
|
|
39
|
-
if (manifest.deployment.projectName) {
|
|
40
|
-
console.log(chalk.gray(' Project:'), manifest.deployment.projectName)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
console.log()
|
|
46
|
-
console.log(chalk.green('✨ Manifest validation successful!'))
|
|
47
|
-
|
|
48
|
-
// Exit with success code
|
|
49
|
-
process.exit(0)
|
|
50
|
-
} catch (error) {
|
|
51
|
-
console.error(chalk.red('❌ Manifest validation failed:\n'))
|
|
52
|
-
|
|
53
|
-
if (error instanceof Error) {
|
|
54
|
-
// If it's our formatted error with validation issues, print it as-is
|
|
55
|
-
if (error.message.includes('Manifest validation failed:')) {
|
|
56
|
-
console.error(error.message)
|
|
57
|
-
} else {
|
|
58
|
-
console.error(chalk.red(error.message))
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
console.error(chalk.red('Unknown error occurred'))
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
console.log()
|
|
65
|
-
console.log(chalk.gray('To create a new manifest, use:'))
|
|
66
|
-
console.log(chalk.cyan(' launch77 create-app <type> <name>'))
|
|
67
|
-
console.log()
|
|
68
|
-
console.log(chalk.gray('Or create one manually at .launch/app.json following the schema at:'))
|
|
69
|
-
console.log(chalk.cyan(' launch77/cli/schemas/app.launch77.schema.json'))
|
|
70
|
-
|
|
71
|
-
// Exit with error code
|
|
72
|
-
process.exit(1)
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
return command
|
|
77
|
-
}
|