zerostart-cli 0.0.36 → 0.0.37
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/README.md +270 -275
- package/out/cli.js +179 -35
- package/out/managers/ProjectManager.js +83 -31
- package/out/managers/TemplateManager.js +227 -212
- package/out/types.js +1 -1
- package/package.json +47 -54
- package/COMMAND_EXAMPLES.md +0 -262
- package/COMMAND_VERIFICATION.md +0 -275
- package/QUICK_TEST_GUIDE.md +0 -140
- package/VERIFICATION_SUMMARY.md +0 -213
- package/test-commands.sh +0 -190
package/out/cli.js
CHANGED
|
@@ -132,24 +132,23 @@ async function initializeProject(name, language, type, options) {
|
|
|
132
132
|
console.log(chalk_1.default.bold.green(' Success! Your project is ready!'));
|
|
133
133
|
console.log(chalk_1.default.gray(' Location: ') + chalk_1.default.cyan(projectPath));
|
|
134
134
|
console.log();
|
|
135
|
-
|
|
136
|
-
const isPractice = type === types_1.ProjectType.DSAPractice;
|
|
137
|
-
if (!isWeb || isPractice) {
|
|
135
|
+
if ([types_1.ProjectLanguage.Python, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.CPP].includes(language)) {
|
|
138
136
|
const gdbLinks = {
|
|
139
137
|
[types_1.ProjectLanguage.Python]: 'https://www.onlinegdb.com/online_python_compiler',
|
|
140
138
|
[types_1.ProjectLanguage.Java]: 'https://www.onlinegdb.com/online_java_compiler',
|
|
141
|
-
[types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler'
|
|
142
|
-
[types_1.ProjectLanguage.NodeJS]: 'https://www.onlinegdb.com/online_node.js_compiler',
|
|
143
|
-
[types_1.ProjectLanguage.React]: 'https://www.onlinegdb.com/'
|
|
139
|
+
[types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler'
|
|
144
140
|
};
|
|
145
|
-
const link = gdbLinks[language]
|
|
141
|
+
const link = gdbLinks[language];
|
|
146
142
|
console.log(chalk_1.default.bold.yellow(' Practice Online:'));
|
|
147
143
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(link));
|
|
148
144
|
console.log(chalk_1.default.gray(' (Opening in your browser...)'));
|
|
149
145
|
openUrl(link);
|
|
150
|
-
return;
|
|
151
146
|
}
|
|
152
|
-
|
|
147
|
+
if (language === types_1.ProjectLanguage.HTMLCSS) {
|
|
148
|
+
console.log(chalk_1.default.bold.cyan('\n Deployment:'));
|
|
149
|
+
console.log(chalk_1.default.gray(' To deploy to Vercel, run: ') + chalk_1.default.white('zerostart deploy-vercel'));
|
|
150
|
+
}
|
|
151
|
+
console.log(chalk_1.default.bold('\n Get started:'));
|
|
153
152
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan(`cd ${name}`));
|
|
154
153
|
console.log(chalk_1.default.gray(' - ') + chalk_1.default.cyan('code .') + chalk_1.default.gray(' (or your favorite editor)'));
|
|
155
154
|
console.log();
|
|
@@ -161,7 +160,7 @@ async function initializeProject(name, language, type, options) {
|
|
|
161
160
|
program
|
|
162
161
|
.name('zerostart')
|
|
163
162
|
.description('Create and deploy a complete project with one command')
|
|
164
|
-
.version('0.0.
|
|
163
|
+
.version('0.0.37');
|
|
165
164
|
// zerostart init [project-name]
|
|
166
165
|
program
|
|
167
166
|
.command('init [project-name]')
|
|
@@ -170,16 +169,59 @@ program
|
|
|
170
169
|
showBanner();
|
|
171
170
|
const answers = await inquirer_1.default.prompt([
|
|
172
171
|
{ type: 'input', name: 'name', message: 'Project Name:', when: !projectName, default: 'my-project' },
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
{
|
|
173
|
+
type: 'list',
|
|
174
|
+
name: 'language',
|
|
175
|
+
message: 'Select Template:',
|
|
176
|
+
choices: [
|
|
177
|
+
types_1.ProjectLanguage.React,
|
|
178
|
+
types_1.ProjectLanguage.TypeScript,
|
|
179
|
+
types_1.ProjectLanguage.HTMLCSS,
|
|
180
|
+
types_1.ProjectLanguage.CPP,
|
|
181
|
+
types_1.ProjectLanguage.Java,
|
|
182
|
+
types_1.ProjectLanguage.Python
|
|
183
|
+
]
|
|
184
|
+
}
|
|
176
185
|
]);
|
|
177
|
-
|
|
186
|
+
const selectedLang = answers.language;
|
|
187
|
+
let createRemote = false;
|
|
188
|
+
let githubToken = null;
|
|
189
|
+
if (selectedLang === types_1.ProjectLanguage.React || selectedLang === types_1.ProjectLanguage.TypeScript) {
|
|
190
|
+
const { github } = await inquirer_1.default.prompt([
|
|
191
|
+
{ type: 'confirm', name: 'github', message: 'Do you want to add this to GitHub?', default: true }
|
|
192
|
+
]);
|
|
193
|
+
if (github) {
|
|
194
|
+
createRemote = true;
|
|
195
|
+
showGitHubTokenHelp();
|
|
196
|
+
const { token } = await inquirer_1.default.prompt([
|
|
197
|
+
{ type: 'password', name: 'token', message: 'Enter your GitHub Personal Access Token:', validate: (input) => input.length > 0 || 'Token is required' }
|
|
198
|
+
]);
|
|
199
|
+
githubToken = token;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
let type = types_1.ProjectType.WebApp;
|
|
203
|
+
if (selectedLang === types_1.ProjectLanguage.TypeScript)
|
|
204
|
+
type = types_1.ProjectType.CLITool;
|
|
205
|
+
if ([types_1.ProjectLanguage.CPP, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.Python].includes(selectedLang))
|
|
206
|
+
type = types_1.ProjectType.DSAPractice;
|
|
207
|
+
await initializeProject(projectName || answers.name, selectedLang, type, {
|
|
178
208
|
isPublic: false,
|
|
179
|
-
createRemote:
|
|
180
|
-
githubToken:
|
|
209
|
+
createRemote: createRemote,
|
|
210
|
+
githubToken: githubToken,
|
|
181
211
|
authMethod: 'none'
|
|
182
212
|
});
|
|
213
|
+
if (selectedLang === types_1.ProjectLanguage.HTMLCSS) {
|
|
214
|
+
const { deploy } = await inquirer_1.default.prompt([
|
|
215
|
+
{ type: 'confirm', name: 'deploy', message: 'Do you want to deploy to Vercel right now?', default: true }
|
|
216
|
+
]);
|
|
217
|
+
if (deploy) {
|
|
218
|
+
const vercelManager = new VercelManager_1.VercelManager();
|
|
219
|
+
const projectPath = path.join(process.cwd(), projectName || answers.name);
|
|
220
|
+
if (await vercelManager.checkAuth()) {
|
|
221
|
+
await vercelManager.deploy(projectPath, projectName || answers.name);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
183
225
|
});
|
|
184
226
|
// zerostart deploy
|
|
185
227
|
program
|
|
@@ -502,7 +544,7 @@ program
|
|
|
502
544
|
return;
|
|
503
545
|
}
|
|
504
546
|
const latestVersion = stdout.trim();
|
|
505
|
-
const currentVersion = '0.0.
|
|
547
|
+
const currentVersion = '0.0.37';
|
|
506
548
|
if (latestVersion === currentVersion) {
|
|
507
549
|
spinner.succeed(chalk_1.default.green('You are using the latest version!'));
|
|
508
550
|
}
|
|
@@ -552,24 +594,20 @@ program
|
|
|
552
594
|
console.log(chalk_1.default.green(' ✔ Deployed to Netlify!'));
|
|
553
595
|
}
|
|
554
596
|
});
|
|
555
|
-
// Shortcut commands (
|
|
597
|
+
// Shortcut commands (Removed Node.js shortcuts)
|
|
556
598
|
const shortcuts = [
|
|
557
599
|
{ cmd: 'dsa-py', lang: types_1.ProjectLanguage.Python, type: types_1.ProjectType.DSAPractice },
|
|
558
600
|
{ cmd: 'dsa-java', lang: types_1.ProjectLanguage.Java, type: types_1.ProjectType.DSAPractice },
|
|
559
601
|
{ cmd: 'dsa-cpp', lang: types_1.ProjectLanguage.CPP, type: types_1.ProjectType.DSAPractice },
|
|
560
|
-
{ cmd: 'dsa-node', lang: types_1.ProjectLanguage.NodeJS, type: types_1.ProjectType.DSAPractice },
|
|
561
602
|
{ cmd: 'web-react', lang: types_1.ProjectLanguage.React, type: types_1.ProjectType.WebApp },
|
|
562
603
|
{ cmd: 'web-html', lang: types_1.ProjectLanguage.HTMLCSS, type: types_1.ProjectType.WebApp },
|
|
563
|
-
{ cmd: 'web-node', lang: types_1.ProjectLanguage.NodeJS, type: types_1.ProjectType.WebApp },
|
|
564
604
|
{ cmd: 'web-py', lang: types_1.ProjectLanguage.Python, type: types_1.ProjectType.WebApp },
|
|
565
605
|
{ cmd: 'web-java', lang: types_1.ProjectLanguage.Java, type: types_1.ProjectType.WebApp },
|
|
566
606
|
{ cmd: 'web-cpp', lang: types_1.ProjectLanguage.CPP, type: types_1.ProjectType.WebApp },
|
|
567
607
|
{ cmd: 'cli-py', lang: types_1.ProjectLanguage.Python, type: types_1.ProjectType.CLITool },
|
|
568
|
-
{ cmd: 'cli-node', lang: types_1.ProjectLanguage.NodeJS, type: types_1.ProjectType.CLITool },
|
|
569
608
|
{ cmd: 'cli-java', lang: types_1.ProjectLanguage.Java, type: types_1.ProjectType.CLITool },
|
|
570
609
|
{ cmd: 'cli-cpp', lang: types_1.ProjectLanguage.CPP, type: types_1.ProjectType.CLITool },
|
|
571
610
|
{ cmd: 'ml-py', lang: types_1.ProjectLanguage.Python, type: types_1.ProjectType.MLProject },
|
|
572
|
-
{ cmd: 'ml-node', lang: types_1.ProjectLanguage.NodeJS, type: types_1.ProjectType.MLProject },
|
|
573
611
|
{ cmd: 'ml-java', lang: types_1.ProjectLanguage.Java, type: types_1.ProjectType.MLProject },
|
|
574
612
|
{ cmd: 'ml-cpp', lang: types_1.ProjectLanguage.CPP, type: types_1.ProjectType.MLProject },
|
|
575
613
|
];
|
|
@@ -579,21 +617,127 @@ shortcuts.forEach(s => {
|
|
|
579
617
|
initializeProject(n, s.lang, s.type, { isPublic: false, createRemote: false, githubToken: null, authMethod: 'none' });
|
|
580
618
|
});
|
|
581
619
|
});
|
|
620
|
+
async function startWizard(initialName) {
|
|
621
|
+
let step = 1;
|
|
622
|
+
let name = initialName;
|
|
623
|
+
let language;
|
|
624
|
+
let github = false;
|
|
625
|
+
let githubToken = null;
|
|
626
|
+
const BACK = '< Back';
|
|
627
|
+
while (step > 0 && step <= 4) {
|
|
628
|
+
if (step === 1) {
|
|
629
|
+
if (!name) {
|
|
630
|
+
const ans = await inquirer_1.default.prompt([{
|
|
631
|
+
type: 'input',
|
|
632
|
+
name: 'name',
|
|
633
|
+
message: 'Project Name:',
|
|
634
|
+
default: 'my-project'
|
|
635
|
+
}]);
|
|
636
|
+
name = ans.name;
|
|
637
|
+
}
|
|
638
|
+
step++;
|
|
639
|
+
}
|
|
640
|
+
else if (step === 2) {
|
|
641
|
+
const choices = [
|
|
642
|
+
types_1.ProjectLanguage.React,
|
|
643
|
+
types_1.ProjectLanguage.TypeScript,
|
|
644
|
+
types_1.ProjectLanguage.HTMLCSS,
|
|
645
|
+
types_1.ProjectLanguage.CPP,
|
|
646
|
+
types_1.ProjectLanguage.Java,
|
|
647
|
+
types_1.ProjectLanguage.Python
|
|
648
|
+
];
|
|
649
|
+
if (!initialName)
|
|
650
|
+
choices.push(new inquirer_1.default.Separator(), BACK);
|
|
651
|
+
const ans = await inquirer_1.default.prompt([{
|
|
652
|
+
type: 'list',
|
|
653
|
+
name: 'language',
|
|
654
|
+
message: 'Select Template:',
|
|
655
|
+
choices: choices
|
|
656
|
+
}]);
|
|
657
|
+
if (ans.language === BACK) {
|
|
658
|
+
name = undefined;
|
|
659
|
+
step--;
|
|
660
|
+
}
|
|
661
|
+
else {
|
|
662
|
+
language = ans.language;
|
|
663
|
+
step++;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
else if (step === 3) {
|
|
667
|
+
if (language === types_1.ProjectLanguage.React || language === types_1.ProjectLanguage.TypeScript) {
|
|
668
|
+
const ans = await inquirer_1.default.prompt([{
|
|
669
|
+
type: 'list',
|
|
670
|
+
name: 'github',
|
|
671
|
+
message: 'Do you want to add this to GitHub?',
|
|
672
|
+
choices: ['Yes', 'No', BACK],
|
|
673
|
+
default: 'Yes'
|
|
674
|
+
}]);
|
|
675
|
+
if (ans.github === BACK) {
|
|
676
|
+
step--;
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
github = ans.github === 'Yes';
|
|
680
|
+
step++;
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
github = false;
|
|
685
|
+
step++; // Skip to creation
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
else if (step === 4) {
|
|
689
|
+
if (github) {
|
|
690
|
+
showGitHubTokenHelp();
|
|
691
|
+
const ans = await inquirer_1.default.prompt([
|
|
692
|
+
{
|
|
693
|
+
type: 'password',
|
|
694
|
+
name: 'token',
|
|
695
|
+
message: 'Enter your GitHub Personal Access Token (or type "back" to return):',
|
|
696
|
+
validate: (input) => input.length > 0 || 'Token is required'
|
|
697
|
+
}
|
|
698
|
+
]);
|
|
699
|
+
if (ans.token.toLowerCase() === 'back') {
|
|
700
|
+
step--;
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
githubToken = ans.token;
|
|
704
|
+
step++;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
step++;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
if (step > 4 && name && language) {
|
|
713
|
+
let type = types_1.ProjectType.WebApp;
|
|
714
|
+
if (language === types_1.ProjectLanguage.TypeScript)
|
|
715
|
+
type = types_1.ProjectType.CLITool;
|
|
716
|
+
if ([types_1.ProjectLanguage.CPP, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.Python].includes(language))
|
|
717
|
+
type = types_1.ProjectType.DSAPractice;
|
|
718
|
+
await initializeProject(name, language, type, {
|
|
719
|
+
isPublic: false,
|
|
720
|
+
createRemote: !!githubToken,
|
|
721
|
+
githubToken: githubToken,
|
|
722
|
+
authMethod: 'none'
|
|
723
|
+
});
|
|
724
|
+
if (language === types_1.ProjectLanguage.HTMLCSS) {
|
|
725
|
+
const { deploy } = await inquirer_1.default.prompt([
|
|
726
|
+
{ type: 'confirm', name: 'deploy', message: 'Do you want to deploy to Vercel right now?', default: true }
|
|
727
|
+
]);
|
|
728
|
+
if (deploy) {
|
|
729
|
+
const vercelManager = new VercelManager_1.VercelManager();
|
|
730
|
+
const projectPath = path.join(process.cwd(), name);
|
|
731
|
+
if (await vercelManager.checkAuth()) {
|
|
732
|
+
await vercelManager.deploy(projectPath, name);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
582
738
|
// Main wizard
|
|
583
739
|
program.argument('[projectName]').action(async (projectName) => {
|
|
584
740
|
showBanner();
|
|
585
|
-
|
|
586
|
-
const answers = await inquirer_1.default.prompt([
|
|
587
|
-
{ type: 'input', name: 'name', message: 'Project Name:', skip: !!projectName, when: !projectName },
|
|
588
|
-
{ type: 'list', name: 'language', message: 'Language:', choices: Object.values(types_1.ProjectLanguage) },
|
|
589
|
-
{ type: 'list', name: 'type', message: 'Type:', choices: Object.values(types_1.ProjectType) },
|
|
590
|
-
{ type: 'list', name: 'createRemote', message: 'Push to GitHub?', choices: ['Yes', 'No'], default: 'No', when: (ans) => ans.type !== types_1.ProjectType.DSAPractice }
|
|
591
|
-
]);
|
|
592
|
-
await initializeProject(projectName || answers.name, answers.language, answers.type, {
|
|
593
|
-
isPublic: false,
|
|
594
|
-
createRemote: answers.createRemote === 'Yes',
|
|
595
|
-
githubToken: null,
|
|
596
|
-
authMethod: 'none'
|
|
597
|
-
});
|
|
741
|
+
await startWizard(projectName);
|
|
598
742
|
});
|
|
599
743
|
program.parse(process.argv);
|
|
@@ -40,6 +40,7 @@ const types_1 = require("../types");
|
|
|
40
40
|
const TemplateManager_1 = require("./TemplateManager");
|
|
41
41
|
const GitHubService_1 = require("../services/GitHubService");
|
|
42
42
|
const GitManager_1 = require("./GitManager");
|
|
43
|
+
const VercelManager_1 = require("./VercelManager");
|
|
43
44
|
class ProjectManager {
|
|
44
45
|
constructor() {
|
|
45
46
|
this.templateManager = new TemplateManager_1.TemplateManager();
|
|
@@ -66,26 +67,35 @@ class ProjectManager {
|
|
|
66
67
|
}
|
|
67
68
|
if (!name)
|
|
68
69
|
return;
|
|
69
|
-
// 2. Get Programming
|
|
70
|
-
const
|
|
71
|
-
|
|
70
|
+
// 2. Get Programming Template
|
|
71
|
+
const templates = [
|
|
72
|
+
types_1.ProjectLanguage.React,
|
|
73
|
+
types_1.ProjectLanguage.TypeScript,
|
|
74
|
+
types_1.ProjectLanguage.HTMLCSS,
|
|
75
|
+
types_1.ProjectLanguage.CPP,
|
|
76
|
+
types_1.ProjectLanguage.Java,
|
|
77
|
+
types_1.ProjectLanguage.Python
|
|
78
|
+
];
|
|
79
|
+
const language = await vscode.window.showQuickPick(templates, {
|
|
80
|
+
placeHolder: 'Select Project Template'
|
|
72
81
|
});
|
|
73
82
|
if (!language)
|
|
74
83
|
return;
|
|
75
|
-
// 3.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
// 3. GitHub Option
|
|
85
|
+
let createRemote = false;
|
|
86
|
+
let isPublic = false;
|
|
87
|
+
if (language === types_1.ProjectLanguage.React || language === types_1.ProjectLanguage.TypeScript) {
|
|
88
|
+
const githubResult = await vscode.window.showQuickPick(['Yes', 'No'], {
|
|
89
|
+
placeHolder: 'Add this project to GitHub?'
|
|
90
|
+
});
|
|
91
|
+
if (githubResult === 'Yes') {
|
|
92
|
+
createRemote = true;
|
|
93
|
+
const visibilityResult = await vscode.window.showQuickPick(['Public', 'Private'], {
|
|
94
|
+
placeHolder: 'Select Repository Visibility'
|
|
95
|
+
});
|
|
96
|
+
isPublic = visibilityResult === 'Public';
|
|
97
|
+
}
|
|
98
|
+
}
|
|
89
99
|
// 5. Select Parent Folder
|
|
90
100
|
const folderResult = await vscode.window.showOpenDialog({
|
|
91
101
|
canSelectFiles: false,
|
|
@@ -97,6 +107,11 @@ class ProjectManager {
|
|
|
97
107
|
return;
|
|
98
108
|
const parentPath = folderResult[0].fsPath;
|
|
99
109
|
const projectPath = path.join(parentPath, name);
|
|
110
|
+
let type = types_1.ProjectType.WebApp;
|
|
111
|
+
if (language === types_1.ProjectLanguage.TypeScript)
|
|
112
|
+
type = types_1.ProjectType.CLITool;
|
|
113
|
+
if ([types_1.ProjectLanguage.CPP, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.Python].includes(language))
|
|
114
|
+
type = types_1.ProjectType.DSAPractice;
|
|
100
115
|
const config = {
|
|
101
116
|
name,
|
|
102
117
|
language: language,
|
|
@@ -117,24 +132,61 @@ class ProjectManager {
|
|
|
117
132
|
await this.gitManager.init(config.path);
|
|
118
133
|
// Create initial commit
|
|
119
134
|
await this.gitManager.commit(config.path, "Initial commit configured by Project Starter AI");
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
135
|
+
if (createRemote) {
|
|
136
|
+
progress.report({ increment: 50, message: "Creating GitHub Repository..." });
|
|
137
|
+
const repoUrl = await this.gitHubService.createRepo(config);
|
|
138
|
+
if (repoUrl && repoUrl.trim().length > 0) {
|
|
139
|
+
progress.report({ increment: 70, message: "Pushing to GitHub..." });
|
|
140
|
+
await this.gitManager.addRemote(config.path, repoUrl);
|
|
141
|
+
await this.gitManager.push(config.path);
|
|
142
|
+
// Clean up token from remote URL if it was injected
|
|
143
|
+
if (repoUrl.includes('x-access-token')) {
|
|
144
|
+
const cleanUrl = repoUrl.replace(/x-access-token:[^@]+@/, '');
|
|
145
|
+
await this.gitManager.setRemoteUrl(config.path, cleanUrl);
|
|
146
|
+
}
|
|
130
147
|
}
|
|
131
148
|
}
|
|
132
149
|
progress.report({ increment: 100, message: "Done!" });
|
|
133
150
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
151
|
+
if ([types_1.ProjectLanguage.Python, types_1.ProjectLanguage.Java, types_1.ProjectLanguage.CPP].includes(language)) {
|
|
152
|
+
const gdbLinks = {
|
|
153
|
+
[types_1.ProjectLanguage.Python]: 'https://www.onlinegdb.com/online_python_compiler',
|
|
154
|
+
[types_1.ProjectLanguage.Java]: 'https://www.onlinegdb.com/online_java_compiler',
|
|
155
|
+
[types_1.ProjectLanguage.CPP]: 'https://www.onlinegdb.com/online_c++_compiler'
|
|
156
|
+
};
|
|
157
|
+
const link = gdbLinks[language];
|
|
158
|
+
const action = await vscode.window.showInformationMessage(`Project '${name}' created! Practice online?`, 'Open GDB Link', 'Open Project');
|
|
159
|
+
if (action === 'Open GDB Link') {
|
|
160
|
+
vscode.env.openExternal(vscode.Uri.parse(link));
|
|
161
|
+
}
|
|
162
|
+
else if (action === 'Open Project') {
|
|
163
|
+
const uri = vscode.Uri.file(projectPath);
|
|
164
|
+
await vscode.commands.executeCommand('vscode.openFolder', uri);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
else if (language === types_1.ProjectLanguage.HTMLCSS) {
|
|
168
|
+
const action = await vscode.window.showInformationMessage(`Project '${name}' created! Deploy to Vercel?`, 'Deploy Now', 'Open Project');
|
|
169
|
+
if (action === 'Deploy Now') {
|
|
170
|
+
const vm = new VercelManager_1.VercelManager();
|
|
171
|
+
if (await vm.checkAuth()) {
|
|
172
|
+
await vm.deploy(projectPath, name);
|
|
173
|
+
vscode.window.showInformationMessage('Deployment started!');
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
vscode.window.showErrorMessage('Vercel not authenticated. Please run "vercel login" in terminal.');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else if (action === 'Open Project') {
|
|
180
|
+
const uri = vscode.Uri.file(projectPath);
|
|
181
|
+
await vscode.commands.executeCommand('vscode.openFolder', uri);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
const action = await vscode.window.showInformationMessage(`Project '${name}' created successfully!`, 'Open Project');
|
|
186
|
+
if (action === 'Open Project') {
|
|
187
|
+
const uri = vscode.Uri.file(projectPath);
|
|
188
|
+
await vscode.commands.executeCommand('vscode.openFolder', uri);
|
|
189
|
+
}
|
|
138
190
|
}
|
|
139
191
|
}
|
|
140
192
|
catch (error) {
|