@icebreakers/monorepo 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,7 +37,7 @@
37
37
  "@commitlint/config-conventional": "^19.4.1",
38
38
  "@commitlint/prompt-cli": "^19.4.1",
39
39
  "@commitlint/types": "^19.0.3",
40
- "@icebreakers/eslint-config": "^0.4.1",
40
+ "@icebreakers/eslint-config": "^0.4.2",
41
41
  "@icebreakers/stylelint-config": "^0.0.3",
42
42
  "@pnpm/workspace.find-packages": "^4.0.9",
43
43
  "@types/fs-extra": "^11.0.4",
@@ -435,6 +435,21 @@ var scripts = {
435
435
  "script:clean": "tsx scripts/clean.ts"
436
436
  };
437
437
  var scriptsEntries = Object.entries(scripts);
438
+ function setPkgJson(sourcePkgJson, targetPkgJson) {
439
+ const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
440
+ const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
441
+ const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
442
+ (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
443
+ Object.entries(deps).forEach((x) => {
444
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
445
+ });
446
+ Object.entries(devDeps).forEach((x) => {
447
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
448
+ });
449
+ for (const [k, v] of scriptsEntries) {
450
+ (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
451
+ }
452
+ }
438
453
  async function main(opts) {
439
454
  const { outDir = "", raw, interactive } = opts;
440
455
  const absOutDir = path.isAbsolute(outDir) ? outDir : path.join(cwd, outDir);
@@ -478,19 +493,7 @@ async function main(opts) {
478
493
  if (await fs.exists(targetPath) && await fs.exists(sourcePath)) {
479
494
  const sourcePkgJson = await fs.readJson(sourcePath);
480
495
  const targetPkgJson = await fs.readJson(targetPath);
481
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
482
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
483
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
484
- (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
485
- Object.entries(deps).forEach((x) => {
486
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
487
- });
488
- Object.entries(devDeps).forEach((x) => {
489
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
490
- });
491
- for (const [k, v] of scriptsEntries) {
492
- (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
493
- }
496
+ setPkgJson(sourcePkgJson, targetPkgJson);
494
497
  await fs.writeJson(targetPath, targetPkgJson, {
495
498
  spaces: 2
496
499
  });
@@ -525,6 +528,7 @@ async function main(opts) {
525
528
  export {
526
529
  init_esm_shims,
527
530
  logger,
531
+ setPkgJson,
528
532
  main
529
533
  };
530
534
  /*! Bundled license information:
package/dist/cli.cjs CHANGED
@@ -316,7 +316,7 @@ var import_commander = require("commander");
316
316
 
317
317
  // package.json
318
318
  var name = "@icebreakers/monorepo";
319
- var version = "0.3.2";
319
+ var version = "0.3.4";
320
320
 
321
321
  // src/lib.ts
322
322
  init_cjs_shims();
@@ -447,6 +447,21 @@ var scripts = {
447
447
  "script:clean": "tsx scripts/clean.ts"
448
448
  };
449
449
  var scriptsEntries = Object.entries(scripts);
450
+ function setPkgJson(sourcePkgJson, targetPkgJson) {
451
+ const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
452
+ const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
453
+ const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
454
+ (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
455
+ Object.entries(deps).forEach((x) => {
456
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
457
+ });
458
+ Object.entries(devDeps).forEach((x) => {
459
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
460
+ });
461
+ for (const [k, v] of scriptsEntries) {
462
+ (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
463
+ }
464
+ }
450
465
  async function main(opts) {
451
466
  const { outDir = "", raw, interactive } = opts;
452
467
  const absOutDir = import_pathe.default.isAbsolute(outDir) ? outDir : import_pathe.default.join(cwd, outDir);
@@ -490,19 +505,7 @@ async function main(opts) {
490
505
  if (await import_fs_extra.default.exists(targetPath) && await import_fs_extra.default.exists(sourcePath)) {
491
506
  const sourcePkgJson = await import_fs_extra.default.readJson(sourcePath);
492
507
  const targetPkgJson = await import_fs_extra.default.readJson(targetPath);
493
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
494
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
495
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
496
- (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
497
- Object.entries(deps).forEach((x) => {
498
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
499
- });
500
- Object.entries(devDeps).forEach((x) => {
501
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
502
- });
503
- for (const [k, v] of scriptsEntries) {
504
- (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
505
- }
508
+ setPkgJson(sourcePkgJson, targetPkgJson);
506
509
  await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
507
510
  spaces: 2
508
511
  });
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  init_esm_shims,
3
3
  logger,
4
4
  main
5
- } from "./chunk-CRQVH5BN.js";
5
+ } from "./chunk-PTAP6MTO.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.3.2";
16
+ var version = "0.3.4";
17
17
 
18
18
  // src/program.ts
19
19
  program.name(name).version(version);
package/dist/index.cjs CHANGED
@@ -315,7 +315,8 @@ var require_set_value = __commonJS({
315
315
  // src/index.ts
316
316
  var src_exports = {};
317
317
  __export(src_exports, {
318
- main: () => main
318
+ main: () => main,
319
+ setPkgJson: () => setPkgJson
319
320
  });
320
321
  module.exports = __toCommonJS(src_exports);
321
322
  init_cjs_shims();
@@ -449,6 +450,21 @@ var scripts = {
449
450
  "script:clean": "tsx scripts/clean.ts"
450
451
  };
451
452
  var scriptsEntries = Object.entries(scripts);
453
+ function setPkgJson(sourcePkgJson, targetPkgJson) {
454
+ const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
455
+ const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
456
+ const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
457
+ (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
458
+ Object.entries(deps).forEach((x) => {
459
+ (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
460
+ });
461
+ Object.entries(devDeps).forEach((x) => {
462
+ (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
463
+ });
464
+ for (const [k, v] of scriptsEntries) {
465
+ (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
466
+ }
467
+ }
452
468
  async function main(opts) {
453
469
  const { outDir = "", raw, interactive } = opts;
454
470
  const absOutDir = import_pathe.default.isAbsolute(outDir) ? outDir : import_pathe.default.join(cwd, outDir);
@@ -492,19 +508,7 @@ async function main(opts) {
492
508
  if (await import_fs_extra.default.exists(targetPath) && await import_fs_extra.default.exists(sourcePath)) {
493
509
  const sourcePkgJson = await import_fs_extra.default.readJson(sourcePath);
494
510
  const targetPkgJson = await import_fs_extra.default.readJson(targetPath);
495
- const packageManager = (0, import_get_value2.default)(sourcePkgJson, "packageManager", { default: "" });
496
- const deps = (0, import_get_value2.default)(sourcePkgJson, "dependencies", { default: {} });
497
- const devDeps = (0, import_get_value2.default)(sourcePkgJson, "devDependencies", { default: {} });
498
- (0, import_set_value.default)(targetPkgJson, "packageManager", packageManager);
499
- Object.entries(deps).forEach((x) => {
500
- (0, import_set_value.default)(targetPkgJson, `dependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
501
- });
502
- Object.entries(devDeps).forEach((x) => {
503
- (0, import_set_value.default)(targetPkgJson, `devDependencies.${x[0].replaceAll(".", "\\.")}`, x[1], { preservePaths: false });
504
- });
505
- for (const [k, v] of scriptsEntries) {
506
- (0, import_set_value.default)(targetPkgJson, `scripts.${k}`, v);
507
- }
511
+ setPkgJson(sourcePkgJson, targetPkgJson);
508
512
  await import_fs_extra.default.writeJson(targetPath, targetPkgJson, {
509
513
  spaces: 2
510
514
  });
@@ -537,7 +541,8 @@ async function main(opts) {
537
541
  }
538
542
  // Annotate the CommonJS export names for ESM import in node:
539
543
  0 && (module.exports = {
540
- main
544
+ main,
545
+ setPkgJson
541
546
  });
542
547
  /*! Bundled license information:
543
548
 
package/dist/index.d.cts CHANGED
@@ -1,9 +1,12 @@
1
+ import { PackageJson } from 'pkg-types';
2
+
1
3
  interface CliOpts {
2
4
  interactive?: boolean;
3
5
  raw?: boolean;
4
6
  outDir?: string;
5
7
  }
6
8
 
9
+ declare function setPkgJson(sourcePkgJson: PackageJson, targetPkgJson: PackageJson): void;
7
10
  declare function main(opts: CliOpts): Promise<void>;
8
11
 
9
- export { main };
12
+ export { main, setPkgJson };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ import { PackageJson } from 'pkg-types';
2
+
1
3
  interface CliOpts {
2
4
  interactive?: boolean;
3
5
  raw?: boolean;
4
6
  outDir?: string;
5
7
  }
6
8
 
9
+ declare function setPkgJson(sourcePkgJson: PackageJson, targetPkgJson: PackageJson): void;
7
10
  declare function main(opts: CliOpts): Promise<void>;
8
11
 
9
- export { main };
12
+ export { main, setPkgJson };
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import {
2
- main
3
- } from "./chunk-CRQVH5BN.js";
2
+ main,
3
+ setPkgJson
4
+ } from "./chunk-PTAP6MTO.js";
4
5
  export {
5
- main
6
+ main,
7
+ setPkgJson
6
8
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "0.3.2",
4
+ "version": "0.3.4",
5
5
  "description": "icebreaker's monorepo config generator",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",