@zokugun/artifact 0.4.0 → 0.4.1

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 (58) hide show
  1. package/README.md +0 -2
  2. package/lib/commands/add.js +2 -3
  3. package/lib/commands/list.js +1 -2
  4. package/lib/commands/update.js +2 -3
  5. package/lib/compositors/compose.js +1 -2
  6. package/lib/compositors/fork.js +1 -2
  7. package/lib/compositors/json.js +18 -9
  8. package/lib/compositors/map-sort.js +1 -2
  9. package/lib/compositors/rc.js +18 -9
  10. package/lib/compositors/yaml.js +18 -9
  11. package/lib/configs/install/read-install-config.js +1 -2
  12. package/lib/configs/install/update-install-config.js +1 -2
  13. package/lib/configs/install/write-install-config.js +3 -4
  14. package/lib/configs/package/read-package-config.js +1 -2
  15. package/lib/journeys/index.js +1 -2
  16. package/lib/parsers/json.js +2 -3
  17. package/lib/parsers/jsonc/parse.js +1 -2
  18. package/lib/parsers/jsonc/stringify.js +1 -2
  19. package/lib/parsers/yaml.js +2 -3
  20. package/lib/routes/command.js +1 -2
  21. package/lib/routes/lines-concat.js +1 -2
  22. package/lib/routes/list-concat.js +1 -2
  23. package/lib/routes/list-sort-concat.js +1 -2
  24. package/lib/routes/map-concat.js +1 -2
  25. package/lib/routes/overwrite.js +1 -2
  26. package/lib/routes/primitive.js +1 -2
  27. package/lib/steps/apply-formatting.js +3 -4
  28. package/lib/steps/configure-branches.js +1 -2
  29. package/lib/steps/configure-install-file-actions.js +1 -2
  30. package/lib/steps/configure-update-file-actions.js +1 -2
  31. package/lib/steps/copy-binary-files.js +3 -4
  32. package/lib/steps/execute-first-block.js +2 -3
  33. package/lib/steps/execute-next-block.js +1 -2
  34. package/lib/steps/index.js +5 -5
  35. package/lib/steps/insert-final-new-line.js +3 -4
  36. package/lib/steps/merge-text-files.js +5 -6
  37. package/lib/steps/read-editor-config.js +22 -13
  38. package/lib/steps/read-files.js +3 -4
  39. package/lib/steps/read-incoming-config.js +1 -2
  40. package/lib/steps/read-incoming-package.js +1 -2
  41. package/lib/steps/remove-files.js +3 -4
  42. package/lib/steps/replace-templates.js +3 -4
  43. package/lib/steps/validate-newer-package.js +3 -4
  44. package/lib/steps/validate-not-present-package.js +3 -4
  45. package/lib/steps/write-text-files.js +3 -4
  46. package/lib/types/format.js +1 -1
  47. package/lib/utils/build-journey-plan.js +1 -2
  48. package/lib/utils/build-travel-plan.js +1 -2
  49. package/lib/utils/command/join-command.js +1 -2
  50. package/lib/utils/command/split-command.js +1 -2
  51. package/lib/utils/dev-null.js +1 -2
  52. package/lib/utils/read-buffer.js +5 -8
  53. package/lib/utils/resolve-request.js +1 -2
  54. package/lib/utils/template.js +17 -7
  55. package/lib/utils/to-lines.js +1 -2
  56. package/lib/utils/trim-final-newline.js +1 -2
  57. package/lib/utils/try-json.js +1 -2
  58. package/package.json +4 -3
package/README.md CHANGED
@@ -45,8 +45,6 @@ Choose the install mode that fits your workflow:
45
45
  npx artifact --help
