@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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import { password, confirm } from '@inquirer/prompts';
|
|
4
|
+
import ora from 'ora';
|
|
5
|
+
import { detectLaunch77Context } from '../../../utils/launch77-context.js';
|
|
6
|
+
import { GitHubCLINotInstalledError, GitHubNotAuthenticatedError, NotInWorkspaceError } from '../errors/git-errors.js';
|
|
7
|
+
import { GitHubService } from '../services/github-service.js';
|
|
8
|
+
import { GitService } from '../services/git-service.js';
|
|
9
|
+
export function gitSetupReleasesCommand() {
|
|
10
|
+
return new Command('git:setup-releases')
|
|
11
|
+
.description('Configure GitHub RELEASE_TOKEN for automated release PRs')
|
|
12
|
+
.option('--token <token>', 'Personal Access Token (for automation)')
|
|
13
|
+
.action(async (options) => {
|
|
14
|
+
console.log(chalk.blue('\n🔐 Setting up GitHub release automation...\n'));
|
|
15
|
+
const cwd = process.cwd();
|
|
16
|
+
const githubService = new GitHubService();
|
|
17
|
+
const gitService = new GitService();
|
|
18
|
+
try {
|
|
19
|
+
// 1. Verify we're in a workspace root
|
|
20
|
+
const context = await detectLaunch77Context(cwd);
|
|
21
|
+
if (!context.isValid || context.locationType !== 'workspace-root') {
|
|
22
|
+
throw new NotInWorkspaceError(cwd);
|
|
23
|
+
}
|
|
24
|
+
// 2. Verify prerequisites
|
|
25
|
+
const spinner = ora('Checking prerequisites...').start();
|
|
26
|
+
await githubService.verifyPrerequisites();
|
|
27
|
+
spinner.succeed('Prerequisites verified');
|
|
28
|
+
// 3. Check if repository has a remote
|
|
29
|
+
const hasOrigin = await gitService.hasRemote(context.workspaceRoot);
|
|
30
|
+
if (!hasOrigin) {
|
|
31
|
+
console.error(chalk.red('\n❌ This workspace is not connected to a GitHub repository\n'));
|
|
32
|
+
console.log(chalk.gray(` Connect to GitHub first: ${chalk.cyan('launch77 git:connect')}\n`));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
// 4. Get current repository information
|
|
36
|
+
const repoSpinner = ora('Detecting repository...').start();
|
|
37
|
+
const { owner, repo } = await githubService.getCurrentRepository(context.workspaceRoot);
|
|
38
|
+
repoSpinner.succeed(`Repository: ${owner}/${repo}`);
|
|
39
|
+
// 5. Explain what RELEASE_TOKEN is
|
|
40
|
+
console.log(chalk.cyan('\n📋 About RELEASE_TOKEN:\n'));
|
|
41
|
+
console.log(chalk.white('The RELEASE_TOKEN is a GitHub Personal Access Token (PAT) that allows'));
|
|
42
|
+
console.log(chalk.white('the Changesets action to create Pull Requests for version updates.\n'));
|
|
43
|
+
console.log(chalk.white('Why is this needed?'));
|
|
44
|
+
console.log(chalk.gray(' • The default GITHUB_TOKEN has limited permissions'));
|
|
45
|
+
console.log(chalk.gray(' • Creating PRs that trigger CI requires a PAT'));
|
|
46
|
+
console.log(chalk.gray(' • This enables automated release workflows\n'));
|
|
47
|
+
console.log(chalk.white('Required permissions:'));
|
|
48
|
+
console.log(chalk.gray(' • Contents: Read and write'));
|
|
49
|
+
console.log(chalk.gray(' • Pull requests: Read and write\n'));
|
|
50
|
+
// 6. Provide link to create PAT
|
|
51
|
+
const tokenUrl = 'https://github.com/settings/personal-access-tokens/new';
|
|
52
|
+
console.log(chalk.cyan('🔗 Create your token:'));
|
|
53
|
+
console.log(chalk.gray(` ${chalk.cyan(tokenUrl)}`));
|
|
54
|
+
console.log(chalk.gray(` Name: Launch77 Release Token`));
|
|
55
|
+
console.log(chalk.gray(` Permissions: Contents (Read and write), Pull requests (Read and write)\n`));
|
|
56
|
+
// 7. Get the token (from option or prompt)
|
|
57
|
+
let token;
|
|
58
|
+
if (options.token) {
|
|
59
|
+
token = options.token;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
token = await password({
|
|
63
|
+
message: 'Paste your Personal Access Token (PAT):',
|
|
64
|
+
mask: '*',
|
|
65
|
+
validate: (value) => {
|
|
66
|
+
if (!value || value.trim().length === 0) {
|
|
67
|
+
return 'Token cannot be empty';
|
|
68
|
+
}
|
|
69
|
+
// GitHub PATs start with specific prefixes
|
|
70
|
+
if (!value.startsWith('ghp_') && !value.startsWith('github_pat_')) {
|
|
71
|
+
return 'Invalid token format. GitHub PATs should start with "ghp_" or "github_pat_"';
|
|
72
|
+
}
|
|
73
|
+
return true;
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// 8. Confirm if token already might exist
|
|
78
|
+
console.log(chalk.yellow('\n⚠ Note: This will overwrite any existing RELEASE_TOKEN secret\n'));
|
|
79
|
+
const shouldContinue = await confirm({
|
|
80
|
+
message: 'Continue and set RELEASE_TOKEN?',
|
|
81
|
+
default: true,
|
|
82
|
+
});
|
|
83
|
+
if (!shouldContinue) {
|
|
84
|
+
console.log(chalk.green('\n✅ No changes made.\n'));
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
// 9. Set the repository secret
|
|
88
|
+
const setSpinner = ora('Setting RELEASE_TOKEN secret...').start();
|
|
89
|
+
try {
|
|
90
|
+
await githubService.setRepositorySecret(owner, repo, 'RELEASE_TOKEN', token);
|
|
91
|
+
setSpinner.succeed('RELEASE_TOKEN configured successfully!');
|
|
92
|
+
// Success message
|
|
93
|
+
console.log(chalk.green('\n✅ Release automation is ready!\n'));
|
|
94
|
+
console.log(chalk.white('What happens now:'));
|
|
95
|
+
console.log(chalk.gray(' • When you push to main, CI runs as usual'));
|
|
96
|
+
console.log(chalk.gray(' • Changesets detects version changes'));
|
|
97
|
+
console.log(chalk.gray(' • A "Version Packages" PR is created automatically'));
|
|
98
|
+
console.log(chalk.gray(' • Merge the PR to publish your packages\n'));
|
|
99
|
+
console.log(chalk.cyan('📚 Learn more:'));
|
|
100
|
+
console.log(chalk.gray(` ${chalk.cyan('https://github.com/changesets/changesets')}\n`));
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
setSpinner.fail('Failed to set RELEASE_TOKEN');
|
|
104
|
+
throw error;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
if (error instanceof GitHubCLINotInstalledError) {
|
|
109
|
+
console.error(chalk.red(`\n❌ ${error.message}\n`));
|
|
110
|
+
console.log(chalk.gray(` Install with: ${chalk.cyan('brew install gh')}\n`));
|
|
111
|
+
console.log(chalk.gray(` Or visit: ${chalk.cyan('https://cli.github.com/')}\n`));
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
if (error instanceof GitHubNotAuthenticatedError) {
|
|
115
|
+
console.error(chalk.red(`\n❌ ${error.message}\n`));
|
|
116
|
+
console.log(chalk.gray(` Authenticate with: ${chalk.cyan('gh auth login')}\n`));
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
if (error instanceof NotInWorkspaceError) {
|
|
120
|
+
console.error(chalk.red(`\n❌ ${error.message}\n`));
|
|
121
|
+
console.log(chalk.gray(` This command must be run from a Launch77 workspace root directory\n`));
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=git-setup-releases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-setup-releases.js","sourceRoot":"","sources":["../../../../src/modules/git/commands/git-setup-releases.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAMvD,MAAM,UAAU,uBAAuB;IACrC,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;SACrC,WAAW,CAAC,0DAA0D,CAAC;SACvE,MAAM,CAAC,iBAAiB,EAAE,wCAAwC,CAAC;SACnE,MAAM,CAAC,KAAK,EAAE,OAA6B,EAAE,EAAE;QAC9C,OAAO,CAA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,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAA;gBAC9E,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,KAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAA;gBAClF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,IAAI,KAAK,YAAY,2BAA2B,EAAE,CAAC;gBACjD,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,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,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
//# 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"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
//# 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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/git/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
//# 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;CAGhF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as git from '../../../infrastructure/git.js';
|
|
2
|
+
import { GitNotInstalledError } 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
|
+
//# 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,MAAM,yBAAyB,CAAA;AAE9D,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;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-workspace.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/commands/init-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,wBAAgB,oBAAoB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"init-workspace.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/commands/init-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAMnC,wBAAgB,oBAAoB,IAAI,OAAO,CAkD9C"}
|
|
@@ -31,12 +31,11 @@ export function initWorkspaceCommand() {
|
|
|
31
31
|
const service = new WorkspaceService();
|
|
32
32
|
try {
|
|
33
33
|
const spinner = ora('Creating workspace structure...').start();
|
|
34
|
-
const result = await service.initWorkspace({ name: workspaceName }, process.cwd());
|
|
35
|
-
spinner.succeed('Workspace structure created');
|
|
36
|
-
// Success message
|
|
37
34
|
const cwd = process.cwd();
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
const result = await service.initWorkspace({ name: workspaceName }, cwd, spinner);
|
|
36
|
+
// Success message
|
|
37
|
+
console.log(chalk.green(`\n✅ Workspace ready at ${path.relative(cwd, result.workspacePath)}\n`));
|
|
38
|
+
console.log(chalk.gray(`Next steps:\n` + ` 1. cd ${workspaceName}\n` + ` 2. Create your first app with launch77 commands\n`));
|
|
40
39
|
}
|
|
41
40
|
catch (error) {
|
|
42
41
|
if (error instanceof WorkspaceAlreadyExistsError) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-workspace.js","sourceRoot":"","sources":["../../../../src/modules/workspace/commands/init-workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,GAAG,MAAM,KAAK,CAAA;AAErB,OAAO,EAAE,2BAA2B,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AACtG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAEnE,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;SACvB,QAAQ,CAAC,QAAQ,EAAE,0DAA0D,CAAC;SAC9E,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,IAAa,EAAE,EAAE;QAC9B,qCAAqC;QACrC,IAAI,aAAa,GAAG,IAAI,CAAA;QACxB,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0BAA0B,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;YAChG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,GAAG,WAAW,aAAa,IAAI,GAAG,qDAAqD,CAAC,CAAC,CAAA;QACjI,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,2BAA2B,EAAE,CAAC;gBACjD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,IAAI,KAAK,YAAY,yBAAyB,EAAE,CAAC;gBAC/C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,KAAK,CAAC,OAAO,IAAI,CAAC,CAAC,CAAA;gBAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;YAED,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { InitWorkspaceRequest, InitWorkspaceResult } from '../types/workspace-types.js';
|
|
2
|
+
import type { Ora } from 'ora';
|
|
2
3
|
export declare class WorkspaceService {
|
|
3
|
-
initWorkspace(request: InitWorkspaceRequest, cwd: string): Promise<InitWorkspaceResult>;
|
|
4
|
+
initWorkspace(request: InitWorkspaceRequest, cwd: string, spinner?: Ora): Promise<InitWorkspaceResult>;
|
|
4
5
|
private getTemplatePath;
|
|
5
6
|
}
|
|
6
7
|
//# sourceMappingURL=workspace-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-service.d.ts","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAC5F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAE9B,qBAAa,gBAAgB;IACrB,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA6D5G,OAAO,CAAC,eAAe;CAYxB"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
2
|
import { fileURLToPath } from 'url';
|
|
3
|
+
import { execa } from 'execa';
|
|
3
4
|
import * as filesystem from '../../../infrastructure/filesystem.js';
|
|
5
|
+
import * as npm from '../../../infrastructure/npm.js';
|
|
4
6
|
import { WorkspaceAlreadyExistsError } from '../errors/workspace-errors.js';
|
|
5
7
|
import { validateWorkspaceName } from '../utils/workspace-validators.js';
|
|
6
8
|
export class WorkspaceService {
|
|
7
|
-
async initWorkspace(request, cwd) {
|
|
9
|
+
async initWorkspace(request, cwd, spinner) {
|
|
8
10
|
const { name } = request;
|
|
9
11
|
// 1. Validate name
|
|
10
12
|
validateWorkspaceName(name);
|
|
@@ -27,6 +29,30 @@ export class WorkspaceService {
|
|
|
27
29
|
if (!(await filesystem.exists(workspaceJsonPath))) {
|
|
28
30
|
throw new Error('Failed to create workspace manifest (.launch77/workspace.json)');
|
|
29
31
|
}
|
|
32
|
+
// 7. Stop spinner before npm install
|
|
33
|
+
if (spinner) {
|
|
34
|
+
spinner.succeed('Workspace structure created');
|
|
35
|
+
}
|
|
36
|
+
// 8. Install dependencies
|
|
37
|
+
console.log('\nInstalling dependencies...');
|
|
38
|
+
try {
|
|
39
|
+
await npm.install(workspacePath);
|
|
40
|
+
console.log('✓ Dependencies installed');
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.warn('⚠ Warning: npm install failed:', error instanceof Error ? error.message : String(error));
|
|
44
|
+
console.warn('You may need to run npm install manually in the workspace directory');
|
|
45
|
+
}
|
|
46
|
+
// 9. Initialize changesets
|
|
47
|
+
console.log('\nInitializing changesets...');
|
|
48
|
+
try {
|
|
49
|
+
await execa('npx', ['changeset', 'init'], { cwd: workspacePath });
|
|
50
|
+
console.log('✓ Changesets initialized');
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.warn('⚠ Warning: changeset init failed:', error instanceof Error ? error.message : String(error));
|
|
54
|
+
console.warn('You may need to run npx changeset init manually in the workspace directory');
|
|
55
|
+
}
|
|
30
56
|
return {
|
|
31
57
|
workspacePath,
|
|
32
58
|
name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-service.js","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,KAAK,UAAU,MAAM,uCAAuC,CAAA;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"workspace-service.js","sourceRoot":"","sources":["../../../../src/modules/workspace/services/workspace-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,KAAK,UAAU,MAAM,uCAAuC,CAAA;AACnE,OAAO,KAAK,GAAG,MAAM,gCAAgC,CAAA;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+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1F,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC1C,MAAM,OAAO,GAAG,KAAK;YACnB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC,6CAA6C;YACnF,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAA,CAAC,8CAA8C;QAEtF,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAA;IAClD,CAAC;CACF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
name: CI & Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
push:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
pull-requests: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
build-and-test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
node-version: [20.x]
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
|
|
27
|
+
- name: Setup Node.js ${{ matrix.node-version }}
|
|
28
|
+
uses: actions/setup-node@v4
|
|
29
|
+
with:
|
|
30
|
+
node-version: ${{ matrix.node-version }}
|
|
31
|
+
cache: 'npm'
|
|
32
|
+
|
|
33
|
+
- name: Install dependencies
|
|
34
|
+
run: npm ci
|
|
35
|
+
|
|
36
|
+
- name: Run linting
|
|
37
|
+
run: npm run lint
|
|
38
|
+
|
|
39
|
+
- name: Run type checking
|
|
40
|
+
run: npm run typecheck
|
|
41
|
+
|
|
42
|
+
- name: Build packages
|
|
43
|
+
run: npm run build
|
|
44
|
+
|
|
45
|
+
- name: Run tests
|
|
46
|
+
run: npm run test
|
|
47
|
+
|
|
48
|
+
quality-checks:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- uses: actions/checkout@v4
|
|
53
|
+
|
|
54
|
+
- name: Setup Node.js 20.x
|
|
55
|
+
uses: actions/setup-node@v4
|
|
56
|
+
with:
|
|
57
|
+
node-version: 20.x
|
|
58
|
+
cache: 'npm'
|
|
59
|
+
|
|
60
|
+
- name: Install dependencies
|
|
61
|
+
run: npm ci
|
|
62
|
+
|
|
63
|
+
- name: Check for dependency vulnerabilities
|
|
64
|
+
run: npm audit --audit-level=high
|
|
65
|
+
|
|
66
|
+
- name: Check formatting
|
|
67
|
+
run: npx prettier --check "**/*.{js,jsx,ts,tsx,json,md}"
|
|
68
|
+
|
|
69
|
+
release:
|
|
70
|
+
name: Release
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
needs: [build-and-test, quality-checks]
|
|
73
|
+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
74
|
+
|
|
75
|
+
steps:
|
|
76
|
+
- name: Checkout Repo
|
|
77
|
+
uses: actions/checkout@v4
|
|
78
|
+
|
|
79
|
+
- name: Setup Node.js 20.x
|
|
80
|
+
uses: actions/setup-node@v4
|
|
81
|
+
with:
|
|
82
|
+
node-version: 20.x
|
|
83
|
+
cache: 'npm'
|
|
84
|
+
|
|
85
|
+
- name: Upgrade npm
|
|
86
|
+
run: npm i -g npm@latest
|
|
87
|
+
|
|
88
|
+
- name: Install Dependencies
|
|
89
|
+
run: npm install
|
|
90
|
+
|
|
91
|
+
- name: Create Release Pull Request or Publish to npm
|
|
92
|
+
id: changesets
|
|
93
|
+
uses: changesets/action@v1
|
|
94
|
+
with:
|
|
95
|
+
publish: npm run release
|
|
96
|
+
title: "chore: version packages"
|
|
97
|
+
commit: "chore: version packages"
|
|
98
|
+
env:
|
|
99
|
+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workspace-name",
|
|
3
3
|
"private": true,
|
|
4
|
+
"license": "UNLICENSED",
|
|
4
5
|
"packageManager": "npm@9.0.0",
|
|
5
6
|
"workspaces": [
|
|
6
7
|
"apps/*",
|
|
@@ -13,9 +14,22 @@
|
|
|
13
14
|
"build": "turbo run build",
|
|
14
15
|
"test": "turbo run test",
|
|
15
16
|
"lint": "turbo run lint",
|
|
16
|
-
"typecheck": "turbo run typecheck"
|
|
17
|
+
"typecheck": "turbo run typecheck",
|
|
18
|
+
"changeset": "changeset",
|
|
19
|
+
"version-packages": "changeset version",
|
|
20
|
+
"release": "turbo run build lint typecheck test && changeset publish",
|
|
21
|
+
"prepare": "husky"
|
|
17
22
|
},
|
|
18
23
|
"devDependencies": {
|
|
24
|
+
"@changesets/cli": "^2.29.8",
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
26
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
27
|
+
"eslint": "^8.56.0",
|
|
28
|
+
"eslint-config-prettier": "^9.0.0",
|
|
29
|
+
"eslint-plugin-import": "^2.29.0",
|
|
30
|
+
"husky": "^9.0.0",
|
|
31
|
+
"lint-staged": "^15.0.0",
|
|
32
|
+
"prettier": "^3.2.0",
|
|
19
33
|
"turbo": "^2.0.0"
|
|
20
34
|
}
|
|
21
35
|
}
|