@zokugun/artifact 0.4.0 → 0.4.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 (59) hide show
  1. package/README.md +0 -2
  2. package/lib/cli.js +2 -0
  3. package/lib/commands/add.js +3 -3
  4. package/lib/commands/list.js +1 -2
  5. package/lib/commands/update.js +3 -3
  6. package/lib/compositors/compose.js +1 -2
  7. package/lib/compositors/fork.js +1 -2
  8. package/lib/compositors/json.js +18 -9
  9. package/lib/compositors/map-sort.js +1 -2
  10. package/lib/compositors/rc.js +18 -9
  11. package/lib/compositors/yaml.js +18 -9
  12. package/lib/configs/install/read-install-config.js +1 -2
  13. package/lib/configs/install/update-install-config.js +1 -2
  14. package/lib/configs/install/write-install-config.js +7 -6
  15. package/lib/configs/package/read-package-config.js +1 -2
  16. package/lib/journeys/index.js +1 -2
  17. package/lib/parsers/json.js +2 -3
  18. package/lib/parsers/jsonc/parse.js +1 -2
  19. package/lib/parsers/jsonc/stringify.js +1 -2
  20. package/lib/parsers/yaml.js +2 -3
  21. package/lib/routes/command.js +1 -2
  22. package/lib/routes/lines-concat.js +1 -2
  23. package/lib/routes/list-concat.js +1 -2
  24. package/lib/routes/list-sort-concat.js +1 -2
  25. package/lib/routes/map-concat.js +1 -2
  26. package/lib/routes/overwrite.js +1 -2
  27. package/lib/routes/primitive.js +1 -2
  28. package/lib/steps/apply-formatting.js +3 -4
  29. package/lib/steps/configure-branches.js +10 -3
  30. package/lib/steps/configure-install-file-actions.js +1 -2
  31. package/lib/steps/configure-update-file-actions.js +1 -2
  32. package/lib/steps/copy-binary-files.js +7 -6
  33. package/lib/steps/execute-first-block.js +2 -3
  34. package/lib/steps/execute-next-block.js +1 -2
  35. package/lib/steps/index.js +7 -6
  36. package/lib/steps/insert-final-new-line.js +3 -4
  37. package/lib/steps/merge-text-files.js +5 -6
  38. package/lib/steps/read-editor-config.js +22 -13
  39. package/lib/steps/read-files.js +3 -4
  40. package/lib/steps/read-incoming-config.js +1 -2
  41. package/lib/steps/read-incoming-package.js +1 -2
  42. package/lib/steps/remove-files.js +7 -6
  43. package/lib/steps/replace-templates.js +3 -4
  44. package/lib/steps/validate-newer-package.js +3 -4
  45. package/lib/steps/validate-not-present-package.js +3 -4
  46. package/lib/steps/write-text-files.js +19 -11
  47. package/lib/types/format.js +1 -1
  48. package/lib/utils/build-journey-plan.js +1 -2
  49. package/lib/utils/build-travel-plan.js +1 -2
  50. package/lib/utils/command/join-command.js +1 -2
  51. package/lib/utils/command/split-command.js +1 -2
  52. package/lib/utils/dev-null.js +1 -2
  53. package/lib/utils/read-buffer.js +5 -8
  54. package/lib/utils/resolve-request.js +1 -2
  55. package/lib/utils/template.js +17 -7
  56. package/lib/utils/to-lines.js +1 -2
  57. package/lib/utils/trim-final-newline.js +1 -2
  58. package/lib/utils/try-json.js +1 -2
  59. 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
 
package/lib/cli.js CHANGED
@@ -13,12 +13,14 @@ program
13
13
  program
14
14
  .command('add')
15
15
  .description('add an artifact to the current project')
16
+ .option('-d, --dry-run', 'fake install')
16
17
  .option('-v, --verbose', 'output more details')
17
18
  .argument('<artifacts...>')
18
19
  .action(commands_1.add);
19
20
  program
20
21
  .command('update')
21
22
  .description('update the current project using the installed artifacts')
23
+ .option('-d, --dry-run', 'fake update')
22
24
  .option('-v, --verbose', 'output more details')
23
25
  .alias('up')
24
26
  .action(commands_1.update);
@@ -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, _d;
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;
@@ -52,6 +52,7 @@ function add(specs, inputOptions) {
52
52
  force: (_a = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.force) !== null && _a !== void 0 ? _a : false,
53
53
  skip: (_b = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.skip) !== null && _b !== void 0 ? _b : false,
54
54
  verbose: (_c = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.verbose) !== null && _c !== void 0 ? _c : false,
55
+ dryRun: (_d = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.dryRun) !== null && _d !== void 0 ? _d : false,
55
56
  };
