sap-adt-cli 1.6.5 → 1.6.7

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/README.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # sap-adt-cli
2
2
 
3
+ The compatible **sap-adt** entry of **Watt — Power your SAP Engineering.**
4
+ Watt is an independent community SAP engineering CLI, not an official SAP
5
+ product or an embedded AI agent. ADT/ABAP is the current foundation, not its
6
+ long-term lifecycle boundary. Evidence first, explicit authorization and
7
+ traceable outcomes guide both entries.
8
+
9
+ New users can install `sap-watt` (`npm install -g "sap-watt@^1.6.7"` followed by
10
+ `sap-watt install`). This package continues to own only `sap-adt`; existing
11
+ scripts, configuration and credentials remain compatible. The npm packages
12
+ have separate runtime slots and do not overwrite each other's command.
13
+
3
14
  npm/npx channel for the self-contained **sap-adt** CLI (SAP ADT REST API:
4
15
  read/write ABAP source and metadata, transport request collection).
5
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sap-adt-cli",
3
- "version": "1.6.5",
3
+ "version": "1.6.7",
4
4
  "description": "Installer and launcher for the self-contained sap-adt CLI (SAP ADT REST API). No Python required; Node.js >=18 needed for this npm channel only.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,12 +1,12 @@
1
1
  {
2
- "cli_version": "1.6.5",
2
+ "cli_version": "1.6.7",
3
3
  "release_state": "published",
4
4
  "artifacts": {
5
5
  "darwin-aarch64": {
6
- "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.5/sap-adt-1.6.5-darwin-aarch64.tar.gz",
7
- "sha256": "0b1d96468050112cdb1d1e6cad7cf7bbb93251086b0e604d578c935bb2e9730a",
6
+ "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.7/sap-adt-1.6.7-darwin-aarch64.tar.gz",
7
+ "sha256": "0c52c98f2ebf2a507d04199b81fca380d67f6649f1fd096f989e6873fc8c2335",
8
8
  "format": "tar.gz",
9
- "size_bytes": 25300701,
9
+ "size_bytes": 25410924,
10
10
  "allowed_redirect_hosts": [
11
11
  "github.com",
12
12
  "release-assets.githubusercontent.com",
@@ -14,10 +14,10 @@
14
14
  ]
15
15
  },
16
16
  "darwin-x86_64": {
17
- "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.5/sap-adt-1.6.5-darwin-x86_64.tar.gz",
18
- "sha256": "7b573821321e88d26d9624e5062e0f70cce49f53895080aa9d6b54d9d9629919",
17
+ "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.7/sap-adt-1.6.7-darwin-x86_64.tar.gz",
18
+ "sha256": "8d86c25c17432392c29cc1621a7725ffc21bbd5a9d9de5bc0c5f854a4135f287",
19
19
  "format": "tar.gz",
20
- "size_bytes": 24243034,
20
+ "size_bytes": 24344121,
21
21
  "allowed_redirect_hosts": [
22
22
  "github.com",
23
23
  "release-assets.githubusercontent.com",
@@ -25,10 +25,10 @@
25
25
  ]
26
26
  },
27
27
  "linux-x86_64": {
28
- "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.5/sap-adt-1.6.5-linux-x86_64.tar.gz",
29
- "sha256": "a5906efb2077c922bfc415e0da235361a90d7483d8d4c3660b12776297176061",
28
+ "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.7/sap-adt-1.6.7-linux-x86_64.tar.gz",
29
+ "sha256": "f4ec78f2024e6980841552826bdd57639cb799a0b9a370605fa004fc5acdb89f",
30
30
  "format": "tar.gz",
31
- "size_bytes": 16756561,
31
+ "size_bytes": 16834630,
32
32
  "allowed_redirect_hosts": [
33
33
  "github.com",
34
34
  "release-assets.githubusercontent.com",
@@ -36,10 +36,10 @@
36
36
  ]
37
37
  },
38
38
  "windows-x86_64": {
39
- "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.5/sap-adt-1.6.5-windows-x86_64.zip",
40
- "sha256": "c2d5019696ada7afd029e8c5076db459381dbcff13604d171f3d2a6763314b39",
39
+ "url": "https://github.com/shrek-abaper/sap-engineering-skill/releases/download/sap-adt-v1.6.7/sap-adt-1.6.7-windows-x86_64.zip",
40
+ "sha256": "35e74e522df5a5ceef4ed364dec967b8f3603b54acd1f02bce0f57af82a37e7b",
41
41
  "format": "zip",
42
- "size_bytes": 15764403,
42
+ "size_bytes": 15841724,
43
43
  "allowed_redirect_hosts": [
44
44
  "github.com",
45
45
  "release-assets.githubusercontent.com",
@@ -33,9 +33,10 @@ const tls = require("node:tls");
33
33
  const { Transform } = require("node:stream");
34
34
  const { pipeline } = require("node:stream/promises");
35
35
  const { fileURLToPath } = require("node:url");
36
- const { findNpm, childEnv, installationHint, safeMessage } = require("./npm.js");
36
+ const { findNpm, childEnv, installationHint, safeMessage, packageIdentity } = require("./npm.js");
37
37
 
38
38
  const PKG_DIR = path.resolve(__dirname, "..");
39
+ const { command: COMMAND } = packageIdentity(PKG_DIR);
39
40
  const MAX_REDIRECTS = 3;
40
41
  // Node's core https client ignores HTTPS_PROXY before v24, so a blocked
41
42
  // direct route hung this wizard forever. Connection setup has a hard deadline;
@@ -64,13 +65,13 @@ function intEnv(name, fallback) {
64
65
  }
65
66
 
66
67
  function fail(message, code = 1) {
67
- process.stderr.write(`[sap-adt install] ERROR: ${safeMessage(message)}\n` +
68
+ process.stderr.write(`[${COMMAND} install] ERROR: ${safeMessage(message)}\n` +
68
69
  `Hint: ${message?.hint || installationHint(message)}\n`);
69
70
  process.exit(code);
70
71
  }
71
72
 
72
73
  function info(message) {
73
- process.stdout.write(`[sap-adt install] ${message}\n`);
74
+ process.stdout.write(`[${COMMAND} install] ${message}\n`);
74
75
  }
75
76
 
76
77
  function platformKey() {
@@ -564,7 +565,7 @@ function installTree(staging, runtimeDir, validate = () => {}) {
564
565
  try {
565
566
  fs.rmSync(backup, { recursive: true, force: true });
566
567
  } catch {
567
- process.stderr.write(`[sap-adt install] WARNING: verified runtime installed, but backup cleanup ` +
568
+ process.stderr.write(`[${COMMAND} install] WARNING: verified runtime installed, but backup cleanup ` +
568
569
  `failed at ${backup}. Close file handles and remove that backup after verification.\n`);
569
570
  }
570
571
  }
@@ -629,12 +630,12 @@ async function main() {
629
630
  version = verifyRuntime(path.join(installed, exeName));
630
631
  });
631
632
  info(`installed ${version || path.join(runtimeDir, exeName)}`);
632
- info("next: sap-adt configure (interactive; password goes to the OS keystore)");
633
+ info(`next: ${COMMAND} configure (interactive; password goes to the OS keystore)`);
633
634
  } finally {
634
635
  try {
635
636
  fs.rmSync(tmp, { recursive: true, force: true });
636
637
  } catch {
637
- process.stderr.write(`[sap-adt install] WARNING: temporary files remain at ${tmp}; ` +
638
+ process.stderr.write(`[${COMMAND} install] WARNING: temporary files remain at ${tmp}; ` +
638
639
  "close file handles and clean up that directory.\n");
639
640
  }
640
641
  }
package/scripts/npm.js CHANGED
@@ -3,6 +3,12 @@
3
3
  const fs = require("node:fs");
4
4
  const path = require("node:path");
5
5
 
6
+ function packageIdentity(root = path.resolve(__dirname, "..")) {
7
+ const { name } = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
8
+ if (!["sap-adt-cli", "sap-watt"].includes(name)) throw new Error("Unknown CLI package identity.");
9
+ return { name, command: name === "sap-watt" ? "sap-watt" : "sap-adt" };
10
+ }
11
+
6
12
  function findNpm(env = process.env) {
7
13
  const candidates = [
8
14
  env.npm_execpath,
@@ -32,7 +38,8 @@ function pythonFallback(platform = process.platform) {
32
38
  const python = platform === "win32" ? "py -3" : "python3";
33
39
  const venv = platform === "win32" ? ".venv-sap-adt\\Scripts\\python.exe" : ".venv-sap-adt/bin/python";
34
40
  return "Use Python >=3.10 in a separate virtual environment instead:\n" +
35
- `${python} -m venv .venv-sap-adt\n${venv} -m pip install "sap-adt-cli>=1.5.0,<2"`;
41
+ `${python} -m venv .venv-sap-adt\n${venv} -m pip install "` +
42
+ (packageIdentity().name === "sap-watt" ? "sap-watt>=1.6.7,<2" : "sap-adt-cli>=1.5.0,<2") + '"';
36
43
  }
37
44
 
38
45
  function safeMessage(value) {
@@ -92,4 +99,4 @@ function installationHint(error, platform = process.platform) {
92
99
  "SAP configuration is unchanged.";
93
100
  }
94
101
 
95
- module.exports = { findNpm, childEnv, pythonFallback, safeMessage, installationHint };
102
+ module.exports = { findNpm, childEnv, pythonFallback, safeMessage, installationHint, packageIdentity };
package/scripts/run.js CHANGED
@@ -14,9 +14,10 @@
14
14
  const { spawnSync } = require("node:child_process");
15
15
  const fs = require("node:fs");
16
16
  const path = require("node:path");
17
- const { pythonFallback, safeMessage, installationHint } = require("./npm.js");
17
+ const { pythonFallback, safeMessage, installationHint, packageIdentity } = require("./npm.js");
18
18
 
19
19
  const PKG_DIR = path.resolve(__dirname, "..");
20
+ const { name: PACKAGE, command: COMMAND } = packageIdentity(PKG_DIR);
20
21
 
21
22
  function platformKey() {
22
23
  const osMap = { linux: "linux", darwin: "darwin", win32: "windows" };
@@ -55,8 +56,8 @@ function main(argv) {
55
56
  }
56
57
  } catch { /* The install wizard diagnoses a missing or invalid manifest. */ }
57
58
  fail(
58
- `sap-adt runtime is not installed for ${platformKey()}.\n` +
59
- `Run the install wizard once: npx sap-adt-cli install\n` +
59
+ `${COMMAND} runtime is not installed for ${platformKey()}.\n` +
60
+ `Run the install wizard once: npx ${PACKAGE} install\n` +
60
61
  `(or: <this-bin> install). Nothing was downloaded or modified.`,
61
62
  2,
62
63
  );
@@ -78,7 +79,9 @@ function main(argv) {
78
79
  }
79
80
 
80
81
  // Argument array, no shell: exit code and both streams pass through.
81
- const result = spawnSync(bin, argv, { stdio: "inherit" });
82
+ const result = spawnSync(bin, argv, {
83
+ stdio: "inherit", env: { ...process.env, _SAP_ADT_COMMAND: COMMAND },
84
+ });
82
85
  if (result.error) {
83
86
  fail(`Failed to launch runtime at ${bin}: ${safeMessage(result.error)}\n` +
84
87
  installationHint({ code: result.error.code, message: "runtime self-test startup" }), 2);
package/scripts/update.js CHANGED
@@ -5,7 +5,7 @@ const os = require("node:os");
5
5
  const path = require("node:path");
6
6
  const { spawnSync } = require("node:child_process");
7
7
  const { installTree, npmEnvironment } = require("./install.js");
8
- const { findNpm, childEnv, installationHint } = require("./npm.js");
8
+ const { findNpm, childEnv, installationHint, packageIdentity } = require("./npm.js");
9
9
 
10
10
  function isUpdate(argv) {
11
11
  for (let i = 0; i < argv.length; i++) {
@@ -32,6 +32,7 @@ function checked(run, command, args, options) {
32
32
 
33
33
  function applyUpdate(root, npm, plan, run = spawnSync, environment = process.env) {
34
34
  const pkg = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
35
+ const { name: packageName, command } = packageIdentity(root);
35
36
  if (!plan || plan.root !== root || pkg.version !== plan.current ||
36
37
  !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(plan.target)) {
37
38
  throw new Error("Invalid update plan; nothing was changed.");
@@ -47,17 +48,17 @@ function applyUpdate(root, npm, plan, run = spawnSync, environment = process.env
47
48
  checked(run, process.execPath, [npm, "install", "--prefix", staging,
48
49
  "--global=false",
49
50
  "--ignore-scripts", "--no-audit", "--no-fund", "--no-package-lock",
50
- "--save-exact", `sap-adt-cli@${plan.target}`], options);
51
- const stagedPackage = path.join(staging, "node_modules", "sap-adt-cli");
51
+ "--save-exact", `${packageName}@${plan.target}`], options);
52
+ const stagedPackage = path.join(staging, "node_modules", packageName);
52
53
  const stagedMetadata = JSON.parse(fs.readFileSync(path.join(stagedPackage, "package.json"), "utf8"));
53
- if (stagedMetadata.name !== "sap-adt-cli" || stagedMetadata.version !== plan.target) {
54
+ if (stagedMetadata.name !== packageName || stagedMetadata.version !== plan.target) {
54
55
  throw new Error("Staged npm package version mismatch; the installed package was not changed.");
55
56
  }
56
57
  checked(run, process.execPath, [path.join(stagedPackage, "scripts", "install.js")], options);
57
58
  const stagedVersion = checked(run, process.execPath,
58
59
  [path.join(stagedPackage, "scripts", "run.js"), "--version"],
59
60
  { env, encoding: "utf8", timeout: 60_000 }).stdout.trim();
60
- if (stagedVersion !== `sap-adt, version ${plan.target}`) {
61
+ if (stagedVersion !== `${command}, version ${plan.target}`) {
61
62
  throw new Error("Staged runtime version mismatch; the installed package was not changed.");
62
63
  }
63
64
  // Check scope again immediately before the first change to the live install.
@@ -70,30 +71,30 @@ function applyUpdate(root, npm, plan, run = spawnSync, environment = process.env
70
71
  throw new Error("npm global root could not be verified; no update was committed.");
71
72
  }
72
73
  // Resolve prefix aliases, but do not authorize a symlinked package.
73
- if (path.join(canonicalGlobalRoot, "sap-adt-cli") !== fs.realpathSync(root)) {
74
+ if (path.join(canonicalGlobalRoot, packageName) !== fs.realpathSync(root)) {
74
75
  throw new Error("npm global root changed; the installed package was not changed.");
75
76
  }
76
77
  const live = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
77
- if (live.name !== "sap-adt-cli" || live.version !== plan.current) {
78
+ if (live.name !== packageName || live.version !== plan.current) {
78
79
  throw new Error("The installed npm package changed during staging; no update was committed.");
79
80
  }
80
81
  committing = true;
81
82
  checked(run, process.execPath, [npm, "install", "--global", "--ignore-scripts",
82
- "--no-audit", "--no-fund", `sap-adt-cli@${plan.target}`], options);
83
+ "--no-audit", "--no-fund", `${packageName}@${plan.target}`], options);
83
84
  const updated = JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8"));
84
- if (updated.name !== "sap-adt-cli" || updated.version !== plan.target) {
85
+ if (updated.name !== packageName || updated.version !== plan.target) {
85
86
  throw new Error("npm did not update the expected package directory.");
86
87
  }
87
88
  installTree(path.join(stagedPackage, "runtime"), path.join(root, "runtime"));
88
89
  const actual = checked(run, process.execPath, [path.join(root, "scripts", "run.js"), "--version"],
89
90
  { env, encoding: "utf8", timeout: 60_000 }).stdout.trim();
90
- if (actual !== `sap-adt, version ${plan.target}`) throw new Error("Final runtime version mismatch.");
91
- process.stdout.write(`Updated and verified sap-adt ${plan.target}.\n`);
91
+ if (actual !== `${command}, version ${plan.target}`) throw new Error("Final runtime version mismatch.");
92
+ process.stdout.write(`Updated and verified ${command} ${plan.target}.\n`);
92
93
  } catch (error) {
93
94
  if (committing) {
94
95
  error.needsInspection = true;
95
96
  error.message += " The npm package may already have changed; repair with npm install -g " +
96
- `"sap-adt-cli@${plan.target}" followed by sap-adt install. No full npm rollback is guaranteed.`;
97
+ `"${packageName}@${plan.target}" followed by ${command} install. No full npm rollback is guaranteed.`;
97
98
  }
98
99
  throw error;
99
100
  } finally {
@@ -109,6 +110,7 @@ function runUpdate(root, bin, argv) {
109
110
  stdio: ["inherit", "pipe", "inherit"], encoding: "utf8", maxBuffer: 1024 * 1024,
110
111
  timeout: 120_000, killSignal: "SIGKILL", windowsHide: true,
111
112
  env: { ...env, _SAP_ADT_UPDATE_LAUNCHER: "1",
113
+ _SAP_ADT_COMMAND: packageIdentity(root).command,
112
114
  _SAP_ADT_NPM_ROOT: root, _SAP_ADT_NPM_NODE: process.execPath, _SAP_ADT_NPM_CLI: npm },
113
115
  });
114
116
  if (result.error) throw new Error("Could not complete the runtime update check. " +