flowstride 1.0.7 → 1.0.8

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 +32 -3
  2. package/package.json +1 -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.8");
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");
@@ -163,6 +162,11 @@ program
163
162
  if (fs.existsSync(nodeModulesPath)) {
164
163
  fs.rmSync(nodeModulesPath, { recursive: true, force: true });
165
164
  }
165
+ // THE FIX: Strict Rollback on Failure
166
+ console.log(chalk_1.default.yellow("⚠️ Reverting login: Enterprise Engine is required to sync."));
167
+ if (fs.existsSync(credentialsPath))
168
+ fs.unlinkSync(credentialsPath);
169
+ process.exit(1);
166
170
  }
167
171
  finally {
168
172
  if (fs.existsSync(tarballPath)) {
@@ -171,10 +175,17 @@ program
171
175
  }
172
176
  }
173
177
  else {
174
- console.log(chalk_1.default.gray(`\nSkipped installation.`));
178
+ // THE FIX: Strict Rollback on Decline
179
+ console.log(chalk_1.default.yellow(`\n⚠️ Installation skipped.`));
180
+ console.log(chalk_1.default.red(`✖ Reverting login: You must install the Enterprise Engine to sync this workspace.`));
181
+ if (fs.existsSync(credentialsPath))
182
+ fs.unlinkSync(credentialsPath);
183
+ process.exit(1);
175
184
  }
176
185
  }
177
186
  }
187
+ // Only print this if the engine was successfully verified or installed
188
+ console.log(chalk_1.default.bold.green(`\n✅ Machine synchronized with Flowstride Enterprise.`));
178
189
  }
179
190
  catch (error) {
180
191
  spinner.fail(chalk_1.default.red(`Network Error: Could not connect to cloud.flowstride.io`));
@@ -187,6 +198,7 @@ program
187
198
  .action(async () => {
188
199
  let token = process.env.FLOWSTRIDE_API_KEY || null;
189
200
  const credentialsPath = path.join(process.cwd(), ".flowstride", "login", "login.json");
201
+ const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
190
202
  if (!token && fs.existsSync(credentialsPath)) {
191
203
  try {
192
204
  const credentials = JSON.parse(fs.readFileSync(credentialsPath, "utf8"));
@@ -194,6 +206,14 @@ program
194
206
  }
195
207
  catch (err) { }
196
208
  }
209
+ // THE FIX: Defensive Self-Healing. If login exists but engine is missing, drop to OS.
210
+ if (!process.env.FLOWSTRIDE_API_KEY &&
211
+ token &&
212
+ !fs.existsSync(nodeModulesPath)) {
213
+ if (fs.existsSync(credentialsPath))
214
+ fs.unlinkSync(credentialsPath);
215
+ token = null;
216
+ }
197
217
  if (!token) {
198
218
  console.log(chalk_1.default.white("⚪ [OS]: (Local Mode / Not Logged In)"));
199
219
  return;
@@ -237,6 +257,7 @@ program
237
257
  let token = process.env.FLOWSTRIDE_API_KEY || null;
238
258
  let forceOS = false;
239
259
  const credentialsPath = path.join(process.cwd(), ".flowstride", "login", "login.json");
260
+ const nodeModulesPath = path.join(process.cwd(), "node_modules", "@flowstride", "pro");
240
261
  if (!token && fs.existsSync(credentialsPath)) {
241
262
  try {
242
263
  const credentials = JSON.parse(fs.readFileSync(credentialsPath, "utf8"));
@@ -244,6 +265,14 @@ program
244
265
  }
245
266
  catch (err) { }
246
267
  }
268
+ // THE FIX: Defensive Self-Healing
269
+ if (!process.env.FLOWSTRIDE_API_KEY &&
270
+ token &&
271
+ !fs.existsSync(nodeModulesPath)) {
272
+ if (fs.existsSync(credentialsPath))
273
+ fs.unlinkSync(credentialsPath);
274
+ token = null;
275
+ }
247
276
  if (!token) {
248
277
  console.log(chalk_1.default.white("⚪ [OS]: (Local Mode / Not Logged In)"));
249
278
  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.8",
4
4
  "description": "An opensource flowfirst test automation framework",
5
5
  "workspaces": [
6
6
  "packages/flowstride_report"