flowstride 1.0.7 → 1.0.9

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +37 -3
  2. package/package.json +2 -1
package/dist/cli/index.js CHANGED
@@ -53,7 +53,7 @@ const API_BASE = process.env.FLOWSTRIDE_API_URL || "https://cloud.flowstride.io"
53
53
  program
54
54
  .name("flowstride")
55
55
  .description("Flowstride: The Enterprise Flow-First Automation CLI")
56
- .version("1.0.7");
56
+ .version("1.0.9");
57
57
  program
58
58
  .command("init")
59
59
  .description("Initialise a new Flowstride workspace in the current directory")
@@ -120,7 +120,6 @@ program
120
120
  syncedAt: new Date().toISOString(),
121
121
  }, null, 2));
122
122
  console.log(chalk_1.default.gray(`\nCredentials securely scoped to ${credentialsPath}`));
123
- console.log(chalk_1.default.bold.green(`\n✅ Machine synchronized with Flowstride Enterprise.`));
124
123
  if (data.isProEligible) {
125
124
  console.log(chalk_1.default.yellow(`\n⚙️ System Check: You have access to Enterprise features (AI Healing, Parallel Workers).`));
126
125
  const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
@@ -159,10 +158,20 @@ program
159
158
  }
160
159
  catch (installError) {
161
160
  installSpinner.stop();
161
+ // ==========================================
162
+ // TEMPORARY DEBUG LOG TO UNMASK THE ERROR
163
+ // ==========================================
164
+ console.error(chalk_1.default.bgRed.white("\n[RAW SYSTEM ERROR]:"), installError);
165
+ // ==========================================
162
166
  console.log(chalk_1.default.red("\n✖ Failed to install the Enterprise Engine. Please check your internet connection or verify your project configuration."));
163
167
  if (fs.existsSync(nodeModulesPath)) {
164
168
  fs.rmSync(nodeModulesPath, { recursive: true, force: true });
165
169
  }
170
+ // THE FIX: Strict Rollback on Failure
171
+ console.log(chalk_1.default.yellow("⚠️ Reverting login: Enterprise Engine is required to sync."));
172
+ if (fs.existsSync(credentialsPath))
173
+ fs.unlinkSync(credentialsPath);
174
+ process.exit(1);
166
175
  }
167
176
  finally {
168
177
  if (fs.existsSync(tarballPath)) {
@@ -171,10 +180,17 @@ program
171
180
  }
172
181
  }
173
182
  else {
174
- console.log(chalk_1.default.gray(`\nSkipped installation.`));
183
+ // THE FIX: Strict Rollback on Decline
184
+ console.log(chalk_1.default.yellow(`\n⚠️ Installation skipped.`));
185
+ console.log(chalk_1.default.red(`✖ Reverting login: You must install the Enterprise Engine to sync this workspace.`));
186
+ if (fs.existsSync(credentialsPath))
187
+ fs.unlinkSync(credentialsPath);
188
+ process.exit(1);
175
189
  }
176
190
  }
177
191
  }
192
+ // Only print this if the engine was successfully verified or installed
193
+ console.log(chalk_1.default.bold.green(`\n✅ Machine synchronized with Flowstride Enterprise.`));
178
194
  }
179
195
  catch (error) {
180
196
  spinner.fail(chalk_1.default.red(`Network Error: Could not connect to cloud.flowstride.io`));
@@ -187,6 +203,7 @@ program
187
203
  .action(async () => {
188
204
  let token = process.env.FLOWSTRIDE_API_KEY || null;
189
205
  const credentialsPath = path.join(process.cwd(), ".flowstride", "login", "login.json");
206
+ const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
190
207
  if (!token && fs.existsSync(credentialsPath)) {
191
208
  try {
192
209
  const credentials = JSON.parse(fs.readFileSync(credentialsPath, "utf8"));
@@ -194,6 +211,14 @@ program
194
211
  }
195
212
  catch (err) { }
196
213
  }
214
+ // THE FIX: Defensive Self-Healing. If login exists but engine is missing, drop to OS.
215
+ if (!process.env.FLOWSTRIDE_API_KEY &&
216
+ token &&
217
+ !fs.existsSync(nodeModulesPath)) {
218
+ if (fs.existsSync(credentialsPath))
219
+ fs.unlinkSync(credentialsPath);
220
+ token = null;
221
+ }
197
222
  if (!token) {
198
223
  console.log(chalk_1.default.white("⚪ [OS]: (Local Mode / Not Logged In)"));
199
224
  return;
@@ -237,6 +262,7 @@ program
237
262
  let token = process.env.FLOWSTRIDE_API_KEY || null;
238
263
  let forceOS = false;
239
264
  const credentialsPath = path.join(process.cwd(), ".flowstride", "login", "login.json");
265
+ const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
240
266
  if (!token && fs.existsSync(credentialsPath)) {
241
267
  try {
242
268
  const credentials = JSON.parse(fs.readFileSync(credentialsPath, "utf8"));
@@ -244,6 +270,14 @@ program
244
270
  }
245
271
  catch (err) { }
246
272
  }
273
+ // THE FIX: Defensive Self-Healing
274
+ if (!process.env.FLOWSTRIDE_API_KEY &&
275
+ token &&
276
+ !fs.existsSync(nodeModulesPath)) {
277
+ if (fs.existsSync(credentialsPath))
278
+ fs.unlinkSync(credentialsPath);
279
+ token = null;
280
+ }
247
281
  if (!token) {
248
282
  console.log(chalk_1.default.white("⚪ [OS]: (Local Mode / Not Logged In)"));
249
283
  forceOS = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowstride",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "An opensource flowfirst test automation framework",
5
5
  "workspaces": [
6
6
  "packages/flowstride_report"
@@ -33,6 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@inquirer/prompts": "^7.10.1",
36
+ "axios": "^1.18.0",
36
37
  "chalk": "^4.1.2",
37
38
  "commander": "^11.0.0",
38
39
  "dotenv": "^17.4.2",