@icebreakers/monorepo 0.6.22 → 0.7.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.
@@ -5,6 +5,8 @@ on:
5
5
  # branches: ['main']
6
6
  pull_request:
7
7
  types: [opened, synchronize]
8
+ branches-ignore:
9
+ - 'renovate/**'
8
10
  workflow_dispatch:
9
11
 
10
12
  permissions:
@@ -18,7 +18,7 @@
18
18
  "scripts": {
19
19
  "build": "turbo run build",
20
20
  "dev": "turbo run dev --parallel",
21
- "test": "vitest run --coverage.enabled",
21
+ "test": "vitest run",
22
22
  "test:dev": "vitest",
23
23
  "lint": "turbo run lint",
24
24
  "release": "changeset",
@@ -33,49 +33,37 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@changesets/changelog-github": "^0.5.0",
36
- "@changesets/cli": "^2.27.11",
37
- "@commitlint/cli": "^19.6.1",
38
- "@commitlint/config-conventional": "^19.6.0",
39
- "@commitlint/prompt-cli": "^19.7.0",
36
+ "@changesets/cli": "^2.27.12",
37
+ "@commitlint/cli": "^19.7.1",
38
+ "@commitlint/config-conventional": "^19.7.1",
39
+ "@commitlint/prompt-cli": "^19.7.1",
40
40
  "@commitlint/types": "^19.5.0",
41
- "@icebreakers/eslint-config": "^0.7.10",
41
+ "@icebreakers/eslint-config": "^0.7.13",
42
42
  "@icebreakers/monorepo": "workspace:*",
43
- "@icebreakers/stylelint-config": "^0.1.3",
43
+ "@icebreakers/stylelint-config": "^0.1.4",
44
44
  "@types/fs-extra": "^11.0.4",
45
- "@types/get-value": "^3.0.5",
46
- "@types/git-url-parse": "^9.0.3",
47
- "@types/klaw": "^3.0.6",
48
- "@types/lint-staged": "^13.3.0",
49
- "@types/lodash": "^4.17.14",
50
- "@types/lodash-es": "^4.17.12",
51
- "@types/micromatch": "^4.0.9",
52
- "@types/node": "^22.10.5",
53
- "@types/set-value": "^4.0.3",
54
- "@vitest/coverage-v8": "~2.1.8",
45
+ "@types/node": "^22.13.1",
46
+ "@vitest/coverage-v8": "~3.0.5",
55
47
  "ci-info": "^4.1.0",
56
48
  "cross-env": "^7.0.3",
57
49
  "defu": "^6.1.4",
58
- "eslint": "^9.17.0",
50
+ "es-toolkit": "^1.32.0",
51
+ "eslint": "^9.20.0",
59
52
  "execa": "^9.5.2",
60
- "fs-extra": "^11.2.0",
61
- "get-value": "^3.0.1",
53
+ "fs-extra": "^11.3.0",
62
54
  "husky": "^9.1.6",
63
- "lint-staged": "^15.3.0",
64
- "lodash": "^4.17.21",
65
- "lodash-es": "^4.17.21",
66
- "micromatch": "^4.0.8",
55
+ "lint-staged": "^15.4.3",
67
56
  "only-allow": "^1.2.1",
68
- "pathe": "^2.0.0",
69
- "pkg-types": "^1.3.0",
57
+ "pathe": "^2.0.2",
58
+ "pkg-types": "^1.3.1",
70
59
  "rimraf": "^6.0.1",
71
- "set-value": "^4.1.0",
72
60
  "tslib": "^2.8.0",
73
- "tsup": "^8.3.5",
61
+ "tsup": "^8.3.6",
74
62
  "tsx": "^4.19.2",
75
- "turbo": "^2.3.3",
63
+ "turbo": "^2.4.0",
76
64
  "typescript": "^5.7.3",
77
- "unbuild": "^3.2.0",
78
- "vitest": "~2.1.8",
65
+ "unbuild": "^3.3.1",
66
+ "vitest": "~3.0.5",
79
67
  "yaml": "^2.7.0"
80
68
  },
81
69
  "publishConfig": {
@@ -0,0 +1,19 @@
1
+ import { defineConfig } from 'vitest/config'
2
+
3
+ export default defineConfig(
4
+ () => {
5
+ return {
6
+ test: {
7
+ workspace: [
8
+ 'packages/*',
9
+ 'apps/*',
10
+ ],
11
+ coverage: {
12
+ enabled: true,
13
+ all: false,
14
+ skipFull: true,
15
+ },
16
+ },
17
+ }
18
+ },
19
+ )
@@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  mod
28
28
  ));
29
29
 
30
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
30
+ // ../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
31
31
  var init_esm_shims = __esm({
32
- "../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
32
+ "../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
33
33
  "use strict";
34
34
  }
35
35
  });
