@zokugun/artifact 0.7.0 → 0.9.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 (107) hide show
  1. package/README.md +22 -2
  2. package/lib/cli.js +16 -11
  3. package/lib/commands/add.js +95 -22
  4. package/lib/commands/index.d.ts +1 -0
  5. package/lib/commands/index.js +3 -1
  6. package/lib/commands/list.js +25 -7
  7. package/lib/commands/outdated.d.ts +1 -0
  8. package/lib/commands/outdated.js +73 -0
  9. package/lib/commands/remove.js +39 -18
  10. package/lib/commands/update.js +36 -21
  11. package/lib/compositors/codec.d.ts +3 -0
  12. package/lib/compositors/codec.js +46 -0
  13. package/lib/compositors/compose.d.ts +1 -0
  14. package/lib/compositors/compose.js +4 -0
  15. package/lib/compositors/index.d.ts +1 -0
  16. package/lib/compositors/index.js +3 -1
  17. package/lib/compositors/json.js +3 -66
  18. package/lib/compositors/rc.js +3 -56
  19. package/lib/compositors/yaml.js +24 -3
  20. package/lib/configs/install/read-install-config.d.ts +2 -5
  21. package/lib/configs/install/read-install-config.js +20 -18
  22. package/lib/configs/install/write-install-config.d.ts +2 -2
  23. package/lib/configs/install/write-install-config.js +2 -1
  24. package/lib/configs/package/read-listing-config.d.ts +7 -0
  25. package/lib/configs/package/read-listing-config.js +71 -0
  26. package/lib/configs/package/read-package-config.d.ts +2 -1
  27. package/lib/configs/package/read-package-config.js +96 -10
  28. package/lib/configs/utils/constants.d.ts +2 -2
  29. package/lib/configs/utils/constants.js +2 -2
  30. package/lib/configs/utils/merge-upsert-property.js +0 -8
  31. package/lib/configs/utils/normalize-file-always.js +5 -0
  32. package/lib/configs/utils/normalize-file-upsert.d.ts +2 -1
  33. package/lib/configs/utils/normalize-file-upsert.js +12 -5
  34. package/lib/journeys/commitlint/index.d.ts +1 -1
  35. package/lib/journeys/config.ts/index.d.ts +1 -1
  36. package/lib/journeys/config.ts/index.js +2 -6
  37. package/lib/journeys/default/index.d.ts +1 -1
  38. package/lib/journeys/gitignore/index.d.ts +1 -1
  39. package/lib/journeys/ignore/index.d.ts +1 -1
  40. package/lib/journeys/index.d.ts +2 -2
  41. package/lib/journeys/index.js +9 -11
  42. package/lib/journeys/npmignore/index.d.ts +1 -1
  43. package/lib/journeys/package/index.d.ts +1 -1
  44. package/lib/journeys/rc/index.d.ts +1 -1
  45. package/lib/journeys/tsconfig/index.d.ts +1 -1
  46. package/lib/parsers/index.d.ts +4 -0
  47. package/lib/parsers/index.js +41 -0
  48. package/lib/parsers/json.d.ts +4 -2
  49. package/lib/parsers/json.js +7 -2
  50. package/lib/parsers/jsonc/parse.d.ts +2 -5
  51. package/lib/parsers/jsonc/parse.js +8 -6
  52. package/lib/parsers/to-format.d.ts +2 -0
  53. package/lib/parsers/to-format.js +50 -0
  54. package/lib/parsers/yaml.d.ts +4 -2
  55. package/lib/parsers/yaml.js +7 -2
  56. package/lib/routes/command.js +7 -0
  57. package/lib/routes/index.d.ts +4 -3
  58. package/lib/routes/index.js +9 -7
  59. package/lib/routes/{list-sort-concat.d.ts → list-concat-after.d.ts} +1 -1
  60. package/lib/routes/{list-sort-concat.js → list-concat-after.js} +2 -2
  61. package/lib/routes/merge-dot-js.d.ts +2 -0
  62. package/lib/routes/merge-dot-js.js +8 -0
  63. package/lib/steps/configure-install-file-actions.js +1 -20
  64. package/lib/steps/configure-update-file-actions.js +1 -20
  65. package/lib/steps/execute-first-block.js +1 -1
  66. package/lib/steps/index.d.ts +0 -2
  67. package/lib/steps/index.js +4 -3
  68. package/lib/steps/merge-text-files.d.ts +1 -1
  69. package/lib/steps/merge-text-files.js +6 -2
  70. package/lib/steps/read-files.d.ts +1 -1
  71. package/lib/steps/read-files.js +56 -42
  72. package/lib/steps/read-incoming-config.js +1 -1
  73. package/lib/steps/remove-files.d.ts +1 -1
  74. package/lib/steps/remove-files.js +3 -2
  75. package/lib/steps/rename-files.d.ts +1 -1
  76. package/lib/steps/rename-files.js +3 -2
  77. package/lib/steps/validate-newer-package.d.ts +1 -1
  78. package/lib/steps/validate-newer-package.js +13 -2
  79. package/lib/types/config.d.ts +11 -7
  80. package/lib/types/context.d.ts +23 -3
  81. package/lib/types/context.js +6 -0
  82. package/lib/types/travel.d.ts +1 -0
  83. package/lib/utils/build-journey-plan.d.ts +2 -2
  84. package/lib/utils/build-route.d.ts +1 -1
  85. package/lib/utils/build-route.js +50 -19
  86. package/lib/utils/build-travel-plan.js +1 -0
  87. package/lib/utils/command/merge-and-chains.js +1 -1
  88. package/lib/utils/command/merge-command-records.js +1 -1
  89. package/lib/utils/command/merge-parts-by-prefix.js +12 -1
  90. package/lib/utils/command/merge-semicolon-segments.js +161 -4
  91. package/lib/utils/fnmatch.d.ts +1 -0
  92. package/lib/utils/fnmatch.js +11 -0
  93. package/lib/utils/format-table.d.ts +1 -0
  94. package/lib/utils/format-table.js +58 -0
  95. package/lib/utils/get-format.js +2 -9
  96. package/lib/utils/load-package.d.ts +6 -0
  97. package/lib/utils/load-package.js +26 -0
  98. package/lib/utils/template.js +1 -3
  99. package/lib/utils/time-difference.d.ts +1 -0
  100. package/lib/utils/time-difference.js +28 -0
  101. package/package.json +128 -125
  102. package/lib/journeys/fixpack/index.d.ts +0 -2
  103. package/lib/journeys/fixpack/index.js +0 -16
  104. package/lib/steps/validate-not-present-package.d.ts +0 -3
  105. package/lib/steps/validate-not-present-package.js +0 -24
  106. package/lib/utils/try-json.d.ts +0 -1
  107. package/lib/utils/try-json.js +0 -11
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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.mapSort)((0, index_js_1.compose)({
9
- sortToTop: index_js_2.listSortConcat,
10
- $$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),
11
- }));
12
- const jsonRoute = (0, index_js_1.json)(mainRoute);
13
- const yamlRoute = (0, index_js_1.yaml)(mainRoute);
14
- const rcRoute = (0, index_js_1.rc)(mainRoute);
15
- const travelPlan = (0, build_travel_plan_js_1.buildTravelPlan)([/^\.fixpackrc\.json$/, jsonRoute], [/^\.fixpackrc\.ya?ml$/, yamlRoute], [/^\.fixpackrc$/, rcRoute]);
16
- exports.default = (0, build_journey_plan_js_1.buildJourneyPlan)(travelPlan);
@@ -1,3 +0,0 @@
1
- import { type AsyncDResult } from '@zokugun/xtry';
2
- import { type Context } from '../types/context.js';
3
- export declare function validateNotPresentPackage({ incomingPackage, config, options }: Context): AsyncDResult<boolean | void>;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateNotPresentPackage = validateNotPresentPackage;
4
- const cli_utils_1 = require("@zokugun/cli-utils");
5
- const xtry_1 = require("@zokugun/xtry");
6
- async function validateNotPresentPackage({ incomingPackage, config, options }) {
7
- if (options.force) {
8
- return xtry_1.OK;
9
- }
10
- const { name } = incomingPackage;
11
- const artifact = config.artifacts[name];
12
- if (artifact) {
13
- if (options.skip) {
14
- if (options.verbose) {
15
- cli_utils_1.logger.debug(`The "${name}" artifact is already present, skipping...`);
16
- }
17
- return xtry_1.OK_TRUE;
18
- }
19
- else {
20
- return (0, xtry_1.err)(`The "${name}" artifact has already been added.`);
21
- }
22
- }
23
- return xtry_1.OK;
24
- }
@@ -1 +0,0 @@
1
- export declare function tryJSON(value: string): Record<string, unknown> | undefined;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryJSON = tryJSON;
4
- function tryJSON(value) {
5
- try {
6
- return JSON.parse(value);
7
- }
8
- catch {
9
- return undefined;
10
- }
11
- }