@zokugun/artifact 0.8.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 (96) hide show
  1. package/lib/commands/add.js +67 -37
  2. package/lib/commands/list.js +2 -2
  3. package/lib/commands/outdated.js +2 -2
  4. package/lib/commands/remove.js +12 -18
  5. package/lib/commands/update.js +36 -21
  6. package/lib/compositors/codec.d.ts +3 -0
  7. package/lib/compositors/codec.js +46 -0
  8. package/lib/compositors/compose.d.ts +1 -0
  9. package/lib/compositors/compose.js +4 -0
  10. package/lib/compositors/index.d.ts +1 -0
  11. package/lib/compositors/index.js +3 -1
  12. package/lib/compositors/json.js +3 -66
  13. package/lib/compositors/rc.js +3 -56
  14. package/lib/compositors/yaml.js +24 -3
  15. package/lib/configs/install/read-install-config.d.ts +2 -5
  16. package/lib/configs/install/read-install-config.js +20 -18
  17. package/lib/configs/install/write-install-config.d.ts +2 -2
  18. package/lib/configs/install/write-install-config.js +2 -1
  19. package/lib/configs/package/read-package-config.d.ts +2 -1
  20. package/lib/configs/package/read-package-config.js +96 -10
  21. package/lib/configs/utils/constants.d.ts +2 -2
  22. package/lib/configs/utils/constants.js +2 -2
  23. package/lib/configs/utils/merge-upsert-property.js +0 -8
  24. package/lib/configs/utils/normalize-file-always.js +5 -0
  25. package/lib/configs/utils/normalize-file-upsert.d.ts +2 -1
  26. package/lib/configs/utils/normalize-file-upsert.js +12 -5
  27. package/lib/journeys/commitlint/index.d.ts +1 -1
  28. package/lib/journeys/config.ts/index.d.ts +1 -1
  29. package/lib/journeys/config.ts/index.js +2 -6
  30. package/lib/journeys/default/index.d.ts +1 -1
  31. package/lib/journeys/gitignore/index.d.ts +1 -1
  32. package/lib/journeys/ignore/index.d.ts +1 -1
  33. package/lib/journeys/index.d.ts +2 -2
  34. package/lib/journeys/index.js +9 -11
  35. package/lib/journeys/npmignore/index.d.ts +1 -1
  36. package/lib/journeys/package/index.d.ts +1 -1
  37. package/lib/journeys/rc/index.d.ts +1 -1
  38. package/lib/journeys/tsconfig/index.d.ts +1 -1
  39. package/lib/parsers/index.d.ts +4 -0
  40. package/lib/parsers/index.js +41 -0
  41. package/lib/parsers/json.d.ts +4 -2
  42. package/lib/parsers/json.js +7 -2
  43. package/lib/parsers/jsonc/parse.d.ts +2 -5
  44. package/lib/parsers/jsonc/parse.js +8 -6
  45. package/lib/parsers/to-format.d.ts +2 -0
  46. package/lib/parsers/to-format.js +50 -0
  47. package/lib/parsers/yaml.d.ts +4 -2
  48. package/lib/parsers/yaml.js +7 -2
  49. package/lib/routes/command.js +7 -0
  50. package/lib/routes/index.d.ts +4 -3
  51. package/lib/routes/index.js +9 -7
  52. package/lib/routes/{list-sort-concat.d.ts → list-concat-after.d.ts} +1 -1
  53. package/lib/routes/{list-sort-concat.js → list-concat-after.js} +2 -2
  54. package/lib/routes/merge-dot-js.d.ts +2 -0
  55. package/lib/routes/merge-dot-js.js +8 -0
  56. package/lib/steps/configure-install-file-actions.js +1 -20
  57. package/lib/steps/configure-update-file-actions.js +1 -20
  58. package/lib/steps/execute-first-block.js +1 -1
  59. package/lib/steps/index.d.ts +0 -2
  60. package/lib/steps/index.js +4 -3
  61. package/lib/steps/merge-text-files.d.ts +1 -1
  62. package/lib/steps/merge-text-files.js +6 -2
  63. package/lib/steps/read-files.d.ts +1 -1
  64. package/lib/steps/read-files.js +56 -42
  65. package/lib/steps/read-incoming-config.js +1 -1
  66. package/lib/steps/remove-files.d.ts +1 -1
  67. package/lib/steps/remove-files.js +3 -2
  68. package/lib/steps/rename-files.d.ts +1 -1
  69. package/lib/steps/rename-files.js +3 -2
  70. package/lib/steps/validate-newer-package.d.ts +1 -1
  71. package/lib/steps/validate-newer-package.js +13 -2
  72. package/lib/types/config.d.ts +11 -7
  73. package/lib/types/context.d.ts +23 -3
  74. package/lib/types/context.js +6 -0
  75. package/lib/types/travel.d.ts +1 -0
  76. package/lib/utils/build-journey-plan.d.ts +2 -2
  77. package/lib/utils/build-route.d.ts +1 -1
  78. package/lib/utils/build-route.js +50 -19
  79. package/lib/utils/build-travel-plan.js +1 -0
  80. package/lib/utils/command/merge-and-chains.js +1 -1
  81. package/lib/utils/command/merge-command-records.js +1 -1
  82. package/lib/utils/command/merge-parts-by-prefix.js +12 -1
  83. package/lib/utils/command/merge-semicolon-segments.js +161 -4
  84. package/lib/utils/fnmatch.d.ts +1 -0
  85. package/lib/utils/fnmatch.js +11 -0
  86. package/lib/utils/get-format.js +2 -9
  87. package/lib/utils/load-package.d.ts +6 -0
  88. package/lib/utils/load-package.js +26 -0
  89. package/lib/utils/template.js +1 -3
  90. package/package.json +128 -127
  91. package/lib/journeys/fixpack/index.d.ts +0 -2
  92. package/lib/journeys/fixpack/index.js +0 -16
  93. package/lib/steps/validate-not-present-package.d.ts +0 -3
  94. package/lib/steps/validate-not-present-package.js +0 -24
  95. package/lib/utils/try-json.d.ts +0 -1
  96. package/lib/utils/try-json.js +0 -11
