@zokugun/artifact 0.4.3 → 0.4.4

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.
@@ -79,10 +79,10 @@ function buildTravel(route) {
79
79
  return (0, compositors_1.json)(buildRoute(route.json));
80
80
  }
81
81
  else if (route.rc) {
82
- return (0, compositors_1.rc)(buildRoute(route.json));
82
+ return (0, compositors_1.rc)(buildRoute(route.rc));
83
83
  }
84
84
  else if (route.yaml) {
85
- return (0, compositors_1.yaml)(buildRoute(route.json));
85
+ return (0, compositors_1.yaml)(buildRoute(route.yaml));
86
86
  }
87
87
  else {
88
88
  throw new Error('Can\'t build route');
@@ -94,7 +94,7 @@ function configureInstallFileActions(context) {
94
94
  if (!install) {
95
95
  return;
96
96
  }
97
- const overwritings = [];
97
+ const overwrites = [];
98
98
  const filters = {};
99
99
  const routes = {};
100
100
  for (const [file, fileUpdate] of Object.entries(install)) {
@@ -104,7 +104,7 @@ function configureInstallFileActions(context) {
104
104
  continue;
105
105
  }
106
106
  if (overwrite) {
107
- overwritings.push(file);
107
+ overwrites.push(file);
108
108
  }
109
109
  if (filter) {
110
110
  filters[file] = filter;
@@ -124,8 +124,8 @@ function configureInstallFileActions(context) {
124
124
  }
125
125
  }
126
126
  }
127
- if (overwritings.length > 0) {
128
- context.onExisting = (file) => (0, micromatch_1.isMatch)(file, overwritings) ? 'overwrite' : 'merge';
127
+ if (overwrites.length > 0) {
128
+ context.onExisting = (file) => (0, micromatch_1.isMatch)(file, overwrites) ? 'overwrite' : 'merge';
129
129
  }
130
130
  if (!(0, lodash_1.isEmpty)(filters)) {
131
131
  context.filters = (file) => {
@@ -79,10 +79,10 @@ function buildTravel(route) {
79
79
  return (0, compositors_1.json)(buildRoute(route.json));
80
80
  }
81
81
  else if (route.rc) {
82
- return (0, compositors_1.rc)(buildRoute(route.json));
82
+ return (0, compositors_1.rc)(buildRoute(route.rc));
83
83
  }
84
84
  else if (route.yaml) {
85
- return (0, compositors_1.yaml)(buildRoute(route.json));
85
+ return (0, compositors_1.yaml)(buildRoute(route.yaml));
86
86
  }
87
87
  else {
88
88
  throw new Error('Can\'t build route');
@@ -98,17 +98,21 @@ function configureUpdateFileActions(context) {
98
98
  }
99
99
  }
100
100
  else if ((0, lodash_1.isPlainObject)(update)) {
101
- const existings = [];
102
- const missings = [];
101
+ const overwriteExistings = [];
102
+ const skipExistings = [];
103
+ const skipMissings = [];
103
104
  const filters = {};
104
105
  const routes = {};
105
106
  for (const [file, fileUpdate] of Object.entries(update)) {
106
- const { missing, update, filter, route } = fileUpdate;
107
+ const { missing, update, overwrite, filter, route } = fileUpdate;
107
108
  if (missing === false) {
108
- missings.push(file);
109
+ skipMissings.push(file);
109
110
  }
110
111
  if (update === false) {
111
- existings.push(file);
112
+ skipExistings.push(file);
113
+ }
114
+ else if (overwrite) {
115
+ overwriteExistings.push(file);
112
116
  }
113
117
  if (filter) {
114
118
  filters[file] = filter;
@@ -128,11 +132,11 @@ function configureUpdateFileActions(context) {
128
132
  }
129
133
  }
130
134
  }
131
- if (missings.length > 0) {
132
- context.onMissing = (file) => (0, micromatch_1.isMatch)(file, missings) ? 'skip' : 'continue';
135
+ if (skipMissings.length > 0) {
136
+ context.onMissing = (file) => (0, micromatch_1.isMatch)(file, skipMissings) ? 'skip' : 'continue';
133
137
  }
134
- if (existings.length > 0) {
135
- context.onExisting = (file) => (0, micromatch_1.isMatch)(file, existings) ? 'skip' : 'merge';
138
+ if (skipExistings.length > 0 || overwriteExistings.length > 0) {
139
+ context.onExisting = (file) => (0, micromatch_1.isMatch)(file, skipExistings) ? 'skip' : ((0, micromatch_1.isMatch)(file, overwriteExistings) ? 'overwrite' : 'merge');
136
140
  }
137
141
  if (!(0, lodash_1.isEmpty)(filters)) {
138
142
  context.filters = (file) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zokugun/artifact",
3
3
  "description": "Boilerplate your project & keep your configurations up to date",
4
- "version": "0.4.3",
4
+ "version": "0.4.4",
5
5
  "author": {
6
6
  "name": "Baptiste Augrain",
7
7
  "email": "daiyam@zokugun.org"
@@ -20,7 +20,6 @@
20
20
  "atf": "bin/artifact"
21
21
  },
22
22
  "scripts": {
23
- "commit": "cz",
24
23
  "compile": "tsc -p src",
25
24
  "lint": "xo",
26
25
  "prepare": "husky install;",
@@ -43,16 +42,16 @@
43
42
  "globby": "^11.0.4",
44
43
  "istextorbinary": "^6.0.0",
45
44
  "jsonc-parser": "^3.0.0",
46
- "lodash": "^4.17.21",
47
- "micromatch": "^4.0.4",
45
+ "lodash": "^4.18.1",
46
+ "micromatch": "^4.0.8",
48
47
  "npm": "^7.23.0",
49
48
  "ora": "^5.4.1",
50
49
  "pacote": "^13.0.5",
51
- "semver": "^7.3.5",
50
+ "semver": "^7.7.4",
52
51
  "tempy": "^1.0.1",
53
52
  "typescript": "^5.9.2",
54
53
  "untildify": "^4.0.0",
55
- "yaml": "^1.10.2"
54
+ "yaml": "2.8.3"
56
55
  },
57
56
  "devDependencies": {
58
57
  "@commitlint/cli": "^16.2.3",
@@ -71,7 +70,6 @@
71
70
  "camelcase": "^6.2.0",
72
71
  "chai": "^4.3.4",
73
72
  "chai-as-promised": "^7.1.1",
74
- "commitizen": "^4.2.4",
75
73
  "eslint": "8.11.0",
76
74
  "eslint-plugin-chai-friendly": "^0.7.2",
77
75
  "fixpack": "^4.0.0",