@zokugun/artifact 0.5.2 → 0.6.0

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 (216) hide show
  1. package/bin/artifact +1 -1
  2. package/lib/cli.d.ts +1 -0
  3. package/lib/cli.js +12 -4
  4. package/lib/commands/add.d.ts +6 -0
  5. package/lib/commands/add.js +47 -36
  6. package/lib/commands/index.d.ts +4 -0
  7. package/lib/commands/index.js +9 -7
  8. package/lib/commands/list.d.ts +1 -0
  9. package/lib/commands/list.js +13 -8
  10. package/lib/commands/remove.d.ts +6 -0
  11. package/lib/commands/remove.js +79 -0
  12. package/lib/commands/update.d.ts +5 -0
  13. package/lib/commands/update.js +43 -39
  14. package/lib/compositors/compose.d.ts +7 -0
  15. package/lib/compositors/compose.js +13 -13
  16. package/lib/compositors/fork.d.ts +3 -0
  17. package/lib/compositors/fork.js +4 -4
  18. package/lib/compositors/index.d.ts +6 -0
  19. package/lib/compositors/index.js +12 -12
  20. package/lib/compositors/json.d.ts +2 -0
  21. package/lib/compositors/json.js +14 -12
  22. package/lib/compositors/map-sort.d.ts +2 -0
  23. package/lib/compositors/map-sort.js +2 -2
  24. package/lib/compositors/rc.d.ts +2 -0
  25. package/lib/compositors/rc.js +13 -10
  26. package/lib/compositors/yaml.d.ts +2 -0
  27. package/lib/compositors/yaml.js +8 -11
  28. package/lib/configs/index.d.ts +3 -0
  29. package/lib/configs/index.js +3 -2
  30. package/lib/configs/install/index.d.ts +3 -0
  31. package/lib/configs/install/index.js +6 -6
  32. package/lib/configs/install/read-install-config.d.ts +6 -0
  33. package/lib/configs/install/read-install-config.js +123 -80
  34. package/lib/configs/install/update-install-config.d.ts +2 -0
  35. package/lib/configs/install/write-install-config.d.ts +5 -0
  36. package/lib/configs/install/write-install-config.js +17 -9
  37. package/lib/configs/package/index.d.ts +1 -0
  38. package/lib/configs/package/index.js +2 -2
  39. package/lib/configs/package/read-package-config.d.ts +3 -0
  40. package/lib/configs/package/read-package-config.js +159 -40
  41. package/lib/configs/uninstall/index.d.ts +1 -0
  42. package/lib/configs/uninstall/index.js +5 -0
  43. package/lib/configs/uninstall/update-uninstall-config.d.ts +2 -0
  44. package/lib/configs/uninstall/update-uninstall-config.js +6 -0
  45. package/lib/configs/utils/constants.d.ts +11 -0
  46. package/lib/configs/utils/constants.js +24 -0
  47. package/lib/configs/utils/is-transform.d.ts +2 -0
  48. package/lib/configs/utils/is-transform.js +16 -0
  49. package/lib/configs/utils/merge-upsert-property.d.ts +3 -0
  50. package/lib/configs/utils/merge-upsert-property.js +68 -0
  51. package/lib/configs/utils/normalize-file-always.d.ts +3 -0
  52. package/lib/configs/utils/normalize-file-always.js +28 -0
  53. package/lib/configs/utils/normalize-file-uninstall.d.ts +3 -0
  54. package/lib/configs/utils/normalize-file-uninstall.js +31 -0
  55. package/lib/configs/utils/normalize-file-upsert.d.ts +3 -0
  56. package/lib/configs/utils/normalize-file-upsert.js +54 -0
  57. package/lib/journeys/commitlint/index.d.ts +2 -0
  58. package/lib/journeys/commitlint/index.js +15 -15
  59. package/lib/journeys/config.ts/index.d.ts +2 -0
  60. package/lib/journeys/config.ts/index.js +5 -5
  61. package/lib/journeys/default/index.d.ts +2 -0
  62. package/lib/journeys/default/index.js +11 -14
  63. package/lib/journeys/fixpack/index.d.ts +2 -0
  64. package/lib/journeys/fixpack/index.js +13 -13
  65. package/lib/journeys/gitignore/index.d.ts +2 -0
  66. package/lib/journeys/gitignore/index.js +5 -5
  67. package/lib/journeys/ignore/index.d.ts +2 -0
  68. package/lib/journeys/ignore/index.js +5 -5
  69. package/lib/journeys/index.d.ts +2 -0
  70. package/lib/journeys/index.js +20 -20
  71. package/lib/journeys/npmignore/index.d.ts +2 -0
  72. package/lib/journeys/npmignore/index.js +5 -5
  73. package/lib/journeys/package/index.d.ts +2 -0
  74. package/lib/journeys/package/index.js +27 -30
  75. package/lib/journeys/rc/index.d.ts +2 -0
  76. package/lib/journeys/rc/index.js +12 -12
  77. package/lib/journeys/tsconfig/index.d.ts +2 -0
  78. package/lib/journeys/tsconfig/index.js +13 -16
  79. package/lib/parsers/json.d.ts +2 -0
  80. package/lib/parsers/jsonc/index.d.ts +2 -0
  81. package/lib/parsers/jsonc/index.js +4 -4
  82. package/lib/parsers/jsonc/parse.d.ts +5 -0
  83. package/lib/parsers/jsonc/parse.js +1 -13
  84. package/lib/parsers/jsonc/stringify.d.ts +2 -0
  85. package/lib/parsers/jsonc/stringify.js +2 -2
  86. package/lib/parsers/jsonc/transform.d.ts +10 -0
  87. package/lib/parsers/yaml.d.ts +2 -0
  88. package/lib/routes/command.d.ts +4 -0
  89. package/lib/routes/command.js +10 -10
  90. package/lib/routes/index.d.ts +8 -0
  91. package/lib/routes/index.js +17 -15
  92. package/lib/routes/lines-concat.d.ts +4 -0
  93. package/lib/routes/lines-concat.js +7 -7
  94. package/lib/routes/list-concat.d.ts +4 -0
  95. package/lib/routes/list-concat.js +3 -7
  96. package/lib/routes/list-sort-concat.d.ts +4 -0
  97. package/lib/routes/list-sort-concat.js +1 -1
  98. package/lib/routes/map-concat.d.ts +4 -0
  99. package/lib/routes/map-concat.js +1 -1
  100. package/lib/routes/map-delete.d.ts +4 -0
  101. package/lib/routes/map-delete.js +32 -0
  102. package/lib/routes/overwrite.d.ts +4 -0
  103. package/lib/routes/overwrite.js +2 -2
  104. package/lib/routes/primitive.d.ts +4 -0
  105. package/lib/routes/primitive.js +3 -3
  106. package/lib/steps/apply-formatting.d.ts +8 -0
  107. package/lib/steps/apply-formatting.js +19 -15
  108. package/lib/steps/configure-branches.d.ts +3 -0
  109. package/lib/steps/configure-branches.js +8 -5
  110. package/lib/steps/configure-install-file-actions.d.ts +3 -0
  111. package/lib/steps/configure-install-file-actions.js +41 -86
  112. package/lib/steps/configure-uninstall-file-actions.d.ts +3 -0
  113. package/lib/steps/configure-uninstall-file-actions.js +53 -0
  114. package/lib/steps/configure-update-file-actions.d.ts +3 -0
  115. package/lib/steps/configure-update-file-actions.js +64 -97
  116. package/lib/steps/copy-binary-files.d.ts +3 -0
  117. package/lib/steps/copy-binary-files.js +24 -11
  118. package/lib/steps/execute-first-block.d.ts +3 -0
  119. package/lib/steps/execute-first-block.js +35 -14
  120. package/lib/steps/execute-next-block.d.ts +3 -0
  121. package/lib/steps/execute-next-block.js +8 -3
  122. package/lib/steps/index.d.ts +54 -0
  123. package/lib/steps/index.js +76 -54
  124. package/lib/steps/insert-final-new-line.d.ts +6 -0
  125. package/lib/steps/insert-final-new-line.js +13 -1
  126. package/lib/steps/merge-text-files.d.ts +3 -0
  127. package/lib/steps/merge-text-files.js +41 -27
  128. package/lib/steps/read-editor-config.d.ts +3 -0
  129. package/lib/steps/read-editor-config.js +21 -26
  130. package/lib/steps/read-files.d.ts +3 -0
  131. package/lib/steps/read-files.js +19 -8
  132. package/lib/steps/read-incoming-config.d.ts +3 -0
  133. package/lib/steps/read-incoming-config.js +7 -5
  134. package/lib/steps/read-incoming-package.d.ts +3 -0
  135. package/lib/steps/read-incoming-package.js +12 -7
  136. package/lib/steps/remove-files.d.ts +3 -0
  137. package/lib/steps/remove-files.js +10 -4
  138. package/lib/steps/rename-files.d.ts +3 -0
  139. package/lib/steps/rename-files.js +25 -0
  140. package/lib/steps/replace-templates.d.ts +3 -0
  141. package/lib/steps/replace-templates.js +19 -5
  142. package/lib/steps/transform-untouched-files.d.ts +3 -0
  143. package/lib/steps/transform-untouched-files.js +73 -0
  144. package/lib/steps/unmerge-text-files.d.ts +3 -0
  145. package/lib/steps/unmerge-text-files.js +63 -0
  146. package/lib/steps/validate-newer-package.d.ts +3 -0
  147. package/lib/steps/validate-newer-package.js +4 -2
  148. package/lib/steps/validate-not-present-package.d.ts +3 -0
  149. package/lib/steps/validate-not-present-package.js +7 -4
  150. package/lib/steps/validate-present-package.d.ts +3 -0
  151. package/lib/steps/validate-present-package.js +24 -0
  152. package/lib/steps/write-text-files.d.ts +3 -0
  153. package/lib/steps/write-text-files.js +16 -7
  154. package/lib/types/binary-file.d.ts +4 -0
  155. package/lib/types/command.d.ts +5 -0
  156. package/lib/types/config.d.ts +58 -0
  157. package/lib/types/context.d.ts +56 -0
  158. package/lib/types/format.d.ts +10 -0
  159. package/lib/types/step.d.ts +3 -0
  160. package/lib/types/text-file.d.ts +7 -0
  161. package/lib/types/travel.d.ts +14 -0
  162. package/lib/utils/apply-transforms.d.ts +2 -0
  163. package/lib/utils/apply-transforms.js +48 -0
  164. package/lib/utils/build-journey-plan.d.ts +2 -0
  165. package/lib/utils/build-route.d.ts +3 -0
  166. package/lib/utils/build-route.js +92 -0
  167. package/lib/utils/build-travel-plan.d.ts +2 -0
  168. package/lib/utils/build-travel.d.ts +3 -0
  169. package/lib/utils/build-travel.js +32 -0
  170. package/lib/utils/command/dedupe-strings.d.ts +1 -0
  171. package/lib/utils/command/index.d.ts +8 -0
  172. package/lib/utils/command/index.js +14 -14
  173. package/lib/utils/command/join-command.d.ts +2 -0
  174. package/lib/utils/command/merge-and-chains.d.ts +1 -0
  175. package/lib/utils/command/merge-and-chains.js +21 -21
  176. package/lib/utils/command/merge-command-records.d.ts +2 -0
  177. package/lib/utils/command/merge-command-records.js +43 -22
  178. package/lib/utils/command/merge-flag-tokens.d.ts +1 -0
  179. package/lib/utils/command/merge-flag-tokens.js +1 -1
  180. package/lib/utils/command/merge-flags-as-string.d.ts +4 -0
  181. package/lib/utils/command/merge-flags-as-string.js +4 -4
  182. package/lib/utils/command/merge-or-segments.d.ts +1 -0
  183. package/lib/utils/command/merge-or-segments.js +28 -28
  184. package/lib/utils/command/merge-parts-by-prefix.d.ts +1 -0
  185. package/lib/utils/command/merge-parts-by-prefix.js +6 -6
  186. package/lib/utils/command/merge-semicolon-segments.d.ts +1 -0
  187. package/lib/utils/command/merge-semicolon-segments.js +35 -35
  188. package/lib/utils/command/merge-with-semicolon-mix.d.ts +1 -0
  189. package/lib/utils/command/merge-with-semicolon-mix.js +12 -12
  190. package/lib/utils/command/prefix-of-command.d.ts +1 -0
  191. package/lib/utils/command/prefix-of-command.js +2 -2
  192. package/lib/utils/command/split-chain.d.ts +1 -0
  193. package/lib/utils/command/split-command.d.ts +2 -0
  194. package/lib/utils/command/split-command.js +8 -8
  195. package/lib/utils/command/split-prefix-and-flags.d.ts +4 -0
  196. package/lib/utils/command/split-prefix-and-flags.js +5 -5
  197. package/lib/utils/command/split-segments.d.ts +1 -0
  198. package/lib/utils/detect-indent.d.ts +5 -0
  199. package/lib/utils/detect-indent.js +60 -0
  200. package/lib/utils/flow.d.ts +3 -0
  201. package/lib/utils/flow.js +12 -0
  202. package/lib/utils/get-format.d.ts +2 -0
  203. package/lib/utils/get-format.js +19 -0
  204. package/lib/utils/has-final-new-line.d.ts +1 -0
  205. package/lib/utils/has-final-new-line.js +7 -0
  206. package/lib/utils/read-buffer.d.ts +2 -0
  207. package/lib/utils/resolve-request.d.ts +3 -0
  208. package/lib/utils/resolve-request.js +4 -3
  209. package/lib/utils/template.d.ts +17 -0
  210. package/lib/utils/template.js +79 -57
  211. package/lib/utils/to-lines.d.ts +1 -0
  212. package/lib/utils/trim-final-newline.d.ts +1 -0
  213. package/lib/utils/try-json.d.ts +1 -0
  214. package/lib/utils/try-json.js +2 -2
  215. package/package.json +123 -101
  216. package/lib/utils/dev-null.js +0 -7
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const routes_1 = require("../../routes");
4
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
5
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
6
- const gitignorePlan = (0, build_travel_plan_1.buildTravelPlan)([/^\.?gitignore$/, routes_1.linesConcat]);
7
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(gitignorePlan, '.gitignore');
3
+ const index_js_1 = require("../../routes/index.js");
4
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
5
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
6
+ const gitignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.?gitignore$/, index_js_1.linesConcat]);
7
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(gitignorePlan, '.gitignore');
@@ -0,0 +1,2 @@
1
+ declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const routes_1 = require("../../routes");
4
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
5
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
6
- const ignorePlan = (0, build_travel_plan_1.buildTravelPlan)([/^\..*ignore$/, routes_1.linesConcat]);
7
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(ignorePlan);
3
+ const index_js_1 = require("../../routes/index.js");
4
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
5
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
6
+ const ignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\..*ignore$/, index_js_1.linesConcat]);
7
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(ignorePlan);
@@ -0,0 +1,2 @@
1
+ import { type Journey } from '../types/travel.js';
2
+ export declare function getJourney(filename: string): Journey | undefined;
@@ -5,27 +5,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getJourney = getJourney;
7
7
  const path_1 = __importDefault(require("path"));
