@getxflow/cli 0.10.1 → 0.10.2

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/dist/bin.js CHANGED
@@ -228,8 +228,12 @@ function nudge() {
228
228
  */
229
229
  function nudgeSkill() {
230
230
  const stale = (0, skills_1.staleSkillCopy)(process.cwd());
231
- if (stale === null)
231
+ if (stale === null) {
232
+ // Everything matches, so the day-long silence has nothing left to protect: drop it,
233
+ // and a copy that drifts after a repair is news again instead of yesterday's answer.
234
+ (0, state_1.clearSkillNudges)();
232
235
  return;
236
+ }
233
237
  const key = `${stale} ${version_1.CLI_VERSION}`;
234
238
  if (!(0, state_1.shouldNudgeSkill)(key))
235
239
  return;
@@ -167,12 +167,21 @@ function copyPaths(base) {
167
167
  return paths;
168
168
  }
169
169
  /**
170
- * Line endings are not a difference. An editor that saved a copy as CRLF would otherwise
171
- * leave the machine announcing a stale skill for ever, and the refresh that "fixes" it
172
- * would change nothing visible. Same normalisation the template gate uses.
170
+ * The stamp names the CLI version, so it moves on every release even when not a word of
171
+ * the instructions changed. Comparing it would call every copy on the machine stale after
172
+ * such a release, which is exactly what comparing content instead of versions avoids.
173
+ */
174
+ const STAMP = /^These instructions ship with xflow CLI .*$/m;
175
+ /**
176
+ * Line endings are not a difference either. An editor that saved a copy as CRLF would
177
+ * otherwise leave the machine announcing a stale skill for ever, and the refresh that
178
+ * "fixes" it would change nothing visible. Same normalisation the template gate uses.
173
179
  */
174
180
  function copyIsStale(expected, actual) {
175
- return expected.replace(/\r\n/g, '\n') !== actual.replace(/\r\n/g, '\n');
181
+ return compared(expected) !== compared(actual);
182
+ }
183
+ function compared(text) {
184
+ return text.replace(/\r\n/g, '\n').replace(STAMP, '');
176
185
  }
177
186
  /**
178
187
  * The first installed copy whose text is not what this CLI ships, or null when every
package/dist/state.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shouldNudge = shouldNudge;
4
4
  exports.shouldNudgeSkill = shouldNudgeSkill;
5
5
  exports.markSkillNudged = markSkillNudged;
6
+ exports.clearSkillNudges = clearSkillNudges;
6
7
  exports.markNudged = markNudged;
7
8
  const node_fs_1 = require("node:fs");
8
9
  const node_os_1 = require("node:os");
@@ -64,6 +65,16 @@ function markSkillNudged(key) {
64
65
  kept[key] = new Date(now).toISOString();
65
66
  write({ skillNudgedAt: kept });
66
67
  }
68
+ /**
69
+ * Forget what was said once there is nothing to repair. The window is for a copy nobody
70
+ * fixed, not for the memory of one that is fine now: without this, "warned, refreshed,
71
+ * drifted again" stays silent all day, because the key is the path and it is already marked.
72
+ */
73
+ function clearSkillNudges() {
74
+ if (Object.keys(read().skillNudgedAt ?? {}).length === 0)
75
+ return;
76
+ write({ skillNudgedAt: {} });
77
+ }
67
78
  function markNudged(version) {
68
79
  write({ nudgedVersion: version, nudgedAt: new Date().toISOString() });
69
80
  }
package/dist/version.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_API_URL = exports.CLI_VERSION = void 0;
4
4
  /** Keep in sync with cli/package.json. */
5
- exports.CLI_VERSION = '0.10.1';
5
+ exports.CLI_VERSION = '0.10.2';
6
6
  /** Overridden by XFLOW_API_URL or the `api` field in xflow.json. */
7
7
  exports.DEFAULT_API_URL = 'https://app.getxflow.com';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getxflow/cli",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "CLI for the XFlow platform: source sync, deployment and publishing of applications",
5
5
  "license": "UNLICENSED",
6
6
  "engines": {
@@ -24,7 +24,7 @@ contains the fix.
24
24
 
25
25
  ## Keeping these instructions current
26
26
 
27
- These instructions ship with xflow CLI 0.10.1. They travel inside the package, so the copy
27
+ These instructions ship with xflow CLI 0.10.2. They travel inside the package, so the copy
28
28
  you are reading can be older than the CLI answering your commands, and nothing about that
29
29
  is visible in the text itself.
30
30