@icebreakers/monorepo 0.0.8 → 0.1.1

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 (35) hide show
  1. package/{dist/assets → assets}/package.json +2 -0
  2. package/dist/chunk-VFW6IW2P.js +435 -0
  3. package/dist/cli.cjs +70 -26
  4. package/dist/cli.js +4 -355
  5. package/dist/index.cjs +447 -0
  6. package/dist/index.d.cts +2 -1
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.js +5 -5
  9. package/package.json +9 -2
  10. package/dist/chunk-22Y5C5SV.js +0 -41
  11. /package/{dist/assets → assets}/.changeset/config.json +0 -0
  12. /package/{dist/assets → assets}/.dockerignore +0 -0
  13. /package/{dist/assets → assets}/.editorconfig +0 -0
  14. /package/{dist/assets → assets}/.gitattributes +0 -0
  15. /package/{dist/assets → assets}/.github/FUNDING.yml +0 -0
  16. /package/{dist/assets → assets}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  17. /package/{dist/assets → assets}/.github/ISSUE_TEMPLATE/config.yml +0 -0
  18. /package/{dist/assets → assets}/.github/workflows/ci.yml +0 -0
  19. /package/{dist/assets → assets}/.github/workflows/release.yml +0 -0
  20. /package/{dist/assets → assets}/.husky/commit-msg +0 -0
  21. /package/{dist/assets → assets}/.husky/pre-commit +0 -0
  22. /package/{dist/assets → assets}/.vscode/settings.json +0 -0
  23. /package/{dist/assets → assets}/CODE_OF_CONDUCT.md +0 -0
  24. /package/{dist/assets → assets}/CONTRIBUTING.md +0 -0
  25. /package/{dist/assets → assets}/Dockerfile +0 -0
  26. /package/{dist/assets → assets}/LICENSE +0 -0
  27. /package/{dist/assets → assets}/SECURITY.md +0 -0
  28. /package/{dist/assets → assets}/commitlint.config.ts +0 -0
  29. /package/{dist/assets → assets}/eslint.config.js +0 -0
  30. /package/{dist/assets → assets}/lint-staged.config.js +0 -0
  31. /package/{dist/assets → assets}/pnpm-workspace.yaml +0 -0
  32. /package/{dist/assets → assets}/renovate.json +0 -0
  33. /package/{dist/assets → assets}/tsconfig.json +0 -0
  34. /package/{dist/assets → assets}/turbo.json +0 -0
  35. /package/{dist/assets → assets}/vitest.workspace.ts +0 -0