8
- const commitlint_1 = __importDefault(require("./commitlint"));
9
- const config_ts_1 = __importDefault(require("./config.ts"));
10
- const default_1 = __importDefault(require("./default"));
11
- const fixpack_1 = __importDefault(require("./fixpack"));
12
- const gitignore_1 = __importDefault(require("./gitignore"));
13
- const ignore_1 = __importDefault(require("./ignore"));
14
- const npmignore_1 = __importDefault(require("./npmignore"));
15
- const package_1 = __importDefault(require("./package"));
16
- const rc_1 = __importDefault(require("./rc"));
17
- const tsconfig_1 = __importDefault(require("./tsconfig"));
8
+ const index_js_1 = __importDefault(require("./commitlint/index.js"));
9
+ const index_js_2 = __importDefault(require("./config.ts/index.js"));
10
+ const index_js_3 = __importDefault(require("./default/index.js"));
11
+ const index_js_4 = __importDefault(require("./fixpack/index.js"));
12
+ const index_js_5 = __importDefault(require("./gitignore/index.js"));
13
+ const index_js_6 = __importDefault(require("./ignore/index.js"));
14
+ const index_js_7 = __importDefault(require("./npmignore/index.js"));
15
+ const index_js_8 = __importDefault(require("./package/index.js"));
16
+ const index_js_9 = __importDefault(require("./rc/index.js"));
17
+ const index_js_10 = __importDefault(require("./tsconfig/index.js"));
18
18
  const plans = [
19
- commitlint_1.default,
20
- fixpack_1.default,
21
- gitignore_1.default,
22
- ignore_1.default,
23
- npmignore_1.default,
24
- package_1.default,
25
- tsconfig_1.default,
26
- rc_1.default,
27
- config_ts_1.default,
28
- default_1.default,
19
+ index_js_1.default,
20
+ index_js_4.default,
21
+ index_js_5.default,
22
+ index_js_6.default,
23
+ index_js_7.default,
24
+ index_js_8.default,
25
+ index_js_10.default,
26
+ index_js_9.default,
27
+ index_js_2.default,
28
+ index_js_3.default,
29
29
  ];
