@launch77/cli 1.2.0 → 1.4.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 (215) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cli.js +8 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/infrastructure/git.d.ts +37 -0
  5. package/dist/infrastructure/git.d.ts.map +1 -0
  6. package/dist/infrastructure/git.js +82 -0
  7. package/dist/infrastructure/git.js.map +1 -0
  8. package/dist/infrastructure/github.d.ts +43 -0
  9. package/dist/infrastructure/github.d.ts.map +1 -0
  10. package/dist/infrastructure/github.js +89 -0
  11. package/dist/infrastructure/github.js.map +1 -0
  12. package/dist/infrastructure/template-generator.d.ts +1 -1
  13. package/dist/infrastructure/template-generator.d.ts.map +1 -1
  14. package/dist/infrastructure/template.d.ts +5 -0
  15. package/dist/infrastructure/template.d.ts.map +1 -1
  16. package/dist/infrastructure/template.js +11 -0
  17. package/dist/infrastructure/template.js.map +1 -1
  18. package/dist/modules/app/commands/create-app.js +1 -1
  19. package/dist/modules/app/commands/create-app.js.map +1 -1
  20. package/dist/modules/app/commands/delete-app.js +1 -1
  21. package/dist/modules/app/commands/delete-app.js.map +1 -1
  22. package/dist/modules/app/services/app-svc.d.ts +1 -1
  23. package/dist/modules/app/services/app-svc.d.ts.map +1 -1
  24. package/dist/modules/app/services/manifest-svc.d.ts +1 -1
  25. package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
  26. package/dist/modules/catalog/config/catalog-config.test.js +1 -1
  27. package/dist/modules/catalog/config/catalog-config.test.js.map +1 -1
  28. package/dist/modules/catalog/schemas/catalog-ui-components.schema.json +2 -18
  29. package/dist/modules/git/commands/git-connect.d.ts +3 -0
  30. package/dist/modules/git/commands/git-connect.d.ts.map +1 -0
  31. package/dist/modules/git/commands/git-connect.js +156 -0
  32. package/dist/modules/git/commands/git-connect.js.map +1 -0
  33. package/dist/modules/git/errors/git-errors.d.ts +21 -0
  34. package/dist/modules/git/errors/git-errors.d.ts.map +1 -0
  35. package/dist/modules/git/errors/git-errors.js +41 -0
  36. package/dist/modules/git/errors/git-errors.js.map +1 -0
  37. package/dist/modules/git/index.d.ts +5 -0
  38. package/dist/modules/git/index.d.ts.map +1 -0
  39. package/dist/modules/git/index.js +8 -0
  40. package/dist/modules/git/index.js.map +1 -0
  41. package/dist/modules/git/services/git-service.d.ts +24 -0
  42. package/dist/modules/git/services/git-service.d.ts.map +1 -0
  43. package/dist/modules/git/services/git-service.js +56 -0
  44. package/dist/modules/git/services/git-service.js.map +1 -0
  45. package/dist/modules/git/services/github-service.d.ts +27 -0
  46. package/dist/modules/git/services/github-service.d.ts.map +1 -0
  47. package/dist/modules/git/services/github-service.js +45 -0
  48. package/dist/modules/git/services/github-service.js.map +1 -0
  49. package/dist/modules/plugin/commands/plugin-create.d.ts +3 -0
  50. package/dist/modules/plugin/commands/plugin-create.d.ts.map +1 -0
  51. package/dist/modules/plugin/commands/plugin-create.js +59 -0
  52. package/dist/modules/plugin/commands/plugin-create.js.map +1 -0
  53. package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -1
  54. package/dist/modules/plugin/commands/plugin-install.js +9 -24
  55. package/dist/modules/plugin/commands/plugin-install.js.map +1 -1
  56. package/dist/modules/plugin/errors/plugin-errors.d.ts +24 -1
  57. package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -1
  58. package/dist/modules/plugin/errors/plugin-errors.js +79 -6
  59. package/dist/modules/plugin/errors/plugin-errors.js.map +1 -1
  60. package/dist/modules/plugin/index.d.ts +4 -2
  61. package/dist/modules/plugin/index.d.ts.map +1 -1
  62. package/dist/modules/plugin/index.js +4 -2
  63. package/dist/modules/plugin/index.js.map +1 -1
  64. package/dist/modules/plugin/lib/plugin-registry.d.ts +6 -12
  65. package/dist/modules/plugin/lib/plugin-registry.d.ts.map +1 -1
  66. package/dist/modules/plugin/lib/plugin-registry.js +13 -30
  67. package/dist/modules/plugin/lib/plugin-registry.js.map +1 -1
  68. package/dist/modules/plugin/lib/plugin-resolver.d.ts +76 -0
  69. package/dist/modules/plugin/lib/plugin-resolver.d.ts.map +1 -0
  70. package/dist/modules/plugin/lib/plugin-resolver.js +128 -0
  71. package/dist/modules/plugin/lib/plugin-resolver.js.map +1 -0
  72. package/dist/modules/plugin/lib/plugin-resolver.test.d.ts +2 -0
  73. package/dist/modules/plugin/lib/plugin-resolver.test.d.ts.map +1 -0
  74. package/dist/modules/plugin/lib/plugin-resolver.test.js +175 -0
  75. package/dist/modules/plugin/lib/plugin-resolver.test.js.map +1 -0
  76. package/dist/modules/plugin/services/plugin-create-service.d.ts +16 -0
  77. package/dist/modules/plugin/services/plugin-create-service.d.ts.map +1 -0
  78. package/dist/modules/plugin/services/plugin-create-service.js +47 -0
  79. package/dist/modules/plugin/services/plugin-create-service.js.map +1 -0
  80. package/dist/modules/plugin/services/plugin-svc.d.ts +8 -3
  81. package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -1
  82. package/dist/modules/plugin/services/plugin-svc.js +96 -15
  83. package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
  84. package/dist/modules/release/commands/release-init.d.ts +3 -0
  85. package/dist/modules/release/commands/release-init.d.ts.map +1 -0
  86. package/dist/modules/release/commands/release-init.js +92 -0
  87. package/dist/modules/release/commands/release-init.js.map +1 -0
  88. package/dist/modules/release/errors/release-errors.d.ts +7 -0
  89. package/dist/modules/release/errors/release-errors.d.ts.map +1 -0
  90. package/dist/modules/release/errors/release-errors.js +13 -0
  91. package/dist/modules/release/errors/release-errors.js.map +1 -0
  92. package/dist/modules/release/index.d.ts +4 -0
  93. package/dist/modules/release/index.d.ts.map +1 -0
  94. package/dist/modules/release/index.js +7 -0
  95. package/dist/modules/release/index.js.map +1 -0
  96. package/dist/modules/release/services/release-service.d.ts +34 -0
  97. package/dist/modules/release/services/release-service.d.ts.map +1 -0
  98. package/dist/modules/release/services/release-service.js +154 -0
  99. package/dist/modules/release/services/release-service.js.map +1 -0
  100. package/dist/modules/workspace/commands/init-workspace.d.ts.map +1 -1
  101. package/dist/modules/workspace/commands/init-workspace.js +4 -5
  102. package/dist/modules/workspace/commands/init-workspace.js.map +1 -1
  103. package/dist/modules/workspace/services/workspace-service.d.ts +2 -1
  104. package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -1
  105. package/dist/modules/workspace/services/workspace-service.js +27 -1
  106. package/dist/modules/workspace/services/workspace-service.js.map +1 -1
  107. package/dist/templates/plugin/README.md.hbs +39 -0
  108. package/dist/{plugins/theme/package.json → templates/plugin/package.json.hbs} +5 -3
  109. package/dist/templates/plugin/plugin.json.hbs +7 -0
  110. package/dist/templates/plugin/src/generator.ts.hbs +64 -0
  111. package/dist/templates/plugin/templates/src/.gitkeep +0 -0
  112. package/dist/templates/plugin/tsconfig.json +10 -0
  113. package/dist/{plugins/theme → templates/plugin}/tsup.config.ts +0 -1
  114. package/dist/templates/workspace/.github/workflows/ci.yml +102 -0
  115. package/dist/templates/workspace/package.json +16 -1
  116. package/dist/templates/workspace/turbo.json +5 -0
  117. package/dist/utils/launch77-context.d.ts +1 -1
  118. package/dist/utils/launch77-context.d.ts.map +1 -1
  119. package/dist/utils/launch77-context.js +25 -2
  120. package/dist/utils/launch77-context.js.map +1 -1
  121. package/dist/utils/launch77-validation.d.ts +1 -1
  122. package/dist/utils/launch77-validation.d.ts.map +1 -1
  123. package/dist/utils/string.d.ts +13 -0
  124. package/dist/utils/string.d.ts.map +1 -0
  125. package/dist/utils/string.js +18 -0
  126. package/dist/utils/string.js.map +1 -0
  127. package/package.json +7 -10
  128. package/src/cli.ts +10 -1
  129. package/src/infrastructure/git.ts +86 -0
  130. package/src/infrastructure/github.ts +111 -0
  131. package/src/infrastructure/template-generator.ts +1 -1
  132. package/src/infrastructure/template.ts +14 -0
  133. package/src/modules/app/commands/create-app.ts +1 -1
  134. package/src/modules/app/commands/delete-app.ts +1 -1
  135. package/src/modules/app/services/app-svc.ts +1 -1
  136. package/src/modules/app/services/manifest-svc.ts +1 -1
  137. package/src/modules/catalog/config/catalog-config.test.ts +1 -1
  138. package/src/modules/git/commands/git-connect.ts +183 -0
  139. package/src/modules/git/errors/git-errors.ts +44 -0
  140. package/src/modules/git/index.ts +9 -0
  141. package/src/modules/git/services/git-service.ts +63 -0
  142. package/src/modules/git/services/github-service.ts +52 -0
  143. package/src/modules/plugin/commands/plugin-create.ts +68 -0
  144. package/src/modules/plugin/commands/plugin-install.ts +9 -26
  145. package/src/modules/plugin/errors/plugin-errors.ts +87 -6
  146. package/src/modules/plugin/index.ts +4 -2
  147. package/src/modules/plugin/lib/plugin-registry.ts +14 -37
  148. package/src/modules/plugin/lib/plugin-resolver.test.ts +215 -0
  149. package/src/modules/plugin/lib/plugin-resolver.ts +160 -0
  150. package/src/modules/plugin/services/plugin-create-service.ts +69 -0
  151. package/src/modules/plugin/services/plugin-svc.ts +108 -15
  152. package/src/modules/release/commands/release-init.ts +102 -0
  153. package/src/modules/release/errors/release-errors.ts +13 -0
  154. package/src/modules/release/index.ts +8 -0
  155. package/src/modules/release/services/release-service.ts +170 -0
  156. package/src/modules/workspace/commands/init-workspace.ts +4 -6
  157. package/src/modules/workspace/services/workspace-service.ts +30 -1
  158. package/src/utils/launch77-context.ts +29 -3
  159. package/src/utils/launch77-validation.ts +1 -1
  160. package/src/utils/string.ts +17 -0
  161. package/templates/plugin/README.md.hbs +39 -0
  162. package/templates/plugin/package.json.hbs +34 -0
  163. package/templates/plugin/plugin.json.hbs +7 -0
  164. package/templates/plugin/src/generator.ts.hbs +64 -0
  165. package/templates/plugin/templates/src/.gitkeep +0 -0
  166. package/templates/plugin/tsconfig.json +10 -0
  167. package/templates/plugin/tsup.config.ts +9 -0
  168. package/templates/workspace/.github/workflows/ci.yml +102 -0
  169. package/templates/workspace/package.json +5 -0
  170. package/templates/workspace/turbo.json +5 -0
  171. package/tests/integration/cli.test.ts +25 -0
  172. package/tests/integration/setup.ts +20 -0
  173. package/vitest.config.ts +9 -0
  174. package/vitest.integration.config.ts +9 -0
  175. package/dist/app-templates/webapp/.env.ci +0 -6
  176. package/dist/app-templates/webapp/.env.example +0 -9
  177. package/dist/app-templates/webapp/.eslintrc.json +0 -6
  178. package/dist/app-templates/webapp/README.md.hbs +0 -80
  179. package/dist/app-templates/webapp/app/about/page.tsx.hbs +0 -41
  180. package/dist/app-templates/webapp/app/dashboard/page.tsx.hbs +0 -51
  181. package/dist/app-templates/webapp/app/globals.css +0 -31
  182. package/dist/app-templates/webapp/app/layout.tsx.hbs +0 -26
  183. package/dist/app-templates/webapp/app/page.tsx.hbs +0 -30
  184. package/dist/app-templates/webapp/next.config.js +0 -99
  185. package/dist/app-templates/webapp/package.json.hbs +0 -30
  186. package/dist/app-templates/webapp/postcss.config.js +0 -6
  187. package/dist/app-templates/webapp/tailwind.config.ts +0 -24
  188. package/dist/app-templates/webapp/tsconfig.json +0 -29
  189. package/dist/app-templates/webapp/vercel.json.hbs +0 -7
  190. package/dist/modules/catalog/schemas/schemas/catalog-ui-components.schema.json +0 -145
  191. package/dist/plugins/theme/plugin.json +0 -9
  192. package/dist/plugins/theme/src/generator.ts +0 -92
  193. package/dist/plugins/theme/src/utils/config-modifier.ts +0 -142
  194. package/dist/plugins/theme/src/utils/css-modifier.ts +0 -89
  195. package/dist/plugins/theme/templates/app/theme-test/page.tsx +0 -156
  196. package/dist/plugins/theme/templates/src/modules/theme/README.md +0 -209
  197. package/dist/plugins/theme/templates/src/modules/theme/config/brand.css +0 -23
  198. package/dist/plugins/theme/tsconfig.json +0 -14
  199. package/dist/templates/templates/startup/apps/.gitkeep +0 -8
  200. package/dist/templates/templates/workspace/.launch77/workspace.json +0 -3
  201. package/dist/templates/templates/workspace/README.md +0 -62
  202. package/dist/templates/templates/workspace/app-templates/.gitkeep +0 -1
  203. package/dist/templates/templates/workspace/apps/.gitkeep +0 -1
  204. package/dist/templates/templates/workspace/libraries/.gitkeep +0 -1
  205. package/dist/templates/templates/workspace/package.json +0 -31
  206. package/dist/templates/templates/workspace/plugins/.gitkeep +0 -1
  207. package/dist/templates/templates/workspace/tsconfig.json +0 -22
  208. package/dist/templates/templates/workspace/turbo.json +0 -25
  209. package/launch77-cli-1.2.0.tgz +0 -0
  210. package/src/modules/plugin/lib/launch77-workspace.code-workspace +0 -14
  211. /package/dist/templates/{templates/workspace → workspace}/.eslintignore +0 -0
  212. /package/dist/templates/{templates/workspace → workspace}/.eslintrc.js +0 -0
  213. /package/dist/templates/{templates/workspace → workspace}/.husky/pre-push +0 -0
  214. /package/dist/templates/{templates/workspace → workspace}/.lintstagedrc.json +0 -0
  215. /package/dist/templates/{templates/workspace → workspace}/.prettierrc +0 -0
