@intuned/runtime-dev 1.0.6-cli.8.2.4 → 1.0.6-cli.8.2.6

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.
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- const exclusions = ["node_modules/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "parameters/**", "output/**"];
7
+ const exclusions = ["node_modules/**", ".git/**", "dist/**", "build/**", "coverage/**", ".next/**", ".cache/**", "out/**", "tmp/**", ".DS_Store", "npm-debug.log*", "yarn-debug.log*", "yarn-error.log*", ".env", ".env.*", "**/*.map", "**/*.tsbuildinfo", "tsconfig.json", "parameters/**", "output/**", "README.md"];
8
8
  var _default = exports.default = exclusions;
@@ -29,12 +29,16 @@ _commander.program.description("Deploy an Intuned project to be public").argumen
29
29
  throw new Error(projectNameValidation.errorMessage);
30
30
  }
31
31
  const auth = await (0, _utils2.getAuthCredentials)(options);
32
- const deployStarted = await (0, _utils.deployProject)(_projectName, auth);
33
- if (!deployStarted) {
34
- throw new Error("Project not deployed");
32
+ const {
33
+ deployDone,
34
+ projectId,
35
+ deployErrorMessage
36
+ } = await (0, _utils.deployProject)(_projectName, auth);
37
+ if (!deployDone) {
38
+ throw new Error(`Project not deployed: ${deployErrorMessage}`);
35
39
  }
36
40
  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`));
41
+ console.log(_chalk.default.green(`\n✅ Project "${_projectName}" deployed successfully!` + `\n\nYou can check your project on the platform: ${_chalk.default.bold(`${url}/projects/${projectId}/details`)}\n`));
38
42
  } catch (error) {
39
43
  console.error(_chalk.default.red(`\n${error.message}`));
40
44
  process.exit(1);
@@ -1,6 +1,10 @@
1
1
  import { AuthCredentials, FileSystemTree } from "../../common/cli/types";
2
2
  export declare function convertProjectToCodeTree(projectPath: string): Promise<FileSystemTree>;
3
- export declare function deployProject(projectName: string, auth: AuthCredentials): Promise<boolean>;
3
+ export declare function deployProject(projectName: string, auth: AuthCredentials): Promise<{
4
+ deployDone: boolean;
5
+ projectId?: string;
6
+ deployErrorMessage?: string;
7
+ }>;
4
8
  export declare const validateProjectName: (projectName: string) => {
5
9
  isValid: boolean;
6
10
  errorMessage?: string;
@@ -147,10 +147,21 @@ async function deployProject(projectName, auth) {
147
147
  return new Promise((resolve, reject) => {
148
148
  const checkInterval = setInterval(async () => {
149
149
  try {
150
- const status = await checkIntunedProjectDeployStatus(workspaceId, projectName, apiKey);
150
+ const {
151
+ status,
152
+ message,
153
+ result
154
+ } = await checkIntunedProjectDeployStatus(workspaceId, projectName, apiKey);
151
155
  if (status === "completed" || status === "failed" || status === "not_found") {
152
156
  clearInterval(checkInterval);
153
- resolve(status === "completed");
157
+ resolve(status === "completed" ? {
158
+ deployDone: true,
159
+ projectId: result.projectId
160
+ } : {
161
+ deployDone: false,
162
+ projectId: "",
163
+ deployErrorMessage: message
164
+ });
154
165
  }
155
166
  const elapsedTime = Date.now() - startTime;
156
167
  if (elapsedTime > _constants.PROJECT_DEPLOY_TIMEOUT) {
@@ -287,16 +298,26 @@ const checkIntunedProjectDeployStatus = async (workspaceId, projectName, apiKey)
287
298
  method: "GET"
288
299
  });
289
300
  if (response.status === 404) {
290
- return "not_found";
301
+ return {
302
+ status: "not_found",
303
+ message: "Project not found"
304
+ };
291
305
  }
292
306
  if (!response.ok) {
293
307
  throw new Error("Error querying deployment status");
294
308
  }
295
309
  const data = await response.json();
296
310
  if (data.status) {
297
- return data.status;
311
+ return {
312
+ status: data.status,
313
+ message: data.message,
314
+ result: data.result
315
+ };
298
316
  }
299
- return "failed";
317
+ return {
318
+ status: "failed",
319
+ message: `Deployment failed, please try again: ${data.message}`
320
+ };
300
321
  } catch (e) {
301
322
  throw new Error(`Error during deployment`);
302
323
  }
@@ -159,6 +159,11 @@ function prepareCLITemplate(codeTree) {
159
159
  codeTree["parameters"] = {
160
160
  directory: {}
161
161
  };
162
+ codeTree["tsconfig.json"] = {
163
+ file: {
164
+ contents: JSON.stringify(_constants.tsConfigCli, null, 2)
165
+ }
166
+ };
162
167
  if (_isFileNode(codeTree["package.json"]) && codeTree["package.json"].file) {
163
168
  const packageJson = JSON.parse(codeTree["package.json"].file.contents);
164
169
  packageJson.scripts = _constants.userCLIScripts;
@@ -166,30 +171,7 @@ function prepareCLITemplate(codeTree) {
166
171
  }
167
172
  codeTree["README.md"] = {
168
173
  file: {
169
- contents: `# Intuned CLI Project
170
-
171
- ## Usage Instructions
172
-
173
- This CLI project is built with Intuned and provides the following commands:
174
-
175
- ### Running the project
176
- \`\`\`
177
- npm run intuned-run
178
- \`\`\`
179
-
180
- ### Building the project
181
- \`\`\`
182
- npm run intuned-build
183
- \`\`\`
184
-
185
- ### Deploying the project
186
- \`\`\`
187
- npm run intuned-deploy
188
- \`\`\`
189
-
190
- ### Storage
191
- Results from your runs will be stored in the \`./output/[runId]\` directory structure.
192
- `
174
+ contents: _constants.cliReadme
193
175
  }
194
176
  };
195
177
  }
@@ -10,3 +10,16 @@ export declare const userCLIScripts: {
10
10
  "intuned-build": string;
11
11
  "intuned-deploy": string;
12
12
  };
13
+ export declare const tsConfigCli: {
14
+ compilerOptions: {
15
+ moduleResolution: string;
16
+ target: string;
17
+ outDir: string;
18
+ sourceMap: boolean;
19
+ declaration: boolean;
20
+ esModuleInterop: boolean;
21
+ };
22
+ include: string[];
23
+ exclude: string[];
24
+ };
25
+ export declare const cliReadme = "# Intuned CLI Project\n\n## Usage Instructions\n\nThis CLI project is built with Intuned and provides the following commands:\n### Init a project\n```\nnpx -p @intuned/runtime intuned-init\n\n### Keys,Environment Variables and Settings\n- INTUNED_WORKSPACE_ID: Your Intuned workspace ID, either provided via command line or intuned.json\n- INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable\n- INTUNED_PROJECT_NAME: The name of your Intuned project, either provided via command line or intuned.json\n\n### Running the project\n```\nnpm run intuned-run\n```\n\n### Building the project\n```\nnpm run intuned-build\n```\n\n### Deploying the project\n```\nnpm run intuned-deploy\n```\n\n### Artifacts provided\n- `./intuned.json`: Intuned project configuration file\n- `./api`: Folder containing the API files\n- `./parameters`: Folder containing the parameters files\n- `./output`: Folder containing the output files\n\n### Run Parameters\n--parameters-file/ -i: Path to the parameters file\n\n### Storage\nResults from your runs and appended payloads will be stored in the `./output/[runId]` directory \nstructure when providing the --store-results option on the intuned run command.\n";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.userCLIScripts = exports.ProjectDeploymentStatus = exports.PROJECT_DEPLOY_TIMEOUT = exports.CURRENT_PLAYWRIGHT_VERSION = void 0;
6
+ exports.userCLIScripts = exports.tsConfigCli = exports.cliReadme = exports.ProjectDeploymentStatus = exports.PROJECT_DEPLOY_TIMEOUT = exports.CURRENT_PLAYWRIGHT_VERSION = void 0;
7
7
  const CURRENT_PLAYWRIGHT_VERSION = exports.CURRENT_PLAYWRIGHT_VERSION = "1.44.1";
8
8
  const ProjectDeploymentStatus = exports.ProjectDeploymentStatus = ["completed", "failed", "pending", "not_found"];
9
9
  const PROJECT_DEPLOY_TIMEOUT = exports.PROJECT_DEPLOY_TIMEOUT = 600000;
@@ -15,4 +15,58 @@ const userCLIScripts = exports.userCLIScripts = {
15
15
  "intuned-run": "intuned-run",
16
16
  "intuned-build": "intuned-build-project",
17
17
  "intuned-deploy": "intuned-deploy"
18
- };
18
+ };
19
+ const tsConfigCli = exports.tsConfigCli = {
20
+ compilerOptions: {
21
+ moduleResolution: "node",
22
+ target: "ES2021",
23
+ outDir: "./dist",
24
+ sourceMap: false,
25
+ declaration: true,
26
+ esModuleInterop: true
27
+ },
28
+ include: ["**/*.ts"],
29
+ exclude: ["node_modules", "dist"]
30
+ };
31
+ const cliReadme = exports.cliReadme = `# Intuned CLI Project
32
+
33
+ ## Usage Instructions
34
+
35
+ This CLI project is built with Intuned and provides the following commands:
36
+ ### Init a project
37
+ \`\`\`
38
+ npx -p @intuned/runtime intuned-init
39
+
40
+ ### Keys,Environment Variables and Settings
41
+ - INTUNED_WORKSPACE_ID: Your Intuned workspace ID, either provided via command line or intuned.json
42
+ - INTUNED_API_KEY: Your Intuned API key, either provided via command line or environment variable
43
+ - INTUNED_PROJECT_NAME: The name of your Intuned project, either provided via command line or intuned.json
44
+
45
+ ### Running the project
46
+ \`\`\`
47
+ npm run intuned-run
48
+ \`\`\`
49
+
50
+ ### Building the project
51
+ \`\`\`
52
+ npm run intuned-build
53
+ \`\`\`
54
+
55
+ ### Deploying the project
56
+ \`\`\`
57
+ npm run intuned-deploy
58
+ \`\`\`
59
+
60
+ ### Artifacts provided
61
+ - \`./intuned.json\`: Intuned project configuration file
62
+ - \`./api\`: Folder containing the API files
63
+ - \`./parameters\`: Folder containing the parameters files
64
+ - \`./output\`: Folder containing the output files
65
+
66
+ ### Run Parameters
67
+ --parameters-file/ -i: Path to the parameters file
68
+
69
+ ### Storage
70
+ Results from your runs and appended payloads will be stored in the \`./output/[runId]\` directory
71
+ structure when providing the --store-results option on the intuned run command.
72
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.0.6-cli.8.2.4",
3
+ "version": "1.0.6-cli.8.2.6",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",