@launch77/cli 1.2.0 → 1.3.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 +11 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/infrastructure/git.d.ts +37 -0
- package/dist/infrastructure/git.d.ts.map +1 -0
- package/dist/infrastructure/git.js +82 -0
- package/dist/infrastructure/git.js.map +1 -0
- package/dist/infrastructure/github.d.ts +43 -0
- package/dist/infrastructure/github.d.ts.map +1 -0
- package/dist/infrastructure/github.js +89 -0
- package/dist/infrastructure/github.js.map +1 -0
- package/dist/modules/catalog/schemas/catalog-ui-components.schema.json +2 -18
- package/dist/modules/git/commands/git-connect.d.ts +3 -0
- package/dist/modules/git/commands/git-connect.d.ts.map +1 -0
- package/dist/modules/git/commands/git-connect.js +156 -0
- package/dist/modules/git/commands/git-connect.js.map +1 -0
- package/dist/modules/git/commands/git-setup-releases.d.ts +3 -0
- package/dist/modules/git/commands/git-setup-releases.d.ts.map +1 -0
- package/dist/modules/git/commands/git-setup-releases.js +128 -0
- package/dist/modules/git/commands/git-setup-releases.js.map +1 -0
- package/dist/modules/git/errors/git-errors.d.ts +18 -0
- package/dist/modules/git/errors/git-errors.d.ts.map +1 -0
- package/dist/modules/git/errors/git-errors.js +35 -0
- package/dist/modules/git/errors/git-errors.js.map +1 -0
- package/dist/modules/git/index.d.ts +3 -0
- package/dist/modules/git/index.d.ts.map +1 -0
- package/dist/modules/git/index.js +3 -0
- package/dist/modules/git/index.js.map +1 -0
- package/dist/modules/git/services/git-service.d.ts +19 -0
- package/dist/modules/git/services/git-service.d.ts.map +1 -0
- package/dist/modules/git/services/git-service.js +46 -0
- package/dist/modules/git/services/git-service.js.map +1 -0
- package/dist/modules/git/services/github-service.d.ts +27 -0
- package/dist/modules/git/services/github-service.d.ts.map +1 -0
- package/dist/modules/git/services/github-service.js +45 -0
- package/dist/modules/git/services/github-service.js.map +1 -0
- package/dist/modules/workspace/commands/init-workspace.d.ts.map +1 -1
- package/dist/modules/workspace/commands/init-workspace.js +4 -5
- package/dist/modules/workspace/commands/init-workspace.js.map +1 -1
- package/dist/modules/workspace/services/workspace-service.d.ts +2 -1
- package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -1
- package/dist/modules/workspace/services/workspace-service.js +27 -1
- package/dist/modules/workspace/services/workspace-service.js.map +1 -1
- package/dist/templates/workspace/.github/workflows/ci.yml +99 -0
- package/dist/templates/workspace/package.json +15 -1
- package/package.json +2 -2
- package/src/cli.ts +5 -0
- package/src/infrastructure/git.ts +86 -0
- package/src/infrastructure/github.ts +111 -0
- package/src/modules/git/commands/git-connect.ts +183 -0
- package/src/modules/git/commands/git-setup-releases.ts +148 -0
- package/src/modules/git/errors/git-errors.ts +37 -0
- package/src/modules/git/index.ts +2 -0
- package/src/modules/git/services/git-service.ts +52 -0
- package/src/modules/git/services/github-service.ts +52 -0
- package/src/modules/workspace/commands/init-workspace.ts +4 -6
- package/src/modules/workspace/services/workspace-service.ts +30 -1
- package/templates/workspace/.github/workflows/ci.yml +99 -0
- package/templates/workspace/package.json +4 -0
- package/dist/app-templates/webapp/.env.ci +0 -6
- package/dist/app-templates/webapp/.env.example +0 -9
- package/dist/app-templates/webapp/.eslintrc.json +0 -6
- package/dist/app-templates/webapp/README.md.hbs +0 -80
- package/dist/app-templates/webapp/app/about/page.tsx.hbs +0 -41
- package/dist/app-templates/webapp/app/dashboard/page.tsx.hbs +0 -51
- package/dist/app-templates/webapp/app/globals.css +0 -31
- package/dist/app-templates/webapp/app/layout.tsx.hbs +0 -26
- package/dist/app-templates/webapp/app/page.tsx.hbs +0 -30
- package/dist/app-templates/webapp/next.config.js +0 -99
- package/dist/app-templates/webapp/package.json.hbs +0 -30
- package/dist/app-templates/webapp/postcss.config.js +0 -6
- package/dist/app-templates/webapp/tailwind.config.ts +0 -24
- package/dist/app-templates/webapp/tsconfig.json +0 -29
- package/dist/app-templates/webapp/vercel.json.hbs +0 -7
- package/dist/modules/catalog/schemas/schemas/catalog-ui-components.schema.json +0 -145
- package/dist/plugins/theme/package.json +0 -32
- package/dist/plugins/theme/plugin.json +0 -9
- package/dist/plugins/theme/src/generator.ts +0 -92
- package/dist/plugins/theme/src/utils/config-modifier.ts +0 -142
- package/dist/plugins/theme/src/utils/css-modifier.ts +0 -89
- package/dist/plugins/theme/templates/app/theme-test/page.tsx +0 -156
- package/dist/plugins/theme/templates/src/modules/theme/README.md +0 -209
- package/dist/plugins/theme/templates/src/modules/theme/config/brand.css +0 -23
- package/dist/plugins/theme/tsconfig.json +0 -14
- package/dist/plugins/theme/tsup.config.ts +0 -10
- package/dist/templates/templates/startup/apps/.gitkeep +0 -8
- package/dist/templates/templates/workspace/.launch77/workspace.json +0 -3
- package/dist/templates/templates/workspace/README.md +0 -62
- package/dist/templates/templates/workspace/app-templates/.gitkeep +0 -1
- package/dist/templates/templates/workspace/apps/.gitkeep +0 -1
- package/dist/templates/templates/workspace/libraries/.gitkeep +0 -1
- package/dist/templates/templates/workspace/package.json +0 -31
- package/dist/templates/templates/workspace/plugins/.gitkeep +0 -1
- package/dist/templates/templates/workspace/tsconfig.json +0 -22
- package/dist/templates/templates/workspace/turbo.json +0 -25
- /package/dist/templates/{templates/workspace → workspace}/.eslintignore +0 -0
- /package/dist/templates/{templates/workspace → workspace}/.eslintrc.js +0 -0
- /package/dist/templates/{templates/workspace → workspace}/.husky/pre-push +0 -0
- /package/dist/templates/{templates/workspace → workspace}/.lintstagedrc.json +0 -0
- /package/dist/templates/{templates/workspace → workspace}/.prettierrc +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @launch77/cli
|
|
2
|
+
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- eba9487: Launch77 workspaces can now be connected to GitHub using the new github:connect command. In addition to creating a new repository this will include a GitHub workflow for building your workspace, running quality checks, and releasing any configured Launch77 apps to npm.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 48e42e1: Added git:setup-releases command to set required permissions for npm releases in github
|
package/dist/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Command } from 'commander';
|
|
|
3
3
|
import { createAppCommand, deleteAppCommand, generateManifestCommand, validateManifestCommand } from './modules/app/index.js';
|
|
4
4
|
import { scanCommand, createGenerateCommand } from './modules/catalog/index.js';
|
|
5
5
|
import { deployInitCommand, deployLogsCommand, deployStatusCommand } from './modules/deploy/index.js';
|
|
6
|
+
import { gitConnectCommand, gitSetupReleasesCommand } from './modules/git/index.js';
|
|
6
7
|
import { pluginInstallCommand } from './modules/plugin/index.js';
|
|
7
8
|
import { createStartupCommand } from './modules/startup/index.js';
|
|
8
9
|
import { getPackageVersion } from './utils/version.js';
|
|
@@ -21,6 +22,9 @@ program.addCommand(validateManifestCommand());
|
|
|
21
22
|
program.addCommand(pluginInstallCommand());
|
|
22
23
|
program.addCommand(scanCommand());
|
|
23
24
|
program.addCommand(createGenerateCommand());
|
|
25
|
+
// Git commands
|
|
26
|
+
program.addCommand(gitConnectCommand());
|
|
27
|
+
program.addCommand(gitSetupReleasesCommand());
|
|
24
28
|
// Deploy commands
|
|
25
29
|
program.addCommand(deployInitCommand());
|
|
26
30
|
program.addCommand(deployStatusCommand());
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAC7H,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,mBAAmB,EAA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EAAE,CAAC,CAAA;AACjC,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAA;AAE3C,eAAe;AACf,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,uBAAuB,EAAE,CAAC,CAAA;AAE7C,kBAAkB;AAClB,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AACvC,OAAO,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAA;AACzC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;AAEvC,OAAO,CAAC,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if git is installed
|
|
3
|
+
*/
|
|
4
|
+
export declare function isGitInstalled(): Promise<boolean>;
|
|
5
|
+
/**
|
|
6
|
+
* Check if a directory is a git repository
|
|
7
|
+
*/
|
|
8
|
+
export declare function isGitRepository(cwd: string): Promise<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Initialize a git repository
|
|
11
|
+
*/
|
|
12
|
+
export declare function gitInit(cwd: string): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Check if there are any commits in the repository
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasCommits(cwd: string): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Stage all files
|
|
19
|
+
*/
|
|
20
|
+
export declare function gitAddAll(cwd: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Create a commit
|
|
23
|
+
*/
|
|
24
|
+
export declare function gitCommit(cwd: string, message: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Get current branch name
|
|
27
|
+
*/
|
|
28
|
+
export declare function getCurrentBranch(cwd: string): Promise<string>;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a remote exists
|
|
31
|
+
*/
|
|
32
|
+
export declare function hasRemote(cwd: string, remoteName: string): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the URL of a remote
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRemoteUrl(cwd: string, remoteName: string): Promise<string>;
|
|
37
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/infrastructure/git.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAOvD;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOnE;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExD;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9D;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE1D;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOjF;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnF"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
/**
|
|
3
|
+
* Check if git is installed
|
|
4
|
+
*/
|
|
5
|
+
export async function isGitInstalled() {
|
|
6
|
+
try {
|
|
7
|
+
await execa('git', ['--version']);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Check if a directory is a git repository
|
|
16
|
+
*/
|
|
17
|
+
export async function isGitRepository(cwd) {
|
|
18
|
+
try {
|
|
19
|
+
await execa('git', ['rev-parse', '--git-dir'], { cwd });
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Initialize a git repository
|
|
28
|
+
*/
|
|
29
|
+
export async function gitInit(cwd) {
|
|
30
|
+
await execa('git', ['init'], { cwd });
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Check if there are any commits in the repository
|
|
34
|
+
*/
|
|
35
|
+
export async function hasCommits(cwd) {
|
|
36
|
+
try {
|
|
37
|
+
await execa('git', ['rev-parse', 'HEAD'], { cwd });
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Stage all files
|
|
46
|
+
*/
|
|
47
|
+
export async function gitAddAll(cwd) {
|
|
48
|
+
await execa('git', ['add', '.'], { cwd });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Create a commit
|
|
52
|
+
*/
|
|
53
|
+
export async function gitCommit(cwd, message) {
|
|
54
|
+
await execa('git', ['commit', '-m', message], { cwd });
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get current branch name
|
|
58
|
+
*/
|
|
59
|
+
export async function getCurrentBranch(cwd) {
|
|
60
|
+
const result = await execa('git', ['branch', '--show-current'], { cwd });
|
|
61
|
+
return result.stdout.trim();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Check if a remote exists
|
|
65
|
+
*/
|
|
66
|
+
export async function hasRemote(cwd, remoteName) {
|
|
67
|
+
try {
|
|
68
|
+
await execa('git', ['remote', 'get-url', remoteName], { cwd });
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the URL of a remote
|
|
77
|
+
*/
|
|
78
|
+
export async function getRemoteUrl(cwd, remoteName) {
|
|
79
|
+
const result = await execa('git', ['remote', 'get-url', remoteName], { cwd });
|
|
80
|
+
return result.stdout.trim();
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/infrastructure/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAClC,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;QACjC,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,GAAW;IAC/C,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;QACvD,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAW;IACvC,MAAM,KAAK,CAAC,KAAK,EA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;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,GAAW,EAAE,UAAkB;IAChE,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;IAC7E,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface GitHubOwner {
|
|
2
|
+
login: string;
|
|
3
|
+
type: 'User' | 'Organization';
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Check if gh CLI is installed
|
|
7
|
+
*/
|
|
8
|
+
export declare function isGhInstalled(): Promise<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Check if gh is authenticated
|
|
11
|
+
*/
|
|
12
|
+
export declare function isGhAuthenticated(): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Get authenticated user's username
|
|
15
|
+
*/
|
|
16
|
+
export declare function getUsername(): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Get user's organizations
|
|
19
|
+
*/
|
|
20
|
+
export declare function getOrganizations(): Promise<string[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Get all available owners (user + organizations)
|
|
23
|
+
*/
|
|
24
|
+
export declare function getAvailableOwners(): Promise<GitHubOwner[]>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a GitHub repository
|
|
27
|
+
*/
|
|
28
|
+
export declare function createRepository(owner: string, repo: string, options: {
|
|
29
|
+
visibility: 'private' | 'public';
|
|
30
|
+
cwd: string;
|
|
31
|
+
}): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the current repository information (owner/repo)
|
|
34
|
+
*/
|
|
35
|
+
export declare function getCurrentRepository(cwd: string): Promise<{
|
|
36
|
+
owner: string;
|
|
37
|
+
repo: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Set a repository secret using gh CLI
|
|
41
|
+
*/
|
|
42
|
+
export declare function setRepositorySecret(owner: string, repo: string, secretName: string, secretValue: string): Promise<void>;
|
|
43
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/infrastructure/github.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,GAAG,cAAc,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAOtD;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAO1D;AAED;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAGnD;AAED;;GAEG;AACH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAI1D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAkBjE;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;IACP,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ,GACA,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAOhG;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7H"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
/**
|
|
3
|
+
* Check if gh CLI is installed
|
|
4
|
+
*/
|
|
5
|
+
export async function isGhInstalled() {
|
|
6
|
+
try {
|
|
7
|
+
await execa('gh', ['--version']);
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Check if gh is authenticated
|
|
16
|
+
*/
|
|
17
|
+
export async function isGhAuthenticated() {
|
|
18
|
+
try {
|
|
19
|
+
await execa('gh', ['auth', 'status']);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get authenticated user's username
|
|
28
|
+
*/
|
|
29
|
+
export async function getUsername() {
|
|
30
|
+
const result = await execa('gh', ['api', 'user', '--jq', '.login']);
|
|
31
|
+
return result.stdout.trim();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get user's organizations
|
|
35
|
+
*/
|
|
36
|
+
export async function getOrganizations() {
|
|
37
|
+
const result = await execa('gh', ['api', 'user/orgs', '--jq', '.[].login']);
|
|
38
|
+
const output = result.stdout.trim();
|
|
39
|
+
return output ? output.split('\n') : [];
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get all available owners (user + organizations)
|
|
43
|
+
*/
|
|
44
|
+
export async function getAvailableOwners() {
|
|
45
|
+
const [username, orgs] = await Promise.all([getUsername(), getOrganizations()]);
|
|
46
|
+
const owners = [
|
|
47
|
+
{
|
|
48
|
+
login: username,
|
|
49
|
+
type: 'User',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
for (const org of orgs) {
|
|
53
|
+
owners.push({
|
|
54
|
+
login: org,
|
|
55
|
+
type: 'Organization',
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return owners;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a GitHub repository
|
|
62
|
+
*/
|
|
63
|
+
export async function createRepository(owner, repo, options) {
|
|
64
|
+
const repoName = `${owner}/${repo}`;
|
|
65
|
+
const visibilityFlag = `--${options.visibility}`;
|
|
66
|
+
await execa('gh', ['repo', 'create', repoName, visibilityFlag, '--source=.', '--remote=origin', '--push'], {
|
|
67
|
+
cwd: options.cwd,
|
|
68
|
+
});
|
|
69
|
+
// Return the repository URL
|
|
70
|
+
return `https://github.com/${owner}/${repo}`;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get the current repository information (owner/repo)
|
|
74
|
+
*/
|
|
75
|
+
export async function getCurrentRepository(cwd) {
|
|
76
|
+
const result = await execa('gh', ['repo', 'view', '--json', 'owner,name'], { cwd });
|
|
77
|
+
const data = JSON.parse(result.stdout);
|
|
78
|
+
return {
|
|
79
|
+
owner: data.owner.login,
|
|
80
|
+
repo: data.name,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Set a repository secret using gh CLI
|
|
85
|
+
*/
|
|
86
|
+
export async function setRepositorySecret(owner, repo, secretName, secretValue) {
|
|
87
|
+
await execa('gh', ['secret', 'set', secretName, '-R', `${owner}/${repo}`, '--body', secretValue]);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=github.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../../src/infrastructure/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAO7B;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,IAAI,CAAC;QACH,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC,CAAA;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EAAE,GAAG,KAAK,IAAI,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAA;AACnG,CAAC"}
|
|
@@ -4,14 +4,7 @@
|
|
|
4
4
|
"title": "Launch77 UI Components Catalog",
|
|
5
5
|
"description": "Catalog metadata for UI component libraries. Generated during library build and consumed by Launch77 platform for component discovery.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": [
|
|
8
|
-
"catalogType",
|
|
9
|
-
"catalogVersion",
|
|
10
|
-
"packageName",
|
|
11
|
-
"packageVersion",
|
|
12
|
-
"generatedAt",
|
|
13
|
-
"components"
|
|
14
|
-
],
|
|
7
|
+
"required": ["catalogType", "catalogVersion", "packageName", "packageVersion", "generatedAt", "components"],
|
|
15
8
|
"additionalProperties": false,
|
|
16
9
|
"properties": {
|
|
17
10
|
"catalogType": {
|
|
@@ -75,16 +68,7 @@
|
|
|
75
68
|
},
|
|
76
69
|
"category": {
|
|
77
70
|
"type": "string",
|
|
78
|
-
"enum": [
|
|
79
|
-
"actions",
|
|
80
|
-
"forms",
|
|
81
|
-
"feedback",
|
|
82
|
-
"layout",
|
|
83
|
-
"marketing",
|
|
84
|
-
"typography",
|
|
85
|
-
"infrastructure",
|
|
86
|
-
"compliance"
|
|
87
|
-
],
|
|
71
|
+
"enum": ["actions", "forms", "feedback", "layout", "marketing", "typography", "infrastructure", "compliance"],
|
|
88
72
|
"description": "Component category for organization and discovery"
|
|
89
73
|
},
|
|
90
74
|
"description": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-connect.d.ts","sourceRoot":"","sources":["../../../../src/modules/git/commands/git-connect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAgBnC,wBAAgB,iBAAiB,IAAI,OAAO,CAqK3C"}
|
|
@@ -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 '../../../utils/launch77-context.js';
|
|
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 git:setup-releases')}\n` + ` - This sets up the RELEASE_TOKEN for creating release PRs\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,CA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O,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,yBAAyB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAA;gBACjF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;gBACzC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,wEAAwE,CAAC,CAAC,CAAA;gBACjG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,IAAI,KAAK,YAAY,oBAAoB,EAAE,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,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 @@
|
|
|
1
|
+
{"version":3,"file":"git-setup-releases.d.ts","sourceRoot":"","sources":["../../../../src/modules/git/commands/git-setup-releases.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAanC,wBAAgB,uBAAuB,IAAI,OAAO,CAqIjD"}
|