@@ -33,6 +33,7 @@
33
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",
@@ -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,435 @@
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 __esm = (fn, res) => function __init() {
8
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
9
+ };
10
+ var __commonJS = (cb, mod) => function __require() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+
30
+ // ../../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
31
+ var init_esm_shims = __esm({
32
+ "../../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"() {
33
+ "use strict";
34
+ }
35
+ });
36
+
37
+ // ../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js
38
+ var require_isobject = __commonJS({
39
+ "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
40
+ "use strict";
41
+ init_esm_shims();
42
+ module.exports = function isObject(val) {
43
+ return val != null && typeof val === "object" && Array.isArray(val) === false;
44
+ };
45
+ }
46
+ });
47
+
48
+ // ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
49
+ var require_get_value = __commonJS({
50
+ "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
51
+ "use strict";
52
+ init_esm_shims();
53
+ var isObject = require_isobject();
54
+ module.exports = function(target, path2, options) {
55
+ if (!isObject(options)) {
56
+ options = { default: options };
57
+ }
58
+ if (!isValidObject(target)) {
59
+ return typeof options.default !== "undefined" ? options.default : target;
60
+ }
61
+ if (typeof path2 === "number") {
62
+ path2 = String(path2);
63
+ }
64
+ const isArray = Array.isArray(path2);
65
+ const isString = typeof path2 === "string";
66
+ const splitChar = options.separator || ".";
67
+ const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
68
+ if (!isString && !isArray) {
69
+ return target;
70
+ }
71
+ if (isString && path2 in target) {
72
+ return isValid(path2, target, options) ? target[path2] : options.default;
73
+ }
74
+ let segs = isArray ? path2 : split(path2, splitChar, options);
75
+ let len = segs.length;
76
+ let idx = 0;
77
+ do {
78
+ let prop = segs[idx];
79
+ if (typeof prop === "number") {
80
+ prop = String(prop);
81
+ }
82
+ while (prop && prop.slice(-1) === "\\") {
83
+ prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
84
+ }
85
+ if (prop in target) {
86
+ if (!isValid(prop, target, options)) {
87
+ return options.default;
88
+ }
89
+ target = target[prop];
90
+ } else {
91
+ let hasProp = false;
92
+ let n = idx + 1;
93
+ while (n < len) {
94
+ prop = join([prop, segs[n++]], joinChar, options);
95
+ if (hasProp = prop in target) {
96
+ if (!isValid(prop, target, options)) {
97
+ return options.default;
98
+ }
99
+ target = target[prop];
100
+ idx = n - 1;
101
+ break;
102
+ }
103
+ }
104
+ if (!hasProp) {
105
+ return options.default;
106
+ }
107
+ }
108
+ } while (++idx < len && isValidObject(target));
109
+ if (idx === len) {
110
+ return target;
111
+ }
112
+ return options.default;
113
+ };
114
+ function join(segs, joinChar, options) {
115
+ if (typeof options.join === "function") {
116
+ return options.join(segs);
117
+ }
118
+ return segs[0] + joinChar + segs[1];
119
+ }
120
+ function split(path2, splitChar, options) {
121
+ if (typeof options.split === "function") {
122
+ return options.split(path2);
123
+ }
124
+ return path2.split(splitChar);
125
+ }
126
+ function isValid(key, target, options) {
127
+ if (typeof options.isValid === "function") {
128
+ return options.isValid(key, target);
129
+ }
130
+ return true;
131
+ }
132
+ function isValidObject(val) {
133
+ return isObject(val) || Array.isArray(val) || typeof val === "function";
134
+ }
135
+ }
136
+ });
137
+
138
+ // ../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js
139
+ var require_is_primitive = __commonJS({
140
+ "../../node_modules/.pnpm/is-primitive@3.0.1/node_modules/is-primitive/index.js"(exports, module) {
141
+ "use strict";
142
+ init_esm_shims();
143
+ module.exports = function isPrimitive(val) {
144
+ if (typeof val === "object") {
145
+ return val === null;
146
+ }
147
+ return typeof val !== "function";
148
+ };
149
+ }
150
+ });
151
+
152
+ // ../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js
153
+ var require_is_plain_object = __commonJS({
154
+ "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
155
+ "use strict";
156
+ init_esm_shims();
157
+ var isObject = require_isobject();
158
+ function isObjectObject(o) {
159
+ return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
160
+ }
161
+ module.exports = function isPlainObject(o) {
162
+ var ctor, prot;
163
+ if (isObjectObject(o) === false) return false;
164
+ ctor = o.constructor;
165
+ if (typeof ctor !== "function") return false;
166
+ prot = ctor.prototype;
167
+ if (isObjectObject(prot) === false) return false;
168
+ if (prot.hasOwnProperty("isPrototypeOf") === false) {
169
+ return false;
170
+ }
171
+ return true;
172
+ };
173
+ }
174
+ });
175
+
176
+ // ../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js
177
+ var require_set_value = __commonJS({
178
+ "../../node_modules/.pnpm/set-value@4.1.0/node_modules/set-value/index.js"(exports, module) {
179
+ "use strict";
180
+ init_esm_shims();
181
+ var { deleteProperty } = Reflect;
182
+ var isPrimitive = require_is_primitive();
183
+ var isPlainObject = require_is_plain_object();
184
+ var isObject = (value) => {
185
+ return typeof value === "object" && value !== null || typeof value === "function";
186
+ };
187
+ var isUnsafeKey = (key) => {
188
+ return key === "__proto__" || key === "constructor" || key === "prototype";
189
+ };
190
+ var validateKey = (key) => {
191
+ if (!isPrimitive(key)) {
192
+ throw new TypeError("Object keys must be strings or symbols");
193
+ }
194
+ if (isUnsafeKey(key)) {
195
+ throw new Error(`Cannot set unsafe key: "${key}"`);
196
+ }
197
+ };
198
+ var toStringKey = (input) => {
199
+ return Array.isArray(input) ? input.flat().map(String).join(",") : input;
200
+ };
201
+ var createMemoKey = (input, options) => {
202
+ if (typeof input !== "string" || !options) return input;
203
+ let key = input + ";";
204
+ if (options.arrays !== void 0) key += `arrays=${options.arrays};`;
205
+ if (options.separator !== void 0) key += `separator=${options.separator};`;
206
+ if (options.split !== void 0) key += `split=${options.split};`;
207
+ if (options.merge !== void 0) key += `merge=${options.merge};`;
208
+ if (options.preservePaths !== void 0) key += `preservePaths=${options.preservePaths};`;
209
+ return key;
210
+ };
211
+ var memoize = (input, options, fn) => {
212
+ const key = toStringKey(options ? createMemoKey(input, options) : input);
213
+ validateKey(key);
214
+ const value = setValue.cache.get(key) || fn();
215
+ setValue.cache.set(key, value);
216
+ return value;
217
+ };
218
+ var splitString = (input, options = {}) => {
219
+ const sep = options.separator || ".";
220
+ const preserve = sep === "/" ? false : options.preservePaths;
221
+ if (typeof input === "string" && preserve !== false && /\//.test(input)) {
222
+ return [input];
223
+ }
224
+ const parts = [];
225
+ let part = "";
226
+ const push = (part2) => {
227
+ let number;
228
+ if (part2.trim() !== "" && Number.isInteger(number = Number(part2))) {
229
+ parts.push(number);
230
+ } else {
231
+ parts.push(part2);
232
+ }
233
+ };
234
+ for (let i = 0; i < input.length; i++) {
235
+ const value = input[i];
236
+ if (value === "\\") {
237
+ part += input[++i];
238
+ continue;
239
+ }
240
+ if (value === sep) {
241
+ push(part);
242
+ part = "";
243
+ continue;
244
+ }
245
+ part += value;
246
+ }
247
+ if (part) {
248
+ push(part);
249
+ }
250
+ return parts;
251
+ };
252
+ var split = (input, options) => {
253
+ if (options && typeof options.split === "function") return options.split(input);
254
+ if (typeof input === "symbol") return [input];
255
+ if (Array.isArray(input)) return input;
256
+ return memoize(input, options, () => splitString(input, options));
257
+ };
258
+ var assignProp = (obj, prop, value, options) => {
259
+ validateKey(prop);
260
+ if (value === void 0) {
261
+ deleteProperty(obj, prop);
262
+ } else if (options && options.merge) {
263
+ const merge = options.merge === "function" ? options.merge : Object.assign;
264
+ if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) {
265
+ obj[prop] = merge(obj[prop], value);
266
+ } else {
267
+ obj[prop] = value;
268
+ }
269
+ } else {
270
+ obj[prop] = value;
271
+ }
272
+ return obj;
273
+ };
274
+ var setValue = (target, path2, value, options) => {
275
+ if (!path2 || !isObject(target)) return target;
276
+ const keys = split(path2, options);
277
+ let obj = target;
278
+ for (let i = 0; i < keys.length; i++) {
279
+ const key = keys[i];
280
+ const next = keys[i + 1];
281
+ validateKey(key);
282
+ if (next === void 0) {
283
+ assignProp(obj, key, value, options);
284
+ break;
285
+ }
286
+ if (typeof next === "number" && !Array.isArray(obj[key])) {
287
+ obj = obj[key] = [];
288
+ continue;
289
+ }
290
+ if (!isObject(obj[key])) {
291
+ obj[key] = {};
292
+ }
293
+ obj = obj[key];
294
+ }
295
+ return target;
296
+ };
297
+ setValue.split = split;
298
+ setValue.cache = /* @__PURE__ */ new Map();
299
+ setValue.clear = () => {
300
+ setValue.cache = /* @__PURE__ */ new Map();
301
+ };
302
+ module.exports = setValue;
303
+ }
304
+ });
305
+
306
+ // src/index.ts
307
+ init_esm_shims();
308
+
309
+ // src/lib.ts
310
+ init_esm_shims();
311
+ var import_get_value2 = __toESM(require_get_value(), 1);
312
+ var import_set_value = __toESM(require_set_value(), 1);
313
+ import { fileURLToPath } from "node:url";
314
+ import process from "node:process";
315
+ import path from "pathe";
316
+ import fs from "fs-extra";
317
+ import klaw from "klaw";
318
+
319
+ // src/git.ts
320
+ init_esm_shims();
321
+ var import_get_value = __toESM(require_get_value(), 1);
322
+ import { simpleGit } from "simple-git";
323
+ import gitUrlParse from "git-url-parse";
324
+ var GitClient = class {
325
+ client;
326
+ constructor(options) {
327
+ this.client = simpleGit(options);
328
+ }
329
+ listConfig() {
330
+ return this.client.listConfig();
331
+ }
332
+ async getRepoName() {
333
+ const listConfig = await this.listConfig();
334
+ const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
335
+ if (x) {
336
+ const url = gitUrlParse(x);
337
+ return `${url.owner}/${url.name}`;
338
+ }
339
+ }
340
+ };
341
+
342
+ // src/lib.ts
343
+ var __filename2 = fileURLToPath(import.meta.url);
344
+ var __dirname2 = path.dirname(__filename2);
345
+ var assetsDir = path.join(__dirname2, "../assets");
346
+ var cwd = process.cwd();
347
+ async function main(outdir = "") {
348
+ const absOutDir = path.isAbsolute(outdir) ? outdir : path.join(cwd, outdir);
349
+ const gitClient = new GitClient({
350
+ baseDir: cwd
351
+ });
352
+ const repoName = await gitClient.getRepoName();
353
+ for await (const file of klaw(assetsDir)) {
354
+ if (file.stats.isFile()) {
355
+ const relPath = path.relative(assetsDir, file.path);
356
+ const targetPath = path.resolve(absOutDir, relPath);
357
+ if (relPath === "package.json") {
358
+ const sourcePath = file.path;
359
+ if (await fs.exists(targetPath) && await fs.exists(sourcePath)) {
360
+ const sourcePkgJson = await fs.readJson(sourcePath);
361
+ const targetPkgJson = await fs.readJson(targetPath);
362
+ const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
363
+ const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
364
+ Object.entries(deps).forEach((x) => {
365
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
366
+ });
367
+ Object.entries(devDeps).forEach((x) => {
368
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
369
+ });
370
+ await fs.writeJson(targetPath, targetPkgJson, {
371
+ spaces: 2
372
+ });
373
+ }
374
+ } else if (relPath === ".changeset/config.json" && repoName && await fs.exists(file.path)) {
375
+ const changesetJson = await fs.readJson(file.path);
376
+ (0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
377
+ await fs.writeJson(targetPath, changesetJson, {
378
+ spaces: 2
379
+ });
380
+ } else {
381
+ await fs.copy(
382
+ file.path,
383
+ path.resolve(absOutDir, relPath)
384
+ );
385
+ }
386
+ }
387
+ }
388
+ }
389
+
390
+ export {
391
+ init_esm_shims,
392
+ main
393
+ };
394
+ /*! Bundled license information:
395
+
396
+ isobject/index.js:
397
+ (*!
398
+ * isobject <https://github.com/jonschlinkert/isobject>
399
+ *
400
+ * Copyright (c) 2014-2017, Jon Schlinkert.
401
+ * Released under the MIT License.
402
+ *)
403
+
404
+ get-value/index.js:
405
+ (*!
406
+ * get-value <https://github.com/jonschlinkert/get-value>
407
+ *
408
+ * Copyright (c) 2014-2018, Jon Schlinkert.
409
+ * Released under the MIT License.
410
+ *)
411
+
412
+ is-primitive/index.js:
413
+ (*!
414
+ * is-primitive <https://github.com/jonschlinkert/is-primitive>
415
+ *
416
+ * Copyright (c) 2014-present, Jon Schlinkert.
417
+ * Released under the MIT License.
418
+ *)
419
+
420
+ is-plain-object/index.js:
421
+ (*!
422
+ * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
423
+ *
424
+ * Copyright (c) 2014-2017, Jon Schlinkert.
425
+ * Released under the MIT License.
426
+ *)
427
+
428
+ set-value/index.js:
429
+ (*!
430
+ * set-value <https://github.com/jonschlinkert/set-value>
431
+ *
432
+ * Copyright (c) Jon Schlinkert (https://github.com/jonschlinkert).
433
+ * Released under the MIT License.
434
+ *)
435
+ */
package/dist/cli.cjs CHANGED
@@ -309,47 +309,91 @@ var require_set_value = __commonJS({
309
309
 
310
310
  // src/cli.ts
311
311
  init_cjs_shims();
312
+
313
+ // src/lib.ts
314
+ init_cjs_shims();
312
315
  var import_node_url = require("url");
313
316
  var import_node_process = __toESM(require("process"), 1);
314
317
  var import_pathe = __toESM(require("pathe"), 1);
315
318
  var import_fs_extra = __toESM(require("fs-extra"), 1);
316
- var import_get_value = __toESM(require_get_value(), 1);
319
+ var import_get_value2 = __toESM(require_get_value(), 1);
317
320
  var import_set_value = __toESM(require_set_value(), 1);
321
+ var import_klaw = __toESM(require("klaw"), 1);
322
+
323
+ // src/git.ts
324
+ init_cjs_shims();
325
+ var import_simple_git = require("simple-git");
326
+ var import_git_url_parse = __toESM(require("git-url-parse"), 1);
327
+ var import_get_value = __toESM(require_get_value(), 1);
328
+ var GitClient = class {
329
+ client;
330
+ constructor(options) {
331
+ this.client = (0, import_simple_git.simpleGit)(options);
332
+ }
333
+ listConfig() {
334
+ return this.client.listConfig();
335
+ }
336
+ async getRepoName() {
337
+ const listConfig = await this.listConfig();
338
+ const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
339
+ if (x) {
340
+ const url = (0, import_git_url_parse.default)(x);
341
+ return `${url.owner}/${url.name}`;
342
+ }
343
+ }
344
+ };
345
+
346
+ // src/lib.ts
318
347
  var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
319
348
  var __dirname = import_pathe.default.dirname(__filename2);
320
- var assetsDir = import_pathe.default.join(__dirname, "./assets");
349
+ var assetsDir = import_pathe.default.join(__dirname, "../assets");
321
350
  var cwd = import_node_process.default.cwd();
322
- async function main() {
323
- const list = await import_fs_extra.default.readdir(assetsDir);
324
- for (const item of list) {
325
- if (item === "package.json") {
326
- const sourcePath = import_pathe.default.resolve(assetsDir, item);
327
- const targetPath = import_pathe.default.resolve(cwd, item);
328
- if (await import_fs_extra.default.exists(targetPath) && await import_fs_extra.default.exists(sourcePath)) {
329
- const sourcePkgJson = await import_fs_extra.default.readJson(sourcePath);
330
- const targetPkgJson = await import_fs_extra.default.readJson(targetPath);
331
- const deps = (0, import_get_value.default)(sourcePkgJson, "dependencies", { default: {} });
332
- const devDeps = (0, import_get_value.default)(sourcePkgJson, "devDependencies", { default: {} });
333
- Object.entries(deps).forEach((x) => {
334
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
335
- });
336
- Object.entries(devDeps).forEach((x) => {
337
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
338
- });
339
- await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
351
+ async function main(outdir = "") {
352
+ const absOutDir = import_pathe.default.isAbsolute(outdir) ? outdir : import_pathe.default.join(cwd, outdir);
353
+ const gitClient = new GitClient({
354
+ baseDir: cwd
355
+ });
356
+ const repoName = await gitClient.getRepoName();
357
+ for await (const file of (0, import_klaw.default)(assetsDir)) {
358
+ if (file.stats.isFile()) {
359
+ const relPath = import_pathe.default.relative(assetsDir, file.path);
360
+ const targetPath = import_pathe.default.resolve(absOutDir, relPath);
361
+ if (relPath === "package.json") {
362
+ const sourcePath = file.path;
363
+ if (await import_fs_extra.default.exists(targetPath) && await import_fs_extra.default.exists(sourcePath)) {
364
+ const sourcePkgJson = await import_fs_extra.default.readJson(sourcePath);
365
+ const targetPkgJson = await import_fs_extra.default.readJson(targetPath);
366
+ const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
367
+ const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
368
+ Object.entries(deps).forEach((x) => {
369
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
370
+ });
371
+ Object.entries(devDeps).forEach((x) => {
372
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
373
+ });
374
+ await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
375
+ spaces: 2
376
+ });
377
+ }
378
+ } else if (relPath === ".changeset/config.json" && repoName && await import_fs_extra.default.exists(file.path)) {
379
+ const changesetJson = await import_fs_extra.default.readJson(file.path);
380
+ (0, import_set_value.default)(changesetJson, "changelog.1.repo", repoName);
381
+ await import_fs_extra.default.writeJson(targetPath, changesetJson, {
340
382
  spaces: 2
341
383
  });
384
+ } else {
385
+ await import_fs_extra.default.copy(
386
+ file.path,
387
+ import_pathe.default.resolve(absOutDir, relPath)
388
+ );
342
389
  }
343
- } else {
344
- await import_fs_extra.default.copy(
345
- import_pathe.default.resolve(assetsDir, item),
346
- import_pathe.default.resolve(cwd, item)
347
- );
348
390
  }
349
391
  }
350
392
  }
393
+
394
+ // src/cli.ts
351
395
  main().then(() => {
352
- console.log("@icebreakers/monorepo ok!");
396
+ console.log("upgrade @icebreakers/monorepo ok!");
353
397
  });
354
398
  /*! Bundled license information:
355
399