@@ -53,7 +53,7 @@ var require_isobject = __commonJS({
53
53
  "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports, module) {
54
54
  "use strict";
55
55
  init_esm_shims();
56
- module.exports = function isObject(val) {
56
+ module.exports = function isObject2(val) {
57
57
  return val != null && typeof val === "object" && Array.isArray(val) === false;
58
58
  };
59
59
  }
@@ -64,9 +64,9 @@ var require_is_plain_object = __commonJS({
64
64
  "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports, module) {
65
65
  "use strict";
66
66
  init_esm_shims();
67
- var isObject = require_isobject();
67
+ var isObject2 = require_isobject();
68
68
  function isObjectObject(o) {
69
- return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
69
+ return isObject2(o) === true && Object.prototype.toString.call(o) === "[object Object]";
70
70
  }
71
71
  module.exports = function isPlainObject2(o) {
72
72
  var ctor, prot;
@@ -91,7 +91,7 @@ var require_set_value = __commonJS({
91
91
  var { deleteProperty } = Reflect;
92
92
  var isPrimitive = require_is_primitive();
93
93
  var isPlainObject2 = require_is_plain_object();
94
- var isObject = (value) => {
94
+ var isObject2 = (value) => {
95
95
  return typeof value === "object" && value !== null || typeof value === "function";
96
96
  };
97
97
  var isUnsafeKey = (key) => {
@@ -159,7 +159,7 @@ var require_set_value = __commonJS({
159
159
  }
160
160
  return parts;
161
161
  };
162
- var split = (input, options) => {
162
+ var split2 = (input, options) => {
163
163
  if (options && typeof options.split === "function") return options.split(input);
164
164
  if (typeof input === "symbol") return [input];
165
165
  if (Array.isArray(input)) return input;
@@ -182,8 +182,8 @@ var require_set_value = __commonJS({
182
182
  return obj;
183
183
  };
184
184
  var setValue = (target, path9, value, options) => {
185
- if (!path9 || !isObject(target)) return target;
186
- const keys = split(path9, options);
185
+ if (!path9 || !isObject2(target)) return target;
186
+ const keys = split2(path9, options);
187
187
  let obj = target;
188
188
  for (let i = 0; i < keys.length; i++) {
189
189
  const key = keys[i];
@@ -197,14 +197,14 @@ var require_set_value = __commonJS({
197
197
  obj = obj[key] = [];
198
198
  continue;
199
199
  }
200
- if (!isObject(obj[key])) {
200
+ if (!isObject2(obj[key])) {
201
201
  obj[key] = {};
202
202
  }
203
203
  obj = obj[key];
204
204
  }
205
205
  return target;
206
206
  };
207
- setValue.split = split;
207
+ setValue.split = split2;
208
208
  setValue.cache = /* @__PURE__ */ new Map();
209
209
  setValue.clear = () => {
210
210
  setValue.cache = /* @__PURE__ */ new Map();
@@ -213,96 +213,6 @@ var require_set_value = __commonJS({
213
213
  }
214
214
  });
215
215
 
216
- // ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
217
- var require_get_value = __commonJS({
218
- "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports, module) {
219
- "use strict";
220
- init_esm_shims();
221
- var isObject = require_isobject();
222
- module.exports = function(target, path9, options) {
223
- if (!isObject(options)) {
224
- options = { default: options };
225
- }
226
- if (!isValidObject(target)) {
227
- return typeof options.default !== "undefined" ? options.default : target;
228
- }
229
- if (typeof path9 === "number") {
230
- path9 = String(path9);
231
- }
232
- const isArray = Array.isArray(path9);
233
- const isString = typeof path9 === "string";
234
- const splitChar = options.separator || ".";
235
- const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
236
- if (!isString && !isArray) {
237
- return target;
238
- }
239
- if (isString && path9 in target) {
240
- return isValid(path9, target, options) ? target[path9] : options.default;
241
- }
242
- let segs = isArray ? path9 : split(path9, splitChar, options);
243
- let len = segs.length;
244
- let idx = 0;
245
- do {
246
- let prop = segs[idx];
247
- if (typeof prop === "number") {
248
- prop = String(prop);
249
- }
250
- while (prop && prop.slice(-1) === "\\") {
251
- prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
252
- }
253
- if (prop in target) {
254
- if (!isValid(prop, target, options)) {
255
- return options.default;
256
- }
257
- target = target[prop];
258
- } else {
259
- let hasProp = false;
260
- let n = idx + 1;
261
- while (n < len) {
262
- prop = join([prop, segs[n++]], joinChar, options);
263
- if (hasProp = prop in target) {
264
- if (!isValid(prop, target, options)) {
265
- return options.default;
266
- }
267
- target = target[prop];
268
- idx = n - 1;
269
- break;
270
- }
271
- }
272
- if (!hasProp) {
273
- return options.default;
274
- }
275
- }
276
- } while (++idx < len && isValidObject(target));
277
- if (idx === len) {
278
- return target;
279
- }
280
- return options.default;
281
- };
282
- function join(segs, joinChar, options) {
283
- if (typeof options.join === "function") {
284
- return options.join(segs);
285
- }
286
- return segs[0] + joinChar + segs[1];
287
- }
288
- function split(path9, splitChar, options) {
289
- if (typeof options.split === "function") {
290
- return options.split(path9);
291
- }
292
- return path9.split(splitChar);
293
- }
294
- function isValid(key, target, options) {
295
- if (typeof options.isValid === "function") {
296
- return options.isValid(key, target);
297
- }
298
- return true;
299
- }
300
- function isValidObject(val) {
301
- return isObject(val) || Array.isArray(val) || typeof val === "function";
302
- }
303
- }
304
- });
305
-
306
216
  // src/monorepo/binaryMirror.ts
307
217
  init_esm_shims();
308
218
  import { parse, stringify } from "comment-json";
@@ -391,7 +301,96 @@ async function cleanProjects(cwd) {
391
301
 
392
302
  // src/monorepo/git.ts
393
303
  init_esm_shims();
394
- var import_get_value = __toESM(require_get_value(), 1);
304
+
305
+ // ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/dist/index.mjs
306
+ init_esm_shims();
307
+ var __defProp2 = Object.defineProperty;
308
+ var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
309
+ var isObject = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object", "isObject");
310
+ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
311
+ if (typeof options.join === "function") {
312
+ return options.join(segs);
313
+ }
314
+ return segs[0] + joinChar + segs[1];
315
+ }, "join");
316
+ var split = /* @__PURE__ */ __name((path9, splitChar, options) => {
317
+ if (typeof options.split === "function") {
318
+ return options.split(path9);
319
+ }
320
+ return path9.split(splitChar);
321
+ }, "split");
322
+ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
323
+ if (typeof options?.isValid === "function") {
324
+ return options.isValid(key, target);
325
+ }
326
+ return true;
327
+ }, "isValid");
328
+ var isValidObject = /* @__PURE__ */ __name((v) => {
329
+ return isObject(v) || typeof v === "function";
330
+ }, "isValidObject");
331
+ var getValue = /* @__PURE__ */ __name((target, path9, options = {}) => {
332
+ if (!isObject(options)) {
333
+ options = { default: options };
334
+ }
335
+ if (!isValidObject(target)) {
336
+ return typeof options.default !== "undefined" ? options.default : target;
337
+ }
338
+ if (typeof path9 === "number") {
339
+ path9 = String(path9);
340
+ }
341
+ const pathIsArray = Array.isArray(path9);
342
+ const pathIsString = typeof path9 === "string";
343
+ const splitChar = options.separator || ".";
344
+ const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
345
+ if (!pathIsString && !pathIsArray) {
346
+ return target;
347
+ }
348
+ if (target[path9] !== void 0) {
349
+ return isValid(path9, target, options) ? target[path9] : options.default;
350
+ }
351
+ const segs = pathIsArray ? path9 : split(path9, splitChar, options);
352
+ const len = segs.length;
353
+ let idx = 0;
354
+ do {
355
+ let prop = segs[idx];
356
+ if (typeof prop !== "string") {
357
+ prop = String(prop);
358
+ }
359
+ while (prop && prop.slice(-1) === "\\") {
360
+ prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
361
+ }
362
+ if (target[prop] !== void 0) {
363
+ if (!isValid(prop, target, options)) {
364
+ return options.default;
365
+ }
366
+ target = target[prop];
367
+ } else {
368
+ let hasProp = false;
369
+ let n = idx + 1;
370
+ while (n < len) {
371
+ prop = join([prop, segs[n++]], joinChar, options);
372
+ if (hasProp = target[prop] !== void 0) {
373
+ if (!isValid(prop, target, options)) {
374
+ return options.default;
375
+ }
376
+ target = target[prop];
377
+ idx = n - 1;
378
+ break;
379
+ }
380
+ }
381
+ if (!hasProp) {
382
+ return options.default;
383
+ }
384
+ }
385
+ } while (++idx < len && isValidObject(target));
386
+ if (idx === len) {
387
+ return target;
388
+ }
389
+ return options.default;
390
+ }, "getValue");
391
+ var index_default = getValue;
392
+
393
+ // src/monorepo/git.ts
395
394
  import gitUrlParse from "git-url-parse";
396
395
  import { simpleGit } from "simple-git";
397
396
  var GitClient = class {
@@ -417,7 +416,7 @@ var GitClient = class {
417
416
  }
418
417
  async getGitUrl() {
419
418
  const config = await this.getConfig();
420
- const x = (0, import_get_value.default)(config, "remote.origin.url");
419
+ const x = index_default(config, "remote.origin.url");
421
420
  if (x) {
422
421
  return gitUrlParse(x);
423
422
  }
@@ -430,8 +429,8 @@ var GitClient = class {
430
429
  }
431
430
  async getUser() {
432
431
  const config = await this.getConfig();
433
- const name2 = (0, import_get_value.default)(config, "user.name");
434
- const email = (0, import_get_value.default)(config, "user.email");
432
+ const name2 = index_default(config, "user.name");
433
+ const email = index_default(config, "user.email");
435
434
  return {
436
435
  name: name2,
437
436
  email
@@ -728,9 +727,8 @@ import process from "node:process";
728
727
  import { fileURLToPath } from "node:url";
729
728
  import checkbox from "@inquirer/checkbox";
730
729
  import confirm from "@inquirer/confirm";
731
- var import_get_value2 = __toESM(require_get_value(), 1);
732
- var import_set_value4 = __toESM(require_set_value(), 1);
733
730
  import fs5 from "fs-extra";
731
+ var import_set_value4 = __toESM(require_set_value(), 1);
734
732
  import klaw from "klaw";
735
733
  import PQueue2 from "p-queue";
736
734
  import path8 from "pathe";
@@ -741,7 +739,7 @@ init_esm_shims();
741
739
 
742
740
  // package.json
743
741
  var name = "@icebreakers/monorepo";
744
- var version = "0.6.22";
742
+ var version = "0.7.0";
745
743
 
746
744
  // src/scripts.ts
747
745
  init_esm_shims();
@@ -776,7 +774,8 @@ function getAssetTargets(raw) {
776
774
  // turbo
777
775
  "turbo.json",
778
776
  // vitest
779
- "vitest.workspace.ts",
777
+ "vitest.config.ts",
778
+ // 'vitest.workspace.ts',
780
779
  // #region docker
781
780
  "Dockerfile",
782
781
  ".dockerignore"
@@ -800,11 +799,11 @@ function isWorkspace(version2) {
800
799
  return false;
801
800
  }
802
801
  function setPkgJson(sourcePkgJson, targetPkgJson) {
803
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
804
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
805
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
806
- const targetDeps = (0, import_get_value2.default)(targetPkgJson, "dependencies", { default: {} });
807
- const targetDevDeps = (0, import_get_value2.default)(targetPkgJson, "devDependencies", { default: {} });
802
+ const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
803
+ const deps = index_default(sourcePkgJson, "dependencies", { default: {} });
804
+ const devDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
805
+ const targetDeps = index_default(targetPkgJson, "dependencies", { default: {} });
806
+ const targetDevDeps = index_default(targetPkgJson, "devDependencies", { default: {} });
808
807
  (0, import_set_value4.default)(targetPkgJson, "packageManager", packageManager);
809
808
  Object.entries(deps).forEach((x) => {
810
809
  if (!isWorkspace(targetDeps[x[0]])) {
@@ -823,7 +822,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson) {
823
822
  }
824
823
  }
825
824
  function confirmOverwrite(filename) {
826
- return confirm({ message: `${pc2.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: false });
825
+ return confirm({ message: `${pc2.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: true });
827
826
  }
828
827
  async function upgradeMonorepo(opts) {
829
828
  const { outDir, raw, interactive, cwd } = defu(opts, {
@@ -879,7 +878,7 @@ async function upgradeMonorepo(opts) {
879
878
  const targetPkgJson = await fs5.readJson(targetPath);
880
879
  setPkgJson(sourcePkgJson, targetPkgJson);
881
880
  const data = JSON.stringify(targetPkgJson, void 0, 2);
882
- await fs5.writeFile(targetPath, `${data}
881
+ await fs5.outputFile(targetPath, `${data}
883
882
  `, "utf8");
884
883
  logger.success(targetPath);
885
884
  }
@@ -888,8 +887,7 @@ async function upgradeMonorepo(opts) {
888
887
  (0, import_set_value4.default)(changesetJson, "changelog.1.repo", repoName);
889
888
  const data = JSON.stringify(changesetJson, void 0, 2);
890
889
  if (await overwriteOrCopy(data)) {
891
- await fs5.ensureDir(path8.dirname(targetPath));
892
- await fs5.writeFile(targetPath, `${data}
890
+ await fs5.outputFile(targetPath, `${data}
893
891
  `, "utf8");
894
892
  logger.success(targetPath);
895
893
  }
@@ -960,11 +958,11 @@ set-value/index.js:
960
958
  * Released under the MIT License.
961
959
  *)
962
960
 
963
- get-value/index.js:
961
+ get-value/dist/index.mjs:
964
962
  (*!
965
963
  * get-value <https://github.com/jonschlinkert/get-value>
966
964
  *
967
- * Copyright (c) 2014-2018, Jon Schlinkert.
965
+ * Copyright (c) 2014-present, Jon Schlinkert.
968
966
  * Released under the MIT License.
969
967
  *)
970
968
  */
package/dist/cli.cjs CHANGED
@@ -28,10 +28,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  mod
29
29
  ));
30
30
 
31
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
31
+ // ../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
32
32
  var getImportMetaUrl, importMetaUrl;
33
33
  var init_cjs_shims = __esm({
34
- "../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
34
+ "../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
35
35
  "use strict";
36
36
  getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
37
37
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -57,7 +57,7 @@ var require_isobject = __commonJS({
57
57
  "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports2, module2) {
58
58
  "use strict";
59
59
  init_cjs_shims();
60
- module2.exports = function isObject(val) {
60
+ module2.exports = function isObject2(val) {
61
61
  return val != null && typeof val === "object" && Array.isArray(val) === false;
62
62
  };
63
63
  }
@@ -68,9 +68,9 @@ var require_is_plain_object = __commonJS({
68
68
  "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports2, module2) {
69
69
  "use strict";
70
70
  init_cjs_shims();
71
- var isObject = require_isobject();
71
+ var isObject2 = require_isobject();
72
72
  function isObjectObject(o) {
73
- return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
73
+ return isObject2(o) === true && Object.prototype.toString.call(o) === "[object Object]";
74
74
  }
75
75
  module2.exports = function isPlainObject2(o) {
76
76
  var ctor, prot;
@@ -95,7 +95,7 @@ var require_set_value = __commonJS({
95
95
  var { deleteProperty } = Reflect;
96
96
  var isPrimitive = require_is_primitive();
97
97
  var isPlainObject2 = require_is_plain_object();
98
- var isObject = (value) => {
98
+ var isObject2 = (value) => {
99
99
  return typeof value === "object" && value !== null || typeof value === "function";
100
100
  };
101
101
  var isUnsafeKey = (key) => {
@@ -163,7 +163,7 @@ var require_set_value = __commonJS({
163
163
  }
164
164
  return parts;
165
165
  };
166
- var split = (input, options) => {
166
+ var split2 = (input, options) => {
167
167
  if (options && typeof options.split === "function") return options.split(input);
168
168
  if (typeof input === "symbol") return [input];
169
169
  if (Array.isArray(input)) return input;
@@ -186,8 +186,8 @@ var require_set_value = __commonJS({
186
186
  return obj;
187
187
  };
188
188
  var setValue = (target, path10, value, options) => {
189
- if (!path10 || !isObject(target)) return target;
190
- const keys = split(path10, options);
189
+ if (!path10 || !isObject2(target)) return target;
190
+ const keys = split2(path10, options);
191
191
  let obj = target;
192
192
  for (let i = 0; i < keys.length; i++) {
193
193
  const key = keys[i];
@@ -201,14 +201,14 @@ var require_set_value = __commonJS({
201
201
  obj = obj[key] = [];
202
202
  continue;
203
203
  }
204
- if (!isObject(obj[key])) {
204
+ if (!isObject2(obj[key])) {
205
205
  obj[key] = {};
206
206
  }
207
207
  obj = obj[key];
208
208
  }
209
209
  return target;
210
210
  };
211
- setValue.split = split;
211
+ setValue.split = split2;
212
212
  setValue.cache = /* @__PURE__ */ new Map();
213
213
  setValue.clear = () => {
214
214
  setValue.cache = /* @__PURE__ */ new Map();
@@ -217,96 +217,6 @@ var require_set_value = __commonJS({
217
217
  }
218
218
  });
219
219
 
220
- // ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
221
- var require_get_value = __commonJS({
222
- "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports2, module2) {
223
- "use strict";
224
- init_cjs_shims();
225
- var isObject = require_isobject();
226
- module2.exports = function(target, path10, options) {
227
- if (!isObject(options)) {
228
- options = { default: options };
229
- }
230
- if (!isValidObject(target)) {
231
- return typeof options.default !== "undefined" ? options.default : target;
232
- }
233
- if (typeof path10 === "number") {
234
- path10 = String(path10);
235
- }
236
- const isArray = Array.isArray(path10);
237
- const isString = typeof path10 === "string";
238
- const splitChar = options.separator || ".";
239
- const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
240
- if (!isString && !isArray) {
241
- return target;
242
- }
243
- if (isString && path10 in target) {
244
- return isValid(path10, target, options) ? target[path10] : options.default;
245
- }
246
- let segs = isArray ? path10 : split(path10, splitChar, options);
247
- let len = segs.length;
248
- let idx = 0;
249
- do {
250
- let prop = segs[idx];
251
- if (typeof prop === "number") {
252
- prop = String(prop);
253
- }
254
- while (prop && prop.slice(-1) === "\\") {
255
- prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
256
- }
257
- if (prop in target) {
258
- if (!isValid(prop, target, options)) {
259
- return options.default;
260
- }
261
- target = target[prop];
262
- } else {
263
- let hasProp = false;
264
- let n = idx + 1;
265
- while (n < len) {
266
- prop = join([prop, segs[n++]], joinChar, options);
267
- if (hasProp = prop in target) {
268
- if (!isValid(prop, target, options)) {
269
- return options.default;
270
- }
271
- target = target[prop];
272
- idx = n - 1;
273
- break;
274
- }
275
- }
276
- if (!hasProp) {
277
- return options.default;
278
- }
279
- }
280
- } while (++idx < len && isValidObject(target));
281
- if (idx === len) {
282
- return target;
283
- }
284
- return options.default;
285
- };
286
- function join(segs, joinChar, options) {
287
- if (typeof options.join === "function") {
288
- return options.join(segs);
289
- }
290
- return segs[0] + joinChar + segs[1];
291
- }
292
- function split(path10, splitChar, options) {
293
- if (typeof options.split === "function") {
294
- return options.split(path10);
295
- }
296
- return path10.split(splitChar);
297
- }
298
- function isValid(key, target, options) {
299
- if (typeof options.isValid === "function") {
300
- return options.isValid(key, target);
301
- }
302
- return true;
303
- }
304
- function isValidObject(val) {
305
- return isObject(val) || Array.isArray(val) || typeof val === "function";
306
- }
307
- }
308
- });
309
-
310
220
  // src/cli.ts
311
221
  init_cjs_shims();
312
222
 
@@ -320,7 +230,7 @@ init_cjs_shims();
320
230
 
321
231
  // package.json
322
232
  var name = "@icebreakers/monorepo";
323
- var version = "0.6.22";
233
+ var version = "0.7.0";
324
234
 
325
235
  // src/create.ts
326
236
  init_cjs_shims();
@@ -531,7 +441,96 @@ async function cleanProjects(cwd2) {
531
441
 
532
442
  // src/monorepo/git.ts
533
443
  init_cjs_shims();
534
- var import_get_value = __toESM(require_get_value(), 1);
444
+
445
+ // ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/dist/index.mjs
446
+ init_cjs_shims();
447
+ var __defProp2 = Object.defineProperty;
448
+ var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
449
+ var isObject = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object", "isObject");
450
+ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
451
+ if (typeof options.join === "function") {
452
+ return options.join(segs);
453
+ }
454
+ return segs[0] + joinChar + segs[1];
455
+ }, "join");
456
+ var split = /* @__PURE__ */ __name((path10, splitChar, options) => {
457
+ if (typeof options.split === "function") {
458
+ return options.split(path10);
459
+ }
460
+ return path10.split(splitChar);
461
+ }, "split");
462
+ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
463
+ if (typeof options?.isValid === "function") {
464
+ return options.isValid(key, target);
465
+ }
466
+ return true;
467
+ }, "isValid");
468
+ var isValidObject = /* @__PURE__ */ __name((v) => {
469
+ return isObject(v) || typeof v === "function";
470
+ }, "isValidObject");
471
+ var getValue = /* @__PURE__ */ __name((target, path10, options = {}) => {
472
+ if (!isObject(options)) {
473
+ options = { default: options };
474
+ }
475
+ if (!isValidObject(target)) {
476
+ return typeof options.default !== "undefined" ? options.default : target;
477
+ }
478
+ if (typeof path10 === "number") {
479
+ path10 = String(path10);
480
+ }
481
+ const pathIsArray = Array.isArray(path10);
482
+ const pathIsString = typeof path10 === "string";
483
+ const splitChar = options.separator || ".";
484
+ const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
485
+ if (!pathIsString && !pathIsArray) {
486
+ return target;
487
+ }
488
+ if (target[path10] !== void 0) {
489
+ return isValid(path10, target, options) ? target[path10] : options.default;
490
+ }
491
+ const segs = pathIsArray ? path10 : split(path10, splitChar, options);
492
+ const len = segs.length;
493
+ let idx = 0;
494
+ do {
495
+ let prop = segs[idx];
496
+ if (typeof prop !== "string") {
497
+ prop = String(prop);
498
+ }
499
+ while (prop && prop.slice(-1) === "\\") {
500
+ prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
501
+ }
502
+ if (target[prop] !== void 0) {
503
+ if (!isValid(prop, target, options)) {
504
+ return options.default;
505
+ }
506
+ target = target[prop];
507
+ } else {
508
+ let hasProp = false;
509
+ let n = idx + 1;
510
+ while (n < len) {
511
+ prop = join([prop, segs[n++]], joinChar, options);
512
+ if (hasProp = target[prop] !== void 0) {
513
+ if (!isValid(prop, target, options)) {
514
+ return options.default;
515
+ }
516
+ target = target[prop];
517
+ idx = n - 1;
518
+ break;
519
+ }
520
+ }
521
+ if (!hasProp) {
522
+ return options.default;
523
+ }
524
+ }
525
+ } while (++idx < len && isValidObject(target));
526
+ if (idx === len) {
527
+ return target;
528
+ }
529
+ return options.default;
530
+ }, "getValue");
531
+ var index_default = getValue;
532
+
533
+ // src/monorepo/git.ts
535
534
  var import_git_url_parse = __toESM(require("git-url-parse"), 1);
536
535
  var import_simple_git = require("simple-git");
537
536
  var GitClient = class {
@@ -557,7 +556,7 @@ var GitClient = class {
557
556
  }
558
557
  async getGitUrl() {
559
558
  const config = await this.getConfig();
560
- const x = (0, import_get_value.default)(config, "remote.origin.url");
559
+ const x = index_default(config, "remote.origin.url");
561
560
  if (x) {
562
561
  return (0, import_git_url_parse.default)(x);
563
562
  }
@@ -570,8 +569,8 @@ var GitClient = class {
570
569
  }
571
570
  async getUser() {
572
571
  const config = await this.getConfig();
573
- const name2 = (0, import_get_value.default)(config, "user.name");
574
- const email = (0, import_get_value.default)(config, "user.email");
572
+ const name2 = index_default(config, "user.name");
573
+ const email = index_default(config, "user.email");
575
574
  return {
576
575
  name: name2,
577
576
  email
@@ -757,7 +756,6 @@ var import_node_url2 = require("url");
757
756
  var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
758
757
  var import_confirm = __toESM(require("@inquirer/confirm"), 1);
759
758
  var import_fs_extra6 = __toESM(require("fs-extra"), 1);
760
- var import_get_value2 = __toESM(require_get_value(), 1);
761
759
  var import_klaw = __toESM(require("klaw"), 1);
762
760
  var import_p_queue2 = __toESM(require("p-queue"), 1);
763
761
  var import_pathe9 = __toESM(require("pathe"), 1);
@@ -797,7 +795,8 @@ function getAssetTargets(raw) {
797
795
  // turbo
798
796
  "turbo.json",
799
797
  // vitest
800
- "vitest.workspace.ts",
798
+ "vitest.config.ts",
799
+ // 'vitest.workspace.ts',
801
800
  // #region docker
802
801
  "Dockerfile",
803
802
  ".dockerignore"
@@ -854,11 +853,11 @@ function isWorkspace(version2) {
854
853
  return false;
855
854
  }
856
855
  function setPkgJson(sourcePkgJson, targetPkgJson) {
857
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
858
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
859
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
860
- const targetDeps = (0, import_get_value2.default)(targetPkgJson, "dependencies", { default: {} });
861
- const targetDevDeps = (0, import_get_value2.default)(targetPkgJson, "devDependencies", { default: {} });
856
+ const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
857
+ const deps = index_default(sourcePkgJson, "dependencies", { default: {} });
858
+ const devDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
859
+ const targetDeps = index_default(targetPkgJson, "dependencies", { default: {} });
860
+ const targetDevDeps = index_default(targetPkgJson, "devDependencies", { default: {} });
862
861
  (0, import_set_value5.default)(targetPkgJson, "packageManager", packageManager);
863
862
  Object.entries(deps).forEach((x) => {
864
863
  if (!isWorkspace(targetDeps[x[0]])) {
@@ -877,7 +876,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson) {
877
876
  }
878
877
  }
879
878
  function confirmOverwrite(filename) {
880
- return (0, import_confirm.default)({ message: `${import_picocolors3.default.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: false });
879
+ return (0, import_confirm.default)({ message: `${import_picocolors3.default.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: true });
881
880
  }
882
881
  async function upgradeMonorepo(opts) {
883
882
  const { outDir, raw, interactive, cwd: cwd2 } = defu(opts, {
@@ -933,7 +932,7 @@ async function upgradeMonorepo(opts) {
933
932
  const targetPkgJson = await import_fs_extra6.default.readJson(targetPath);
934
933
  setPkgJson(sourcePkgJson, targetPkgJson);
935
934
  const data = JSON.stringify(targetPkgJson, void 0, 2);
936
- await import_fs_extra6.default.writeFile(targetPath, `${data}
935
+ await import_fs_extra6.default.outputFile(targetPath, `${data}
937
936
  `, "utf8");
938
937
  logger.success(targetPath);
939
938
  }
@@ -942,8 +941,7 @@ async function upgradeMonorepo(opts) {
942
941
  (0, import_set_value5.default)(changesetJson, "changelog.1.repo", repoName);
943
942
  const data = JSON.stringify(changesetJson, void 0, 2);
944
943
  if (await overwriteOrCopy(data)) {
945
- await import_fs_extra6.default.ensureDir(import_pathe9.default.dirname(targetPath));
946
- await import_fs_extra6.default.writeFile(targetPath, `${data}
944
+ await import_fs_extra6.default.outputFile(targetPath, `${data}
947
945
  `, "utf8");
948
946
  logger.success(targetPath);
949
947
  }
@@ -1029,11 +1027,11 @@ set-value/index.js:
1029
1027
  * Released under the MIT License.
1030
1028
  *)
1031
1029
 
1032
- get-value/index.js:
1030
+ get-value/dist/index.mjs:
1033
1031
  (*!
1034
1032
  * get-value <https://github.com/jonschlinkert/get-value>
1035
1033
  *
1036
- * Copyright (c) 2014-2018, Jon Schlinkert.
1034
+ * Copyright (c) 2014-present, Jon Schlinkert.
1037
1035
  * Released under the MIT License.
1038
1036
  *)
1039
1037
  */
package/dist/cli.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  syncNpmMirror,
12
12
  upgradeMonorepo,
13
13
  version
14
- } from "./chunk-QU6W43GW.js";
14
+ } from "./chunk-44PQOGBH.js";
15
15
 
16
16
  // src/cli.ts
17
17
  init_esm_shims();
package/dist/index.cjs CHANGED
@@ -33,10 +33,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
33
33
  ));
34
34
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
35
35
 
36
- // ../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
36
+ // ../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js
37
37
  var getImportMetaUrl, importMetaUrl;
38
38
  var init_cjs_shims = __esm({
39
- "../../node_modules/.pnpm/tsup@8.3.5_jiti@2.4.2_postcss@8.4.49_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
39
+ "../../node_modules/.pnpm/tsup@8.3.6_jiti@2.4.2_postcss@8.5.0_tsx@4.19.2_typescript@5.7.3_yaml@2.7.0/node_modules/tsup/assets/cjs_shims.js"() {
40
40
  "use strict";
41
41
  getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
42
42
  importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
@@ -62,7 +62,7 @@ var require_isobject = __commonJS({
62
62
  "../../node_modules/.pnpm/isobject@3.0.1/node_modules/isobject/index.js"(exports2, module2) {
63
63
  "use strict";
64
64
  init_cjs_shims();
65
- module2.exports = function isObject(val) {
65
+ module2.exports = function isObject2(val) {
66
66
  return val != null && typeof val === "object" && Array.isArray(val) === false;
67
67
  };
68
68
  }
@@ -73,9 +73,9 @@ var require_is_plain_object = __commonJS({
73
73
  "../../node_modules/.pnpm/is-plain-object@2.0.4/node_modules/is-plain-object/index.js"(exports2, module2) {
74
74
  "use strict";
75
75
  init_cjs_shims();
76
- var isObject = require_isobject();
76
+ var isObject2 = require_isobject();
77
77
  function isObjectObject(o) {
78
- return isObject(o) === true && Object.prototype.toString.call(o) === "[object Object]";
78
+ return isObject2(o) === true && Object.prototype.toString.call(o) === "[object Object]";
79
79
  }
80
80
  module2.exports = function isPlainObject2(o) {
81
81
  var ctor, prot;
@@ -100,7 +100,7 @@ var require_set_value = __commonJS({
100
100
  var { deleteProperty } = Reflect;
101
101
  var isPrimitive = require_is_primitive();
102
102
  var isPlainObject2 = require_is_plain_object();
103
- var isObject = (value) => {
103
+ var isObject2 = (value) => {
104
104
  return typeof value === "object" && value !== null || typeof value === "function";
105
105
  };
106
106
  var isUnsafeKey = (key) => {
@@ -168,7 +168,7 @@ var require_set_value = __commonJS({
168
168
  }
169
169
  return parts;
170
170
  };
171
- var split = (input, options) => {
171
+ var split2 = (input, options) => {
172
172
  if (options && typeof options.split === "function") return options.split(input);
173
173
  if (typeof input === "symbol") return [input];
174
174
  if (Array.isArray(input)) return input;
@@ -191,8 +191,8 @@ var require_set_value = __commonJS({
191
191
  return obj;
192
192
  };
193
193
  var setValue = (target, path9, value, options) => {
194
- if (!path9 || !isObject(target)) return target;
195
- const keys = split(path9, options);
194
+ if (!path9 || !isObject2(target)) return target;
195
+ const keys = split2(path9, options);
196
196
  let obj = target;
197
197
  for (let i = 0; i < keys.length; i++) {
198
198
  const key = keys[i];
@@ -206,14 +206,14 @@ var require_set_value = __commonJS({
206
206
  obj = obj[key] = [];
207
207
  continue;
208
208
  }
209
- if (!isObject(obj[key])) {
209
+ if (!isObject2(obj[key])) {
210
210
  obj[key] = {};
211
211
  }
212
212
  obj = obj[key];
213
213
  }
214
214
  return target;
215
215
  };
216
- setValue.split = split;
216
+ setValue.split = split2;
217
217
  setValue.cache = /* @__PURE__ */ new Map();
218
218
  setValue.clear = () => {
219
219
  setValue.cache = /* @__PURE__ */ new Map();
@@ -222,99 +222,9 @@ var require_set_value = __commonJS({
222
222
  }
223
223
  });
224
224
 
225
- // ../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js
226
- var require_get_value = __commonJS({
227
- "../../node_modules/.pnpm/get-value@3.0.1/node_modules/get-value/index.js"(exports2, module2) {
228
- "use strict";
229
- init_cjs_shims();
230
- var isObject = require_isobject();
231
- module2.exports = function(target, path9, options) {
232
- if (!isObject(options)) {
233
- options = { default: options };
234
- }
235
- if (!isValidObject(target)) {
236
- return typeof options.default !== "undefined" ? options.default : target;
237
- }
238
- if (typeof path9 === "number") {
239
- path9 = String(path9);
240
- }
241
- const isArray = Array.isArray(path9);
242
- const isString = typeof path9 === "string";
243
- const splitChar = options.separator || ".";
244
- const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
245
- if (!isString && !isArray) {
246
- return target;
247
- }
248
- if (isString && path9 in target) {
249
- return isValid(path9, target, options) ? target[path9] : options.default;
250
- }
251
- let segs = isArray ? path9 : split(path9, splitChar, options);
252
- let len = segs.length;
253
- let idx = 0;
254
- do {
255
- let prop = segs[idx];
256
- if (typeof prop === "number") {
257
- prop = String(prop);
258
- }
259
- while (prop && prop.slice(-1) === "\\") {
260
- prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
261
- }
262
- if (prop in target) {
263
- if (!isValid(prop, target, options)) {
264
- return options.default;
265
- }
266
- target = target[prop];
267
- } else {
268
- let hasProp = false;
269
- let n = idx + 1;
270
- while (n < len) {
271
- prop = join([prop, segs[n++]], joinChar, options);
272
- if (hasProp = prop in target) {
273
- if (!isValid(prop, target, options)) {
274
- return options.default;
275
- }
276
- target = target[prop];
277
- idx = n - 1;
278
- break;
279
- }
280
- }
281
- if (!hasProp) {
282
- return options.default;
283
- }
284
- }
285
- } while (++idx < len && isValidObject(target));
286
- if (idx === len) {
287
- return target;
288
- }
289
- return options.default;
290
- };
291
- function join(segs, joinChar, options) {
292
- if (typeof options.join === "function") {
293
- return options.join(segs);
294
- }
295
- return segs[0] + joinChar + segs[1];
296
- }
297
- function split(path9, splitChar, options) {
298
- if (typeof options.split === "function") {
299
- return options.split(path9);
300
- }
301
- return path9.split(splitChar);
302
- }
303
- function isValid(key, target, options) {
304
- if (typeof options.isValid === "function") {
305
- return options.isValid(key, target);
306
- }
307
- return true;
308
- }
309
- function isValidObject(val) {
310
- return isObject(val) || Array.isArray(val) || typeof val === "function";
311
- }
312
- }
313
- });
314
-
315
225
  // src/index.ts
316
- var src_exports = {};
317
- __export(src_exports, {
226
+ var index_exports = {};
227
+ __export(index_exports, {
318
228
  GitClient: () => GitClient,
319
229
  cleanProjects: () => cleanProjects,
320
230
  escapeStringRegexp: () => escapeStringRegexp,
@@ -328,7 +238,7 @@ __export(src_exports, {
328
238
  syncNpmMirror: () => syncNpmMirror,
329
239
  upgradeMonorepo: () => upgradeMonorepo
330
240
  });
331
- module.exports = __toCommonJS(src_exports);
241
+ module.exports = __toCommonJS(index_exports);
332
242
  init_cjs_shims();
333
243
 
334
244
  // src/monorepo/index.ts
@@ -422,7 +332,96 @@ async function cleanProjects(cwd) {
422
332
 
423
333
  // src/monorepo/git.ts
424
334
  init_cjs_shims();
425
- var import_get_value = __toESM(require_get_value(), 1);
335
+
336
+ // ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/dist/index.mjs
337
+ init_cjs_shims();
338
+ var __defProp2 = Object.defineProperty;
339
+ var __name = (target, value) => __defProp2(target, "name", { value, configurable: true });
340
+ var isObject = /* @__PURE__ */ __name((v) => v !== null && typeof v === "object", "isObject");
341
+ var join = /* @__PURE__ */ __name((segs, joinChar, options) => {
342
+ if (typeof options.join === "function") {
343
+ return options.join(segs);
344
+ }
345
+ return segs[0] + joinChar + segs[1];
346
+ }, "join");
347
+ var split = /* @__PURE__ */ __name((path9, splitChar, options) => {
348
+ if (typeof options.split === "function") {
349
+ return options.split(path9);
350
+ }
351
+ return path9.split(splitChar);
352
+ }, "split");
353
+ var isValid = /* @__PURE__ */ __name((key, target = {}, options) => {
354
+ if (typeof options?.isValid === "function") {
355
+ return options.isValid(key, target);
356
+ }
357
+ return true;
358
+ }, "isValid");
359
+ var isValidObject = /* @__PURE__ */ __name((v) => {
360
+ return isObject(v) || typeof v === "function";
361
+ }, "isValidObject");
362
+ var getValue = /* @__PURE__ */ __name((target, path9, options = {}) => {
363
+ if (!isObject(options)) {
364
+ options = { default: options };
365
+ }
366
+ if (!isValidObject(target)) {
367
+ return typeof options.default !== "undefined" ? options.default : target;
368
+ }
369
+ if (typeof path9 === "number") {
370
+ path9 = String(path9);
371
+ }
372
+ const pathIsArray = Array.isArray(path9);
373
+ const pathIsString = typeof path9 === "string";
374
+ const splitChar = options.separator || ".";
375
+ const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
376
+ if (!pathIsString && !pathIsArray) {
377
+ return target;
378
+ }
379
+ if (target[path9] !== void 0) {
380
+ return isValid(path9, target, options) ? target[path9] : options.default;
381
+ }
382
+ const segs = pathIsArray ? path9 : split(path9, splitChar, options);
383
+ const len = segs.length;
384
+ let idx = 0;
385
+ do {
386
+ let prop = segs[idx];
387
+ if (typeof prop !== "string") {
388
+ prop = String(prop);
389
+ }
390
+ while (prop && prop.slice(-1) === "\\") {
391
+ prop = join([prop.slice(0, -1), segs[++idx] || ""], joinChar, options);
392
+ }
393
+ if (target[prop] !== void 0) {
394
+ if (!isValid(prop, target, options)) {
395
+ return options.default;
396
+ }
397
+ target = target[prop];
398
+ } else {
399
+ let hasProp = false;
400
+ let n = idx + 1;
401
+ while (n < len) {
402
+ prop = join([prop, segs[n++]], joinChar, options);
403
+ if (hasProp = target[prop] !== void 0) {
404
+ if (!isValid(prop, target, options)) {
405
+ return options.default;
406
+ }
407
+ target = target[prop];
408
+ idx = n - 1;
409
+ break;
410
+ }
411
+ }
412
+ if (!hasProp) {
413
+ return options.default;
414
+ }
415
+ }
416
+ } while (++idx < len && isValidObject(target));
417
+ if (idx === len) {
418
+ return target;
419
+ }
420
+ return options.default;
421
+ }, "getValue");
422
+ var index_default = getValue;
423
+
424
+ // src/monorepo/git.ts
426
425
  var import_git_url_parse = __toESM(require("git-url-parse"), 1);
427
426
  var import_simple_git = require("simple-git");
428
427
  var GitClient = class {
@@ -448,7 +447,7 @@ var GitClient = class {
448
447
  }
449
448
  async getGitUrl() {
450
449
  const config = await this.getConfig();
451
- const x = (0, import_get_value.default)(config, "remote.origin.url");
450
+ const x = index_default(config, "remote.origin.url");
452
451
  if (x) {
453
452
  return (0, import_git_url_parse.default)(x);
454
453
  }
@@ -461,8 +460,8 @@ var GitClient = class {
461
460
  }
462
461
  async getUser() {
463
462
  const config = await this.getConfig();
464
- const name2 = (0, import_get_value.default)(config, "user.name");
465
- const email = (0, import_get_value.default)(config, "user.email");
463
+ const name2 = index_default(config, "user.name");
464
+ const email = index_default(config, "user.email");
466
465
  return {
467
466
  name: name2,
468
467
  email
@@ -726,7 +725,6 @@ var import_node_url = require("url");
726
725
  var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
727
726
  var import_confirm = __toESM(require("@inquirer/confirm"), 1);
728
727
  var import_fs_extra5 = __toESM(require("fs-extra"), 1);
729
- var import_get_value2 = __toESM(require_get_value(), 1);
730
728
  var import_klaw = __toESM(require("klaw"), 1);
731
729
  var import_p_queue2 = __toESM(require("p-queue"), 1);
732
730
  var import_pathe8 = __toESM(require("pathe"), 1);
@@ -738,7 +736,7 @@ init_cjs_shims();
738
736
 
739
737
  // package.json
740
738
  var name = "@icebreakers/monorepo";
741
- var version = "0.6.22";
739
+ var version = "0.7.0";
742
740
 
743
741
  // src/scripts.ts
744
742
  init_cjs_shims();
@@ -773,7 +771,8 @@ function getAssetTargets(raw) {
773
771
  // turbo
774
772
  "turbo.json",
775
773
  // vitest
776
- "vitest.workspace.ts",
774
+ "vitest.config.ts",
775
+ // 'vitest.workspace.ts',
777
776
  // #region docker
778
777
  "Dockerfile",
779
778
  ".dockerignore"
@@ -830,11 +829,11 @@ function isWorkspace(version2) {
830
829
  return false;
831
830
  }
832
831
  function setPkgJson(sourcePkgJson, targetPkgJson) {
833
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
834
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
835
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
836
- const targetDeps = (0, import_get_value2.default)(targetPkgJson, "dependencies", { default: {} });
837
- const targetDevDeps = (0, import_get_value2.default)(targetPkgJson, "devDependencies", { default: {} });
832
+ const packageManager = index_default(sourcePkgJson, "packageManager", { default: "" });
833
+ const deps = index_default(sourcePkgJson, "dependencies", { default: {} });
834
+ const devDeps = index_default(sourcePkgJson, "devDependencies", { default: {} });
835
+ const targetDeps = index_default(targetPkgJson, "dependencies", { default: {} });
836
+ const targetDevDeps = index_default(targetPkgJson, "devDependencies", { default: {} });
838
837
  (0, import_set_value4.default)(targetPkgJson, "packageManager", packageManager);
839
838
  Object.entries(deps).forEach((x) => {
840
839
  if (!isWorkspace(targetDeps[x[0]])) {
@@ -853,7 +852,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson) {
853
852
  }
854
853
  }
855
854
  function confirmOverwrite(filename) {
856
- return (0, import_confirm.default)({ message: `${import_picocolors2.default.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: false });
855
+ return (0, import_confirm.default)({ message: `${import_picocolors2.default.greenBright(filename)} \u6587\u4EF6\u5185\u5BB9\u53D1\u751F\u6539\u53D8,\u662F\u5426\u8986\u76D6?`, default: true });
857
856
  }
858
857
  async function upgradeMonorepo(opts) {
859
858
  const { outDir, raw, interactive, cwd } = defu(opts, {
@@ -909,7 +908,7 @@ async function upgradeMonorepo(opts) {
909
908
  const targetPkgJson = await import_fs_extra5.default.readJson(targetPath);
910
909
  setPkgJson(sourcePkgJson, targetPkgJson);
911
910
  const data = JSON.stringify(targetPkgJson, void 0, 2);
912
- await import_fs_extra5.default.writeFile(targetPath, `${data}
911
+ await import_fs_extra5.default.outputFile(targetPath, `${data}
913
912
  `, "utf8");
914
913
  logger.success(targetPath);
915
914
  }
@@ -918,8 +917,7 @@ async function upgradeMonorepo(opts) {
918
917
  (0, import_set_value4.default)(changesetJson, "changelog.1.repo", repoName);
919
918
  const data = JSON.stringify(changesetJson, void 0, 2);
920
919
  if (await overwriteOrCopy(data)) {
921
- await import_fs_extra5.default.ensureDir(import_pathe8.default.dirname(targetPath));
922
- await import_fs_extra5.default.writeFile(targetPath, `${data}
920
+ await import_fs_extra5.default.outputFile(targetPath, `${data}
923
921
  `, "utf8");
924
922
  logger.success(targetPath);
925
923
  }
@@ -983,11 +981,11 @@ set-value/index.js:
983
981
  * Released under the MIT License.
984
982
  *)
985
983
 
986
- get-value/index.js:
984
+ get-value/dist/index.mjs:
987
985
  (*!
988
986
  * get-value <https://github.com/jonschlinkert/get-value>
989
987
  *
990
- * Copyright (c) 2014-2018, Jon Schlinkert.
988
+ * Copyright (c) 2014-present, Jon Schlinkert.
991
989
  * Released under the MIT License.
992
990
  *)
993
991
  */
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  setVscodeBinaryMirror,
13
13
  syncNpmMirror,
14
14
  upgradeMonorepo
15
- } from "./chunk-QU6W43GW.js";
15
+ } from "./chunk-44PQOGBH.js";
16
16
 
17
17
  // src/index.ts
18
18
  init_esm_shims();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "0.6.22",
4
+ "version": "0.7.0",
5
5
  "description": "icebreaker's monorepo config generator",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -34,23 +34,33 @@
34
34
  "templates"
35
35
  ],
36
36
  "dependencies": {
37
- "@inquirer/checkbox": "^4.0.4",
38
- "@inquirer/confirm": "^5.1.1",
37
+ "@inquirer/checkbox": "^4.1.1",
38
+ "@inquirer/confirm": "^5.1.5",
39
39
  "@pnpm/logger": "^1000.0.0",
40
- "@pnpm/types": "^1000.1.0",
41
- "@pnpm/workspace.find-packages": "^1000.0.5",
42
- "commander": "^13.0.0",
40
+ "@pnpm/types": "^1000.1.1",
41
+ "@pnpm/workspace.find-packages": "^1000.0.7",
42
+ "commander": "^13.1.0",
43
43
  "comment-json": "^4.2.5",
44
- "consola": "^3.3.3",
44
+ "consola": "^3.4.0",
45
45
  "execa": "^9.5.2",
46
- "fs-extra": "^11.2.0",
46
+ "fs-extra": "^11.3.0",
47
47
  "git-url-parse": "^16.0.0",
48
48
  "klaw": "^4.1.0",
49
- "p-queue": "^8.0.1",
50
- "pathe": "^2.0.0",
49
+ "p-queue": "^8.1.0",
50
+ "pathe": "^2.0.2",
51
51
  "picocolors": "^1.1.1",
52
52
  "simple-git": "^3.27.0"
53
53
  },
54
+ "devDependencies": {
55
+ "@types/get-value": "^3.0.5",
56
+ "@types/git-url-parse": "^9.0.3",
57
+ "@types/klaw": "^3.0.6",
58
+ "@types/micromatch": "^4.0.9",
59
+ "@types/set-value": "^4.0.3",
60
+ "get-value": "^4.0.1",
61
+ "micromatch": "^4.0.8",
62
+ "set-value": "^4.1.0"
63
+ },
54
64
  "scripts": {
55
65
  "dev": "tsup --watch --sourcemap",
56
66
  "build": "tsup",
@@ -1,8 +0,0 @@
1
- import { defineWorkspace } from 'vitest/config'
2
-
3
- export default defineWorkspace(
4
- [
5
- 'packages/*',
6
- 'apps/*',
7
- ],
8
- )