56
57
  const { config, configStats } = yield (0, configs_1.readInstallConfig)(targetPath);
57
58
  for (const spec of specs) {
@@ -82,4 +83,3 @@ function add(specs, inputOptions) {
82
83
  }
83
84
  });
84
85
  }
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, _c;
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();
@@ -55,6 +55,7 @@ function update(inputOptions) {
55
55
  force: (_a = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.force) !== null && _a !== void 0 ? _a : false,
56
56
  skip: false,
57
57
  verbose: (_b = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.verbose) !== null && _b !== void 0 ? _b : false,
58
+ dryRun: (_c = inputOptions === null || inputOptions === void 0 ? void 0 : inputOptions.dryRun) !== null && _c !== void 0 ? _c : false,
58
59
  };
59
60
  const { config, configStats } = yield (0, configs_1.readInstallConfig)(targetPath);
60
61
  for (const [name, artifact] of Object.entries(config.artifacts)) {
@@ -85,4 +86,3 @@ function update(inputOptions) {
85
86
  }
86
87
  });
87
88
  }
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
  };
@@ -34,11 +34,12 @@ function writeInstallConfig(config, { name, finalNewLine, type }, formats, targe
34
34
  };
35
35
  yield (0, insert_final_new_line_1.insertFinalNewLine)({ mergedTextFiles: [file] });
36
36
  yield (0, apply_formatting_1.applyFormatting)({ mergedTextFiles: [file], formats });
37
- const filePath = path_1.default.join(targetPath, name);
38
- yield fs_extra_1.default.outputFile(filePath, file.data, 'utf-8');
37
+ if (!options.dryRun) {
38
+ const filePath = path_1.default.join(targetPath, name);
39
+ yield fs_extra_1.default.outputFile(filePath, file.data, 'utf-8');
40
+ }
39
41
  if (options.verbose) {
40
42
  console.log(`${name} has been written`);
41
43
  }
42
44
  });
43
45
  }
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"));
@@ -29,7 +29,7 @@ function configureBranches(context) {
29
29
  const match = /^\[(@[\w-]+:[\w-]+|[\w-]+)(?::([\w-]+))?]$/.exec(directory);
30
30
  if (match) {
31
31
  const [branch, name, variant] = match;
32
- const packageName = name.replace(/:/g, '/');
32
+ const packageName = name.replace(/:(artifact-)?/g, '/artifact-');
33
33
  const artifact = context.config.artifacts[packageName];
34
34
  let found = false;
35
35
  if (artifact) {
@@ -53,6 +53,9 @@ function configureBranches(context) {
53
53
  }
54
54
  }
55
55
  if (found) {
56
+ if (context.options.verbose) {
57
+ console.log(`- branch: ${name}${variant ? `:${variant}` : ''} has been matched`);
58
+ }
56
59
  bucket.push({
57
60
  name: context.incomingName,
58
61
  version: context.incomingVersion,
@@ -61,10 +64,14 @@ function configureBranches(context) {
61
64
  incomingPath: node_path_1.default.join(cwd, directory),
62
65
  });
63
66
  }
67
+ else {
68
+ if (context.options.verbose) {
69
+ console.log(`- branch: ${name}${variant ? `:${variant}` : ''} hasn't been matched (${artifact ? 'variant' : 'artifact'} not found)`);
70
+ }
71
+ }
64
72
  }
65
73
  }
66
74
  context.blocks.unshift(...bucket);
67
75
  }
68
76
  });
69
77
  }
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);
@@ -40,12 +40,13 @@ function copyBinaryFiles({ binaryFiles, incomingPath, targetPath, onExisting, on
40
40
  continue;
41
41
  }
42
42
  }
43
- yield fs_extra_1.default.ensureFile(target);
44
- yield fs_extra_1.default.copyFile(source, target);
43
+ if (!options.dryRun) {
44
+ yield fs_extra_1.default.ensureFile(target);
45
+ yield fs_extra_1.default.copyFile(source, target);
46
+ }
45
47
  if (options.verbose) {
46
48
  console.log(`${file.target} has been written as a binary file`);
47
49
  }
48
50
  }
49
51
  });
50
52
  }
51
- exports.copyBinaryFiles = copyBinaryFiles;