30
30
  function getJourney(filename) {
31
31
  const basename = path_1.default.basename(filename);
@@ -0,0 +1,2 @@
1
+ declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const routes_1 = require("../../routes");
4
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
5
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
6
- const gitignorePlan = (0, build_travel_plan_1.buildTravelPlan)([/^\.?npmignore$/, routes_1.linesConcat]);
7
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(gitignorePlan, '.npmignore');
3
+ const index_js_1 = require("../../routes/index.js");
4
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
5
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
6
+ const gitignorePlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.?npmignore$/, index_js_1.linesConcat]);
7
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(gitignorePlan, '.npmignore');
@@ -0,0 +1,2 @@
1
+ declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
+ export default _default;
@@ -1,34 +1,31 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
7
- const compositors_1 = require("../../compositors");
8
- const routes_1 = require("../../routes");
9
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
10
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
11
- const mainRoute = (0, compositors_1.compose)({
3
+ const is_it_type_1 = require("@zokugun/is-it-type");
4
+ const index_js_1 = require("../../compositors/index.js");
5
+ const index_js_2 = require("../../routes/index.js");
6
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
7
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
8
+ const mainRoute = (0, index_js_1.compose)({
12
9
  // default fields
13
- keywords: routes_1.listConcat,
14
- homepage: routes_1.primitive,
15
- bugs: (0, compositors_1.fork)([isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
16
- license: (0, compositors_1.fork)([isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
17
- licenses: routes_1.listConcat,
18
- author: (0, compositors_1.fork)([isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
19
- repository: (0, compositors_1.fork)([isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
20
- scripts: (0, compositors_1.mapSort)((0, compositors_1.compose)({
21
- $$default: routes_1.command,
10
+ keywords: index_js_2.listConcat,
11
+ homepage: index_js_2.primitive,
12
+ bugs: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
13
+ license: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
14
+ licenses: index_js_2.listConcat,
15
+ author: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
16
+ repository: (0, index_js_1.fork)([is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
17
+ scripts: (0, index_js_1.mapSort)((0, index_js_1.compose)({
18
+ $$default: index_js_2.command,
22
19
  })),
23
- config: (0, compositors_1.mapSort)(routes_1.mapConcat),
24
- engines: (0, compositors_1.mapSort)(routes_1.mapConcat),
25
- dependencies: (0, compositors_1.mapSort)(routes_1.mapConcat),
26
- devDependencies: (0, compositors_1.mapSort)(routes_1.mapConcat),
27
- peerDependencies: (0, compositors_1.mapSort)(routes_1.mapConcat),
28
- optionalDependencies: (0, compositors_1.mapSort)(routes_1.mapConcat),
29
- bundledDependencies: (0, compositors_1.mapSort)(routes_1.mapConcat),
20
+ config: (0, index_js_1.mapSort)(index_js_2.mapConcat),
21
+ engines: (0, index_js_1.mapSort)(index_js_2.mapConcat),
22
+ dependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
23
+ devDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
24
+ peerDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
25
+ optionalDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
26
+ bundledDependencies: (0, index_js_1.mapSort)(index_js_2.mapConcat),
30
27
  // tools fields
31
- browserslist: routes_1.listConcat,
28
+ browserslist: index_js_2.listConcat,
32
29
  // other fields
33
30
  $$ignore: [
34
31
  'name',
@@ -40,8 +37,8 @@ const mainRoute = (0, compositors_1.compose)({
40
37
  'cpu',
41
38
  'preferGlobal',
42
39
  ],
43
- $$default: (0, compositors_1.fork)([Array.isArray, routes_1.listConcat], [isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
40
+ $$default: (0, index_js_1.fork)([is_it_type_1.isArray, index_js_2.listConcat], [is_it_type_1.isRecord, index_js_2.mapConcat], index_js_2.primitive),
44
41
  });
45
- const jsonRoute = (0, compositors_1.json)(mainRoute);
46
- const travelPlan = (0, build_travel_plan_1.buildTravelPlan)(['package.json', jsonRoute]);
47
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(travelPlan);
42
+ const jsonRoute = (0, index_js_1.json)(mainRoute);
43
+ const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)(['package.json', jsonRoute]);
44
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
@@ -0,0 +1,2 @@
1
+ declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
+ export default _default;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
- const compositors_1 = require("../../compositors");
5
- const routes_1 = require("../../routes");
6
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
7
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
8
- const mainRoute = (0, compositors_1.compose)({
9
- $$default: (0, compositors_1.fork)([Array.isArray, routes_1.listConcat], [lodash_1.isPlainObject, routes_1.mapConcat], routes_1.primitive),
3
+ const lodash_es_1 = require("lodash-es");
4
+ const index_js_1 = require("../../compositors/index.js");
5
+ const index_js_2 = require("../../routes/index.js");
6
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
7
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
8
+ const mainRoute = (0, index_js_1.compose)({
9
+ $$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
10
10
  });
11
- const jsonRoute = (0, compositors_1.json)(mainRoute);
12
- const yamlRoute = (0, compositors_1.yaml)(mainRoute);
13
- const rcRoute = (0, compositors_1.rc)(mainRoute);
14
- const travelPlan = (0, build_travel_plan_1.buildTravelPlan)([/^\.\w+rc\.json$/, jsonRoute], [/^\.\w+rc\.ya?ml$/, yamlRoute], [/^\.\w+rc$/, rcRoute]);
15
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(travelPlan);
11
+ const jsonRoute = (0, index_js_1.json)(mainRoute);
12
+ const yamlRoute = (0, index_js_1.yaml)(mainRoute);
13
+ const rcRoute = (0, index_js_1.rc)(mainRoute);
14
+ const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.\w+rc\.json$/, jsonRoute], [/^\.\w+rc\.ya?ml$/, yamlRoute], [/^\.\w+rc$/, rcRoute]);
15
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
@@ -0,0 +1,2 @@
1
+ declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
+ export default _default;
@@ -1,20 +1,17 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
7
- const compositors_1 = require("../../compositors");
8
- const routes_1 = require("../../routes");
9
- const build_journey_plan_1 = require("../../utils/build-journey-plan");
10
- const build_travel_plan_1 = require("../../utils/build-travel-plan");
11
- const mainRoute = (0, compositors_1.compose)({
12
- compilerOptions: (0, compositors_1.compose)({
13
- lib: routes_1.listConcat,
14
- $$default: (0, compositors_1.fork)([Array.isArray, routes_1.listConcat], [isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
3
+ const lodash_es_1 = require("lodash-es");
4
+ const index_js_1 = require("../../compositors/index.js");
5
+ const index_js_2 = require("../../routes/index.js");
6
+ const build_journey_plan_js_1 = require("../../utils/build-journey-plan.js");
7
+ const build_travel_plan_js_1 = require("../../utils/build-travel-plan.js");
8
+ const mainRoute = (0, index_js_1.compose)({
9
+ compilerOptions: (0, index_js_1.compose)({
10
+ lib: index_js_2.listConcat,
11
+ $$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
15
12
  }),
16
- $$default: (0, compositors_1.fork)([Array.isArray, routes_1.listConcat], [isPlainObject_1.default, routes_1.mapConcat], routes_1.primitive),
13
+ $$default: (0, index_js_1.fork)([Array.isArray, index_js_2.listConcat], [lodash_es_1.isPlainObject, index_js_2.mapConcat], index_js_2.primitive),
17
14
  });
18
- const jsonRoute = (0, compositors_1.json)(mainRoute);
19
- const travelPlan = (0, build_travel_plan_1.buildTravelPlan)([/tsconfig(?:\.\w+)?\.json$/, jsonRoute]);
20
- exports.default = (0, build_journey_plan_1.buildJourneyPlan)(travelPlan);
15
+ const jsonRoute = (0, index_js_1.json)(mainRoute);
16
+ const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)([/tsconfig(?:\.\w+)?\.json$/, jsonRoute]);
17
+ exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
@@ -0,0 +1,2 @@
1
+ export declare function parse(data: string): Record<string, any>;
2
+ export declare function stringify(data: Record<string, any>): string;
@@ -0,0 +1,2 @@
1
+ export { parse } from './parse.js';
2
+ export { stringify } from './stringify.js';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stringify = exports.parse = void 0;
4
- var parse_1 = require("./parse");
5
- Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_1.parse; } });
6
- var stringify_1 = require("./stringify");
7
- Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_1.stringify; } });
4
+ var parse_js_1 = require("./parse.js");
5
+ Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.parse; } });
6
+ var stringify_js_1 = require("./stringify.js");
7
+ Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.stringify; } });
@@ -0,0 +1,5 @@
1
+ import { type Transform } from './transform.js';
2
+ export declare function parse(text: string | undefined): {
3
+ data: any;
4
+ transform: Transform | undefined;
5
+ };
@@ -20,7 +20,6 @@ function parse(text) {
20
20
  let lastKid;
21
21
  (0, jsonc_parser_1.visit)(text, {
22
22
  onObjectBegin(offset, length, startLine, _startCharacter) {
23
- // console.log('onObjectBegin', startLine)
24
23
  if (current) {
25
24
  stack.unshift(current);
26
25
  }
@@ -46,11 +45,9 @@ function parse(text) {
46
45
  lastOffset = offset + length;
47
46
  },
48
47
  onObjectProperty(name, _offset, _length, _startLine, _startCharacter) {
49
- // console.log('onObjectProperty', name, _startLine, _startCharacter)
50
48
  property = name;
51
49
  },
52
50
  onObjectEnd(offset, length, startLine, _startCharacter) {
53
- // console.log('onObjectEnd', startLine, startCharacter)
54
51
  if (stack.length > 0) {
55
52
  lastKid = transform;
56
53
  current = stack.shift();
@@ -60,7 +57,6 @@ function parse(text) {
60
57
  lastOffset = offset + length;
61
58
  },
62
59
  onArrayBegin(offset, length, startLine, _startCharacter) {
63
- // console.log('onArrayBegin', startLine, _startCharacter)
64
60
  if (current) {
65
61
  stack.unshift(current);
66
62
  }
@@ -86,7 +82,6 @@ function parse(text) {
86
82
  lastOffset = offset + length;
87
83
  },
88
84
  onArrayEnd(offset, length, startLine, _startCharacter) {
89
- // console.log('onArrayEnd', startLine, _startCharacter)
90
85
  if (stack.length > 0) {
91
86
  lastKid = transform;
92
87
  current = stack.shift();
@@ -96,7 +91,6 @@ function parse(text) {
96
91
  lastOffset = offset + length;
97
92
  },
98
93
  onLiteralValue(value, offset, length, startLine, _startCharacter) {
99
- // console.log('onLiteralValue', startLine, _startCharacter)
100
94
  if (current) {
101
95
  if (Array.isArray(current)) {
102
96
  lastKid = {};
@@ -132,13 +126,9 @@ function parse(text) {
132
126
  lastOffset = offset + length;
133
127
  },
134
128
  onSeparator(_character, offset, length, _startLine, _startCharacter) {
135
- // console.log('onSeparator', _character, _startLine, _startCharacter)
136
- if (lastOffset) {
137
- lastOffset = offset + length;
138
- }
129
+ lastOffset &&= offset + length;
139
130
  },
140
131
  onComment(offset, length, startLine, _startCharacter) {
141
- // console.log('onComment', startLine, _startCharacter)
142
132
  let line = text.slice(offset, offset + length);
143
133
  if (startLine === lastLine && lastKid) {
144
134
  line = text.slice(lastOffset, lastOffset + offset - lastOffset) + line;
@@ -179,13 +169,11 @@ function parse(text) {
179
169
  }
180
170
  },
181
171
  onError(error, _offset, _length, _startLine, _startCharacter) {
182
- // console.log('onError', error, _startLine, _startCharacter)
183
172
  if ((error === 3 /* ParseErrorCode.PropertyNameExpected */ || error === 4 /* ParseErrorCode.ValueExpected */) && lastKid) {
184
173
  lastKid.separator = true;
185
174
  }
186
175
  },
187
176
  });
188
- // console.log(JSON.stringify(transform, null, 2))
189
177
  return {
190
178
  data: current,
191
179
  transform,
@@ -0,0 +1,2 @@
1
+ import { type Transform } from './transform.js';
2
+ export declare function stringify(data: unknown, transform?: Transform): string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stringify = stringify;
4
- const lodash_1 = require("lodash");
4
+ const lodash_es_1 = require("lodash-es");
5
5
  function stringify(data, transform = {}) {
6
6
  const result = format(data, '', transform);
7
7
  return result;
@@ -14,7 +14,7 @@ function format(data, indentValue, transform, separator = false) {
14
14
  result += ',';
15
15
  }
16
16
  }
17
- else if ((0, lodash_1.isPlainObject)(data)) {
17
+ else if ((0, lodash_es_1.isPlainObject)(data)) {
18
18
  result = formatObject(data, indentValue, transform);
19
19
  if (separator) {
20
20
  result += ',';
@@ -0,0 +1,10 @@
1
+ export type Transform = {
2
+ children?: Record<string, Transform>;
3
+ comments?: {
4
+ bottom?: string[];
5
+ right?: string[];
6
+ top?: string[];
7
+ };
8
+ emptyLines?: number;
9
+ separator?: boolean;
10
+ };
@@ -0,0 +1,2 @@
1
+ export declare function parse(data: string): Record<string, unknown>;
2
+ export declare function stringify(data: Record<string, unknown>): string;
@@ -0,0 +1,4 @@
1
+ export declare function command({ current, incoming }: {
2
+ current: string | undefined;
3
+ incoming: string | undefined;
4
+ }): Promise<string>;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.command = command;
4
- const command_1 = require("../utils/command");
5
- function command({ current, incoming }) {
4
+ const index_js_1 = require("../utils/command/index.js");
5
+ async function command({ current, incoming }) {
6
6
  if (!incoming) {
7
7
  return current ?? '';
8
8
  }
@@ -18,22 +18,22 @@ function command({ current, incoming }) {
18
18
  const incomingCommand = trueAndMatch[1].trim();
19
19
  return currentSegments.has(incomingCommand) ? current : `${current} && ${incomingCommand}`;
20
20
  }
21
- const mixed = (0, command_1.mergeWithSemicolonMix)(current, incoming);
21
+ const mixed = (0, index_js_1.mergeWithSemicolonMix)(current, incoming);
22
22
  if (mixed) {
23
23
  return mixed;
24
24
  }
25
- const andMerged = (0, command_1.mergeAndChains)(current, incoming);
25
+ const andMerged = (0, index_js_1.mergeAndChains)(current, incoming);
26
26
  if (andMerged) {
27
27
  return andMerged;
28
28
  }
29
29
  if (incoming.includes('||')) {
30
- return (0, command_1.mergeOrSegments)(current, incoming);
30
+ return (0, index_js_1.mergeOrSegments)(current, incoming);
31
31
  }
32
32
  if (incoming.includes(';')) {
33
- return (0, command_1.mergeSemicolonSegments)(current, incoming);
33
+ return (0, index_js_1.mergeSemicolonSegments)(current, incoming);
34
34
  }
35
- const currentCommand = (0, command_1.splitCommand)(current);
36
- const incomingCommand = (0, command_1.splitCommand)(incoming);
37
- const merged = (0, command_1.mergeCommandRecords)(currentCommand, incomingCommand, current);
38
- return (0, command_1.joinCommand)(merged);
35
+ const currentCommand = (0, index_js_1.splitCommand)(current);
36
+ const incomingCommand = (0, index_js_1.splitCommand)(incoming);
37
+ const merged = await (0, index_js_1.mergeCommandRecords)(currentCommand, incomingCommand, current);
38
+ return (0, index_js_1.joinCommand)(merged);
39
39
  }
@@ -0,0 +1,8 @@
1
+ export { command } from './command.js';
2
+ export { mapConcat } from './map-concat.js';
3
+ export { mapDelete } from './map-delete.js';
4
+ export { linesConcat } from './lines-concat.js';
5
+ export { listConcat } from './list-concat.js';
6
+ export { listSortConcat } from './list-sort-concat.js';
7
+ export { overwrite } from './overwrite.js';
8
+ export { primitive } from './primitive.js';
@@ -1,17 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.primitive = exports.overwrite = exports.listSortConcat = exports.listConcat = exports.linesConcat = exports.mapConcat = exports.command = void 0;
4
- var command_1 = require("./command");
5
- Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_1.command; } });
6
- var map_concat_1 = require("./map-concat");
7
- Object.defineProperty(exports, "mapConcat", { enumerable: true, get: function () { return map_concat_1.mapConcat; } });
8
- var lines_concat_1 = require("./lines-concat");
9
- Object.defineProperty(exports, "linesConcat", { enumerable: true, get: function () { return lines_concat_1.linesConcat; } });
10
- var list_concat_1 = require("./list-concat");
11
- Object.defineProperty(exports, "listConcat", { enumerable: true, get: function () { return list_concat_1.listConcat; } });
12
- var list_sort_concat_1 = require("./list-sort-concat");
13
- Object.defineProperty(exports, "listSortConcat", { enumerable: true, get: function () { return list_sort_concat_1.listSortConcat; } });
14
- var overwrite_1 = require("./overwrite");
15
- Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return overwrite_1.overwrite; } });
16
- var primitive_1 = require("./primitive");
17
- Object.defineProperty(exports, "primitive", { enumerable: true, get: function () { return primitive_1.primitive; } });
3
+ exports.primitive = exports.overwrite = exports.listSortConcat = exports.listConcat = exports.linesConcat = exports.mapDelete = exports.mapConcat = exports.command = void 0;
4
+ var command_js_1 = require("./command.js");
5
+ Object.defineProperty(exports, "command", { enumerable: true, get: function () { return command_js_1.command; } });
6
+ var map_concat_js_1 = require("./map-concat.js");
7
+ Object.defineProperty(exports, "mapConcat", { enumerable: true, get: function () { return map_concat_js_1.mapConcat; } });
8
+ var map_delete_js_1 = require("./map-delete.js");
9
+ Object.defineProperty(exports, "mapDelete", { enumerable: true, get: function () { return map_delete_js_1.mapDelete; } });
10
+ var lines_concat_js_1 = require("./lines-concat.js");
11
+ Object.defineProperty(exports, "linesConcat", { enumerable: true, get: function () { return lines_concat_js_1.linesConcat; } });
12
+ var list_concat_js_1 = require("./list-concat.js");
13
+ Object.defineProperty(exports, "listConcat", { enumerable: true, get: function () { return list_concat_js_1.listConcat; } });
14
+ var list_sort_concat_js_1 = require("./list-sort-concat.js");
15
+ Object.defineProperty(exports, "listSortConcat", { enumerable: true, get: function () { return list_sort_concat_js_1.listSortConcat; } });
16
+ var overwrite_js_1 = require("./overwrite.js");
17
+ Object.defineProperty(exports, "overwrite", { enumerable: true, get: function () { return overwrite_js_1.overwrite; } });
18
+ var primitive_js_1 = require("./primitive.js");
19
+ Object.defineProperty(exports, "primitive", { enumerable: true, get: function () { return primitive_js_1.primitive; } });
@@ -0,0 +1,4 @@
1
+ export declare function linesConcat({ current, incoming }: {
2
+ current: string | undefined;
3
+ incoming: string | undefined;
4
+ }): Promise<string>;
@@ -1,19 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.linesConcat = linesConcat;
4
- const to_lines_1 = require("../utils/to-lines");
5
- const trim_final_newline_1 = require("../utils/trim-final-newline");
6
- const list_concat_1 = require("./list-concat");
7
- function linesConcat({ current, incoming }) {
4
+ const to_lines_js_1 = require("../utils/to-lines.js");
5
+ const trim_final_newline_js_1 = require("../utils/trim-final-newline.js");
6
+ const list_concat_js_1 = require("./list-concat.js");
7
+ async function linesConcat({ current, incoming }) {
8
8
  if (!incoming) {
9
9
  return current ?? '';
10
10
  }
11
11
  if (!current) {
12
12
  return incoming;
13
13
  }
14
- const currentLines = (0, to_lines_1.toLines)((0, trim_final_newline_1.trimFinalNewLine)(current));
15
- const incomingLines = (0, to_lines_1.toLines)((0, trim_final_newline_1.trimFinalNewLine)(incoming));
16
- const result = (0, list_concat_1.listConcat)({
14
+ const currentLines = (0, to_lines_js_1.toLines)((0, trim_final_newline_js_1.trimFinalNewLine)(current));
15
+ const incomingLines = (0, to_lines_js_1.toLines)((0, trim_final_newline_js_1.trimFinalNewLine)(incoming));
16
+ const result = await (0, list_concat_js_1.listConcat)({
17
17
  current: currentLines,
18
18
  incoming: incomingLines,
19
19
  });
@@ -0,0 +1,4 @@
1
+ export declare function listConcat({ current, incoming }: {
2
+ current: unknown[] | undefined;
3
+ incoming: unknown[] | undefined;
4
+ }): Promise<any[]>;
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.listConcat = listConcat;
7
- const isEqual_1 = __importDefault(require("lodash/isEqual"));
8
- const uniqWith_1 = __importDefault(require("lodash/uniqWith"));
9
- function listConcat({ current, incoming }) {
4
+ const lodash_es_1 = require("lodash-es");
5
+ async function listConcat({ current, incoming }) {
10
6
  if (!incoming) {
11
7
  return current ?? [];
12
8
  }
13
9
  if (!current) {
14
10
  return incoming;
15
11
  }
16
- return (0, uniqWith_1.default)([...current, ...incoming], isEqual_1.default);
12
+ return (0, lodash_es_1.uniqWith)([...current, ...incoming], lodash_es_1.isEqual);
17
13
  }
@@ -0,0 +1,4 @@
1
+ export declare function listSortConcat({ current, incoming }: {
2
+ current: unknown[] | undefined;
3
+ incoming: unknown[] | undefined;
4
+ }): Promise<any[]>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listSortConcat = listSortConcat;
4
- function listSortConcat({ current, incoming }) {
4
+ async function listSortConcat({ current, incoming }) {
5
5
  if (!incoming) {
6
6
  return current ?? [];
7
7
  }
@@ -0,0 +1,4 @@
1
+ export declare function mapConcat({ current, incoming }: {
2
+ current: Record<string, any> | undefined;
3
+ incoming: Record<string, any> | undefined;
4
+ }): Promise<Record<string, any>>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapConcat = mapConcat;
4
- function mapConcat({ current, incoming }) {
4
+ async function mapConcat({ current, incoming }) {
5
5
  if (!incoming) {
6
6
  return current ?? {};
7
7
  }
@@ -0,0 +1,4 @@
1
+ export declare function mapDelete({ current, incoming }: {
2
+ current: Record<string, unknown> | undefined;
3
+ incoming: Record<string, unknown> | undefined;
4
+ }): Promise<Record<string, unknown>>;