46
46
  ```
47
47
 
48
- Artifact requires [Node.js](http://nodejs.org) 18+.
49
-
50
48
  Quick Start
51
49
  -----------
52
50
 
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.add = void 0;
15
+ exports.add = add;
16
16
  const process_1 = __importDefault(require("process"));
17
17
  const ansi_colors_1 = require("ansi-colors");
18
18
  const npm_1 = __importDefault(require("npm"));
@@ -43,8 +43,8 @@ const { mainFlow } = (0, steps_1.composeSteps)([
43
43
  steps_1.steps.executeNextBlock,
44
44
  ]);
45
45
  function add(specs, inputOptions) {
46
- var _a, _b, _c;
47
46
  return __awaiter(this, void 0, void 0, function* () {
47
+ var _a, _b, _c;
48
48
  yield npm_1.default.load();
49
49
  const registry = npm_1.default.config.get('registry');
50
50
  const targetPath = process_1.default.env.INIT_CWD;
@@ -82,4 +82,3 @@ function add(specs, inputOptions) {
82
82
  }
83
83
  });
84
84
  }
85
- exports.add = add;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.list = void 0;
15
+ exports.list = list;
16
16
  const process_1 = __importDefault(require("process"));
17
17
  const lodash_1 = require("lodash");
18
18
  const configs_1 = require("../configs");
@@ -44,4 +44,3 @@ function list() {
44
44
  console.log();
45
45
  });
46
46
  }
47
- exports.list = list;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.update = void 0;
15
+ exports.update = update;
16
16
  const process_1 = __importDefault(require("process"));
17
17
  const ansi_colors_1 = require("ansi-colors");
18
18
  const lodash_1 = require("lodash");
@@ -44,8 +44,8 @@ const { mainFlow } = (0, steps_1.composeSteps)([
44
44
  steps_1.steps.executeNextBlock,
45
45
  ]);
46
46
  function update(inputOptions) {
47
- var _a, _b;
48
47
  return __awaiter(this, void 0, void 0, function* () {
48
+ var _a, _b;
49
49
  // @ts-expect-error log property isn't exposed
50
50
  npm_1.default.log.stream = (0, dev_null_1.createDevNull)();
51
51
  yield npm_1.default.load();
@@ -85,4 +85,3 @@ function update(inputOptions) {
85
85
  }
86
86
  });
87
87
  }
88
- exports.update = update;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.compose = void 0;
3
+ exports.compose = compose;
4
4
  const lodash_1 = require("lodash");
5
5
  function apply(map, keys, current, incoming, result) {
6
6
  var _a, _b;
@@ -50,4 +50,3 @@ function compose(map) {
50
50
  }
51
51
  };
52
52
  }
53
- exports.compose = compose;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fork = void 0;
3
+ exports.fork = fork;
4
4
  function fork(...cases) {
5
5
  return ({ current, incoming }) => {
6
6
  const targetCase = cases.find((c) => {
@@ -18,4 +18,3 @@ function fork(...cases) {
18
18
  return targetMerge({ current, incoming });
19
19
  };
20
20
  }
21
- exports.fork = fork;
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.json = void 0;
36
+ exports.json = json;
27
37
  const lodash_1 = require("lodash");
28
38
  const JSON = __importStar(require("../parsers/json"));
29
39
  const JSONC = __importStar(require("../parsers/jsonc"));
@@ -57,4 +67,3 @@ function json(...routes) {
57
67
  }
58
68
  };
59
69
  }
60
- exports.json = json;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapSort = void 0;
3
+ exports.mapSort = mapSort;
4
4
  const { compare } = new Intl.Collator('en');
5
5
  function mapSort(route) {
6
6
  return (args) => {
@@ -13,4 +13,3 @@ function mapSort(route) {
13
13
  return sorted;
14
14
  };
15
15
  }
16
- exports.mapSort = mapSort;
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.rc = void 0;
36
+ exports.rc = rc;
27
37
  const lodash_1 = require("lodash");
28
38
  const JSON = __importStar(require("../parsers/json"));
29
39
  const YAML = __importStar(require("../parsers/yaml"));
@@ -47,4 +57,3 @@ function rc(...routes) {
47
57
  }
48
58
  };
49
59
  }
50
- exports.rc = rc;
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.yaml = void 0;
36
+ exports.yaml = yaml;
27
37
  const lodash_1 = require("lodash");
28
38
  const YAML = __importStar(require("../parsers/yaml"));
29
39
  function fromYaml({ current, incoming, filters, ignores }) {
@@ -37,4 +47,3 @@ function fromYaml({ current, incoming, filters, ignores }) {
37
47
  function yaml(...routes) {
38
48
  return (0, lodash_1.flow)(fromYaml, ...routes, YAML.stringify);
39
49
  }
40
- exports.yaml = yaml;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readInstallConfig = void 0;
15
+ exports.readInstallConfig = readInstallConfig;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const yaml_1 = __importDefault(require("yaml"));
@@ -115,7 +115,6 @@ function readInstallConfig(targetPath) {
115
115
  }
116
116
  });
117
117
  }
118
- exports.readInstallConfig = readInstallConfig;
119
118
  function isOldInstallConfig(config) {
120
119
  return Array.isArray(config.artifacts);
121
120
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateInstallConfig = void 0;
3
+ exports.updateInstallConfig = updateInstallConfig;
4
4
  function updateInstallConfig(config, { name, version, provides, requires }) {
5
5
  const artifact = {
6
6
  version,
@@ -13,4 +13,3 @@ function updateInstallConfig(config, { name, version, provides, requires }) {
13
13
  }
14
14
  config.artifacts[name] = artifact;
15
15
  }
16
- exports.updateInstallConfig = updateInstallConfig;
@@ -12,15 +12,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.writeInstallConfig = void 0;
15
+ exports.writeInstallConfig = writeInstallConfig;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const lodash_1 = require("lodash");
19
19
  const yaml_1 = __importDefault(require("yaml"));
20
20
  const apply_formatting_1 = require("../../steps/apply-formatting");
21
21
  const insert_final_new_line_1 = require("../../steps/insert-final-new-line");
22
- function writeInstallConfig(config, { name, finalNewLine, type }, formats, targetPath, options) {
23
- return __awaiter(this, void 0, void 0, function* () {
22
+ function writeInstallConfig(config_1, _a, formats_1, targetPath_1, options_1) {
23
+ return __awaiter(this, arguments, void 0, function* (config, { name, finalNewLine, type }, formats, targetPath, options) {
24
24
  const exported = {
25
25
  artifacts: config.artifacts,
26
26
  };
@@ -41,4 +41,3 @@ function writeInstallConfig(config, { name, finalNewLine, type }, formats, targe
41
41
  }
42
42
  });
43
43
  }
44
- exports.writeInstallConfig = writeInstallConfig;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readPackageConfig = void 0;
15
+ exports.readPackageConfig = readPackageConfig;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const yaml_1 = __importDefault(require("yaml"));
@@ -75,4 +75,3 @@ function readPackageConfig(targetPath) {
75
75
  return config;
76
76
  });
77
77
  }
78
- exports.readPackageConfig = readPackageConfig;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getJourney = void 0;
6
+ exports.getJourney = getJourney;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const commitlint_1 = __importDefault(require("./commitlint"));
9
9
  const config_ts_1 = __importDefault(require("./config.ts"));
@@ -37,4 +37,3 @@ function getJourney(filename) {
37
37
  }
38
38
  return undefined;
39
39
  }
40
- exports.getJourney = getJourney;
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringify = exports.parse = void 0;
3
+ exports.parse = parse;
4
+ exports.stringify = stringify;
4
5
  function parse(data) {
5
6
  return JSON.parse(data);
6
7
  }
7
- exports.parse = parse;
8
8
  function stringify(data) {
9
9
  return JSON.stringify(data, null, '\t');
10
10
  }
11
- exports.stringify = stringify;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parse = void 0;
3
+ exports.parse = parse;
4
4
  const jsonc_parser_1 = require("jsonc-parser");
5
5
  function parse(text) {
6
6
  if (!text) {
@@ -191,4 +191,3 @@ function parse(text) {
191
191
  transform,
192
192
  };
193
193
  }
194
- exports.parse = parse;
@@ -1,12 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringify = void 0;
3
+ exports.stringify = stringify;
4
4
  const lodash_1 = require("lodash");
5
5
  function stringify(data, transform = {}) {
6
6
  const result = format(data, '', transform);
7
7
  return result;
8
8
  }
9
- exports.stringify = stringify;
10
9
  function format(data, indentValue, transform, separator = false) {
11
10
  var _a;
12
11
  let result;
@@ -3,13 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.stringify = exports.parse = void 0;
6
+ exports.parse = parse;
7
+ exports.stringify = stringify;
7
8
  const yaml_1 = __importDefault(require("yaml"));
8
9
  function parse(data) {
9
10
  return yaml_1.default.parse(data);
10
11
  }
11
- exports.parse = parse;
12
12
  function stringify(data) {
13
13
  return yaml_1.default.stringify(data);
14
14
  }
15
- exports.stringify = stringify;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.command = void 0;
3
+ exports.command = command;
4
4
  const command_1 = require("../utils/command");
5
5
  const list_concat_1 = require("./list-concat");
6
6
  function command({ current, incoming }) {
@@ -43,4 +43,3 @@ function command({ current, incoming }) {
43
43
  }
44
44
  return (0, command_1.joinCommand)(result);
45
45
  }
46
- exports.command = command;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.linesConcat = void 0;
3
+ exports.linesConcat = linesConcat;
4
4
  const to_lines_1 = require("../utils/to-lines");
5
5
  const trim_final_newline_1 = require("../utils/trim-final-newline");
6
6
  const list_concat_1 = require("./list-concat");
@@ -19,4 +19,3 @@ function linesConcat({ current, incoming }) {
19
19
  });
20
20
  return result.join('\n');
21
21
  }
22
- exports.linesConcat = linesConcat;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.listConcat = void 0;
6
+ exports.listConcat = listConcat;
7
7
  const isEqual_1 = __importDefault(require("lodash/isEqual"));
8
8
  const uniqWith_1 = __importDefault(require("lodash/uniqWith"));
9
9
  function listConcat({ current, incoming }) {
@@ -15,4 +15,3 @@ function listConcat({ current, incoming }) {
15
15
  }
16
16
  return (0, uniqWith_1.default)([...current, ...incoming], isEqual_1.default);
17
17
  }
18
- exports.listConcat = listConcat;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listSortConcat = void 0;
3
+ exports.listSortConcat = listSortConcat;
4
4
  function listSortConcat({ current, incoming }) {
5
5
  if (!incoming) {
6
6
  return current !== null && current !== void 0 ? current : [];
@@ -39,4 +39,3 @@ function listSortConcat({ current, incoming }) {
39
39
  const result = sorting.map((weight) => weight2values[weight]);
40
40
  return result;
41
41
  }
42
- exports.listSortConcat = listSortConcat;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapConcat = void 0;
3
+ exports.mapConcat = mapConcat;
4
4
  function mapConcat({ current, incoming }) {
5
5
  if (!incoming) {
6
6
  return current !== null && current !== void 0 ? current : {};
@@ -10,4 +10,3 @@ function mapConcat({ current, incoming }) {
10
10
  }
11
11
  return Object.assign(Object.assign({}, current), incoming);
12
12
  }
13
- exports.mapConcat = mapConcat;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.overwrite = void 0;
3
+ exports.overwrite = overwrite;
4
4
  function overwrite({ current, incoming }) {
5
5
  if (typeof incoming === 'undefined') {
6
6
  return current !== null && current !== void 0 ? current : [];
@@ -9,4 +9,3 @@ function overwrite({ current, incoming }) {
9
9
  return incoming;
10
10
  }
11
11
  }
12
- exports.overwrite = overwrite;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.primitive = void 0;
3
+ exports.primitive = primitive;
4
4
  function primitive({ current, incoming }) {
5
5
  if (typeof incoming === 'undefined') {
6
6
  return current !== null && current !== void 0 ? current : [];
@@ -15,4 +15,3 @@ function primitive({ current, incoming }) {
15
15
  return incoming;
16
16
  }
17
17
  }
18
- exports.primitive = primitive;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.applyFormatting = void 0;
15
+ exports.applyFormatting = applyFormatting;
16
16
  const detect_indent_1 = __importDefault(require("detect-indent"));
17
17
  const fnmatch_1 = __importDefault(require("editorconfig/src/lib/fnmatch"));
18
18
  const format_1 = require("../types/format");
@@ -63,8 +63,8 @@ function indentWithTab(data) {
63
63
  return data;
64
64
  }
65
65
  } // }}}
66
- function applyFormatting({ mergedTextFiles, formats }) {
67
- return __awaiter(this, void 0, void 0, function* () {
66
+ function applyFormatting(_a) {
67
+ return __awaiter(this, arguments, void 0, function* ({ mergedTextFiles, formats }) {
68
68
  for (const file of mergedTextFiles) {
69
69
  for (const format of formats) {
70
70
  if (fnmatch(file.name, format.glob)) {
@@ -75,4 +75,3 @@ function applyFormatting({ mergedTextFiles, formats }) {
75
75
  }
76
76
  });
77
77
  }
78
- exports.applyFormatting = applyFormatting;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.configureBranches = void 0;
15
+ exports.configureBranches = configureBranches;
16
16
  const node_path_1 = __importDefault(require("node:path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const globby_1 = __importDefault(require("globby"));
@@ -67,4 +67,3 @@ function configureBranches(context) {
67
67
  }
68
68
  });
69
69
  }
70
- exports.configureBranches = configureBranches;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.configureInstallFileActions = void 0;
12
+ exports.configureInstallFileActions = configureInstallFileActions;
13
13
  const lodash_1 = require("lodash");
14
14
  const micromatch_1 = require("micromatch");
15
15
  const compositors_1 = require("../compositors");
@@ -149,4 +149,3 @@ function configureInstallFileActions(context) {
149
149
  }
150
150
  });
151
151
  }
152
- exports.configureInstallFileActions = configureInstallFileActions;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.configureUpdateFileActions = void 0;
12
+ exports.configureUpdateFileActions = configureUpdateFileActions;
13
13
  const lodash_1 = require("lodash");
14
14
  const micromatch_1 = require("micromatch");
15
15
  const compositors_1 = require("../compositors");
@@ -157,4 +157,3 @@ function configureUpdateFileActions(context) {
157
157
  }
158
158
  });
159
159
  }
160
- exports.configureUpdateFileActions = configureUpdateFileActions;
@@ -12,11 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.copyBinaryFiles = void 0;
15
+ exports.copyBinaryFiles = copyBinaryFiles;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
- function copyBinaryFiles({ binaryFiles, incomingPath, targetPath, onExisting, onMissing, options }) {
19
- return __awaiter(this, void 0, void 0, function* () {
18
+ function copyBinaryFiles(_a) {
19
+ return __awaiter(this, arguments, void 0, function* ({ binaryFiles, incomingPath, targetPath, onExisting, onMissing, options }) {
20
20
  const cwd = path_1.default.join(incomingPath, 'configs');
21
21
  for (const file of binaryFiles) {
22
22
  const source = path_1.default.join(cwd, file.source);
@@ -48,4 +48,3 @@ function copyBinaryFiles({ binaryFiles, incomingPath, targetPath, onExisting, on
48
48
  }
49
49
  });
50
50
  }
51
- exports.copyBinaryFiles = copyBinaryFiles;
@@ -12,13 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.executeFirstBlock = void 0;
15
+ exports.executeFirstBlock = executeFirstBlock;
16
16
  const node_path_1 = __importDefault(require("node:path"));
17
17
  const lodash_1 = require("lodash");
18
18
  const configs_1 = require("../configs");
19
19
  function executeFirstBlock(context) {
20
- var _a, _b, _c, _d;
21
20
  return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b, _c, _d;
22
22
  const { name, version } = context.incomingPackage;
23
23
  const root = String((_b = (_a = context.incomingConfig.variants) === null || _a === void 0 ? void 0 : _a.root) !== null && _b !== void 0 ? _b : '');
24
24
  if (context.incomingVariant) {
@@ -91,7 +91,6 @@ function executeFirstBlock(context) {
91
91
  }
92
92
  });
93
93
  }
94
- exports.executeFirstBlock = executeFirstBlock;
95
94
  function pushToResult(name, version, variant, alias, context) {
96
95
  var _a, _b;
97
96
  var _c;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.executeNextBlock = void 0;
12
+ exports.executeNextBlock = executeNextBlock;
13
13
  const lodash_1 = require("lodash");
14
14
  function executeNextBlock(context) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -20,4 +20,3 @@ function executeNextBlock(context) {
20
20
  }
21
21
  });
22
22
  }
23
- exports.executeNextBlock = executeNextBlock;
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.composeSteps = exports.steps = void 0;
12
+ exports.steps = void 0;
13
+ exports.composeSteps = composeSteps;
13
14
  const apply_formatting_1 = require("./apply-formatting");
14
15
  const configure_branches_1 = require("./configure-branches");
15
16
  const configure_install_file_actions_1 = require("./configure-install-file-actions");
@@ -81,12 +82,12 @@ function composeSteps(validations, processes) {
81
82
  });
82
83
  const commonFlow = (name, version, variant, branch, incomingPath, mainContext) => __awaiter(this, void 0, void 0, function* () {
83
84
  if (mainContext.options.verbose) {
84
- let message = `--> ${name}@${version}`;
85
+ let message = `\n---> ${name} version=${version}`;
85
86
  if (variant) {
86
- message += `:${variant}`;
87
+ message += ` variant=${variant}`;
87
88
  }
88
89
  if (branch) {
89
- message += `(${branch})`;
90
+ message += ` branch=${branch}`;
90
91
  }
91
92
  console.log(message);
92
93
  }
@@ -102,4 +103,3 @@ function composeSteps(validations, processes) {
102
103
  });
103
104
  return { mainFlow, commonFlow };
104
105
  }
105
- exports.composeSteps = composeSteps;
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.insertFinalNewLine = void 0;
13
- function insertFinalNewLine({ mergedTextFiles }) {
14
- return __awaiter(this, void 0, void 0, function* () {
12
+ exports.insertFinalNewLine = insertFinalNewLine;
13
+ function insertFinalNewLine(_a) {
14
+ return __awaiter(this, arguments, void 0, function* ({ mergedTextFiles }) {
15
15
  for (const file of mergedTextFiles) {
16
16
  if (file.finalNewLine) {
17
17
  const withFinalNewLine = file.data.endsWith('\n');
@@ -22,4 +22,3 @@ function insertFinalNewLine({ mergedTextFiles }) {
22
22
  }
23
23
  });
24
24
  }
25
- exports.insertFinalNewLine = insertFinalNewLine;
@@ -12,18 +12,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.mergeTextFiles = void 0;
15
+ exports.mergeTextFiles = mergeTextFiles;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const journeys_1 = require("../journeys");
19
- function mergeTextFiles({ targetPath, textFiles, mergedTextFiles, onExisting, onMissing, filters, routes, options }) {
20
- var _a;
21
- return __awaiter(this, void 0, void 0, function* () {
19
+ function mergeTextFiles(_a) {
20
+ return __awaiter(this, arguments, void 0, function* ({ targetPath, textFiles, mergedTextFiles, onExisting, onMissing, filters, routes, options }) {
21
+ var _b;
22
22
  for (const file of textFiles) {
23
23
  if (options.verbose) {
24
24
  console.log(`${file.name} is going to be merged`);
25
25
  }
26
- const journey = (_a = routes(file.name)) !== null && _a !== void 0 ? _a : (0, journeys_1.getJourney)(file.name);
26
+ const journey = (_b = routes(file.name)) !== null && _b !== void 0 ? _b : (0, journeys_1.getJourney)(file.name);
27
27
  if (!journey) {
28
28
  if (options.verbose) {
29
29
  console.log(`${file.name}, no merger has been found`);
@@ -105,4 +105,3 @@ function mergeTextFiles({ targetPath, textFiles, mergedTextFiles, onExisting, on
105
105
  }
106
106
  });
107
107
  }
108
- exports.mergeTextFiles = mergeTextFiles;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
36
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
37
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
35
45
  return (mod && mod.__esModule) ? mod : { "default": mod };
36
46
  };
37
47
  Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.readEditorConfig = void 0;
48
+ exports.readEditorConfig = readEditorConfig;
39
49
  const path_1 = __importDefault(require("path"));
40
50
  const editorconfig = __importStar(require("editorconfig"));
41
51
  const fs_extra_1 = __importDefault(require("fs-extra"));
@@ -53,22 +63,22 @@ function buildFullGlob(glob) {
53
63
  }
54
64
  return glob.replace(/\*\*/g, '{*,**/**/**}');
55
65
  } // }}}
56
- function readEditorConfig({ incomingPath, targetPath, formats }) {
57
- return __awaiter(this, void 0, void 0, function* () {
66
+ function readEditorConfig(_a) {
67
+ return __awaiter(this, arguments, void 0, function* ({ incomingPath, targetPath, formats }) {
58
68
  let data;
59
69
  try {
60
70
  const dir = path_1.default.join(incomingPath, 'configs');
61
71
  const file = path_1.default.join(dir, '.editorconfig');
62
72
  data = yield fs_extra_1.default.readFile(file, 'utf-8');
63
73
  }
64
- catch (_a) {
74
+ catch (_b) {
65
75
  }
66
76
  if (!data) {
67
77
  try {
68
78
  const file = path_1.default.join(targetPath, '.editorconfig');
69
79
  data = yield fs_extra_1.default.readFile(file, 'utf-8');
70
80
  }
71
- catch (_b) {
81
+ catch (_c) {
72
82
  }
73
83
  }
74
84
  if (!data) {
@@ -98,4 +108,3 @@ function readEditorConfig({ incomingPath, targetPath, formats }) {
98
108
  formats.reverse();
99
109
  });
100
110
  }
101
- exports.readEditorConfig = readEditorConfig;
@@ -12,14 +12,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readFiles = void 0;
15
+ exports.readFiles = readFiles;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const globby_1 = __importDefault(require("globby"));
19
19
  const istextorbinary_1 = require("istextorbinary");
20
20
  const read_buffer_1 = require("../utils/read-buffer");
21
- function readFiles({ incomingPath, textFiles, binaryFiles, options }) {
22
- return __awaiter(this, void 0, void 0, function* () {
21
+ function readFiles(_a) {
22
+ return __awaiter(this, arguments, void 0, function* ({ incomingPath, textFiles, binaryFiles, options }) {
23
23
  const cwd = path_1.default.join(incomingPath, 'configs');
24
24
  const files = yield (0, globby_1.default)(['**/*', '!**/*.lock', '!**/*-lock.*'], {
25
25
  cwd,
@@ -66,4 +66,3 @@ function readFiles({ incomingPath, textFiles, binaryFiles, options }) {
66
66
  }
67
67
  });
68
68
  }
69
- exports.readFiles = readFiles;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.readIncomingConfig = void 0;
12
+ exports.readIncomingConfig = readIncomingConfig;
13
13
  const configs_1 = require("../configs");
14
14
  function readIncomingConfig(context) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -22,4 +22,3 @@ function readIncomingConfig(context) {
22
22
  }
23
23
  });
24
24
  }
25
- exports.readIncomingConfig = readIncomingConfig;
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readIncomingPackage = void 0;
15
+ exports.readIncomingPackage = readIncomingPackage;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const lodash_1 = require("lodash");
@@ -26,7 +26,6 @@ function readIncomingPackage(context) {
26
26
  context.incomingPackage = incomingPackage;
27
27
  });
28
28
  }
29
- exports.readIncomingPackage = readIncomingPackage;
30
29
  function isPackageManifest(value) {
31
30
  if ((0, lodash_1.isNil)(value) || !(0, lodash_1.isPlainObject)(value)) {
32
31
  return false;
@@ -12,13 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.removeFiles = void 0;
15
+ exports.removeFiles = removeFiles;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
18
  const globby_1 = __importDefault(require("globby"));
19
19
  const micromatch_1 = require("micromatch");
20
- function removeFiles({ removedPatterns, targetPath, options }) {
21
- return __awaiter(this, void 0, void 0, function* () {
20
+ function removeFiles(_a) {
21
+ return __awaiter(this, arguments, void 0, function* ({ removedPatterns, targetPath, options }) {
22
22
  if (removedPatterns.length === 0) {
23
23
  return;
24
24
  }
@@ -38,4 +38,3 @@ function removeFiles({ removedPatterns, targetPath, options }) {
38
38
  }
39
39
  });
40
40
  }
41
- exports.removeFiles = removeFiles;
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.replaceTemplates = void 0;
12
+ exports.replaceTemplates = replaceTemplates;
13
13
  const template_1 = require("../utils/template");
14
- function replaceTemplates({ textFiles, binaryFiles, targetPath }) {
15
- return __awaiter(this, void 0, void 0, function* () {
14
+ function replaceTemplates(_a) {
15
+ return __awaiter(this, arguments, void 0, function* ({ textFiles, binaryFiles, targetPath }) {
16
16
  const engine = new template_1.TemplateEngine(targetPath);
17
17
  for (const file of textFiles) {
18
18
  file.data = engine.render(file.data);
@@ -23,4 +23,3 @@ function replaceTemplates({ textFiles, binaryFiles, targetPath }) {
23
23
  }
24
24
  });
25
25
  }
26
- exports.replaceTemplates = replaceTemplates;
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.validateNewerPackage = void 0;
12
+ exports.validateNewerPackage = validateNewerPackage;
13
13
  const semver_1 = require("semver");
14
- function validateNewerPackage({ incomingPackage, config, options }) {
15
- return __awaiter(this, void 0, void 0, function* () {
14
+ function validateNewerPackage(_a) {
15
+ return __awaiter(this, arguments, void 0, function* ({ incomingPackage, config, options }) {
16
16
  if (options.force) {
17
17
  return;
18
18
  }
@@ -22,4 +22,3 @@ function validateNewerPackage({ incomingPackage, config, options }) {
22
22
  }
23
23
  });
24
24
  }
25
- exports.validateNewerPackage = validateNewerPackage;
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.validateNotPresentPackage = void 0;
13
- function validateNotPresentPackage({ incomingPackage, config, options }) {
14
- return __awaiter(this, void 0, void 0, function* () {
12
+ exports.validateNotPresentPackage = validateNotPresentPackage;
13
+ function validateNotPresentPackage(_a) {
14
+ return __awaiter(this, arguments, void 0, function* ({ incomingPackage, config, options }) {
15
15
  if (options.force) {
16
16
  return;
17
17
  }
@@ -30,4 +30,3 @@ function validateNotPresentPackage({ incomingPackage, config, options }) {
30
30
  }
31
31
  });
32
32
  }
33
- exports.validateNotPresentPackage = validateNotPresentPackage;
@@ -12,11 +12,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.writeTextFiles = void 0;
15
+ exports.writeTextFiles = writeTextFiles;
16
16
  const path_1 = __importDefault(require("path"));
17
17
  const fs_extra_1 = __importDefault(require("fs-extra"));
18
- function writeTextFiles({ mergedTextFiles, targetPath, options }) {
19
- return __awaiter(this, void 0, void 0, function* () {
18
+ function writeTextFiles(_a) {
19
+ return __awaiter(this, arguments, void 0, function* ({ mergedTextFiles, targetPath, options }) {
20
20
  for (const file of mergedTextFiles) {
21
21
  const filePath = path_1.default.join(targetPath, file.name);
22
22
  yield fs_extra_1.default.outputFile(filePath, file.data, 'utf-8');
@@ -29,4 +29,3 @@ function writeTextFiles({ mergedTextFiles, targetPath, options }) {
29
29
  }
30
30
  });
31
31
  }
32
- exports.writeTextFiles = writeTextFiles;
@@ -5,4 +5,4 @@ var IndentStyle;
5
5
  (function (IndentStyle) {
6
6
  IndentStyle["SPACE"] = "space";
7
7
  IndentStyle["TAB"] = "tab";
8
- })(IndentStyle = exports.IndentStyle || (exports.IndentStyle = {}));
8
+ })(IndentStyle || (exports.IndentStyle = IndentStyle = {}));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildJourneyPlan = void 0;
3
+ exports.buildJourneyPlan = buildJourneyPlan;
4
4
  function buildJourneyPlan(plan, alias) {
5
5
  return (basename) => {
6
6
  const travel = plan(basename);
@@ -15,4 +15,3 @@ function buildJourneyPlan(plan, alias) {
15
15
  }
16
16
  };
17
17
  }
18
- exports.buildJourneyPlan = buildJourneyPlan;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildTravelPlan = void 0;
3
+ exports.buildTravelPlan = buildTravelPlan;
4
4
  function buildTravelPlan(...mappers) {
5
5
  return (basename) => {
6
6
  const mapper = mappers.find((mapper) => {
@@ -17,4 +17,3 @@ function buildTravelPlan(...mappers) {
17
17
  }
18
18
  };
19
19
  }
20
- exports.buildTravelPlan = buildTravelPlan;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.joinCommand = void 0;
3
+ exports.joinCommand = joinCommand;
4
4
  function joinCommand(commands) {
5
5
  const subcommands = [];
6
6
  for (const [key, values] of Object.entries(commands)) {
@@ -29,4 +29,3 @@ function joinCommand(commands) {
29
29
  }
30
30
  return subcommands.join(' ');
31
31
  }
32
- exports.joinCommand = joinCommand;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitCommand = void 0;
3
+ exports.splitCommand = splitCommand;
4
4
  const lodash_1 = require("lodash");
5
5
  function splitCommand(command) {
6
6
  const result = {};
@@ -29,4 +29,3 @@ function splitCommand(command) {
29
29
  }
30
30
  return result;
31
31
  }
32
- exports.splitCommand = splitCommand;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDevNull = void 0;
3
+ exports.createDevNull = createDevNull;
4
4
  const fs_1 = require("fs");
5
5
  function createDevNull() {
6
6
  return (0, fs_1.createWriteStream)('/dev/null');
7
7
  }
8
- exports.createDevNull = createDevNull;
@@ -12,19 +12,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.readBuffer = void 0;
15
+ exports.readBuffer = readBuffer;
16
16
  const buffer_1 = require("buffer");
17
17
  const promises_1 = __importDefault(require("fs/promises"));
18
- function readBuffer(filepath, size, offset = 0) {
19
- return __awaiter(this, void 0, void 0, function* () {
18
+ function readBuffer(filepath_1, size_1) {
19
+ return __awaiter(this, arguments, void 0, function* (filepath, size, offset = 0) {
20
20
  const buffer = buffer_1.Buffer.alloc(size);
21
21
  const file = yield promises_1.default.open(filepath, 'r');
22
22
  try {
23
- const { bytesRead } = yield file.read(buffer, offset, size, 0);
23
+ const { bytesRead } = yield file.read(buffer, 0, size, offset);
24
24
  if (bytesRead < size) {
25
- const smaller = buffer_1.Buffer.alloc(bytesRead);
26
- buffer.copy(smaller, 0, 0, bytesRead);
27
- return smaller;
25
+ return buffer.slice(0, bytesRead);
28
26
  }
29
27
  else {
30
28
  return buffer;
@@ -35,4 +33,3 @@ function readBuffer(filepath, size, offset = 0) {
35
33
  }
36
34
  });
37
35
  }
38
- exports.readBuffer = readBuffer;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.resolveRequest = void 0;
6
+ exports.resolveRequest = resolveRequest;
7
7
  const untildify_1 = __importDefault(require("untildify"));
8
8
  function resolveRequest(spec) {
9
9
  if (spec.startsWith('~')) {
@@ -40,4 +40,3 @@ function resolveRequest(spec) {
40
40
  return { name: spec };
41
41
  }
42
42
  } // }}}
43
- exports.resolveRequest = resolveRequest;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.toLines = void 0;
3
+ exports.toLines = toLines;
4
4
  function toLines(value) {
5
5
  return value.split(/\r?\n/g);
6
6
  }
7
- exports.toLines = toLines;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trimFinalNewLine = void 0;
3
+ exports.trimFinalNewLine = trimFinalNewLine;
4
4
  const FINAL_NEWLINE_REGEX = /(\r?\n)*$/;
5
5
  function trimFinalNewLine(value) {
6
6
  return value.replace(FINAL_NEWLINE_REGEX, '');
7
7
  }
8
- exports.trimFinalNewLine = trimFinalNewLine;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryJson = void 0;
3
+ exports.tryJson = tryJson;
4
4
  function tryJson(value) {
5
5
  try {
6
6
  return JSON.parse(value);
@@ -9,4 +9,3 @@ function tryJson(value) {
9
9
  return undefined;
10
10
  }
11
11
  }
12
- exports.tryJson = tryJson;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zokugun/artifact",
3
3
  "description": "Boilerplate your project & keep your configurations up to date",
4
- "version": "0.4.0",
4
+ "version": "0.4.1",
5
5
  "author": {
6
6
  "name": "Baptiste Augrain",
7
7
  "email": "daiyam@zokugun.org"
@@ -33,7 +33,7 @@
33
33
  "watch:test": "tsc-watch -p test"
34
34
  },
35
35
  "dependencies": {
36
- "@zokugun/configdotts-merge": "^0.1.0",
36
+ "@zokugun/configdotts-merge": "^0.2.0",
37
37
  "ansi-colors": "^4.1.1",
38
38
  "commander": "^9.0.0",
39
39
  "dayjs": "^1.11.13",
@@ -50,6 +50,7 @@
50
50
  "pacote": "^13.0.5",
51
51
  "semver": "^7.3.5",
52
52
  "tempy": "^1.0.1",
53
+ "typescript": "^5.9.2",
53
54
  "untildify": "^4.0.0",
54
55
  "yaml": "^1.10.2"
55
56
  },
@@ -71,6 +72,7 @@
71
72
  "chai": "^4.3.4",
72
73
  "chai-as-promised": "^7.1.1",
73
74
  "commitizen": "^4.2.4",
75
+ "eslint": "8.11.0",
74
76
  "eslint-plugin-chai-friendly": "^0.7.2",
75
77
  "fixpack": "^4.0.0",
76
78
  "husky": "^7.0.1",
@@ -81,7 +83,6 @@
81
83
  "rewiremock": "^3.14.3",
82
84
  "source-map-support": "^0.5.20",
83
85
  "tsc-watch": "^4.5.0",
84
- "typescript": "^4.2.4",
85
86
  "universalify": "^2.0.0",
86
87
  "xo": "^0.48.0"
87
88
  },