@abaplint/cli 2.84.5 → 2.84.6

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.
@@ -7,6 +7,8 @@ const fs = require("fs");
7
7
  const file_operations_1 = require("./file_operations");
8
8
  class Rename {
9
9
  constructor(reg) {
10
+ this.deletedFiles = [];
11
+ this.addedFiles = [];
10
12
  this.reg = reg;
11
13
  }
12
14
  run(config, base) {
@@ -16,7 +18,21 @@ class Rename {
16
18
  }
17
19
  this.skip(rconfig);
18
20
  this.rename(rconfig);
19
- this.write(rconfig, base);
21
+ if (rconfig.output === undefined || rconfig.output === "") {
22
+ // write changes inline
23
+ this.deletedFiles.forEach(f => {
24
+ console.log("rm " + f);
25
+ fs.rmSync(f);
26
+ });
27
+ this.addedFiles.forEach(f => {
28
+ console.log("write " + f.getFilename());
29
+ fs.writeFileSync(f.getFilename(), f.getRaw());
30
+ });
31
+ }
32
+ else {
33
+ // output full registry contents to output folder
34
+ this.write(rconfig, base);
35
+ }
20
36
  }
21
37
  ////////////////////////
22
38
  write(rconfig, base) {
@@ -51,9 +67,11 @@ class Rename {
51
67
  if (!match) {
52
68
  continue;
53
69
  }
70
+ o.getFiles().forEach(f => this.deletedFiles.push(f.getFilename()));
54
71
  const newStr = o.getName().replace(regex, p.newName);
55
72
  console.log("Renaming " + o.getName().padEnd(30, " ") + " -> " + newStr);
56
73
  renamer.rename(o.getType(), o.getName(), newStr);
74
+ o.getFiles().forEach(f => this.addedFiles.push(f));
57
75
  }
58
76
  }
59
77
  }
package/package.json CHANGED
@@ -1,64 +1,64 @@
1
- {
2
- "name": "@abaplint/cli",
3
- "version": "2.84.5",
4
- "description": "abaplint - Command Line Interface",
5
- "bin": {
6
- "abaplint": "./abaplint"
7
- },
8
- "main": "./build/src/index.js",
9
- "types": "./build/src/index.d.ts",
10
- "scripts": {
11
- "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
12
- "compile": "tsc",
13
- "test": "npm run compile && mocha && npm run lint && npm run webpack",
14
- "webpack": "webpack --progress",
15
- "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
16
- "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
17
- },
18
- "mocha": {
19
- "recursive": true,
20
- "reporter": "progress",
21
- "spec": "./build/test/*.js",
22
- "require": "source-map-support/register"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/abaplint/abaplint.git"
27
- },
28
- "engines": {
29
- "node": ">=12.0.0"
30
- },
31
- "keywords": [
32
- "ABAP",
33
- "lint"
34
- ],
35
- "author": "Lars Hvam Petersen",
36
- "license": "MIT",
37
- "bugs": {
38
- "url": "https://github.com/abaplint/abaplint/issues"
39
- },
40
- "homepage": "https://abaplint.org",
41
- "devDependencies": {
42
- "@abaplint/core": "^2.84.5",
43
- "@types/chai": "^4.3.0",
44
- "@types/glob": "^7.2.0",
45
- "@types/minimist": "^1.2.2",
46
- "@types/mocha": "^9.1.0",
47
- "@types/node": "^17.0.12",
48
- "@types/progress": "^2.0.5",
49
- "chai": "^4.3.5",
50
- "chalk": "=4.1.2",
51
- "eslint": "^8.7.0",
52
- "glob": "^7.2.0",
53
- "json5": "^2.2.0",
54
- "memfs": "^3.4.1",
55
- "minimist": "^1.2.5",
56
- "mocha": "^9.2.0",
57
- "progress": "^2.0.3",
58
- "typescript": "^4.5.5",
59
- "webpack": "^5.67.0",
60
- "webpack-cli": "^4.9.2",
61
- "xml-js": "^1.6.11"
62
- },
63
- "dependencies": {}
64
- }
1
+ {
2
+ "name": "@abaplint/cli",
3
+ "version": "2.84.6",
4
+ "description": "abaplint - Command Line Interface",
5
+ "bin": {
6
+ "abaplint": "./abaplint"
7
+ },
8
+ "main": "./build/src/index.js",
9
+ "types": "./build/src/index.d.ts",
10
+ "scripts": {
11
+ "lint": "eslint src/**/*.ts test/**/*.ts --format unix",
12
+ "compile": "tsc",
13
+ "test": "npm run compile && mocha && npm run lint && npm run webpack",
14
+ "webpack": "webpack --progress",
15
+ "publish:minor": "npm --no-git-tag-version version minor && rm -rf build && npm install && npm run test && npm publish --access public",
16
+ "publish:patch": "npm --no-git-tag-version version patch && rm -rf build && npm install && npm run test && npm publish --access public"
17
+ },
18
+ "mocha": {
19
+ "recursive": true,
20
+ "reporter": "progress",
21
+ "spec": "./build/test/*.js",
22
+ "require": "source-map-support/register"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/abaplint/abaplint.git"
27
+ },
28
+ "engines": {
29
+ "node": ">=12.0.0"
30
+ },
31
+ "keywords": [
32
+ "ABAP",
33
+ "lint"
34
+ ],
35
+ "author": "Lars Hvam Petersen",
36
+ "license": "MIT",
37
+ "bugs": {
38
+ "url": "https://github.com/abaplint/abaplint/issues"
39
+ },
40
+ "homepage": "https://abaplint.org",
41
+ "devDependencies": {
42
+ "@abaplint/core": "^2.84.6",
43
+ "@types/chai": "^4.3.0",
44
+ "@types/glob": "^7.2.0",
45
+ "@types/minimist": "^1.2.2",
46
+ "@types/mocha": "^9.1.0",
47
+ "@types/node": "^17.0.12",
48
+ "@types/progress": "^2.0.5",
49
+ "chai": "^4.3.5",
50
+ "chalk": "=4.1.2",
51
+ "eslint": "^8.7.0",
52
+ "glob": "^7.2.0",
53
+ "json5": "^2.2.0",
54
+ "memfs": "^3.4.1",
55
+ "minimist": "^1.2.5",
56
+ "mocha": "^9.2.0",
57
+ "progress": "^2.0.3",
58
+ "typescript": "^4.5.5",
59
+ "webpack": "^5.67.0",
60
+ "webpack-cli": "^4.9.2",
61
+ "xml-js": "^1.6.11"
62
+ },
63
+ "dependencies": {}
64
+ }