@ps-aux/nodebup 0.1.0 → 0.2.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.
Files changed (40) hide show
  1. package/README.md +0 -0
  2. package/lib/bup/AggregateBackupController.js +84 -0
  3. package/lib/cli/app.js +55 -0
  4. package/lib/cli/bin.js +2 -8
  5. package/lib/config/Config.js +58 -0
  6. package/lib/config/expandAndCreatePath.js +24 -0
  7. package/lib/config/validateConfigAgainstSchema.js +65 -0
  8. package/lib/config/validateConfigAgainstSchema.spec.js +29 -0
  9. package/lib/ctx/Context.js +23 -16
  10. package/lib/ctx/ContextSymbols.js +14 -0
  11. package/lib/fs/Fs.js +81 -0
  12. package/lib/fs/areDirsSame.js +20 -0
  13. package/lib/fs/areDirsSame.test.js +20 -0
  14. package/lib/fs/fssync/FsSync.spec.js +37 -0
  15. package/lib/fs/fssync/FsSyncer.js +54 -0
  16. package/lib/fs/path/Path.js +59 -0
  17. package/lib/fs/readYaml.js +20 -0
  18. package/lib/globald.d.js +3 -0
  19. package/lib/log/AppLogger.js +28 -0
  20. package/lib/log/MinimalLogger.js +10 -4
  21. package/lib/storage/StorageBackendProvider.js +53 -0
  22. package/lib/storage/local-file/LocalFileStorageBackend.js +22 -0
  23. package/lib/storage/restic/ResticClient.js +86 -0
  24. package/lib/storage/restic/ResticClient.spec.js +96 -0
  25. package/lib/storage/restic/ResticClientFactory.js +77 -0
  26. package/lib/storage/restic/ResticController.js +39 -0
  27. package/lib/storage/restic/ResticStorageBackend.js +23 -0
  28. package/lib/storage/types.d.js +5 -0
  29. package/lib/tools/gpg/Gpg.js +28 -0
  30. package/lib/tools/gpg/Gpg.spec.js +14 -0
  31. package/lib/tools/shell/Shell.js +52 -0
  32. package/lib/{shell → tools/shell}/shellCmd.js +4 -2
  33. package/lib/tools/ssh/SshKeyManager.js +36 -0
  34. package/lib/tools/ssh/SshKeyManager.spec.js +14 -0
  35. package/lib/types.js +5 -0
  36. package/package.json +53 -48
  37. package/lib/cli/entrypoint.js +0 -27
  38. package/lib/foo/foo.command.js +0 -16
  39. package/lib/shell/LocalShellCmdExecutor.js +0 -46
  40. package/lib/types.d.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ps-aux/nodebup",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "",
5
5
  "module": "lib/index.js",
6
6
  "main": "lib/index.js",
@@ -8,11 +8,13 @@
8
8
  "build": "rm -rf build && babel --extensions '.ts,.js' src -d lib src",
9
9
  "pub": "npm publish --access public",
10
10
  "test": "jest",
11
- "typecheck": "tsc --noEmit",
11
+ "tc": "tsc --noEmit",
12
12
  "format": "prettier \"**/*.{js,ts,tsx}\" --write",
13
13
  "build-n-run": "npm run build && ",
14
14
  "lint": "eslint '**/*.{js,ts,tsx}' --fix",
15
- "update-deps": "ncu --upgrade"
15
+ "update-deps": "ncu --upgrade",
16
+ "prepare": "husky install",
17
+ "pre-commit": "lint-staged"
16
18
  },
17
19
  "keywords": [],
18
20
  "author": "",
@@ -25,58 +27,61 @@
25
27
  },
26
28
  "typings": "src/types.d.ts",
27
29
  "devDependencies": {
28
- "@babel/cli": "^7.8.4",
29
- "@babel/core": "^7.8.7",
30
- "@babel/node": "^7.8.7",
31
- "@babel/plugin-proposal-class-properties": "^7.8.3",
32
- "@babel/plugin-proposal-object-rest-spread": "^7.8.3",
33
- "@babel/plugin-proposal-optional-chaining": "^7.8.3",
34
- "@babel/preset-env": "^7.8.7",
35
- "@babel/preset-typescript": "^7.8.3",
36
- "@types/jest": "^25.1.4",
37
- "@types/jest-when": "^2.7.0",
38
- "@types/node": "^13.9.0",
39
- "@types/ramda": "^0.26.43",
40
- "@typescript-eslint/eslint-plugin": "^2.23.0",
41
- "@typescript-eslint/parser": "^2.23.0",
42
- "babel-eslint": "^10.1.0",
43
- "babel-jest": "^25.1.0",
44
- "babel-plugin-module-resolver": "^4.0.0",
45
- "eslint": "^6.8.0",
46
- "eslint-config-standard": "^14.1.0",
47
- "eslint-plugin-import": "^2.20.1",
48
- "eslint-plugin-node": "^11.0.0",
49
- "eslint-plugin-prettier": "^3.1.2",
50
- "eslint-plugin-promise": "^4.2.1",
51
- "eslint-plugin-standard": "^4.0.1",
52
- "husky": "^4.2.3",
53
- "jest": "^25.1.0",
54
- "jest-when": "^2.7.0",
55
- "lint-staged": "^10.0.8",
56
- "npm-check-updates": "^4.0.4",
57
- "prettier": "^1.19.1",
58
- "typescript": "^3.8.3"
59
- },
60
- "husky": {
61
- "hooks": {
62
- "pre-commit": "lint-staged"
63
- }
30
+ "@babel/cli": "^7.16.0",
31
+ "@babel/core": "^7.16.5",
32
+ "@babel/eslint-parser": "^7.16.5",
33
+ "@babel/node": "^7.16.5",
34
+ "@babel/plugin-proposal-class-properties": "^7.16.5",
35
+ "@babel/plugin-proposal-decorators": "^7.16.5",
36
+ "@babel/plugin-proposal-object-rest-spread": "^7.16.5",
37
+ "@babel/plugin-proposal-optional-chaining": "^7.16.5",
38
+ "@babel/preset-env": "^7.16.5",
39
+ "@babel/preset-typescript": "^7.16.5",
40
+ "@types/jest": "^27.0.3",
41
+ "@types/jest-when": "^2.7.4",
42
+ "@types/node": "^17.0.5",
43
+ "@types/ramda": "^0.27.62",
44
+ "@typescript-eslint/eslint-plugin": "^5.8.1",
45
+ "@typescript-eslint/parser": "^5.8.1",
46
+ "babel-plugin-module-resolver": "^4.1.0",
47
+ "babel-plugin-transform-typescript-metadata": "^0.3.2",
48
+ "dir-compare": "^4.0.0",
49
+ "eslint": "^8.5.0",
50
+ "eslint-config-standard": "^16.0.3",
51
+ "eslint-plugin-import": "^2.25.3",
52
+ "eslint-plugin-node": "^11.1.0",
53
+ "eslint-plugin-prettier": "^4.0.0",
54
+ "eslint-plugin-promise": "^6.0.0",
55
+ "eslint-plugin-standard": "^5.0.0",
56
+ "husky": "^7.0.4",
57
+ "jest": "^27.4.5",
58
+ "jest-extended": "^1.2.0",
59
+ "jest-when": "^3.5.0",
60
+ "lint-staged": "^12.1.4",
61
+ "npm-check-updates": "^12.0.5",
62
+ "prettier": "^2.5.1",
63
+ "ts-jest": "^27.1.2",
64
+ "typescript": "^4.5.4"
64
65
  },
