qatools-cli 1.1.9 → 1.1.10

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/package.json +1 -1
  2. package/qatools.js +31 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qatools-cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.10",
4
4
  "description": "CLI for QA Tools — requirements, epics, sprints, sessions, App Context sync, project agenda. The companion to qa-tools.com.",
5
5
  "scripts": {
6
6
  "release": "npm version patch --no-git-tag-version && npm publish",
package/qatools.js CHANGED
@@ -740,6 +740,36 @@ program
740
740
  process.exit(0);
741
741
  });
742
742
 
743
+ // Non-blocking: warn if a newer qatools-cli is published on npm (sync can't upgrade the tool itself)
744
+ function cmpVersion(a, b) {
745
+ const pa = String(a).split(".").map(Number), pb = String(b).split(".").map(Number);
746
+ for (let i = 0; i < 3; i++) { const d = (pa[i] || 0) - (pb[i] || 0); if (d) return d < 0 ? -1 : 1; }
747
+ return 0;
748
+ }
749
+ function checkCliVersion() {
750
+ return new Promise((resolve) => {
751
+ try {
752
+ const current = require("./package.json").version;
753
+ const req = require("https").get("https://registry.npmjs.org/qatools-cli/latest", { timeout: 3000 }, (res) => {
754
+ let body = "";
755
+ res.on("data", (c) => (body += c));
756
+ res.on("end", () => {
757
+ try {
758
+ const latest = JSON.parse(body).version;
759
+ if (latest && cmpVersion(current, latest) < 0) {
760
+ console.log(`\n⚠ A newer qatools-cli is available: ${current} → ${latest}`);
761
+ console.log(` Upgrade so commands, skills and rules are current: npm i -g qatools-cli@latest\n`);
762
+ }
763
+ } catch { /* malformed response — skip */ }
764
+ resolve();
765
+ });
766
+ });
767
+ req.on("error", () => resolve());
768
+ req.on("timeout", () => { req.destroy(); resolve(); });
769
+ } catch { resolve(); }
770
+ });
771
+ }
772
+
743
773
  program
744
774
  .command("sync")
745
775
  .description("Sync App Context from qa-tools into a CLAUDE.md block")
@@ -750,6 +780,7 @@ program
750
780
  .option("-e, --email <email>", "Login email")
751
781
  .option("-p, --password <password>", "Login password")
752
782
  .action(async (options) => {
783
+ await checkCliVersion();
753
784
  await authenticate(options);
754
785
  const creds = getCredentials();
755
786
  const projectId = options.project || creds?.projectId;