@icebreakers/monorepo 0.0.7 → 0.1.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.
- package/{dist/assets → assets}/package.json +4 -2
- package/dist/chunk-J3MNI6VD.js +520 -0
- package/dist/cli.cjs +149 -26
- package/dist/cli.js +4 -355
- package/dist/index.cjs +526 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -5
- package/package.json +8 -2
- package/dist/chunk-22Y5C5SV.js +0 -41
- /package/{dist/assets → assets}/.changeset/config.json +0 -0
- /package/{dist/assets → assets}/.dockerignore +0 -0
- /package/{dist/assets → assets}/.editorconfig +0 -0
- /package/{dist/assets → assets}/.gitattributes +0 -0
- /package/{dist/assets → assets}/.github/FUNDING.yml +0 -0
- /package/{dist/assets → assets}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- /package/{dist/assets → assets}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- /package/{dist/assets → assets}/.github/workflows/ci.yml +0 -0
- /package/{dist/assets → assets}/.github/workflows/release.yml +0 -0
- /package/{dist/assets → assets}/.husky/commit-msg +0 -0
- /package/{dist/assets → assets}/.husky/pre-commit +0 -0
- /package/{dist/assets → assets}/.vscode/settings.json +0 -0
- /package/{dist/assets → assets}/CODE_OF_CONDUCT.md +0 -0
- /package/{dist/assets → assets}/CONTRIBUTING.md +0 -0
- /package/{dist/assets → assets}/Dockerfile +0 -0
- /package/{dist/assets → assets}/LICENSE +0 -0
- /package/{dist/assets → assets}/SECURITY.md +0 -0
- /package/{dist/assets → assets}/commitlint.config.ts +0 -0
- /package/{dist/assets → assets}/eslint.config.js +0 -0
- /package/{dist/assets → assets}/lint-staged.config.js +0 -0
- /package/{dist/assets → assets}/pnpm-workspace.yaml +0 -0
- /package/{dist/assets → assets}/renovate.json +0 -0
- /package/{dist/assets → assets}/tsconfig.json +0 -0
- /package/{dist/assets → assets}/turbo.json +0 -0
- /package/{dist/assets → assets}/vitest.workspace.ts +0 -0
|
@@ -30,13 +30,14 @@
|
|
|
30
30
|
"@commitlint/config-conventional": "^19.2.2",
|
|
31
31
|
"@commitlint/prompt-cli": "^19.4.0",
|
|
32
32
|
"@commitlint/types": "^19.0.3",
|
|
33
|
-
"@icebreakers/eslint-config": "^0.3.
|
|
33
|
+
"@icebreakers/eslint-config": "^0.3.22",
|
|
34
34
|
"@types/fs-extra": "^11.0.4",
|
|
35
35
|
"@types/get-value": "^3.0.5",
|
|
36
|
+
"@types/klaw": "^3.0.6",
|
|
36
37
|
"@types/lint-staged": "^13.3.0",
|
|
37
38
|
"@types/lodash": "^4.17.7",
|
|
38
39
|
"@types/lodash-es": "^4.17.12",
|
|
39
|
-
"@types/node": "^22.4.
|
|
40
|
+
"@types/node": "^22.4.1",
|
|
40
41
|
"@types/set-value": "^4.0.3",
|
|
41
42
|
"@vitest/coverage-v8": "^2.0.5",
|
|
42
43
|
"ci-info": "^4.0.0",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"fs-extra": "^11.2.0",
|
|
46
47
|
"get-value": "^3.0.1",
|
|
47
48
|
"husky": "^9.1.4",
|
|
49
|
+
"klaw": "^4.1.0",
|
|
48
50
|
"lint-staged": "^15.2.8",
|
|
49
51
|
"lodash": "^4.17.21",
|
|
50
52
|
"lodash-es": "^4.17.21",
|
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __esm = (fn, res) => function __init() {
|
|
14
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
|
+
};
|
|
16
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
17
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
+
mod
|
|
34
|
+
));
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js
|
|
37
|
+
var init_esm_shims = __esm({
|
|
38
|
+
"../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.41_tsx@4.17.0_typescript@5.5.4_yaml@2.5.0/node_modules/tsup/assets/esm_shims.js"() {
|
|
39
|
+
"use strict";
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
|
|
44
|
+
var require_isobject = __commonJS({
|
|
45
|
+
"../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
|
|
46
|
+
"use strict";
|
|
47
|
+
init_esm_shims();
|
|
48
|
+
module.exports = function isObject(val) {
|
|
49
|
+
return val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
|
|
55
|
+
var require_get_value = __commonJS({
|
|
56
|
+
"../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
|
|
57
|
+
"use strict";
|
|
58
|
+
init_esm_shims();
|
|
59
|
+
var isObject = require_isobject();
|
|
60
|
+
module.exports = function(target, path2, options) {
|
|
61
|
+
if (!isObject(options)) {
|
|
62
|
+
options = { default: options };
|
|
63
|
+
}
|
|
64
|
+
if (!isValidObject(target)) {
|
|
65
|
+
return typeof options.default !== "undefined" ? options.default : target;
|
|
66
|
+
}
|
|
67
|
+
if (typeof path2 === "number") {
|
|
68
|
+
path2 = String(path2);
|
|
69
|
+
}
|
|
70
|
+
const isArray = Array.isArray(path2);
|
|
71
|
+
const isString = typeof path2 === "string";
|
|
72
|
+
const splitChar = options.separator || ".";
|
|
73
|
+
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
74
|
+
if (!isString && !isArray) {
|
|
75
|
+
return target;
|
|
76
|
+
}
|
|
77
|
+
if (isString && path2 in target) {
|
|
78
|
+
return isValid(path2, target, options) ? target[path2] : options.default;
|
|
79
|
+
}
|
|
80
|
+
let segs = isArray ? path2 : split(path2, splitChar, options);
|
|
81
|
+
let len = segs.length;
|
|
82
|
+
let idx = 0;
|
|
83
|
+
do {
|
|
84
|
+
let prop = segs[idx];
|
|
85
|
+
if (typeof prop === "number") {
|
|
86
|
+
prop = String(prop);
|
|
87
|
+
}
|
|
88
|
+
while (prop && prop.slice(-1) === "\\") {
|
|
89
|
+
prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
|
|
90
|
+
}
|
|
91
|
+
if (prop in target) {
|
|
92
|
+
if (!isValid(prop, target, options)) {
|
|
93
|
+
return options.default;
|
|
94
|
+
}
|
|
95
|
+
target = target[prop];
|
|
96
|
+
} else {
|
|
97
|
+
let hasProp = false;
|
|
98
|
+
let n = idx + 1;
|
|
99
|
+
while (n < len) {
|
|
100
|
+
prop = join([prop, segs[n++]], joinChar, options);
|
|
101
|
+
if (hasProp = prop in target) {
|
|
102
|
+
if (!isValid(prop, target, options)) {
|
|
103
|
+
return options.default;
|
|
104
|
+
}
|
|
105
|
+
target = target[prop];
|
|
106
|
+
idx = n - 1;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!hasProp) {
|
|
111
|
+
return options.default;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} while (++idx < len && isValidObject(target));
|
|
115
|
+
if (idx === len) {
|
|
116
|
+
return target;
|
|
117
|
+
}
|
|
118
|
+
return options.default;
|
|
119
|
+
};
|
|
120
|
+
function join(segs, joinChar, options) {
|
|
121
|
+
if (typeof options.join === "function") {
|
|
122
|
+
return options.join(segs);
|
|
123
|
+
}
|
|
124
|
+
return segs[0] + joinChar + segs[1];
|
|
125
|
+
}
|
|
126
|
+
function split(path2, splitChar, options) {
|
|
127
|
+
if (typeof options.split === "function") {
|
|
128
|
+
return options.split(path2);
|
|
129
|
+
}
|
|
130
|
+
return path2.split(splitChar);
|
|
131
|
+
}
|
|
132
|
+
function isValid(key, target, options) {
|
|
133
|
+
if (typeof options.isValid === "function") {
|
|
134
|
+
return options.isValid(key, target);
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
function isValidObject(val) {
|
|
139
|
+
return isObject(val) || Array.isArray(val) || typeof val === "function";
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
|
|
145
|
+
var require_is_primitive = __commonJS({
|
|
146
|
+
"../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js"(exports, module) {
|
|
147
|
+
"use strict";
|
|
148
|
+
init_esm_shims();
|
|
149
|
+
module.exports = function isPrimitive(val) {
|
|
150
|
+
if (typeof val === "object") {
|
|
151
|
+
return val === null;
|
|
152
|
+
}
|
|
153
|
+
return typeof val !== "function";
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
|
|
159
|
+
var require_is_plain_object = __commonJS({
|
|
160
|
+
"../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
|
|
161
|
+
"use strict";
|
|
162
|
+
init_esm_shims();
|
|
163
|
+
var isObject = require_isobject();
|
|
164
|
+
function isObjectObject(o) {
|
|
165
|
+
return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
|
|
166
|
+
}
|
|
167
|
+
module.exports = function isPlainObject(o) {
|
|
168
|
+
var ctor, prot;
|
|
169
|
+
if (isObjectObject(o) === false) return false;
|
|
170
|
+
ctor = o.constructor;
|
|
171
|
+
if (typeof ctor !== "function") return false;
|
|
172
|
+
prot = ctor.prototype;
|
|
173
|
+
if (isObjectObject(prot) === false) return false;
|
|
174
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
return true;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// ../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js
|
|
183
|
+
var require_set_value = __commonJS({
|
|
184
|
+
"../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js"(exports, module) {
|
|
185
|
+
"use strict";
|
|
186
|
+
init_esm_shims();
|
|
187
|
+
var { deleteProperty } = Reflect;
|
|
188
|
+
var isPrimitive = require_is_primitive();
|
|
189
|
+
var isPlainObject = require_is_plain_object();
|
|
190
|
+
var isObject = (value) => {
|
|
191
|
+
return typeof value === "object" && value !== null || typeof value === "function";
|
|
192
|
+
};
|
|
193
|
+
var isUnsafeKey = (key) => {
|
|
194
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
195
|
+
};
|
|
196
|
+
var validateKey = (key) => {
|
|
197
|
+
if (!isPrimitive(key)) {
|
|
198
|
+
throw new TypeError("Object keys must be strings or symbols");
|
|
199
|
+
}
|
|
200
|
+
if (isUnsafeKey(key)) {
|
|
201
|
+
throw new Error(`Cannot set unsafe key: "${key}"`);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
var toStringKey = (input) => {
|
|
205
|
+
return Array.isArray(input) ? input.flat().map(String).join(",") : input;
|
|
206
|
+
};
|
|
207
|
+
var createMemoKey = (input, options) => {
|
|
208
|
+
if (typeof input !== "string" || !options) return input;
|
|
209
|
+
let key = input + ";";
|
|
210
|
+
if (options.arrays !== void 0) key += `arrays=${options.arrays};`;
|
|
211
|
+
if (options.separator !== void 0) key += `separator=${options.separator};`;
|
|
212
|
+
if (options.split !== void 0) key += `split=${options.split};`;
|
|
213
|
+
if (options.merge !== void 0) key += `merge=${options.merge};`;
|
|
214
|
+
if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`;
|
|
215
|
+
return key;
|
|
216
|
+
};
|
|
217
|
+
var memoize = (input, options, fn) => {
|
|
218
|
+
const key = toStringKey(options ? createMemoKey(input, options) : input);
|
|
219
|
+
validateKey(key);
|
|
220
|
+
const value = setValue.cache.get(key) || fn();
|
|
221
|
+
setValue.cache.set(key, value);
|
|
222
|
+
return value;
|
|
223
|
+
};
|
|
224
|
+
var splitString = (input, options = {}) => {
|
|
225
|
+
const sep = options.separator || ".";
|
|
226
|
+
const preserve = sep === "/" ? false : options.preservePaths;
|
|
227
|
+
if (typeof input === "string" && preserve !== false && /\//.test(input)) {
|
|
228
|
+
return [input];
|
|
229
|
+
}
|
|
230
|
+
const parts = [];
|
|
231
|
+
let part = "";
|
|
232
|
+
const push = (part2) => {
|
|
233
|
+
let number;
|
|
234
|
+
if (part2.trim() !== "" && Number.isInteger(number = Number(part2))) {
|
|
235
|
+
parts.push(number);
|
|
236
|
+
} else {
|
|
237
|
+
parts.push(part2);
|
|
238
|
+
}
|
|
239
|
+
};
|
|
240
|
+
for (let i = 0; i < input.length; i++) {
|
|
241
|
+
const value = input[i];
|
|
242
|
+
if (value === "\\") {
|
|
243
|
+
part += input[++i];
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
if (value === sep) {
|
|
247
|
+
push(part);
|
|
248
|
+
part = "";
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
part += value;
|
|
252
|
+
}
|
|
253
|
+
if (part) {
|
|
254
|
+
push(part);
|
|
255
|
+
}
|
|
256
|
+
return parts;
|
|
257
|
+
};
|
|
258
|
+
var split = (input, options) => {
|
|
259
|
+
if (options && typeof options.split === "function") return options.split(input);
|
|
260
|
+
if (typeof input === "symbol") return [input];
|
|
261
|
+
if (Array.isArray(input)) return input;
|
|
262
|
+
return memoize(input, options, () => splitString(input, options));
|
|
263
|
+
};
|
|
264
|
+
var assignProp = (obj, prop, value, options) => {
|
|
265
|
+
validateKey(prop);
|
|
266
|
+
if (value === void 0) {
|
|
267
|
+
deleteProperty(obj, prop);
|
|
268
|
+
} else if (options && options.merge) {
|
|
269
|
+
const merge = options.merge === "function" ? options.merge : Object.assign;
|
|
270
|
+
if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) {
|
|
271
|
+
obj[prop] = merge(obj[prop], value);
|
|
272
|
+
} else {
|
|
273
|
+
obj[prop] = value;
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
obj[prop] = value;
|
|
277
|
+
}
|
|
278
|
+
return obj;
|
|
279
|
+
};
|
|
280
|
+
var setValue = (target, path2, value, options) => {
|
|
281
|
+
if (!path2 || !isObject(target)) return target;
|
|
282
|
+
const keys = split(path2, options);
|
|
283
|
+
let obj = target;
|
|
284
|
+
for (let i = 0; i < keys.length; i++) {
|
|
285
|
+
const key = keys[i];
|
|
286
|
+
const next = keys[i + 1];
|
|
287
|
+
validateKey(key);
|
|
288
|
+
if (next === void 0) {
|
|
289
|
+
assignProp(obj, key, value, options);
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
if (typeof next === "number" && !Array.isArray(obj[key])) {
|
|
293
|
+
obj = obj[key] = [];
|
|
294
|
+
continue;
|
|
295
|
+
}
|
|
296
|
+
if (!isObject(obj[key])) {
|
|
297
|
+
obj[key] = {};
|
|
298
|
+
}
|
|
299
|
+
obj = obj[key];
|
|
300
|
+
}
|
|
301
|
+
return target;
|
|
302
|
+
};
|
|
303
|
+
setValue.split = split;
|
|
304
|
+
setValue.cache = /* @__PURE__ */ new Map();
|
|
305
|
+
setValue.clear = () => {
|
|
306
|
+
setValue.cache = /* @__PURE__ */ new Map();
|
|
307
|
+
};
|
|
308
|
+
module.exports = setValue;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// ../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js
|
|
313
|
+
var require_src = __commonJS({
|
|
314
|
+
"../../node_modules/.pnpm/klaw@4.1.0/node_modules/klaw/src/index.js"(exports, module) {
|
|
315
|
+
"use strict";
|
|
316
|
+
init_esm_shims();
|
|
317
|
+
var { strictEqual } = __require("assert");
|
|
318
|
+
var path2 = __require("path");
|
|
319
|
+
var fs2 = __require("fs");
|
|
320
|
+
var { Readable } = __require("stream");
|
|
321
|
+
var { fileURLToPath: fileURLToPath2 } = __require("url");
|
|
322
|
+
var Walker = class extends Readable {
|
|
323
|
+
/**
|
|
324
|
+
* @param {string} dir
|
|
325
|
+
* @param {Object} options
|
|
326
|
+
*/
|
|
327
|
+
constructor(dir, options) {
|
|
328
|
+
if (dir instanceof URL) {
|
|
329
|
+
dir = fileURLToPath2(dir);
|
|
330
|
+
}
|
|
331
|
+
strictEqual(typeof dir, "string", "`dir` parameter should be of type string or file URL. Got type: " + typeof dir);
|
|
332
|
+
options = {
|
|
333
|
+
queueMethod: "shift",
|
|
334
|
+
pathSorter: void 0,
|
|
335
|
+
filter: void 0,
|
|
336
|
+
depthLimit: void 0,
|
|
337
|
+
preserveSymlinks: false,
|
|
338
|
+
...options,
|
|
339
|
+
objectMode: true
|
|
340
|
+
};
|
|
341
|
+
super(options);
|
|
342
|
+
this.root = path2.resolve(dir);
|
|
343
|
+
this.paths = [this.root];
|
|
344
|
+
this.options = options;
|
|
345
|
+
if (options.depthLimit > -1) {
|
|
346
|
+
this.rootDepth = this.root.split(path2.sep).length + 1;
|
|
347
|
+
}
|
|
348
|
+
this.fs = options.fs || fs2;
|
|
349
|
+
}
|
|
350
|
+
_read() {
|
|
351
|
+
if (this.paths.length === 0) {
|
|
352
|
+
return this.push(null);
|
|
353
|
+
}
|
|
354
|
+
const pathItem = this.paths[this.options.queueMethod]();
|
|
355
|
+
const statFunction = this.options.preserveSymlinks ? this.fs.lstat : this.fs.stat;
|
|
356
|
+
statFunction(pathItem, (err, stats) => {
|
|
357
|
+
const item = { path: pathItem, stats };
|
|
358
|
+
if (err) {
|
|
359
|
+
return this.emit("error", err, item);
|
|
360
|
+
}
|
|
361
|
+
if (!stats.isDirectory() || this.rootDepth && pathItem.split(path2.sep).length - this.rootDepth >= this.options.depthLimit) {
|
|
362
|
+
return this.push(item);
|
|
363
|
+
}
|
|
364
|
+
this.fs.readdir(pathItem, (err2, pathItems) => {
|
|
365
|
+
if (err2) {
|
|
366
|
+
this.push(item);
|
|
367
|
+
return this.emit("error", err2, item);
|
|
368
|
+
}
|
|
369
|
+
pathItems = pathItems.map(function(part) {
|
|
370
|
+
return path2.join(pathItem, part);
|
|
371
|
+
});
|
|
372
|
+
if (this.options.filter) {
|
|
373
|
+
pathItems = pathItems.filter(this.options.filter);
|
|
374
|
+
}
|
|
375
|
+
if (this.options.pathSorter) {
|
|
376
|
+
pathItems.sort(this.options.pathSorter);
|
|
377
|
+
}
|
|
378
|
+
this.paths.push.apply(this.paths, pathItems);
|
|
379
|
+
this.push(item);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
function walk(root, options) {
|
|
385
|
+
return new Walker(root, options);
|
|
386
|
+
}
|
|
387
|
+
module.exports = walk;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
// src/index.ts
|
|
392
|
+
init_esm_shims();
|
|
393
|
+
|
|
394
|
+
// src/lib.ts
|
|
395
|
+
init_esm_shims();
|
|
396
|
+
var import_get_value2 = __toESM(require_get_value(), 1);
|
|
397
|
+
var import_set_value = __toESM(require_set_value(), 1);
|
|
398
|
+
var import_klaw = __toESM(require_src(), 1);
|
|
399
|
+
import { fileURLToPath } from "node:url";
|
|
400
|
+
import process from "node:process";
|
|
401
|
+
import path from "pathe";
|
|
402
|
+
import fs from "fs-extra";
|
|
403
|
+
|
|
404
|
+
// src/git.ts
|
|
405
|
+
init_esm_shims();
|
|
406
|
+
var import_get_value = __toESM(require_get_value(), 1);
|
|
407
|
+
import { simpleGit } from "simple-git";
|
|
408
|
+
import gitUrlParse from "git-url-parse";
|
|
409
|
+
var GitClient = class {
|
|
410
|
+
client;
|
|
411
|
+
constructor(options) {
|
|
412
|
+
this.client = simpleGit(options);
|
|
413
|
+
}
|
|
414
|
+
listConfig() {
|
|
415
|
+
return this.client.listConfig();
|
|
416
|
+
}
|
|
417
|
+
async getRepoName() {
|
|
418
|
+
const listConfig = await this.listConfig();
|
|
419
|
+
const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
|
|
420
|
+
if (x) {
|
|
421
|
+
const url = gitUrlParse(x);
|
|
422
|
+
return `${url.owner}/${url.name}`;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// src/lib.ts
|
|
428
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
429
|
+
var __dirname2 = path.dirname(__filename2);
|
|
430
|
+
var assetsDir = path.join(__dirname2, "../assets");
|
|
431
|
+
var cwd = process.cwd();
|
|
432
|
+
async function main(outdir = "") {
|
|
433
|
+
const absOutDir = path.isAbsolute(outdir) ? outdir : path.join(cwd, outdir);
|
|
434
|
+
const gitClient = new GitClient({
|
|
435
|
+
baseDir: cwd
|
|
436
|
+
});
|
|
437
|
+
const repoName = await gitClient.getRepoName();
|
|
438
|
+
for await (const file of (0, import_klaw.default)(assetsDir)) {
|
|
439
|
+
if (file.stats.isFile()) {
|
|
440
|
+
const relPath = path.relative(assetsDir, file.path);
|
|
441
|
+
const targetPath = path.resolve(absOutDir, relPath);
|
|
442
|
+
if (relPath === "package.json") {
|
|
443
|
+
const sourcePath = file.path;
|
|
444
|
+
if (await fs.exists(targetPath) && await fs.exists(sourcePath)) {
|
|
445
|
+
const sourcePkgJson = await fs.readJson(sourcePath);
|
|
446
|
+
const targetPkgJson = await fs.readJson(targetPath);
|
|
447
|
+
const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
|
|
448
|
+
const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
|
|
449
|
+
Object.entries(deps).forEach((x) => {
|
|
450
|
+
(0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
|
|
451
|
+
});
|
|
452
|
+
Object.entries(devDeps).forEach((x) => {
|
|
453
|
+
(0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
|
|
454
|
+
});
|
|
455
|
+
await fs.writeJson(targetPath, targetPkgJson, {
|
|
456
|
+
spaces: 2
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
} else if (relPath === ".changeset/config.json" && repoName && await fs.exists(file.path)) {
|
|
460
|
+
const changesetJson = await fs.readJson(file.path);
|
|
461
|
+
(0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
|
|
462
|
+
await fs.writeJson(targetPath, changesetJson, {
|
|
463
|
+
spaces: 2
|
|
464
|
+
});
|
|
465
|
+
} else {
|
|
466
|
+
await fs.copy(
|
|
467
|
+
file.path,
|
|
468
|
+
path.resolve(absOutDir, relPath)
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export {
|
|
476
|
+
init_esm_shims,
|
|
477
|
+
main
|
|
478
|
+
};
|
|
479
|
+
/*! Bundled license information:
|
|
480
|
+
|
|
481
|
+
isobject/index.js:
|
|
482
|
+
(*!
|
|
483
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
484
|
+
*
|
|
485
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
486
|
+
* Released under the MIT License.
|
|
487
|
+
*)
|
|
488
|
+
|
|
489
|
+
get-value/index.js:
|
|
490
|
+
(*!
|
|
491
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
492
|
+
*
|
|
493
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
494
|
+
* Released under the MIT License.
|
|
495
|
+
*)
|
|
496
|
+
|
|
497
|
+
is-primitive/index.js:
|
|
498
|
+
(*!
|
|
499
|
+
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
|
500
|
+
*
|
|
501
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
502
|
+
* Released under the MIT License.
|
|
503
|
+
*)
|
|
504
|
+
|
|
505
|
+
is-plain-object/index.js:
|
|
506
|
+
(*!
|
|
507
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
508
|
+
*
|
|
509
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
510
|
+
* Released under the MIT License.
|
|
511
|
+
*)
|
|
512
|
+
|
|
513
|
+
set-value/index.js:
|
|
514
|
+
(*!
|
|
515
|
+
* set-value <https://github.com/jonschlinkert/set-value>
|
|
516
|
+
*
|
|
517
|
+
* Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
|
|
518
|
+
* Released under the MIT License.
|
|
519
|
+
*)
|
|
520
|
+
*/
|