@icebreakers/monorepo 0.6.8 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/package.json +5 -5
- package/dist/{chunk-ITSP35ZQ.js → chunk-653WXXRS.js} +24 -18
- package/dist/cli.cjs +24 -18
- package/dist/cli.js +1 -1
- package/dist/index.cjs +24 -18
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/assets/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@9.12.
|
|
6
|
+
"packageManager": "pnpm@9.12.2",
|
|
7
7
|
"author": "ice breaker <1324318532@qq.com>",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -46,17 +46,17 @@
|
|
|
46
46
|
"@types/git-url-parse": "^9.0.3",
|
|
47
47
|
"@types/klaw": "^3.0.6",
|
|
48
48
|
"@types/lint-staged": "^13.3.0",
|
|
49
|
-
"@types/lodash": "^4.17.
|
|
49
|
+
"@types/lodash": "^4.17.11",
|
|
50
50
|
"@types/lodash-es": "^4.17.12",
|
|
51
51
|
"@types/micromatch": "^4.0.9",
|
|
52
|
-
"@types/node": "^22.7.
|
|
52
|
+
"@types/node": "^22.7.6",
|
|
53
53
|
"@types/set-value": "^4.0.3",
|
|
54
54
|
"@vitest/coverage-v8": "~2.1.3",
|
|
55
55
|
"ci-info": "^4.0.0",
|
|
56
56
|
"cross-env": "^7.0.3",
|
|
57
57
|
"defu": "^6.1.4",
|
|
58
58
|
"eslint": "^9.12.0",
|
|
59
|
-
"execa": "^9.4.
|
|
59
|
+
"execa": "^9.4.1",
|
|
60
60
|
"fs-extra": "^11.2.0",
|
|
61
61
|
"get-value": "^3.0.1",
|
|
62
62
|
"husky": "^9.1.6",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"pkg-types": "^1.2.1",
|
|
70
70
|
"rimraf": "^6.0.1",
|
|
71
71
|
"set-value": "^4.1.0",
|
|
72
|
-
"tslib": "^2.
|
|
72
|
+
"tslib": "^2.8.0",
|
|
73
73
|
"tsup": "^8.3.0",
|
|
74
74
|
"tsx": "^4.19.1",
|
|
75
75
|
"turbo": "^2.1.3",
|
|
@@ -51,27 +51,27 @@ var require_get_value = __commonJS({
|
|
|
51
51
|
"use strict";
|
|
52
52
|
init_esm_shims();
|
|
53
53
|
var isObject = require_isobject();
|
|
54
|
-
module.exports = function(target,
|
|
54
|
+
module.exports = function(target, path9, options) {
|
|
55
55
|
if (!isObject(options)) {
|
|
56
56
|
options = { default: options };
|
|
57
57
|
}
|
|
58
58
|
if (!isValidObject(target)) {
|
|
59
59
|
return typeof options.default !== "undefined" ? options.default : target;
|
|
60
60
|
}
|
|
61
|
-
if (typeof
|
|
62
|
-
|
|
61
|
+
if (typeof path9 === "number") {
|
|
62
|
+
path9 = String(path9);
|
|
63
63
|
}
|
|
64
|
-
const isArray = Array.isArray(
|
|
65
|
-
const isString = typeof
|
|
64
|
+
const isArray = Array.isArray(path9);
|
|
65
|
+
const isString = typeof path9 === "string";
|
|
66
66
|
const splitChar = options.separator || ".";
|
|
67
67
|
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
68
68
|
if (!isString && !isArray) {
|
|
69
69
|
return target;
|
|
70
70
|
}
|
|
71
|
-
if (isString &&
|
|
72
|
-
return isValid(
|
|
71
|
+
if (isString && path9 in target) {
|
|
72
|
+
return isValid(path9, target, options) ? target[path9] : options.default;
|
|
73
73
|
}
|
|
74
|
-
let segs = isArray ?
|
|
74
|
+
let segs = isArray ? path9 : split(path9, splitChar, options);
|
|
75
75
|
let len = segs.length;
|
|
76
76
|
let idx = 0;
|
|
77
77
|
do {
|
|
@@ -117,11 +117,11 @@ var require_get_value = __commonJS({
|
|
|
117
117
|
}
|
|
118
118
|
return segs[0] + joinChar + segs[1];
|
|
119
119
|
}
|
|
120
|
-
function split(
|
|
120
|
+
function split(path9, splitChar, options) {
|
|
121
121
|
if (typeof options.split === "function") {
|
|
122
|
-
return options.split(
|
|
122
|
+
return options.split(path9);
|
|
123
123
|
}
|
|
124
|
-
return
|
|
124
|
+
return path9.split(splitChar);
|
|
125
125
|
}
|
|
126
126
|
function isValid(key, target, options) {
|
|
127
127
|
if (typeof options.isValid === "function") {
|
|
@@ -271,9 +271,9 @@ var require_set_value = __commonJS({
|
|
|
271
271
|
}
|
|
272
272
|
return obj;
|
|
273
273
|
};
|
|
274
|
-
var setValue = (target,
|
|
275
|
-
if (!
|
|
276
|
-
const keys = split(
|
|
274
|
+
var setValue = (target, path9, value, options) => {
|
|
275
|
+
if (!path9 || !isObject(target)) return target;
|
|
276
|
+
const keys = split(path9, options);
|
|
277
277
|
let obj = target;
|
|
278
278
|
for (let i = 0; i < keys.length; i++) {
|
|
279
279
|
const key = keys[i];
|
|
@@ -405,7 +405,7 @@ init_esm_shims();
|
|
|
405
405
|
|
|
406
406
|
// package.json
|
|
407
407
|
var name = "@icebreakers/monorepo";
|
|
408
|
-
var version = "0.6.
|
|
408
|
+
var version = "0.6.9";
|
|
409
409
|
|
|
410
410
|
// src/logger.ts
|
|
411
411
|
init_esm_shims();
|
|
@@ -784,9 +784,13 @@ async function createContext(cwd2) {
|
|
|
784
784
|
const git = new GitClient();
|
|
785
785
|
const workspaceFilepath = path5.resolve(cwd2, "pnpm-workspace.yaml");
|
|
786
786
|
const projects = await getWorkspacePackages(cwd2);
|
|
787
|
+
const gitUrl = await git.getGitUrl();
|
|
788
|
+
const gitUser = await git.getUser();
|
|
787
789
|
return {
|
|
788
790
|
cwd: cwd2,
|
|
789
791
|
git,
|
|
792
|
+
gitUrl,
|
|
793
|
+
gitUser,
|
|
790
794
|
workspaceFilepath,
|
|
791
795
|
projects
|
|
792
796
|
};
|
|
@@ -798,9 +802,7 @@ var import_set_value4 = __toESM(require_set_value(), 1);
|
|
|
798
802
|
import fs4 from "fs-extra";
|
|
799
803
|
import path6 from "pathe";
|
|
800
804
|
async function setPkgJson_default(ctx) {
|
|
801
|
-
const {
|
|
802
|
-
const gitUrl = await git.getGitUrl();
|
|
803
|
-
const gitUser = await git.getUser();
|
|
805
|
+
const { gitUrl, gitUser, projects, cwd: cwd2, workspaceFilepath } = ctx;
|
|
804
806
|
if (gitUrl && await fs4.exists(workspaceFilepath)) {
|
|
805
807
|
for (const project of projects) {
|
|
806
808
|
const pkgJson = project.manifest;
|
|
@@ -880,9 +882,13 @@ init_esm_shims();
|
|
|
880
882
|
import os from "node:os";
|
|
881
883
|
import { execa } from "execa";
|
|
882
884
|
import PQueue2 from "p-queue";
|
|
885
|
+
import path8 from "pathe";
|
|
883
886
|
import pc2 from "picocolors";
|
|
884
887
|
async function syncNpmMirror(cwd2) {
|
|
885
888
|
const packages = await getWorkspacePackages(cwd2);
|
|
889
|
+
logger.info(`[\u5F53\u524D\u5DE5\u4F5C\u533ARepo]:
|
|
890
|
+
${packages.map((x) => `- ${pc2.green(x.manifest.name)} : ${path8.relative(cwd2, x.rootDir)}`).join("\n")}
|
|
891
|
+
`);
|
|
886
892
|
const set5 = new Set(packages.map((x) => x.manifest.name));
|
|
887
893
|
logger.info(`[\u5373\u5C06\u540C\u6B65\u7684\u5305]:
|
|
888
894
|
${Array.from(set5).map((x) => `- ${pc2.green(x)}`).join("\n")}
|
package/dist/cli.cjs
CHANGED
|
@@ -55,27 +55,27 @@ var require_get_value = __commonJS({
|
|
|
55
55
|
"use strict";
|
|
56
56
|
init_cjs_shims();
|
|
57
57
|
var isObject = require_isobject();
|
|
58
|
-
module2.exports = function(target,
|
|
58
|
+
module2.exports = function(target, path9, options) {
|
|
59
59
|
if (!isObject(options)) {
|
|
60
60
|
options = { default: options };
|
|
61
61
|
}
|
|
62
62
|
if (!isValidObject(target)) {
|
|
63
63
|
return typeof options.default !== "undefined" ? options.default : target;
|
|
64
64
|
}
|
|
65
|
-
if (typeof
|
|
66
|
-
|
|
65
|
+
if (typeof path9 === "number") {
|
|
66
|
+
path9 = String(path9);
|
|
67
67
|
}
|
|
68
|
-
const isArray = Array.isArray(
|
|
69
|
-
const isString = typeof
|
|
68
|
+
const isArray = Array.isArray(path9);
|
|
69
|
+
const isString = typeof path9 === "string";
|
|
70
70
|
const splitChar = options.separator || ".";
|
|
71
71
|
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
72
72
|
if (!isString && !isArray) {
|
|
73
73
|
return target;
|
|
74
74
|
}
|
|
75
|
-
if (isString &&
|
|
76
|
-
return isValid(
|
|
75
|
+
if (isString && path9 in target) {
|
|
76
|
+
return isValid(path9, target, options) ? target[path9] : options.default;
|
|
77
77
|
}
|
|
78
|
-
let segs = isArray ?
|
|
78
|
+
let segs = isArray ? path9 : split(path9, splitChar, options);
|
|
79
79
|
let len = segs.length;
|
|
80
80
|
let idx = 0;
|
|
81
81
|
do {
|
|
@@ -121,11 +121,11 @@ var require_get_value = __commonJS({
|
|
|
121
121
|
}
|
|
122
122
|
return segs[0] + joinChar + segs[1];
|
|
123
123
|
}
|
|
124
|
-
function split(
|
|
124
|
+
function split(path9, splitChar, options) {
|
|
125
125
|
if (typeof options.split === "function") {
|
|
126
|
-
return options.split(
|
|
126
|
+
return options.split(path9);
|
|
127
127
|
}
|
|
128
|
-
return
|
|
128
|
+
return path9.split(splitChar);
|
|
129
129
|
}
|
|
130
130
|
function isValid(key, target, options) {
|
|
131
131
|
if (typeof options.isValid === "function") {
|
|
@@ -275,9 +275,9 @@ var require_set_value = __commonJS({
|
|
|
275
275
|
}
|
|
276
276
|
return obj;
|
|
277
277
|
};
|
|
278
|
-
var setValue = (target,
|
|
279
|
-
if (!
|
|
280
|
-
const keys = split(
|
|
278
|
+
var setValue = (target, path9, value, options) => {
|
|
279
|
+
if (!path9 || !isObject(target)) return target;
|
|
280
|
+
const keys = split(path9, options);
|
|
281
281
|
let obj = target;
|
|
282
282
|
for (let i = 0; i < keys.length; i++) {
|
|
283
283
|
const key = keys[i];
|
|
@@ -320,7 +320,7 @@ init_cjs_shims();
|
|
|
320
320
|
|
|
321
321
|
// package.json
|
|
322
322
|
var name = "@icebreakers/monorepo";
|
|
323
|
-
var version = "0.6.
|
|
323
|
+
var version = "0.6.9";
|
|
324
324
|
|
|
325
325
|
// src/lib.ts
|
|
326
326
|
init_cjs_shims();
|
|
@@ -801,9 +801,13 @@ async function createContext(cwd3) {
|
|
|
801
801
|
const git = new GitClient();
|
|
802
802
|
const workspaceFilepath = import_pathe5.default.resolve(cwd3, "pnpm-workspace.yaml");
|
|
803
803
|
const projects = await getWorkspacePackages(cwd3);
|
|
804
|
+
const gitUrl = await git.getGitUrl();
|
|
805
|
+
const gitUser = await git.getUser();
|
|
804
806
|
return {
|
|
805
807
|
cwd: cwd3,
|
|
806
808
|
git,
|
|
809
|
+
gitUrl,
|
|
810
|
+
gitUser,
|
|
807
811
|
workspaceFilepath,
|
|
808
812
|
projects
|
|
809
813
|
};
|
|
@@ -815,9 +819,7 @@ var import_fs_extra4 = __toESM(require("fs-extra"), 1);
|
|
|
815
819
|
var import_pathe6 = __toESM(require("pathe"), 1);
|
|
816
820
|
var import_set_value4 = __toESM(require_set_value(), 1);
|
|
817
821
|
async function setPkgJson_default(ctx) {
|
|
818
|
-
const {
|
|
819
|
-
const gitUrl = await git.getGitUrl();
|
|
820
|
-
const gitUser = await git.getUser();
|
|
822
|
+
const { gitUrl, gitUser, projects, cwd: cwd3, workspaceFilepath } = ctx;
|
|
821
823
|
if (gitUrl && await import_fs_extra4.default.exists(workspaceFilepath)) {
|
|
822
824
|
for (const project of projects) {
|
|
823
825
|
const pkgJson = project.manifest;
|
|
@@ -897,9 +899,13 @@ init_cjs_shims();
|
|
|
897
899
|
var import_node_os = __toESM(require("os"), 1);
|
|
898
900
|
var import_execa = require("execa");
|
|
899
901
|
var import_p_queue2 = __toESM(require("p-queue"), 1);
|
|
902
|
+
var import_pathe8 = __toESM(require("pathe"), 1);
|
|
900
903
|
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
901
904
|
async function syncNpmMirror(cwd3) {
|
|
902
905
|
const packages = await getWorkspacePackages(cwd3);
|
|
906
|
+
logger.info(`[\u5F53\u524D\u5DE5\u4F5C\u533ARepo]:
|
|
907
|
+
${packages.map((x) => `- ${import_picocolors2.default.green(x.manifest.name)} : ${import_pathe8.default.relative(cwd3, x.rootDir)}`).join("\n")}
|
|
908
|
+
`);
|
|
903
909
|
const set5 = new Set(packages.map((x) => x.manifest.name));
|
|
904
910
|
logger.info(`[\u5373\u5C06\u540C\u6B65\u7684\u5305]:
|
|
905
911
|
${Array.from(set5).map((x) => `- ${import_picocolors2.default.green(x)}`).join("\n")}
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -60,27 +60,27 @@ var require_get_value = __commonJS({
|
|
|
60
60
|
"use strict";
|
|
61
61
|
init_cjs_shims();
|
|
62
62
|
var isObject = require_isobject();
|
|
63
|
-
module2.exports = function(target,
|
|
63
|
+
module2.exports = function(target, path9, options) {
|
|
64
64
|
if (!isObject(options)) {
|
|
65
65
|
options = { default: options };
|
|
66
66
|
}
|
|
67
67
|
if (!isValidObject(target)) {
|
|
68
68
|
return typeof options.default !== "undefined" ? options.default : target;
|
|
69
69
|
}
|
|
70
|
-
if (typeof
|
|
71
|
-
|
|
70
|
+
if (typeof path9 === "number") {
|
|
71
|
+
path9 = String(path9);
|
|
72
72
|
}
|
|
73
|
-
const isArray = Array.isArray(
|
|
74
|
-
const isString = typeof
|
|
73
|
+
const isArray = Array.isArray(path9);
|
|
74
|
+
const isString = typeof path9 === "string";
|
|
75
75
|
const splitChar = options.separator || ".";
|
|
76
76
|
const joinChar = options.joinChar || (typeof splitChar === "string" ? splitChar : ".");
|
|
77
77
|
if (!isString && !isArray) {
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
if (isString &&
|
|
81
|
-
return isValid(
|
|
80
|
+
if (isString && path9 in target) {
|
|
81
|
+
return isValid(path9, target, options) ? target[path9] : options.default;
|
|
82
82
|
}
|
|
83
|
-
let segs = isArray ?
|
|
83
|
+
let segs = isArray ? path9 : split(path9, splitChar, options);
|
|
84
84
|
let len = segs.length;
|
|
85
85
|
let idx = 0;
|
|
86
86
|
do {
|
|
@@ -126,11 +126,11 @@ var require_get_value = __commonJS({
|
|
|
126
126
|
}
|
|
127
127
|
return segs[0] + joinChar + segs[1];
|
|
128
128
|
}
|
|
129
|
-
function split(
|
|
129
|
+
function split(path9, splitChar, options) {
|
|
130
130
|
if (typeof options.split === "function") {
|
|
131
|
-
return options.split(
|
|
131
|
+
return options.split(path9);
|
|
132
132
|
}
|
|
133
|
-
return
|
|
133
|
+
return path9.split(splitChar);
|
|
134
134
|
}
|
|
135
135
|
function isValid(key, target, options) {
|
|
136
136
|
if (typeof options.isValid === "function") {
|
|
@@ -280,9 +280,9 @@ var require_set_value = __commonJS({
|
|
|
280
280
|
}
|
|
281
281
|
return obj;
|
|
282
282
|
};
|
|
283
|
-
var setValue = (target,
|
|
284
|
-
if (!
|
|
285
|
-
const keys = split(
|
|
283
|
+
var setValue = (target, path9, value, options) => {
|
|
284
|
+
if (!path9 || !isObject(target)) return target;
|
|
285
|
+
const keys = split(path9, options);
|
|
286
286
|
let obj = target;
|
|
287
287
|
for (let i = 0; i < keys.length; i++) {
|
|
288
288
|
const key = keys[i];
|
|
@@ -351,7 +351,7 @@ init_cjs_shims();
|
|
|
351
351
|
|
|
352
352
|
// package.json
|
|
353
353
|
var name = "@icebreakers/monorepo";
|
|
354
|
-
var version = "0.6.
|
|
354
|
+
var version = "0.6.9";
|
|
355
355
|
|
|
356
356
|
// src/logger.ts
|
|
357
357
|
init_cjs_shims();
|
|
@@ -818,9 +818,13 @@ async function createContext(cwd2) {
|
|
|
818
818
|
const git = new GitClient();
|
|
819
819
|
const workspaceFilepath = import_pathe5.default.resolve(cwd2, "pnpm-workspace.yaml");
|
|
820
820
|
const projects = await getWorkspacePackages(cwd2);
|
|
821
|
+
const gitUrl = await git.getGitUrl();
|
|
822
|
+
const gitUser = await git.getUser();
|
|
821
823
|
return {
|
|
822
824
|
cwd: cwd2,
|
|
823
825
|
git,
|
|
826
|
+
gitUrl,
|
|
827
|
+
gitUser,
|
|
824
828
|
workspaceFilepath,
|
|
825
829
|
projects
|
|
826
830
|
};
|
|
@@ -832,9 +836,7 @@ var import_fs_extra4 = __toESM(require("fs-extra"), 1);
|
|
|
832
836
|
var import_pathe6 = __toESM(require("pathe"), 1);
|
|
833
837
|
var import_set_value4 = __toESM(require_set_value(), 1);
|
|
834
838
|
async function setPkgJson_default(ctx) {
|
|
835
|
-
const {
|
|
836
|
-
const gitUrl = await git.getGitUrl();
|
|
837
|
-
const gitUser = await git.getUser();
|
|
839
|
+
const { gitUrl, gitUser, projects, cwd: cwd2, workspaceFilepath } = ctx;
|
|
838
840
|
if (gitUrl && await import_fs_extra4.default.exists(workspaceFilepath)) {
|
|
839
841
|
for (const project of projects) {
|
|
840
842
|
const pkgJson = project.manifest;
|
|
@@ -914,9 +916,13 @@ init_cjs_shims();
|
|
|
914
916
|
var import_node_os = __toESM(require("os"), 1);
|
|
915
917
|
var import_execa = require("execa");
|
|
916
918
|
var import_p_queue2 = __toESM(require("p-queue"), 1);
|
|
919
|
+
var import_pathe8 = __toESM(require("pathe"), 1);
|
|
917
920
|
var import_picocolors2 = __toESM(require("picocolors"), 1);
|
|
918
921
|
async function syncNpmMirror(cwd2) {
|
|
919
922
|
const packages = await getWorkspacePackages(cwd2);
|
|
923
|
+
logger.info(`[\u5F53\u524D\u5DE5\u4F5C\u533ARepo]:
|
|
924
|
+
${packages.map((x) => `- ${import_picocolors2.default.green(x.manifest.name)} : ${import_pathe8.default.relative(cwd2, x.rootDir)}`).join("\n")}
|
|
925
|
+
`);
|
|
920
926
|
const set5 = new Set(packages.map((x) => x.manifest.name));
|
|
921
927
|
logger.info(`[\u5373\u5C06\u540C\u6B65\u7684\u5305]:
|
|
922
928
|
${Array.from(set5).map((x) => `- ${import_picocolors2.default.green(x)}`).join("\n")}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.9",
|
|
5
5
|
"description": "icebreaker's monorepo config generator",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"commander": "^12.1.0",
|
|
43
43
|
"comment-json": "^4.2.5",
|
|
44
44
|
"consola": "^3.2.3",
|
|
45
|
-
"execa": "^9.4.
|
|
45
|
+
"execa": "^9.4.1",
|
|
46
46
|
"fs-extra": "^11.2.0",
|
|
47
47
|
"git-url-parse": "^15.0.0",
|
|
48
48
|
"klaw": "^4.1.0",
|
|
49
49
|
"p-queue": "^8.0.1",
|
|
50
50
|
"pathe": "^1.1.2",
|
|
51
|
-
"picocolors": "^1.1.
|
|
51
|
+
"picocolors": "^1.1.1",
|
|
52
52
|
"simple-git": "^3.27.0"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|