65
66
  "lint-staged": {
66
67
  "./**/*.{js,ts,tsx}": [
67
68
  "prettier --write",
68
- "eslint --fix",
69
- "git add"
69
+ "eslint --fix"
70
70
  ]
71
71
  },
72
72
  "dependencies": {
73
73
  "@hapi/joi": "^17.1.1",
74
- "@types/hapi__joi": "^16.0.12",
75
- "axios": "^0.19.2",
76
- "handlebars": "^4.7.3",
77
- "js-yaml": "^3.13.1",
78
- "ramda": "^0.27.0",
79
- "wait-on": "^4.0.1",
80
- "yargs": "^15.3.0"
74
+ "@ps-aux/nclif": "^0.0.6-alpha.2",
75
+ "@types/hapi__joi": "^17.1.8",
76
+ "axios": "^0.24.0",
77
+ "handlebars": "^4.7.7",
78
+ "inversify": "^6.0.1",
79
+ "js-yaml": "^4.1.0",
80
+ "pino": "^7.6.2",
81
+ "ramda": "^0.27.1",
82
+ "reflect-metadata": "^0.1.13",
83
+ "wait-on": "^6.0.0",
84
+ "yaml": "^1.10.2",
85
+ "yargs": "^17.3.1"
81
86
  }
82
87
  }
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _yargs = _interopRequireDefault(require("yargs"));
9
-
10
- var _foo = require("../foo/foo.command");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const entrypoint = ctx => {
15
- try {
16
- // eslint-disable-next-line no-unused-expressions
17
- _yargs.default.scriptName('bup').usage('$0 <cmd> [args]').command((0, _foo.fooCmd)()).alias('h', 'help').help() // https://github.com/yargs/yargs/issues/895#issuecomment-392893305
18
- .demandCommand().recommendCommands().strict().argv;
19
- } catch (err) {
20
- console.log(err);
21
- console.error('Error:', err.message);
22
- process.exit(1);
23
- }
24
- };
25
-
26
- var _default = entrypoint;
27
- exports.default = _default;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.fooCmd = void 0;
7
-
8
- const fooCmd = () => ({
9
- command: 'foo',
10
- describe: 'Do foo',
11
- handler: args => {
12
- console.log('haha'); // throw new Error('Assertion error')
13
- }
14
- });
15
-
16
- exports.fooCmd = fooCmd;
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.LocalShellCmdExecutor = void 0;
7
-
8
- var _MinimalLogger = require("../log/MinimalLogger");
9
-
10
- var _shellCmd = require("./shellCmd");
11
-
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
- class LocalShellCmdExecutor {
15
- constructor(log) {
16
- _defineProperty(this, "log", void 0);
17
-
18
- _defineProperty(this, "exec", cmd => {
19
- this.log.debug(cmd);
20
- (0, _shellCmd.shellCmd)(cmd, {
21
- returnStdout: false
22
- });
23
- });
24
-
25
- _defineProperty(this, "execWithStdIn", (cmd, stdin) => {
26
- this.log.debug(`"${stdin}" > ${cmd}`);
27
- (0, _shellCmd.shellCmd)(cmd, {
28
- stdin,
29
- returnStdout: false
30
- });
31
- });
32
-
33
- _defineProperty(this, "execAndReturnVal", (cmd, ops) => {
34
- this.log.debug(cmd, '[stdout consumed]');
35
- return (0, _shellCmd.shellCmd)(cmd, {
36
- returnStdout: true,
37
- ...ops
38
- });
39
- });
40
-
41
- this.log = log || (0, _MinimalLogger.minimalLogger)();
42
- }
43
-
44
- }
45
-
46
- exports.LocalShellCmdExecutor = LocalShellCmdExecutor;
package/lib/types.d.js DELETED
@@ -1 +0,0 @@
1
- "use strict";