@@ -0,0 +1,156 @@
1
+ import chalk from 'chalk';
2
+ import { Command } from 'commander';
3
+ import { select, input, confirm } from '@inquirer/prompts';
4
+ import ora from 'ora';
5
+ import { detectLaunch77Context } from '@launch77/plugin-runtime';
6
+ import { GitHubCLINotInstalledError, GitHubNotAuthenticatedError, NotInWorkspaceError, GitNotInstalledError } from '../errors/git-errors.js';
7
+ import { GitHubService } from '../services/github-service.js';
8
+ import { GitService } from '../services/git-service.js';
9
+ export function gitConnectCommand() {
10
+ return new Command('git:connect')
11
+ .description('Connect Launch77 workspace to GitHub repository')
12
+ .option('--owner <name>', 'GitHub owner (username or organization)')
13
+ .option('--repo <name>', 'Repository name (defaults to workspace name)')
14
+ .option('--private', 'Create private repository (default)')
15
+ .option('--public', 'Create public repository')
16
+ .action(async (options) => {
17
+ console.log(chalk.blue('\nšŸ”— Connecting workspace to GitHub...\n'));
18
+ const cwd = process.cwd();
19
+ const githubService = new GitHubService();
20
+ const gitService = new GitService();
21
+ try {
22
+ // 1. Verify we're in a workspace root
23
+ const context = await detectLaunch77Context(cwd);
24
+ if (!context.isValid || context.locationType !== 'workspace-root') {
25
+ throw new NotInWorkspaceError(cwd);
26
+ }
27
+ // 2. Verify prerequisites
28
+ const spinner = ora('Checking prerequisites...').start();
29
+ await gitService.verifyGitInstalled();
30
+ await githubService.verifyPrerequisites();
31
+ spinner.succeed('Prerequisites verified');
32
+ // 3. Check if already connected to a remote
33
+ const hasOrigin = await gitService.hasRemote(context.workspaceRoot);
34
+ if (hasOrigin) {
35
+ const remoteUrl = await gitService.getRemoteUrl(context.workspaceRoot);
36
+ console.log(chalk.yellow('\n⚠ This workspace is already connected to a git remote:\n'));
37
+ console.log(chalk.gray(` origin: ${chalk.cyan(remoteUrl)}\n`));
38
+ const shouldExit = await confirm({
39
+ message: 'Workspace already connected. Exit?',
40
+ default: true,
41
+ });
42
+ if (shouldExit) {
43
+ console.log(chalk.green('\nāœ… No changes made.\n'));
44
+ process.exit(0);
45
+ }
46
+ console.log(chalk.yellow('\n⚠ Continuing may fail if remote "origin" cannot be overwritten...\n'));
47
+ }
48
+ // 4. Get available owners
49
+ const availableOwners = await githubService.getAvailableOwners();
50
+ // 5. Determine owner
51
+ let owner;
52
+ if (options.owner) {
53
+ owner = options.owner;
54
+ }
55
+ else {
56
+ const ownerChoices = availableOwners.map((o) => ({
57
+ name: o.type === 'User' ? `${o.login} (personal)` : o.login,
58
+ value: o.login,
59
+ }));
60
+ owner = await select({
61
+ message: 'Select repository owner:',
62
+ choices: ownerChoices,
63
+ });
64
+ }
65
+ // 6. Determine repository name
66
+ let repoName;
67
+ if (options.repo) {
68
+ repoName = options.repo;
69
+ }
70
+ else {
71
+ repoName = await input({
72
+ message: 'Repository name:',
73
+ default: context.workspaceName,
74
+ validate: (value) => {
75
+ if (!value || value.trim().length === 0) {
76
+ return 'Repository name cannot be empty';
77
+ }
78
+ // GitHub repo name validation (simplified)
79
+ const validPattern = /^[a-zA-Z0-9._-]+$/;
80
+ if (!validPattern.test(value)) {
81
+ return 'Repository name must contain only letters, numbers, dots, hyphens, and underscores';
82
+ }
83
+ return true;
84
+ },
85
+ });
86
+ }
87
+ // 7. Determine visibility
88
+ let visibility;
89
+ if (options.public) {
90
+ visibility = 'public';
91
+ }
92
+ else if (options.private) {
93
+ visibility = 'private';
94
+ }
95
+ else {
96
+ const visibilityChoice = await select({
97
+ message: 'Repository visibility:',
98
+ choices: [
99
+ { name: 'Private', value: 'private' },
100
+ { name: 'Public', value: 'public' },
101
+ ],
102
+ default: 'private',
103
+ });
104
+ visibility = visibilityChoice;
105
+ }
106
+ // 8. Ensure git repository is ready
107
+ await gitService.ensureRepositoryReady(context.workspaceRoot);
108
+ // 9. Create GitHub repository and push
109
+ const createSpinner = ora('Creating GitHub repository and pushing...').start();
110
+ try {
111
+ const repoUrl = await githubService.createAndPushRepository(owner, repoName, visibility, context.workspaceRoot);
112
+ createSpinner.succeed('Repository created and code pushed');
113
+ // Success message
114
+ console.log(chalk.green(`\nāœ… Workspace connected to GitHub!\n`));
115
+ console.log(chalk.white(` Repository: ${chalk.cyan(repoUrl)}\n`));
116
+ console.log(chalk.gray(`Next steps:\n` + ` - Your code has been pushed to GitHub\n` + ` - GitHub Actions will run automatically\n` + ` - View your repository: ${chalk.cyan('gh repo view --web')}\n` + `\n` + ` ${chalk.yellow('šŸ“¦ Enable automatic releases (recommended):')}\n` + ` - Run: ${chalk.cyan('launch77 release:init')}\n` + ` - This sets up complete release workflow (GitHub tokens, changesets, npm)\n`));
117
+ }
118
+ catch (error) {
119
+ createSpinner.fail('Failed to create repository');
120
+ // Check if it's a "repository already exists" error
121
+ if (error instanceof Error && error.message.includes('already exists')) {
122
+ console.error(chalk.red(`\nāŒ Repository ${owner}/${repoName} already exists on GitHub\n`));
123
+ console.log(chalk.gray(` View existing repository: ${chalk.cyan(`https://github.com/${owner}/${repoName}`)}\n`));
124
+ }
125
+ else {
126
+ throw error;
127
+ }
128
+ }
129
+ }
130
+ catch (error) {
131
+ if (error instanceof GitHubCLINotInstalledError) {
132
+ console.error(chalk.red(`\nāŒ ${error.message}\n`));
133
+ console.log(chalk.gray(` Install with: ${chalk.cyan('brew install gh')}\n`));
134
+ console.log(chalk.gray(` Or visit: ${chalk.cyan('https://cli.github.com/')}\n`));
135
+ process.exit(1);
136
+ }
137
+ if (error instanceof GitHubNotAuthenticatedError) {
138
+ console.error(chalk.red(`\nāŒ ${error.message}\n`));
139
+ console.log(chalk.gray(` Authenticate with: ${chalk.cyan('gh auth login')}\n`));
140
+ process.exit(1);
141
+ }
142
+ if (error instanceof NotInWorkspaceError) {
143
+ console.error(chalk.red(`\nāŒ ${error.message}\n`));
144
+ console.log(chalk.gray(` This command must be run from a Launch77 workspace root directory\n`));
145
+ process.exit(1);
146
+ }
147
+ if (error instanceof GitNotInstalledError) {
148
+ console.error(chalk.red(`\nāŒ ${error.message}\n`));
149
+ console.log(chalk.gray(` Install git from: ${chalk.cyan('https://git-scm.com/downloads')}\n`));
150
+ process.exit(1);
151
+ }
152
+ throw error;
153
+ }
154
+ });
155
+ }
156
+ //# sourceMappingURL=git-connect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-connect.js","sourceRoot":"","sources":["../../../../src/modules/git/commands/git-connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5I,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AASvD,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC;SAC9B,WAAW,CAAC,iDAAiD,CAAC;SAC9D,MAAM,CAAC,gBAAgB,EAAE,yCAAyC,CAAC;SACnE,MAAM,CAAC,eAAe,EAAE,8CAA8C,CAAC;SACvE,MAAM,CAAC,WAAW,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AO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,KAAK,CAAC,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC,CAAA;gBAChG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,21 @@
1
+ export declare class GitHubCLINotInstalledError extends Error {
2
+ constructor();
3
+ }
4
+ export declare class GitHubNotAuthenticatedError extends Error {
5
+ constructor();
6
+ }
7
+ export declare class NotInWorkspaceError extends Error {
8
+ constructor(cwd: string);
9
+ }
10
+ export declare class GitNotInstalledError extends Error {
11
+ constructor();
12
+ }
13
+ export declare class RepositoryAlreadyExistsError extends Error {
14
+ owner: string;
15
+ repo: string;
16
+ constructor(owner: string, repo: string);
17
+ }
18
+ export declare class GitHubNotConnectedError extends Error {
19
+ constructor();
20
+ }
21
+ //# sourceMappingURL=git-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-errors.d.ts","sourceRoot":"","sources":["../../../../src/modules/git/errors/git-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,0BAA2B,SAAQ,KAAK;;CAKpD;AAED,qBAAa,2BAA4B,SAAQ,KAAK;;CAKrD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,GAAG,EAAE,MAAM;CAIxB;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAK9C;AAED,qBAAa,4BAA6B,SAAQ,KAAK;IAE5C,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,MAAM;gBADZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM;CAKtB;AAED,qBAAa,uBAAwB,SAAQ,KAAK;;CAKjD"}
@@ -0,0 +1,41 @@
1
+ export class GitHubCLINotInstalledError extends Error {
2
+ constructor() {
3
+ super('GitHub CLI (gh) is not installed');
4
+ this.name = 'GitHubCLINotInstalledError';
5
+ }
6
+ }
7
+ export class GitHubNotAuthenticatedError extends Error {
8
+ constructor() {
9
+ super('GitHub CLI is not authenticated');
10
+ this.name = 'GitHubNotAuthenticatedError';
11
+ }
12
+ }
13
+ export class NotInWorkspaceError extends Error {
14
+ constructor(cwd) {
15
+ super(`Not in a Launch77 workspace root. Current directory: ${cwd}`);
16
+ this.name = 'NotInWorkspaceError';
17
+ }
18
+ }
19
+ export class GitNotInstalledError extends Error {
20
+ constructor() {
21
+ super('Git is not installed');
22
+ this.name = 'GitNotInstalledError';
23
+ }
24
+ }
25
+ export class RepositoryAlreadyExistsError extends Error {
26
+ owner;
27
+ repo;
28
+ constructor(owner, repo) {
29
+ super(`Repository ${owner}/${repo} already exists`);
30
+ this.owner = owner;
31
+ this.repo = repo;
32
+ this.name = 'RepositoryAlreadyExistsError';
33
+ }
34
+ }
35
+ export class GitHubNotConnectedError extends Error {
36
+ constructor() {
37
+ super('This workspace is not connected to a GitHub repository');
38
+ this.name = 'GitHubNotConnectedError';
39
+ }
40
+ }
41
+ //# sourceMappingURL=git-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-errors.js","sourceRoot":"","sources":["../../../../src/modules/git/errors/git-errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IACnD;QACE,KAAK,CAAC,kCAAkC,CAAC,CAAA;QACzC,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAA;IAC1C,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD;QACE,KAAK,CAAC,iCAAiC,CAAC,CAAA;QACxC,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAA;IAC3C,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,GAAW;QACrB,KAAK,CAAC,wDAAwD,GAAG,EAAE,CAAC,CAAA;QACpE,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAA;IACnC,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,sBAAsB,CAAC,CAAA;QAC7B,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAA;IACpC,CAAC;CACF;AAED,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAE5C;IACA;IAFT,YACS,KAAa,EACb,IAAY;QAEnB,KAAK,CAAC,cAAc,KAAK,IAAI,IAAI,iBAAiB,CAAC,CAAA;QAH5C,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;QAGnB,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAA;IAC5C,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD;QACE,KAAK,CAAC,wDAAwD,CAAC,CAAA;QAC/D,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAA;IACvC,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ export { GitService } from './services/git-service.js';
2
+ export { GitHubService } from './services/github-service.js';
3
+ export { GitHubCLINotInstalledError, GitHubNotAuthenticatedError, NotInWorkspaceError, GitNotInstalledError, RepositoryAlreadyExistsError, GitHubNotConnectedError } from './errors/git-errors.js';
4
+ export { gitConnectCommand } from './commands/git-connect.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/git/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAG5D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGlM,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,8 @@
1
+ // Services (for other modules to use)
2
+ export { GitService } from './services/git-service.js';
3
+ export { GitHubService } from './services/github-service.js';
4
+ // Errors (for proper error handling)
5
+ export { GitHubCLINotInstalledError, GitHubNotAuthenticatedError, NotInWorkspaceError, GitNotInstalledError, RepositoryAlreadyExistsError, GitHubNotConnectedError } from './errors/git-errors.js';
6
+ // Commands
7
+ export { gitConnectCommand } from './commands/git-connect.js';
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/git/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAE5D,qCAAqC;AACrC,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAElM,WAAW;AACX,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA"}
@@ -0,0 +1,24 @@
1
+ export declare class GitService {
2
+ /**
3
+ * Verify git is installed
4
+ */
5
+ verifyGitInstalled(): Promise<void>;
6
+ /**
7
+ * Initialize git repository if needed and create initial commit if needed
8
+ */
9
+ ensureRepositoryReady(cwd: string): Promise<void>;
10
+ /**
11
+ * Check if repository already has a remote
12
+ */
13
+ hasRemote(cwd: string, remoteName?: string): Promise<boolean>;
14
+ /**
15
+ * Get the URL of a remote
16
+ */
17
+ getRemoteUrl(cwd: string, remoteName?: string): Promise<string>;
18
+ /**
19
+ * Ensure repository is connected to GitHub (has a remote)
20
+ * Throws GitHubNotConnectedError if not connected
21
+ */
22
+ ensureConnectedToGitHub(cwd: string, remoteName?: string): Promise<void>;
23
+ }
24
+ //# sourceMappingURL=git-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/git/services/git-service.ts"],"names":[],"mappings":"AAGA,qBAAa,UAAU;IACrB;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAOzC;;OAEG;IACG,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBvD;;OAEG;IACG,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,MAAiB,GAAG,OAAO,CAAC,OAAO,CAAC;IAI7E;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,MAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/E;;;OAGG;IACG,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,GAAE,MAAiB,GAAG,OAAO,CAAC,IAAI,CAAC;CAMzF"}
@@ -0,0 +1,56 @@
1
+ import * as git from '../../../infrastructure/git.js';
2
+ import { GitNotInstalledError, GitHubNotConnectedError } from '../errors/git-errors.js';
3
+ export class GitService {
4
+ /**
5
+ * Verify git is installed
6
+ */
7
+ async verifyGitInstalled() {
8
+ const isInstalled = await git.isGitInstalled();
9
+ if (!isInstalled) {
10
+ throw new GitNotInstalledError();
11
+ }
12
+ }
13
+ /**
14
+ * Initialize git repository if needed and create initial commit if needed
15
+ */
16
+ async ensureRepositoryReady(cwd) {
17
+ // Check if git repository exists
18
+ const isRepo = await git.isGitRepository(cwd);
19
+ if (!isRepo) {
20
+ console.log('Initializing git repository...');
21
+ await git.gitInit(cwd);
22
+ console.log('āœ“ Git repository initialized');
23
+ }
24
+ // Check if there are any commits
25
+ const hasAnyCommits = await git.hasCommits(cwd);
26
+ if (!hasAnyCommits) {
27
+ console.log('Creating initial commit...');
28
+ await git.gitAddAll(cwd);
29
+ await git.gitCommit(cwd, 'Initial commit');
30
+ console.log('āœ“ Initial commit created');
31
+ }
32
+ }
33
+ /**
34
+ * Check if repository already has a remote
35
+ */
36
+ async hasRemote(cwd, remoteName = 'origin') {
37
+ return git.hasRemote(cwd, remoteName);
38
+ }
39
+ /**
40
+ * Get the URL of a remote
41
+ */
42
+ async getRemoteUrl(cwd, remoteName = 'origin') {
43
+ return git.getRemoteUrl(cwd, remoteName);
44
+ }
45
+ /**
46
+ * Ensure repository is connected to GitHub (has a remote)
47
+ * Throws GitHubNotConnectedError if not connected
48
+ */
49
+ async ensureConnectedToGitHub(cwd, remoteName = 'origin') {
50
+ const hasOrigin = await this.hasRemote(cwd, remoteName);
51
+ if (!hasOrigin) {
52
+ throw new GitHubNotConnectedError();
53
+ }
54
+ }
55
+ }
56
+ //# sourceMappingURL=git-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git-service.js","sourceRoot":"","sources":["../../../../src/modules/git/services/git-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAA;AACrD,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAEvF,MAAM,OAAO,UAAU;IACrB;;OAEG;IACH,KAAK,CAAC,kBAAkB;QACtB,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,cAAc,EAAE,CAAA;QAC9C,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,oBAAoB,EAAE,CAAA;QAClC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,qBAAqB,CAAC,GAAW;QACrC,iCAAiC;QACjC,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;QAE7C,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAA;YAC7C,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YACtB,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAA;QAC7C,CAAC;QAED,iCAAiC;QACjC,MAAM,aAAa,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAE/C,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;YACzC,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;YACxB,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAA;YAC1C,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,aAAqB,QAAQ;QACxD,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IACvC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,YAAY,CAAC,GAAW,EAAE,aAAqB,QAAQ;QAC3D,OAAO,GAAG,CAAC,YAAY,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;IAC1C,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,uBAAuB,CAAC,GAAW,EAAE,aAAqB,QAAQ;QACtE,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QACvD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,uBAAuB,EAAE,CAAA;QACrC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import type { GitHubOwner } from '../../../infrastructure/github.js';
2
+ export declare class GitHubService {
3
+ /**
4
+ * Verify GitHub CLI prerequisites (installed and authenticated)
5
+ */
6
+ verifyPrerequisites(): Promise<void>;
7
+ /**
8
+ * Get all available repository owners (personal + organizations)
9
+ */
10
+ getAvailableOwners(): Promise<GitHubOwner[]>;
11
+ /**
12
+ * Create a GitHub repository and push initial commit
13
+ */
14
+ createAndPushRepository(owner: string, repo: string, visibility: 'private' | 'public', cwd: string): Promise<string>;
15
+ /**
16
+ * Get the current repository (owner/repo) from the working directory
17
+ */
18
+ getCurrentRepository(cwd: string): Promise<{
19
+ owner: string;
20
+ repo: string;
21
+ }>;
22
+ /**
23
+ * Set a repository secret
24
+ */
25
+ setRepositorySecret(owner: string, repo: string, secretName: string, secretValue: string): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=github-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/git/services/github-service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEpE,qBAAa,aAAa;IACxB;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAY1C;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAIlD;;OAEG;IACG,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAO1H;;OAEG;IACG,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAIjF;;OAEG;IACG,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG/G"}
@@ -0,0 +1,45 @@
1
+ import * as github from '../../../infrastructure/github.js';
2
+ import { GitHubCLINotInstalledError, GitHubNotAuthenticatedError } from '../errors/git-errors.js';
3
+ export class GitHubService {
4
+ /**
5
+ * Verify GitHub CLI prerequisites (installed and authenticated)
6
+ */
7
+ async verifyPrerequisites() {
8
+ const isInstalled = await github.isGhInstalled();
9
+ if (!isInstalled) {
10
+ throw new GitHubCLINotInstalledError();
11
+ }
12
+ const isAuthenticated = await github.isGhAuthenticated();
13
+ if (!isAuthenticated) {
14
+ throw new GitHubNotAuthenticatedError();
15
+ }
16
+ }
17
+ /**
18
+ * Get all available repository owners (personal + organizations)
19
+ */
20
+ async getAvailableOwners() {
21
+ return github.getAvailableOwners();
22
+ }
23
+ /**
24
+ * Create a GitHub repository and push initial commit
25
+ */
26
+ async createAndPushRepository(owner, repo, visibility, cwd) {
27
+ return github.createRepository(owner, repo, {
28
+ visibility,
29
+ cwd,
30
+ });
31
+ }
32
+ /**
33
+ * Get the current repository (owner/repo) from the working directory
34
+ */
35
+ async getCurrentRepository(cwd) {
36
+ return github.getCurrentRepository(cwd);
37
+ }
38
+ /**
39
+ * Set a repository secret
40
+ */
41
+ async setRepositorySecret(owner, repo, secretName, secretValue) {
42
+ return github.setRepositorySecret(owner, repo, secretName, secretValue);
43
+ }
44
+ }
45
+ //# sourceMappingURL=github-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github-service.js","sourceRoot":"","sources":["../../../../src/modules/git/services/github-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mCAAmC,CAAA;AAC3D,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAA;AAIjG,MAAM,OAAO,aAAa;IACxB;;OAEG;IACH,KAAK,CAAC,mBAAmB;QACvB,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,aAAa,EAAE,CAAA;QAChD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,0BAA0B,EAAE,CAAA;QACxC,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,iBAAiB,EAAE,CAAA;QACxD,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,2BAA2B,EAAE,CAAA;QACzC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB;QACtB,OAAO,MAAM,CAAC,kBAAkB,EAAE,CAAA;IACpC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,uBAAuB,CAAC,KAAa,EAAE,IAAY,EAAE,UAAgC,EAAE,GAAW;QACtG,OAAO,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE;YAC1C,UAAU;YACV,GAAG;SACJ,CAAC,CAAA;IACJ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oBAAoB,CAAC,GAAW;QACpC,OAAO,MAAM,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAA;IACzC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,KAAa,EAAE,IAAY,EAAE,UAAkB,EAAE,WAAmB;QAC5F,OAAO,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,CAAC,CAAA;IACzE,CAAC;CACF"}
@@ -0,0 +1,3 @@
1
+ import { Command } from 'commander';
2
+ export declare function pluginCreateCommand(): Command;
3
+ //# sourceMappingURL=plugin-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-create.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/plugin-create.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,wBAAgB,mBAAmB,IAAI,OAAO,CAyD7C"}
@@ -0,0 +1,59 @@
1
+ /* eslint-disable no-console */
2
+ import * as path from 'path';
3
+ import chalk from 'chalk';
4
+ import { Command } from 'commander';
5
+ import ora from 'ora';
6
+ import { detectLaunch77Context } from '@launch77/plugin-runtime';
7
+ import { PluginCreateService } from '../services/plugin-create-service.js';
8
+ export function pluginCreateCommand() {
9
+ const command = new Command('plugin:create')
10
+ .argument('<plugin-name>', 'Name of the plugin to create (e.g., analytics)')
11
+ .option('-d, --description <description>', 'Plugin description')
12
+ .description('Create a new plugin from template')
13
+ .action(async (pluginName, options) => {
14
+ try {
15
+ console.log(chalk.blue(`\nšŸ”Œ Creating plugin: ${pluginName}\n`));
16
+ // Detect context
17
+ const context = await detectLaunch77Context(process.cwd());
18
+ // Create plugin service
19
+ const pluginCreateService = new PluginCreateService();
20
+ // Create plugin
21
+ const spinner = ora('Generating plugin structure...').start();
22
+ let result;
23
+ try {
24
+ result = await pluginCreateService.createPlugin({
25
+ pluginName,
26
+ description: options.description,
27
+ }, context);
28
+ spinner.succeed('Plugin structure generated');
29
+ }
30
+ catch (error) {
31
+ spinner.fail('Failed to generate plugin structure');
32
+ throw error;
33
+ }
34
+ // Success message
35
+ const relativePath = path.relative(process.cwd(), result.pluginPath);
36
+ const displayPath = relativePath.startsWith('..') ? result.pluginPath : relativePath;
37
+ console.log(chalk.green(`\nāœ… Plugin created successfully at ${displayPath}`));
38
+ // Next steps
39
+ console.log(chalk.white('\n' + '─'.repeat(60) + '\n'));
40
+ console.log(chalk.cyan('šŸ“‹ Next Steps:\n'));
41
+ const cdPath = path.relative(process.cwd(), result.pluginPath);
42
+ console.log(chalk.gray('1. Navigate to your plugin directory:'));
43
+ console.log(chalk.cyan(` cd ${cdPath}\n`));
44
+ console.log(chalk.gray('2. Implement your plugin logic in src/generator.ts\n'));
45
+ console.log(chalk.gray('3. Add any template files to templates/\n'));
46
+ console.log(chalk.gray('4. Build your plugin:'));
47
+ console.log(chalk.cyan(' npm run build\n'));
48
+ console.log(chalk.gray('5. Test your plugin:'));
49
+ console.log(chalk.cyan(` launch77 plugin:install ${pluginName}\n`));
50
+ }
51
+ catch (error) {
52
+ const message = error instanceof Error ? error.message : String(error);
53
+ console.error(chalk.red('Error:'), message);
54
+ process.exit(1);
55
+ }
56
+ });
57
+ return command;
58
+ }
59
+ //# sourceMappingURL=plugin-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-create.js","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/plugin-create.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,K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AAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,8BAA8B,UAAU,IAAI,CAAC,CAAC,CAAA;QACvE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACtE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAA;YAC3C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-install.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/plugin-install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,wBAAgB,oBAAoB,IAAI,OAAO,CA0C9C"}
1
+ {"version":3,"file":"plugin-install.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/plugin-install.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKnC,wBAAgB,oBAAoB,IAAI,OAAO,CA0B9C"}
@@ -1,42 +1,27 @@
1
1
  /* eslint-disable no-console */
2
2
  import chalk from 'chalk';
3
3
  import { Command } from 'commander';
4
- import ora from 'ora';
5
- import { detectLaunch77Context } from '../../../utils/launch77-context.js';
4
+ import { detectLaunch77Context } from '@launch77/plugin-runtime';
6
5
  import { PluginService } from '../services/plugin-svc.js';
7
6
  export function pluginInstallCommand() {
8
7
  const command = new Command('plugin:install')
9
- .argument('<plugin-name>', 'Name of the plugin to install (e.g., database)')
10
- .description('Install a plugin to the current app')
8
+ .argument('<plugin-name>', 'Name of the plugin to install (e.g., release, @org/plugin-name)')
9
+ .description('Install a plugin to the current package')
11
10
  .action(async (pluginName) => {
12
11
  try {
13
- console.log(chalk.blue(`\nšŸ”Œ Installing ${pluginName} plugin\n`));
14
12
  // Detect context
15
13
  const context = await detectLaunch77Context(process.cwd());
16
14
  // Create plugin service
17
15
  const pluginService = new PluginService();
18
- // Install files
19
- const filesSpinner = ora('Installing plugin files...').start();
20
- try {
21
- await pluginService.installPlugin({ pluginName }, context);
22
- filesSpinner.succeed('Plugin files installed');
23
- }
24
- catch (error) {
25
- filesSpinner.fail('Failed to install plugin');
26
- throw error;
27
- }
28
- // Package.json update spinner
29
- const pkgSpinner = ora('Updating package.json...').start();
30
- pkgSpinner.succeed('package.json updated');
31
- // Dependencies spinner
32
- const installSpinner = ora('Installing dependencies...').start();
33
- installSpinner.succeed('Dependencies installed');
34
- // Success message (post-install hook handles custom messages)
35
- console.log(chalk.green(`\nāœ… Plugin '${pluginName}' installed successfully!\n`));
16
+ // Install plugin with transparent logging
17
+ // The service handles all logging internally
18
+ await pluginService.installPlugin({ pluginName }, context, console.log);
19
+ // Success message
20
+ console.log(chalk.green(`āœ… Plugin '${pluginName}' installed successfully!\n`));
36
21
  }
37
22
  catch (error) {
38
23
  const message = error instanceof Error ? error.message : String(error);
39
- console.error(chalk.red('Error:'), message);
24
+ console.error(chalk.red('\nError:'), message);
40
25
  process.exit(1);
41
26
  }
42
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-install.js","sourceRoot":"","sources":["../../../../src/modules/plugin/commands/plugin-install.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,UAAU,oBAAoB;IAClC,MAAM,OAAO,GA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,aAAa,UAAU,6BAA6B,CAAC,CAAC,CAAA;QAChF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACtE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,CAAA;YAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QACjB,CAAC;IACH,CAAC,CAAC,CAAA;IAEJ,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -6,11 +6,34 @@ export declare class InvalidPluginContextError extends Error {
6
6
  }
7
7
  /**
8
8
  * Factory function to create standardized InvalidPluginContextError
9
- * for when plugin:install is run outside of an app directory
9
+ * for when plugin:install is run outside of a package directory
10
10
  */
11
11
  export declare function createInvalidContextError(currentLocation: string): InvalidPluginContextError;
12
+ /**
13
+ * Error when plugin.json is missing the required 'targets' field
14
+ */
15
+ export declare class MissingPluginTargetsError extends Error {
16
+ constructor(pluginName: string);
17
+ }
18
+ /**
19
+ * Factory function to create error when plugin targets don't match current location
20
+ */
21
+ export declare function createInvalidTargetError(pluginName: string, currentTarget: string, allowedTargets: string[]): InvalidPluginContextError;
12
22
  export declare class PluginInstallationError extends Error {
13
23
  readonly cause?: Error | undefined;
14
24
  constructor(message: string, cause?: Error | undefined);
15
25
  }
26
+ /**
27
+ * Error when plugin resolution fails
28
+ */
29
+ export declare class PluginResolutionError extends Error {
30
+ constructor(pluginName: string, reason: string);
31
+ }
32
+ /**
33
+ * Error when npm package installation fails
34
+ */
35
+ export declare class NpmInstallationError extends Error {
36
+ readonly cause?: Error | undefined;
37
+ constructor(packageName: string, cause?: Error | undefined);
38
+ }
16
39
  //# sourceMappingURL=plugin-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-errors.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/errors/plugin-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,UAAU,EAAE,MAAM;CAM/B;AAED,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,MAAM,GAAG,yBAAyB,CAa5F;AAED,qBAAa,uBAAwB,SAAQ,KAAK;aAG9B,KAAK,CAAC,EAAE,KAAK;gBAD7B,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC"}
1
+ {"version":3,"file":"plugin-errors.d.ts","sourceRoot":"","sources":["../../../../src/modules/plugin/errors/plugin-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,UAAU,EAAE,MAAM;CAM/B;AAED,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,EAAE,MAAM,GAAG,yBAAyB,CAa5F;AAED;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,UAAU,EAAE,MAAM;CAgB/B;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,yBAAyB,CAwBvI;AAED,qBAAa,uBAAwB,SAAQ,KAAK;aAG9B,KAAK,CAAC,EAAE,KAAK;gBAD7B,OAAO,EAAE,MAAM,EACC,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAI/C;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAG3B,KAAK,CAAC,EAAE,KA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