package/package.json CHANGED
@@ -1,129 +1,130 @@
1
1
  {
2
- "name": "@zokugun/artifact",
3
- "description": "Boilerplate your project & keep your configurations up to date",
4
- "version": "0.8.0",
5
- "author": {
6
- "name": "Baptiste Augrain",
7
- "email": "daiyam@zokugun.org"
8
- },
9
- "license": "MIT",
10
- "homepage": "https://github.com/zokugun/artifact",
11
- "repository": {
12
- "type": "git",
13
- "url": "https://github.com/zokugun/artifact.git"
14
- },
15
- "bugs": {
16
- "url": "https://github.com/zokugun/artifact/discussions/categories/issue-triage"
17
- },
18
- "engines": {
19
- "node": ">=18.20"
20
- },
21
- "bin": {
22
- "artifact": "bin/artifact",
23
- "atf": "bin/artifact"
24
- },
25
- "scripts": {
26
- "audit:fix": "npm audit fix --min-release-age=0",
27
- "build": "npm run clean && npm run compile:src",
28
- "ci:lint": "zizmor .",
29
- "ci:lint:fix": "zizmor . --fix=all",
30
- "clean": "rimraf .test lib",
31
- "compile:src": "tsc -p src",
32
- "lint": "xo",
33
- "lint:all": "fixpack && npm run ci:lint && npm run lint",
34
- "lint:fix": "xo --fix",
35
- "prepack": "npm run build",
36
- "prepare": "husky; fixpack || true",
37
- "release": "release-it",
38
- "test": "tsc -p test && mocha",
39
- "test:dev": "mocha",
40
- "test:watch": "tsc-watch -p src -p test --onSuccess 'mocha -g=\"\"'",
41
- "update:artifacts": "artifact update",
42
- "update:ci": "PINACT_MIN_AGE=7 pinact run",
43
- "update:deps": "taze",
44
- "watch:build": "tsc-watch -p src --onSuccess 'npm run build'",
45
- "watch:src": "tsc-watch -p src",
46
- "watch:test": "tsc-watch -p test"
47
- },
48
- "dependencies": {
49
- "@types/cli-progress": "^3.11.6",
50
- "@zokugun/cli-utils": "0.3.1",
51
- "@zokugun/configdotts-merge": "0.2.1",
52
- "@zokugun/fs-extra-plus": "0.3.7",
53
- "@zokugun/is-it-type": "0.8.1",
54
- "@zokugun/xtry": "0.11.4",
55
- "cli-progress": "^3.12.0",
56
- "dayjs": "1.11.20",
57
- "editorconfig": "0.15.3",
58
- "git-url-parse": "16.1.0",
59
- "globby": "11.1.0",
60
- "istextorbinary": "6.0.0",
61
- "jq-wasm": "1.1.0-jq-1.8.1",
62
- "jsonc-parser": "3.3.1",
63
- "lodash-es": "4.18.1",
64
- "micromatch": "4.0.8",
65
- "pacote": "21.5.0",
66
- "semver": "7.7.4",
67
- "tempy": "1.0.1",
68
- "untildify": "4.0.0",
69
- "yaml": "2.8.3"
70
- },
71
- "devDependencies": {
72
- "@commitlint/cli": "19.8.1",
73
- "@commitlint/config-conventional": "19.8.1",
74
- "@types/chai": "4.3.20",
75
- "@types/chai-as-promised": "7.1.8",
76
- "@types/lodash-es": "4.17.12",
77
- "@types/micromatch": "4.0.10",
78
- "@types/mocha": "9.1.1",
79
- "@types/node": "20.19.39",
80
- "@types/npm": "7.19.3",
81
- "@types/pacote": "11.1.8",
82
- "@types/semver": "7.7.1",
83
- "@types/universalify": "1.0.3",
84
- "camelcase": "6.3.0",
85
- "chai": "4.5.0",
86
- "chai-as-promised": "7.1.2",
87
- "eslint": "8.11.0",
88
- "eslint-plugin-chai-friendly": "0.7.4",
89
- "fixpack": "4.0.0",
90
- "husky": "9.1.7",
91
- "lint-staged": "16.4.0",
92
- "memfs": "3.6.0",
93
- "mocha": "9.2.2",
94
- "release-it": "20.0.0",
95
- "rewiremock": "3.14.6",
96
- "source-map-support": "0.5.21",
97
- "taze": "19.11.0",
98
- "tsc-watch": "7.2.0",
99
- "typescript": "5.9.3",
100
- "universalify": "2.0.1",
101
- "xo": "0.60.0"
102
- },
103
- "overrides": {
104
- "mocha": {
105
- "diff": "5.2.2",
106
- "glob": "8.1.0",
107
- "js-yaml": "4.1.1",
108
- "minimatch": "4.2.6",
109
- "nanoid": "3.3.11",
110
- "serialize-javascript": "7.0.5"
111
- }
112
- },
113
- "keywords": [
114
- "artifact",
115
- "boilerplate",
116
- "boilerplates",
117
- "codegeneration",
118
- "codemod",
119
- "codemods",
120
- "configuration",
121
- "configurations",
122
- "generate",
123
- "generator",
124
- "project-generator",
125
- "project-starter",
126
- "project-template",
127
- "scaffold"
128
- ]
2
+ "name": "@zokugun/artifact",
3
+ "description": "Boilerplate your project & keep your configurations up to date",
4
+ "version": "0.9.0",
5
+ "author": {
6
+ "name": "Baptiste Augrain",
7
+ "email": "daiyam@zokugun.org"
8
+ },
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/zokugun/artifact",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/zokugun/artifact.git"
14
+ },
15
+ "bugs": {
16
+ "url": "https://github.com/zokugun/artifact/discussions/categories/issue-triage"
17
+ },
18
+ "engines": {
19
+ "node": ">=18.20"
20
+ },
21
+ "bin": {
22
+ "artifact": "bin/artifact",
23
+ "atf": "bin/artifact"
24
+ },
25
+ "scripts": {
26
+ "audit:fix": "npm audit fix --min-release-age=0",
27
+ "build": "npm run clean && npm run compile:src",
28
+ "ci:lint": "zizmor .",
29
+ "ci:lint:fix": "zizmor . --fix=all",
30
+ "clean": "rimraf .test lib",
31
+ "compile:src": "tsc -p src",
32
+ "lint": "xo",
33
+ "lint:all": "fixpack && npm run lint:package && npm run ci:lint && npm run lint",
34
+ "lint:fix": "xo --fix",
35
+ "lint:package": "fixpack || true",
36
+ "prepare": "husky; npm run lint:package",
37
+ "release": "release-it",
38
+ "test": "tsc -p test && mocha",
39
+ "test:dev": "mocha",
40
+ "test:watch": "tsc-watch -p src -p test --onSuccess 'mocha -g=\"\"'",
41
+ "update:artifacts": "artifact update",
42
+ "update:ci": "PINACT_MIN_AGE=7 pinact run --update",
43
+ "update:deps": "taze --all",
44
+ "watch:build": "tsc-watch -p src --onSuccess 'npm run build'",
45
+ "watch:src": "tsc-watch -p src",
46
+ "watch:test": "tsc-watch -p test"
47
+ },
48
+ "dependencies": {
49
+ "@types/cli-progress": "3.11.6",
50
+ "@zokugun/cli-utils": "0.3.2",
51
+ "@zokugun/configdotts-merge": "0.3.0",
52
+ "@zokugun/fs-extra-plus": "0.3.7",
53
+ "@zokugun/is-it-type": "0.8.1",
54
+ "@zokugun/xtry": "0.11.4",
55
+ "cli-progress": "3.12.0",
56
+ "dayjs": "1.11.20",
57
+ "editorconfig": "0.15.3",
58
+ "git-url-parse": "16.1.0",
59
+ "globby": "11.1.0",
60
+ "istextorbinary": "6.0.0",
61
+ "jq-wasm": "1.1.0-jq-1.8.1",
62
+ "jsonc-parser": "3.3.1",
63
+ "lodash-es": "4.18.1",
64
+ "micromatch": "4.0.8",
65
+ "pacote": "21.5.0",
66
+ "semver": "7.7.4",
67
+ "tempy": "1.0.1",
68
+ "untildify": "4.0.0",
69
+ "yaml": "2.8.3"
70
+ },
71
+ "devDependencies": {
72
+ "@commitlint/cli": "20.5.2",
73
+ "@commitlint/config-conventional": "20.5.0",
74
+ "@types/chai": "4.3.20",
75
+ "@types/chai-as-promised": "7.1.8",
76
+ "@types/lodash-es": "4.17.12",
77
+ "@types/micromatch": "4.0.10",
78
+ "@types/mocha": "9.1.1",
79
+ "@types/node": "20.19.39",
80
+ "@types/npm": "7.19.3",
81
+ "@types/pacote": "11.1.8",
82
+ "@types/semver": "7.7.1",
83
+ "@types/universalify": "1.0.3",
84
+ "camelcase": "6.3.0",
85
+ "chai": "4.5.0",
86
+ "chai-as-promised": "7.1.2",
87
+ "eslint": "8.11.0",
88
+ "eslint-plugin-chai-friendly": "0.7.4",
89
+ "fixpack": "4.0.0",
90
+ "husky": "9.1.7",
91
+ "lint-staged": "16.4.0",
92
+ "memfs": "3.6.0",
93
+ "mocha": "9.2.2",
94
+ "release-it": "20.0.1",
95
+ "rewiremock": "3.14.6",
96
+ "rimraf": "6.1.3",
97
+ "source-map-support": "0.5.21",
98
+ "taze": "19.11.0",
99
+ "tsc-watch": "7.2.0",
100
+ "typescript": "5.9.3",
101
+ "universalify": "2.0.1",
102
+ "xo": "0.60.0"
103
+ },
104
+ "overrides": {
105
+ "mocha": {
106
+ "diff": "5.2.2",
107
+ "glob": "8.1.0",
108
+ "js-yaml": "4.1.1",
109
+ "minimatch": "4.2.6",
110
+ "nanoid": "3.3.11",
111
+ "serialize-javascript": "7.0.5"
112
+ }
113
+ },
114
+ "keywords": [
115
+ "artifact",
116
+ "boilerplate",
117
+ "boilerplates",
118
+ "codegeneration",
119
+ "codemod",
120
+ "codemods",
121
+ "configuration",
122
+ "configurations",
123
+ "generate",
124
+ "generator",
125
+ "project-generator",
126
+ "project-starter",
127
+ "project-template",
128
+ "scaffold"
129
+ ]
129
130
  }
@@ -1,2 +0,0 @@
1
- declare const _default: (basename: string) => import("../../types/travel.js").Journey | undefined;
2
- export default _default;
@@ -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
- }