@icebreakers/monorepo 0.2.4 → 0.2.7

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.
@@ -4,6 +4,7 @@
4
4
  "version": "0.0.0",
5
5
  "private": true,
6
6
  "packageManager": "pnpm@9.9.0",
7
+ "author": "ice breaker <1324318532@qq.com>",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/sonofmagic/monorepo-template.git"
@@ -26,7 +27,8 @@
26
27
  "prepare": "husky",
27
28
  "commit": "commit",
28
29
  "script:init": "tsx scripts/init.ts",
29
- "script:sync": "tsx scripts/sync.ts"
30
+ "script:sync": "tsx scripts/sync.ts",
31
+ "script:clean": "tsx scripts/clean.ts"
30
32
  },
31
33
  "devDependencies": {
32
34
  "@changesets/changelog-github": "^0.5.0",
@@ -35,7 +37,7 @@
35
37
  "@commitlint/config-conventional": "^19.4.1",
36
38
  "@commitlint/prompt-cli": "^19.4.1",
37
39
  "@commitlint/types": "^19.0.3",
38
- "@icebreakers/eslint-config": "^0.4.0",
40
+ "@icebreakers/eslint-config": "^0.4.1",
39
41
  "@icebreakers/stylelint-config": "^0.0.3",
40
42
  "@pnpm/workspace.find-packages": "^4.0.9",
41
43
  "@types/fs-extra": "^11.0.4",
@@ -46,13 +48,13 @@
46
48
  "@types/lodash": "^4.17.7",
47
49
  "@types/lodash-es": "^4.17.12",
48
50
  "@types/micromatch": "^4.0.9",
49
- "@types/node": "^22.5.3",
51
+ "@types/node": "^22.5.4",
50
52
  "@types/set-value": "^4.0.3",
51
53
  "@vitest/coverage-v8": "^2.0.5",
52
54
  "ci-info": "^4.0.0",
53
55
  "cross-env": "^7.0.3",
54
56
  "defu": "^6.1.4",
55
- "eslint": "^9.9.1",
57
+ "eslint": "^9.10.0",
56
58
  "execa": "^9.3.1",
57
59
  "fast-glob": "^3.3.2",
58
60
  "fs-extra": "^11.2.0",
@@ -310,30 +310,43 @@ init_esm_shims();
310
310
  init_esm_shims();
311
311
  var import_get_value2 = __toESM(require_get_value(), 1);
312
312
  var import_set_value = __toESM(require_set_value(), 1);
313
- import { fileURLToPath } from "node:url";
314
313
  import process from "node:process";
315
- import path from "pathe";
314
+ import { fileURLToPath } from "node:url";
315
+ import checkbox from "@inquirer/checkbox";
316
316
  import fs from "fs-extra";
317
317
  import klaw from "klaw";
318
318
  import PQueue from "p-queue";
319
- import checkbox from "@inquirer/checkbox";
319
+ import path from "pathe";
320
320
 
321
321
  // ../../scripts/git.ts
322
322
  init_esm_shims();
323
323
  var import_get_value = __toESM(require_get_value(), 1);
324
- import { simpleGit } from "simple-git";
325
324
  import gitUrlParse from "git-url-parse";
325
+ import { simpleGit } from "simple-git";
326
326
  var GitClient = class {
327
327
  client;
328
+ #config;
328
329
  constructor(options = {}) {
329
330
  this.client = simpleGit(options);
330
331
  }
331
332
  listConfig() {
332
333
  return this.client.listConfig();
333
334
  }
334
- async getGitUrl() {
335
+ async init() {
335
336
  const listConfig = await this.listConfig();
336
- const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
337
+ this.#config = listConfig.all;
338
+ return this.#config;
339
+ }
340
+ async getConfig() {
341
+ if (this.#config) {
342
+ return this.#config;
343
+ } else {
344
+ return await this.init();
345
+ }
346
+ }
347
+ async getGitUrl() {
348
+ const config = await this.getConfig();
349
+ const x = (0, import_get_value.default)(config, "remote.origin.url");
337
350
  if (x) {
338
351
  return gitUrlParse(x);
339
352
  }
@@ -344,6 +357,15 @@ var GitClient = class {
344
357
  return `${url.owner}/${url.name}`;
345
358
  }
346
359
  }
360
+ async getUser() {
361
+ const config = await this.getConfig();
362
+ const name = (0, import_get_value.default)(config, "user.name");
363
+ const email = (0, import_get_value.default)(config, "user.email");
364
+ return {
365
+ name,
366
+ email
367
+ };
368
+ }
347
369
  };
348
370
 
349
371
  // src/logger.ts
@@ -351,20 +373,6 @@ init_esm_shims();
351
373
  import { createConsola } from "consola";
352
374
  var logger = createConsola();
353
375
 
354
- // src/utils.ts
355
- init_esm_shims();
356
- function escapeStringRegexp(str) {
357
- return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
358
- }
359
- function isMatch(str, arr) {
360
- for (const reg of arr) {
361
- if (reg.test(str)) {
362
- return true;
363
- }
364
- }
365
- return false;
366
- }
367
-
368
376
  // src/targets.ts
369
377
  init_esm_shims();
370
378
  function getTargets(raw) {
@@ -400,6 +408,20 @@ function getTargets(raw) {
400
408
  return list;
401
409
  }
402
410
 
411
+ // src/utils.ts
412
+ init_esm_shims();
413
+ function escapeStringRegexp(str) {
414
+ return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
415
+ }
416
+ function isMatch(str, arr) {
417
+ for (const reg of arr) {
418
+ if (reg.test(str)) {
419
+ return true;
420
+ }
421
+ }
422
+ return false;
423
+ }
424
+
403
425
  // src/lib.ts
404
426
  var queue = new PQueue({ concurrency: 1 });
405
427
  var __filename2 = fileURLToPath(import.meta.url);
@@ -448,10 +470,10 @@ async function main(opts) {
448
470
  const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
449
471
  (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
450
472
  Object.entries(deps).forEach((x) => {
451
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
473
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
452
474
  });
453
475
  Object.entries(devDeps).forEach((x) => {
454
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
476
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
455
477
  });
456
478
  await fs.writeJson(targetPath, targetPkgJson, {
457
479
  spaces: 2
package/dist/cli.cjs CHANGED
@@ -316,41 +316,49 @@ var import_commander = require("commander");
316
316
 
317
317
  // package.json
318
318
  var name = "@icebreakers/monorepo";
319
- var version = "0.2.4";
320
-
321
- // src/logger.ts
322
- init_cjs_shims();
323
- var import_consola = require("consola");
324
- var logger = (0, import_consola.createConsola)();
319
+ var version = "0.2.7";
325
320
 
326
321
  // src/lib.ts
327
322
  init_cjs_shims();
328
- var import_node_url = require("url");
329
323
  var import_node_process = __toESM(require("process"), 1);
330
- var import_pathe = __toESM(require("pathe"), 1);
324
+ var import_node_url = require("url");
325
+ var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
331
326
  var import_fs_extra = __toESM(require("fs-extra"), 1);
332
327
  var import_get_value2 = __toESM(require_get_value(), 1);
333
- var import_set_value = __toESM(require_set_value(), 1);
334
328
  var import_klaw = __toESM(require("klaw"), 1);
335
329
  var import_p_queue = __toESM(require("p-queue"), 1);
336
- var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
330
+ var import_pathe = __toESM(require("pathe"), 1);
331
+ var import_set_value = __toESM(require_set_value(), 1);
337
332
 
338
333
  // ../../scripts/git.ts
339
334
  init_cjs_shims();
340
335
  var import_get_value = __toESM(require_get_value(), 1);
341
- var import_simple_git = require("simple-git");
342
336
  var import_git_url_parse = __toESM(require("git-url-parse"), 1);
337
+ var import_simple_git = require("simple-git");
343
338
  var GitClient = class {
344
339
  client;
340
+ #config;
345
341
  constructor(options = {}) {
346
342
  this.client = (0, import_simple_git.simpleGit)(options);
347
343
  }
348
344
  listConfig() {
349
345
  return this.client.listConfig();
350
346
  }
351
- async getGitUrl() {
347
+ async init() {
352
348
  const listConfig = await this.listConfig();
353
- const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
349
+ this.#config = listConfig.all;
350
+ return this.#config;
351
+ }
352
+ async getConfig() {
353
+ if (this.#config) {
354
+ return this.#config;
355
+ } else {
356
+ return await this.init();
357
+ }
358
+ }
359
+ async getGitUrl() {
360
+ const config = await this.getConfig();
361
+ const x = (0, import_get_value.default)(config, "remote.origin.url");
354
362
  if (x) {
355
363
  return (0, import_git_url_parse.default)(x);
356
364
  }
@@ -361,21 +369,21 @@ var GitClient = class {
361
369
  return `${url.owner}/${url.name}`;
362
370
  }
363
371
  }
372
+ async getUser() {
373
+ const config = await this.getConfig();
374
+ const name2 = (0, import_get_value.default)(config, "user.name");
375
+ const email = (0, import_get_value.default)(config, "user.email");
376
+ return {
377
+ name: name2,
378
+ email
379
+ };
380
+ }
364
381
  };
365
382
 
366
- // src/utils.ts
383
+ // src/logger.ts
367
384
  init_cjs_shims();
368
- function escapeStringRegexp(str) {
369
- return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
370
- }
371
- function isMatch(str, arr) {
372
- for (const reg of arr) {
373
- if (reg.test(str)) {
374
- return true;
375
- }
376
- }
377
- return false;
378
- }
385
+ var import_consola = require("consola");
386
+ var logger = (0, import_consola.createConsola)();
379
387
 
380
388
  // src/targets.ts
381
389
  init_cjs_shims();
@@ -412,6 +420,20 @@ function getTargets(raw) {
412
420
  return list;
413
421
  }
414
422
 
423
+ // src/utils.ts
424
+ init_cjs_shims();
425
+ function escapeStringRegexp(str) {
426
+ return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
427
+ }
428
+ function isMatch(str, arr) {
429
+ for (const reg of arr) {
430
+ if (reg.test(str)) {
431
+ return true;
432
+ }
433
+ }
434
+ return false;
435
+ }
436
+
415
437
  // src/lib.ts
416
438
  var queue = new import_p_queue.default({ concurrency: 1 });
417
439
  var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
@@ -460,10 +482,10 @@ async function main(opts) {
460
482
  const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
461
483
  (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
462
484
  Object.entries(deps).forEach((x) => {
463
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
485
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
464
486
  });
465
487
  Object.entries(devDeps).forEach((x) => {
466
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
488
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
467
489
  });
468
490
  await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
469
491
  spaces: 2
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  init_esm_shims,
3
3
  logger,
4
4
  main
5
- } from "./chunk-GENB6U7R.js";
5
+ } from "./chunk-IWVKXXSC.js";
6
6
 
7
7
  // src/cli.ts
8
8
  init_esm_shims();
@@ -13,7 +13,7 @@ import { program } from "commander";
13
13
 
14
14
  // package.json
15
15
  var name = "@icebreakers/monorepo";
16
- var version = "0.2.4";
16
+ var version = "0.2.7";
17
17
 
18
18
  // src/program.ts
19
19
  program.name(name).version(version);
package/dist/index.cjs CHANGED
@@ -322,32 +322,45 @@ init_cjs_shims();
322
322
 
323
323
  // src/lib.ts
324
324
  init_cjs_shims();
325
- var import_node_url = require("url");
326
325
  var import_node_process = __toESM(require("process"), 1);
327
- var import_pathe = __toESM(require("pathe"), 1);
326
+ var import_node_url = require("url");
327
+ var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
328
328
  var import_fs_extra = __toESM(require("fs-extra"), 1);
329
329
  var import_get_value2 = __toESM(require_get_value(), 1);
330
- var import_set_value = __toESM(require_set_value(), 1);
331
330
  var import_klaw = __toESM(require("klaw"), 1);
332
331
  var import_p_queue = __toESM(require("p-queue"), 1);
333
- var import_checkbox = __toESM(require("@inquirer/checkbox"), 1);
332
+ var import_pathe = __toESM(require("pathe"), 1);
333
+ var import_set_value = __toESM(require_set_value(), 1);
334
334
 
335
335
  // ../../scripts/git.ts
336
336
  init_cjs_shims();
337
337
  var import_get_value = __toESM(require_get_value(), 1);
338
- var import_simple_git = require("simple-git");
339
338
  var import_git_url_parse = __toESM(require("git-url-parse"), 1);
339
+ var import_simple_git = require("simple-git");
340
340
  var GitClient = class {
341
341
  client;
342
+ #config;
342
343
  constructor(options = {}) {
343
344
  this.client = (0, import_simple_git.simpleGit)(options);
344
345
  }
345
346
  listConfig() {
346
347
  return this.client.listConfig();
347
348
  }
348
- async getGitUrl() {
349
+ async init() {
349
350
  const listConfig = await this.listConfig();
350
- const x = (0, import_get_value.default)(listConfig.all, "remote.origin.url");
351
+ this.#config = listConfig.all;
352
+ return this.#config;
353
+ }
354
+ async getConfig() {
355
+ if (this.#config) {
356
+ return this.#config;
357
+ } else {
358
+ return await this.init();
359
+ }
360
+ }
361
+ async getGitUrl() {
362
+ const config = await this.getConfig();
363
+ const x = (0, import_get_value.default)(config, "remote.origin.url");
351
364
  if (x) {
352
365
  return (0, import_git_url_parse.default)(x);
353
366
  }
@@ -358,6 +371,15 @@ var GitClient = class {
358
371
  return `${url.owner}/${url.name}`;
359
372
  }
360
373
  }
374
+ async getUser() {
375
+ const config = await this.getConfig();
376
+ const name = (0, import_get_value.default)(config, "user.name");
377
+ const email = (0, import_get_value.default)(config, "user.email");
378
+ return {
379
+ name,
380
+ email
381
+ };
382
+ }
361
383
  };
362
384
 
363
385
  // src/logger.ts
@@ -365,20 +387,6 @@ init_cjs_shims();
365
387
  var import_consola = require("consola");
366
388
  var logger = (0, import_consola.createConsola)();
367
389
 
368
- // src/utils.ts
369
- init_cjs_shims();
370
- function escapeStringRegexp(str) {
371
- return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
372
- }
373
- function isMatch(str, arr) {
374
- for (const reg of arr) {
375
- if (reg.test(str)) {
376
- return true;
377
- }
378
- }
379
- return false;
380
- }
381
-
382
390
  // src/targets.ts
383
391
  init_cjs_shims();
384
392
  function getTargets(raw) {
@@ -414,6 +422,20 @@ function getTargets(raw) {
414
422
  return list;
415
423
  }
416
424
 
425
+ // src/utils.ts
426
+ init_cjs_shims();
427
+ function escapeStringRegexp(str) {
428
+ return str.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
429
+ }
430
+ function isMatch(str, arr) {
431
+ for (const reg of arr) {
432
+ if (reg.test(str)) {
433
+ return true;
434
+ }
435
+ }
436
+ return false;
437
+ }
438
+
417
439
  // src/lib.ts
418
440
  var queue = new import_p_queue.default({ concurrency: 1 });
419
441
  var __filename2 = (0, import_node_url.fileURLToPath)(importMetaUrl);
@@ -462,10 +484,10 @@ async function main(opts) {
462
484
  const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
463
485
  (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
464
486
  Object.entries(deps).forEach((x) => {
465
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0]}`, x[1], { preservePaths: false });
487
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
466
488
  });
467
489
  Object.entries(devDeps).forEach((x) => {
468
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0]}`, x[1], { preservePaths: false });
490
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
469
491
  });
470
492
  await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
471
493
  spaces: 2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  main
3
- } from "./chunk-GENB6U7R.js";
3
+ } from "./chunk-IWVKXXSC.js";
4
4
  export {
5
5
  main
6
6
  };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "0.2.4",
4
+ "version": "0.2.7",
5
5
  "description": "icebreaker's monorepo config generator",
6
- "author": "sonofmagic",
6
+ "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
8
8
  "homepage": "https://monorepo.icebreaker.top",
9
9
  "repository": {