@intuned/runtime-dev 1.0.6-cli.8.2.0 → 1.0.6-cli.8.2.1
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.
|
@@ -33,8 +33,8 @@ _commander.program.description("Deploy an Intuned project to be public").argumen
|
|
|
33
33
|
if (!deployStarted) {
|
|
34
34
|
throw new Error("Project not deployed");
|
|
35
35
|
}
|
|
36
|
-
const url = `https://
|
|
37
|
-
console.log(_chalk.default.green(`\n✅ Project "${_projectName}" deployed successfully!` + `\n\nYou can check your project on the platform: ${_chalk.default.bold(url)}\n`));
|
|
36
|
+
const url = process.env.DOMAIN || `https://app.intuned.io`;
|
|
37
|
+
console.log(_chalk.default.green(`\n✅ Project "${_projectName}" deployed successfully!` + `\n\nYou can check your project on the platform: ${_chalk.default.bold(`${url}/projects`)}\n`));
|
|
38
38
|
} catch (error) {
|
|
39
39
|
console.error(_chalk.default.red(`\n${error.message}`));
|
|
40
40
|
process.exit(1);
|
|
@@ -149,7 +149,7 @@ async function deployProject(projectName, auth) {
|
|
|
149
149
|
workspaceId,
|
|
150
150
|
apiKey
|
|
151
151
|
} = auth;
|
|
152
|
-
const baseUrl =
|
|
152
|
+
const baseUrl = process.env.DOMAIN || `https://app.intuned.io`;
|
|
153
153
|
const url = `${baseUrl}/api/v1/workspace/${workspaceId}/projects/create`;
|
|
154
154
|
const headers = {
|
|
155
155
|
"x-api-key": apiKey,
|
|
@@ -308,7 +308,7 @@ const validateIntunedProject = async () => {
|
|
|
308
308
|
exports.validateIntunedProject = validateIntunedProject;
|
|
309
309
|
const checkIntunedProjectDeployStatus = async (workspaceId, projectName, apiKey) => {
|
|
310
310
|
try {
|
|
311
|
-
const baseUrl =
|
|
311
|
+
const baseUrl = process.env.DOMAIN || `https://app.intuned.io`;
|
|
312
312
|
const url = `${baseUrl}/api/v1/workspace/${workspaceId}/projects/create/${projectName}/result`;
|
|
313
313
|
const headers = {
|
|
314
314
|
"x-api-key": apiKey,
|
|
@@ -128,9 +128,10 @@ async function scaffoldProject(templateId, isTargetDirectoryEmpty) {
|
|
|
128
128
|
console.log(_chalk.default.cyan(`\n🚀 Initializing ${_chalk.default.bold(templateId)} project...\n`));
|
|
129
129
|
console.log(_chalk.default.cyan("📦 Fetching template..."));
|
|
130
130
|
const template = await fetchProjectTemplate(templateId);
|
|
131
|
-
console.log(_chalk.default.green(`✓ Template "${
|
|
131
|
+
console.log(_chalk.default.green(`✓ Template "${templateId}" fetched successfully`));
|
|
132
132
|
console.log(_chalk.default.cyan("🔨 Creating project files..."));
|
|
133
133
|
const codeTree = template;
|
|
134
|
+
prepareCLITemplate(codeTree);
|
|
134
135
|
await mountFiles(cwd, codeTree);
|
|
135
136
|
console.log(_chalk.default.green("✓ Project files created"));
|
|
136
137
|
console.log((0, _boxen.default)(_chalk.default.green(`✅ Project initialized successfully`) + `\n\n${_chalk.default.cyan("Project details:")}` + `\n• Template: ${_chalk.default.bold(templateId)}` + `\n• Directory: ${_chalk.default.bold(process.cwd())}` + `\n\n${_chalk.default.cyan("Next steps:")}` + `\n1. ${_chalk.default.bold("cd")} into your project directory (if not already there)` + `\n2. Run ${_chalk.default.bold("npm/yarn install")} to install dependencies` + `\n3. Develop, test and run your automation APIs`, {
|
|
@@ -141,7 +142,7 @@ async function scaffoldProject(templateId, isTargetDirectoryEmpty) {
|
|
|
141
142
|
}));
|
|
142
143
|
}
|
|
143
144
|
async function fetchProjectTemplate(templateId) {
|
|
144
|
-
const baseUrl =
|
|
145
|
+
const baseUrl = process.env.DOMAIN || `https://app.intuned.io`;
|
|
145
146
|
const url = `${baseUrl}/api/templates/${templateId}`;
|
|
146
147
|
const response = await fetch(url);
|
|
147
148
|
if (!response.ok) {
|
|
@@ -152,4 +153,14 @@ async function fetchProjectTemplate(templateId) {
|
|
|
152
153
|
throw new Error("Template not found");
|
|
153
154
|
}
|
|
154
155
|
return data.template;
|
|
156
|
+
}
|
|
157
|
+
function prepareCLITemplate(codeTree) {
|
|
158
|
+
codeTree["parameters"] = {
|
|
159
|
+
directory: {}
|
|
160
|
+
};
|
|
161
|
+
codeTree["README.md"] = {
|
|
162
|
+
file: {
|
|
163
|
+
contents: `# Intuned CLI Project`
|
|
164
|
+
}
|
|
165
|
+
};
|
|
155
166
|
}
|