@abaplint/cli 2.119.41 → 2.119.43

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/build/cli.js +30 -19
  2. package/package.json +6 -5
package/build/cli.js CHANGED
@@ -29142,7 +29142,8 @@ class FieldChain {
29142
29142
  if (allowGenericDeference === false
29143
29143
  && (context === null || context === void 0 ? void 0 : context.isGeneric()) === true
29144
29144
  && input.scope.getVersion() < version_1.Version.v756
29145
- && input.scope.getVersion() !== version_1.Version.Cloud) {
29145
+ && input.scope.getVersion() !== version_1.Version.Cloud
29146
+ && input.scope.getVersion() !== version_1.Version.OpenABAP) {
29146
29147
  throw new Error("A generic reference cannot be dereferenced");
29147
29148
  }
29148
29149
  }
@@ -32154,9 +32155,23 @@ class Select {
32154
32155
  }
32155
32156
  }
32156
32157
  }
32158
+ static countResultType(scope) {
32159
+ if (scope.getVersion() >= version_1.Version.v750
32160
+ || scope.getVersion() === version_1.Version.OpenABAP
32161
+ || scope.getVersion() === version_1.Version.Cloud) {
32162
+ return new basic_1.Integer8Type();
32163
+ }
32164
+ else {
32165
+ return basic_1.IntegerType.get();
32166
+ }
32167
+ }
32157
32168
  static buildStructureType(fields, dbSources, scope) {
32158
32169
  var _a, _b, _c, _d, _e, _f;
32159
32170
  if (fields.length === 1 && dbSources.length === 1) {
32171
+ // COUNT( * ) yields an integer regardless of the (possibly dynamic) table
32172
+ if (/^count\(\s*\*\s*\)$/i.test(fields[0].code)) {
32173
+ return this.countResultType(scope);
32174
+ }
32160
32175
  const dbType = (_a = dbSources[0]) === null || _a === void 0 ? void 0 : _a.parseType(scope.getRegistry());
32161
32176
  if (dbType === undefined) {
32162
32177
  const name = ((_b = dbSources[0]) === null || _b === void 0 ? void 0 : _b.getName()) || "buildStructureTypeError";
@@ -32176,16 +32191,6 @@ class Select {
32176
32191
  if (field) {
32177
32192
  return field;
32178
32193
  }
32179
- else if (fields[0].code === "COUNT(*)") {
32180
- if (scope.getVersion() >= version_1.Version.v750
32181
- || scope.getVersion() === version_1.Version.OpenABAP
32182
- || scope.getVersion() === version_1.Version.Cloud) {
32183
- return new basic_1.Integer8Type();
32184
- }
32185
- else {
32186
- return basic_1.IntegerType.get();
32187
- }
32188
- }
32189
32194
  else {
32190
32195
  // todo: aggregated/calculated values
32191
32196
  return basic_1.VoidType.get("SELECT_todo11");
@@ -66582,7 +66587,7 @@ class Registry {
66582
66587
  }
66583
66588
  static abaplintVersion() {
66584
66589
  // magic, see build script "version.js"
66585
- return "2.119.41";
66590
+ return "2.119.43";
66586
66591
  }
66587
66592
  getDDICReferences() {
66588
66593
  return this.ddicReferences;
@@ -96133,6 +96138,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
96133
96138
  };
96134
96139
  Object.defineProperty(exports, "__esModule", ({ value: true }));
96135
96140
  const minimist_1 = __importDefault(__webpack_require__(/*! minimist */ "./node_modules/minimist/index.js"));
96141
+ const core_1 = __webpack_require__(/*! @abaplint/core */ "../core/build/src/index.js");
96136
96142
  const _1 = __webpack_require__(/*! . */ "./build/src/index.js");
96137
96143
  const parsed = (0, minimist_1.default)(process.argv.slice(2), { boolean: ["p", "c", "fix", "rename"] });
96138
96144
  let format = "standard";
@@ -96160,9 +96166,12 @@ const arg = {
96160
96166
  if (issues[0].getKey() === _1.GENERIC_ERROR) {
96161
96167
  process.exit(2); // eg. "git" does not exist in system
96162
96168
  }
96163
- else {
96169
+ else if (issues.some(i => i.getSeverity() === core_1.Severity.Error)) {
96164
96170
  process.exit(1);
96165
96171
  }
96172
+ else {
96173
+ process.exit(0); //only Warnings/ Infos
96174
+ }
96166
96175
  }
96167
96176
  else {
96168
96177
  process.exit();
@@ -96307,9 +96316,12 @@ class FileOperations {
96307
96316
  }
96308
96317
  fs.rmSync(dir, { recursive: true });
96309
96318
  }
96319
+ /** Normalize backslashes to forward slashes, keeping the drive letter so absolute
96320
+ * paths/glob patterns resolve on the correct drive (the path may be on a different
96321
+ * drive than the current working directory). */
96310
96322
  static toUnixPath(path) {
96311
96323
  if (os.platform() === "win32") {
96312
- return path.replace(/[\\/]+/g, "/").replace(/^([a-zA-Z]+:|\.\/)/, "");
96324
+ return path.replace(/[\\/]+/g, "/");
96313
96325
  }
96314
96326
  else {
96315
96327
  return path;
@@ -97355,14 +97367,13 @@ async function loadDependencies(config, compress, bar, base) {
97355
97367
  }
97356
97368
  if (d.url) {
97357
97369
  process.stderr.write("Clone: " + d.url + "\n");
97358
- let dir = fs.mkdtempSync(path.join(os.tmpdir(), "abaplint-"));
97359
- dir = file_operations_1.FileOperations.toUnixPath(dir);
97370
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "abaplint-"));
97360
97371
  let branch = "";
97361
97372
  if (d.branch) {
97362
97373
  branch = "-b " + d.branch + " ";
97363
97374
  }
97364
97375
  childProcess.execSync("git clone --quiet --depth 1 " + branch + d.url + " .", { cwd: dir, stdio: "inherit" });
97365
- const names = file_operations_1.FileOperations.loadFileNames(dir + d.files);
97376
+ const names = file_operations_1.FileOperations.loadFileNames(file_operations_1.FileOperations.toUnixPath(dir) + d.files);
97366
97377
  files = files.concat(await file_operations_1.FileOperations.loadFiles(compress, names, bar));
97367
97378
  file_operations_1.FileOperations.deleteFolderRecursive(dir);
97368
97379
  }
@@ -97589,8 +97600,8 @@ class Rename {
97589
97600
  continue;
97590
97601
  }
97591
97602
  for (const f of o.getFiles()) {
97592
- // yea, ffs
97593
- const n = outputFolder + f.getFilename().replace(myBase, "").replace("//?/C:", "");
97603
+ // strip the long-path prefix (Windows) then the drive-qualified base
97604
+ const n = outputFolder + f.getFilename().replace("//?/", "").replace(myBase, "");
97594
97605
  console.log("Write " + n);
97595
97606
  fs.mkdirSync(path.dirname(n), { recursive: true });
97596
97607
  fs.writeFileSync(n, f.getRaw());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/cli",
3
- "version": "2.119.41",
3
+ "version": "2.119.43",
4
4
  "description": "abaplint - Command Line Interface",
5
5
  "funding": "https://github.com/sponsors/larshp",
6
6
  "bin": {
@@ -8,11 +8,12 @@
8
8
  },
9
9
  "scripts": {
10
10
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
11
- "compile": "tsc",
11
+ "clean": "rm -rf build",
12
+ "compile": "npm run clean && tsc",
12
13
  "test": "npm run compile && mocha && npm run lint && npm run webpack",
13
14
  "webpack": "webpack --progress",
14
- "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
15
- "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
15
+ "publish:minor": "npm --no-git-tag-version version minor && npm run clean && npm install && npm run test && npm publish --access public",
16
+ "publish:patch": "npm --no-git-tag-version version patch && npm run clean && npm install && npm run test && npm publish --access public"
16
17
  },
17
18
  "mocha": {
18
19
  "recursive": true,
@@ -38,7 +39,7 @@
38
39
  },
39
40
  "homepage": "https://abaplint.org",
40
41
  "devDependencies": {
41
- "@abaplint/core": "^2.119.41",
42
+ "@abaplint/core": "^2.119.43",
42
43
  "@types/chai": "^4.3.20",
43
44
  "@types/minimist": "^1.2.5",
44
45
  "@types/mocha": "^10.0.10",