@icebreakers/monorepo 1.0.17 → 1.1.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.
- package/dist/{chunk-IQWID4TH.js → chunk-VXG3KCQ5.js} +133 -126
- package/dist/cli.cjs +132 -125
- package/dist/cli.js +2 -2
- package/dist/index.cjs +132 -125
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -215,67 +215,7 @@ var require_set_value = __commonJS({
|
|
|
215
215
|
}
|
|
216
216
|
});
|
|
217
217
|
|
|
218
|
-
// src/monorepo/
|
|
219
|
-
init_esm_shims();
|
|
220
|
-
import { parse, stringify } from "comment-json";
|
|
221
|
-
import fs from "fs-extra";
|
|
222
|
-
import path2 from "pathe";
|
|
223
|
-
|
|
224
|
-
// src/monorepo/mirror/sources.ts
|
|
225
|
-
init_esm_shims();
|
|
226
|
-
var chinaMirrorsEnvs = {
|
|
227
|
-
COREPACK_NPM_REGISTRY: "https://registry.npmmirror.com",
|
|
228
|
-
EDGEDRIVER_CDNURL: "https://npmmirror.com/mirrors/edgedriver",
|
|
229
|
-
NODEJS_ORG_MIRROR: "https://cdn.npmmirror.com/binaries/node",
|
|
230
|
-
NVM_NODEJS_ORG_MIRROR: "https://cdn.npmmirror.com/binaries/node",
|
|
231
|
-
PHANTOMJS_CDNURL: "https://cdn.npmmirror.com/binaries/phantomjs",
|
|
232
|
-
CHROMEDRIVER_CDNURL: "https://cdn.npmmirror.com/binaries/chromedriver",
|
|
233
|
-
OPERADRIVER_CDNURL: "https://cdn.npmmirror.com/binaries/operadriver",
|
|
234
|
-
CYPRESS_DOWNLOAD_PATH_TEMPLATE: "https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip",
|
|
235
|
-
ELECTRON_MIRROR: "https://cdn.npmmirror.com/binaries/electron/",
|
|
236
|
-
ELECTRON_BUILDER_BINARIES_MIRROR: "https://cdn.npmmirror.com/binaries/electron-builder-binaries/",
|
|
237
|
-
SASS_BINARY_SITE: "https://cdn.npmmirror.com/binaries/node-sass",
|
|
238
|
-
SWC_BINARY_SITE: "https://cdn.npmmirror.com/binaries/node-swc",
|
|
239
|
-
NWJS_URLBASE: "https://cdn.npmmirror.com/binaries/nwjs/v",
|
|
240
|
-
PUPPETEER_DOWNLOAD_HOST: "https://cdn.npmmirror.com/binaries/chrome-for-testing",
|
|
241
|
-
PUPPETEER_DOWNLOAD_BASE_URL: "https://cdn.npmmirror.com/binaries/chrome-for-testing",
|
|
242
|
-
PLAYWRIGHT_DOWNLOAD_HOST: "https://cdn.npmmirror.com/binaries/playwright",
|
|
243
|
-
SENTRYCLI_CDNURL: "https://cdn.npmmirror.com/binaries/sentry-cli",
|
|
244
|
-
SAUCECTL_INSTALL_BINARY_MIRROR: "https://cdn.npmmirror.com/binaries/saucectl",
|
|
245
|
-
RE2_DOWNLOAD_MIRROR: "https://cdn.npmmirror.com/binaries/node-re2",
|
|
246
|
-
RE2_DOWNLOAD_SKIP_PATH: "true",
|
|
247
|
-
PRISMA_ENGINES_MIRROR: "https://cdn.npmmirror.com/binaries/prisma",
|
|
248
|
-
npm_config_better_sqlite3_binary_host: "https://cdn.npmmirror.com/binaries/better-sqlite3",
|
|
249
|
-
npm_config_keytar_binary_host: "https://cdn.npmmirror.com/binaries/keytar",
|
|
250
|
-
npm_config_sharp_binary_host: "https://cdn.npmmirror.com/binaries/sharp",
|
|
251
|
-
npm_config_sharp_libvips_binary_host: "https://cdn.npmmirror.com/binaries/sharp-libvips",
|
|
252
|
-
npm_config_robotjs_binary_host: "https://cdn.npmmirror.com/binaries/robotjs"
|
|
253
|
-
};
|
|
254
|
-
|
|
255
|
-
// src/monorepo/mirror/utils.ts
|
|
256
|
-
init_esm_shims();
|
|
257
|
-
var import_set_value = __toESM(require_set_value(), 1);
|
|
258
|
-
function setMirror(obj) {
|
|
259
|
-
const platforms = ["linux", "windows", "osx"];
|
|
260
|
-
const prefix = "terminal.integrated.env";
|
|
261
|
-
if (typeof obj === "object" && obj) {
|
|
262
|
-
for (const platform of platforms) {
|
|
263
|
-
(0, import_set_value.default)(obj, [prefix, platform].join(".").replaceAll(".", "\\."), chinaMirrorsEnvs);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// src/monorepo/binaryMirror.ts
|
|
269
|
-
async function setVscodeBinaryMirror(cwd) {
|
|
270
|
-
const targetJsonPath = path2.resolve(cwd, ".vscode/settings.json");
|
|
271
|
-
await fs.ensureFile(targetJsonPath);
|
|
272
|
-
const json = parse(await fs.readFile(targetJsonPath, "utf8"), void 0, false);
|
|
273
|
-
json && typeof json === "object" && setMirror(json);
|
|
274
|
-
await fs.writeFile(targetJsonPath, `${stringify(json, void 0, 2)}
|
|
275
|
-
`, "utf8");
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// src/monorepo/workspace.ts
|
|
218
|
+
// src/monorepo/workspace/index.ts
|
|
279
219
|
init_esm_shims();
|
|
280
220
|
import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
|
|
281
221
|
import { findWorkspacePackages } from "@pnpm/workspace.find-packages";
|
|
@@ -350,14 +290,13 @@ var defuArrayFn = createDefu((object, key, currentValue) => {
|
|
|
350
290
|
}
|
|
351
291
|
});
|
|
352
292
|
|
|
353
|
-
// src/monorepo/workspace.ts
|
|
354
|
-
import
|
|
355
|
-
async function getWorkspacePackages(
|
|
293
|
+
// src/monorepo/workspace/index.ts
|
|
294
|
+
import path2 from "pathe";
|
|
295
|
+
async function getWorkspacePackages(workspaceDir, options) {
|
|
356
296
|
const { ignoreRootPackage, ignorePrivatePackage, patterns } = defu(options, {
|
|
357
297
|
ignoreRootPackage: true,
|
|
358
298
|
ignorePrivatePackage: true
|
|
359
299
|
});
|
|
360
|
-
const workspaceDir = await findWorkspaceDir(cwd) ?? cwd;
|
|
361
300
|
const manifest = await readWorkspaceManifest(workspaceDir);
|
|
362
301
|
const packages = await findWorkspacePackages(workspaceDir, {
|
|
363
302
|
patterns: patterns ?? (manifest == null ? void 0 : manifest.packages)
|
|
@@ -368,7 +307,7 @@ async function getWorkspacePackages(cwd, options) {
|
|
|
368
307
|
}
|
|
369
308
|
return true;
|
|
370
309
|
}).map((project) => {
|
|
371
|
-
const pkgJsonPath =
|
|
310
|
+
const pkgJsonPath = path2.resolve(project.rootDir, "package.json");
|
|
372
311
|
return {
|
|
373
312
|
...project,
|
|
374
313
|
pkgJsonPath
|
|
@@ -381,24 +320,29 @@ async function getWorkspacePackages(cwd, options) {
|
|
|
381
320
|
}
|
|
382
321
|
return pkgs;
|
|
383
322
|
}
|
|
323
|
+
async function getWorkspaceData(cwd, options) {
|
|
324
|
+
const workspaceDir = await findWorkspaceDir(cwd) ?? cwd;
|
|
325
|
+
const packages = await getWorkspacePackages(workspaceDir, options);
|
|
326
|
+
return {
|
|
327
|
+
cwd,
|
|
328
|
+
workspaceDir,
|
|
329
|
+
packages
|
|
330
|
+
};
|
|
331
|
+
}
|
|
384
332
|
|
|
385
333
|
// src/monorepo/clean.ts
|
|
386
334
|
init_esm_shims();
|
|
387
|
-
var
|
|
335
|
+
var import_set_value = __toESM(require_set_value(), 1);
|
|
388
336
|
import checkbox from "@inquirer/checkbox";
|
|
389
|
-
import
|
|
390
|
-
import
|
|
391
|
-
import path4 from "pathe";
|
|
337
|
+
import fs from "fs-extra";
|
|
338
|
+
import path3 from "pathe";
|
|
392
339
|
async function cleanProjects(cwd) {
|
|
393
|
-
const workspaceDir = await
|
|
394
|
-
const packages = await getWorkspacePackages(workspaceDir, {
|
|
395
|
-
ignorePrivatePackage: false
|
|
396
|
-
});
|
|
340
|
+
const { packages, workspaceDir } = await getWorkspaceData(cwd);
|
|
397
341
|
const cleanDirs = await checkbox({
|
|
398
342
|
message: "\u8BF7\u9009\u62E9\u9700\u8981\u6E05\u7406\u7684\u76EE\u5F55",
|
|
399
343
|
choices: packages.map((x) => {
|
|
400
344
|
return {
|
|
401
|
-
name:
|
|
345
|
+
name: path3.relative(workspaceDir, x.rootDir),
|
|
402
346
|
value: x.rootDir,
|
|
403
347
|
checked: true,
|
|
404
348
|
description: x.manifest.name
|
|
@@ -406,17 +350,17 @@ async function cleanProjects(cwd) {
|
|
|
406
350
|
})
|
|
407
351
|
});
|
|
408
352
|
for (const dir of cleanDirs) {
|
|
409
|
-
await
|
|
353
|
+
await fs.remove(dir);
|
|
410
354
|
}
|
|
411
|
-
const name2 = "package.json";
|
|
412
|
-
const pkgJson = await
|
|
413
|
-
(0,
|
|
414
|
-
await
|
|
355
|
+
const name2 = path3.resolve(workspaceDir, "package.json");
|
|
356
|
+
const pkgJson = await fs.readJson(name2);
|
|
357
|
+
(0, import_set_value.default)(pkgJson, "devDependencies.@icebreakers/monorepo", "latest", { preservePaths: false });
|
|
358
|
+
await fs.outputJson(name2, pkgJson, {
|
|
415
359
|
spaces: 2
|
|
416
360
|
});
|
|
417
361
|
}
|
|
418
362
|
|
|
419
|
-
// src/monorepo/git.ts
|
|
363
|
+
// src/monorepo/git/index.ts
|
|
420
364
|
init_esm_shims();
|
|
421
365
|
|
|
422
366
|
// ../../node_modules/.pnpm/get-value@4.0.1/node_modules/get-value/dist/index.mjs
|
|
@@ -507,7 +451,7 @@ var getValue = /* @__PURE__ */ __name((target, path11, options = {}) => {
|
|
|
507
451
|
}, "getValue");
|
|
508
452
|
var index_default = getValue;
|
|
509
453
|
|
|
510
|
-
// src/monorepo/git.ts
|
|
454
|
+
// src/monorepo/git/index.ts
|
|
511
455
|
import gitUrlParse from "git-url-parse";
|
|
512
456
|
import { simpleGit } from "simple-git";
|
|
513
457
|
var GitClient = class {
|
|
@@ -555,17 +499,17 @@ var GitClient = class {
|
|
|
555
499
|
}
|
|
556
500
|
};
|
|
557
501
|
|
|
558
|
-
// src/monorepo/init.ts
|
|
502
|
+
// src/monorepo/init/index.ts
|
|
559
503
|
init_esm_shims();
|
|
560
504
|
|
|
561
|
-
// src/monorepo/context.ts
|
|
505
|
+
// src/monorepo/context/index.ts
|
|
562
506
|
init_esm_shims();
|
|
563
|
-
import
|
|
507
|
+
import path4 from "pathe";
|
|
564
508
|
import "@pnpm/types";
|
|
565
509
|
async function createContext(cwd) {
|
|
566
510
|
const git = new GitClient();
|
|
567
|
-
const
|
|
568
|
-
const
|
|
511
|
+
const { packages, workspaceDir } = await getWorkspaceData(cwd);
|
|
512
|
+
const workspaceFilepath = path4.resolve(workspaceDir, "pnpm-workspace.yaml");
|
|
569
513
|
const gitUrl = await git.getGitUrl();
|
|
570
514
|
const gitUser = await git.getUser();
|
|
571
515
|
return {
|
|
@@ -573,44 +517,45 @@ async function createContext(cwd) {
|
|
|
573
517
|
git,
|
|
574
518
|
gitUrl,
|
|
575
519
|
gitUser,
|
|
520
|
+
workspaceDir,
|
|
576
521
|
workspaceFilepath,
|
|
577
|
-
|
|
522
|
+
packages
|
|
578
523
|
};
|
|
579
524
|
}
|
|
580
525
|
|
|
581
|
-
// src/monorepo/setChangeset.ts
|
|
526
|
+
// src/monorepo/init/setChangeset.ts
|
|
582
527
|
init_esm_shims();
|
|
583
|
-
var
|
|
584
|
-
import
|
|
585
|
-
import
|
|
528
|
+
var import_set_value2 = __toESM(require_set_value(), 1);
|
|
529
|
+
import fs2 from "fs-extra";
|
|
530
|
+
import path5 from "pathe";
|
|
586
531
|
async function setChangeset_default(ctx) {
|
|
587
532
|
const { gitUrl, workspaceFilepath } = ctx;
|
|
588
|
-
if (gitUrl && await
|
|
589
|
-
const changesetConfigPath =
|
|
590
|
-
if (await
|
|
591
|
-
const changesetConfig = await
|
|
533
|
+
if (gitUrl && await fs2.exists(workspaceFilepath)) {
|
|
534
|
+
const changesetConfigPath = path5.resolve(path5.dirname(workspaceFilepath), ".changeset/config.json");
|
|
535
|
+
if (await fs2.exists(changesetConfigPath)) {
|
|
536
|
+
const changesetConfig = await fs2.readJson(
|
|
592
537
|
changesetConfigPath
|
|
593
538
|
);
|
|
594
539
|
if (gitUrl.full_name) {
|
|
595
|
-
(0,
|
|
596
|
-
await
|
|
540
|
+
(0, import_set_value2.default)(changesetConfig, "changelog.1.repo", gitUrl.full_name);
|
|
541
|
+
await fs2.outputJson(changesetConfigPath, changesetConfig, { spaces: 2 });
|
|
597
542
|
}
|
|
598
543
|
}
|
|
599
544
|
}
|
|
600
545
|
}
|
|
601
546
|
|
|
602
|
-
// src/monorepo/setPkgJson.ts
|
|
547
|
+
// src/monorepo/init/setPkgJson.ts
|
|
603
548
|
init_esm_shims();
|
|
604
|
-
var
|
|
605
|
-
import
|
|
606
|
-
import
|
|
549
|
+
var import_set_value3 = __toESM(require_set_value(), 1);
|
|
550
|
+
import fs3 from "fs-extra";
|
|
551
|
+
import path6 from "pathe";
|
|
607
552
|
async function setPkgJson_default(ctx) {
|
|
608
|
-
const { gitUrl, gitUser,
|
|
609
|
-
if (gitUrl && await
|
|
610
|
-
for (const
|
|
611
|
-
const pkgJson =
|
|
612
|
-
const directory =
|
|
613
|
-
(0,
|
|
553
|
+
const { gitUrl, gitUser, packages, cwd, workspaceFilepath } = ctx;
|
|
554
|
+
if (gitUrl && await fs3.exists(workspaceFilepath)) {
|
|
555
|
+
for (const pkg of packages) {
|
|
556
|
+
const pkgJson = pkg.manifest;
|
|
557
|
+
const directory = path6.relative(cwd, pkg.rootDir);
|
|
558
|
+
(0, import_set_value3.default)(pkgJson, "bugs.url", `https://github.com/${gitUrl.full_name}/issues`);
|
|
614
559
|
const repository = {
|
|
615
560
|
type: "git",
|
|
616
561
|
url: `git+https://github.com/${gitUrl.full_name}.git`
|
|
@@ -618,23 +563,23 @@ async function setPkgJson_default(ctx) {
|
|
|
618
563
|
if (directory) {
|
|
619
564
|
repository.directory = directory;
|
|
620
565
|
}
|
|
621
|
-
(0,
|
|
566
|
+
(0, import_set_value3.default)(pkgJson, "repository", repository);
|
|
622
567
|
if (gitUser) {
|
|
623
|
-
(0,
|
|
568
|
+
(0, import_set_value3.default)(pkgJson, "author", `${gitUser.name} <${gitUser.email}>`);
|
|
624
569
|
}
|
|
625
|
-
await
|
|
570
|
+
await fs3.writeJSON(pkg.pkgJsonPath, pkgJson, {
|
|
626
571
|
spaces: 2
|
|
627
572
|
});
|
|
628
573
|
}
|
|
629
574
|
}
|
|
630
575
|
}
|
|
631
576
|
|
|
632
|
-
// src/monorepo/setReadme.ts
|
|
577
|
+
// src/monorepo/init/setReadme.ts
|
|
633
578
|
init_esm_shims();
|
|
634
|
-
import
|
|
635
|
-
import
|
|
579
|
+
import fs4 from "fs-extra";
|
|
580
|
+
import path7 from "pathe";
|
|
636
581
|
async function getRows(ctx) {
|
|
637
|
-
const {
|
|
582
|
+
const { packages, git, cwd } = ctx;
|
|
638
583
|
const gitUrl = await git.getGitUrl();
|
|
639
584
|
const gitUser = await git.getUser();
|
|
640
585
|
const rows = [];
|
|
@@ -642,12 +587,12 @@ async function getRows(ctx) {
|
|
|
642
587
|
rows.push(`# ${gitUrl.name}
|
|
643
588
|
`);
|
|
644
589
|
}
|
|
645
|
-
rows.push("##
|
|
646
|
-
for (const
|
|
647
|
-
const p =
|
|
590
|
+
rows.push("## Packages\n");
|
|
591
|
+
for (const pkg of packages) {
|
|
592
|
+
const p = path7.relative(cwd, pkg.rootDirRealPath);
|
|
648
593
|
if (p) {
|
|
649
|
-
const description =
|
|
650
|
-
rows.push(`- [${
|
|
594
|
+
const description = pkg.manifest.description ? `- ${pkg.manifest.description}` : "";
|
|
595
|
+
rows.push(`- [${pkg.manifest.name}](${p}) ${description}`);
|
|
651
596
|
}
|
|
652
597
|
}
|
|
653
598
|
if (gitUrl) {
|
|
@@ -672,11 +617,11 @@ async function getRows(ctx) {
|
|
|
672
617
|
}
|
|
673
618
|
async function setReadme_default(ctx) {
|
|
674
619
|
const rows = await getRows(ctx);
|
|
675
|
-
await
|
|
620
|
+
await fs4.writeFile(path7.resolve(ctx.cwd, "README.md"), `${rows.join("\n")}
|
|
676
621
|
`);
|
|
677
622
|
}
|
|
678
623
|
|
|
679
|
-
// src/monorepo/init.ts
|
|
624
|
+
// src/monorepo/init/index.ts
|
|
680
625
|
async function init(cwd) {
|
|
681
626
|
const ctx = await createContext(cwd);
|
|
682
627
|
await setChangeset_default(ctx);
|
|
@@ -684,6 +629,68 @@ async function init(cwd) {
|
|
|
684
629
|
await setReadme_default(ctx);
|
|
685
630
|
}
|
|
686
631
|
|
|
632
|
+
// src/monorepo/mirror/binaryMirror.ts
|
|
633
|
+
init_esm_shims();
|
|
634
|
+
import { parse, stringify } from "comment-json";
|
|
635
|
+
import fs5 from "fs-extra";
|
|
636
|
+
import path8 from "pathe";
|
|
637
|
+
|
|
638
|
+
// src/monorepo/mirror/utils.ts
|
|
639
|
+
init_esm_shims();
|
|
640
|
+
var import_set_value4 = __toESM(require_set_value(), 1);
|
|
641
|
+
|
|
642
|
+
// src/monorepo/mirror/sources.ts
|
|
643
|
+
init_esm_shims();
|
|
644
|
+
var chinaMirrorsEnvs = {
|
|
645
|
+
COREPACK_NPM_REGISTRY: "https://registry.npmmirror.com",
|
|
646
|
+
EDGEDRIVER_CDNURL: "https://npmmirror.com/mirrors/edgedriver",
|
|
647
|
+
NODEJS_ORG_MIRROR: "https://cdn.npmmirror.com/binaries/node",
|
|
648
|
+
NVM_NODEJS_ORG_MIRROR: "https://cdn.npmmirror.com/binaries/node",
|
|
649
|
+
PHANTOMJS_CDNURL: "https://cdn.npmmirror.com/binaries/phantomjs",
|
|
650
|
+
CHROMEDRIVER_CDNURL: "https://cdn.npmmirror.com/binaries/chromedriver",
|
|
651
|
+
OPERADRIVER_CDNURL: "https://cdn.npmmirror.com/binaries/operadriver",
|
|
652
|
+
CYPRESS_DOWNLOAD_PATH_TEMPLATE: "https://cdn.npmmirror.com/binaries/cypress/${version}/${platform}-${arch}/cypress.zip",
|
|
653
|
+
ELECTRON_MIRROR: "https://cdn.npmmirror.com/binaries/electron/",
|
|
654
|
+
ELECTRON_BUILDER_BINARIES_MIRROR: "https://cdn.npmmirror.com/binaries/electron-builder-binaries/",
|
|
655
|
+
SASS_BINARY_SITE: "https://cdn.npmmirror.com/binaries/node-sass",
|
|
656
|
+
SWC_BINARY_SITE: "https://cdn.npmmirror.com/binaries/node-swc",
|
|
657
|
+
NWJS_URLBASE: "https://cdn.npmmirror.com/binaries/nwjs/v",
|
|
658
|
+
PUPPETEER_DOWNLOAD_HOST: "https://cdn.npmmirror.com/binaries/chrome-for-testing",
|
|
659
|
+
PUPPETEER_DOWNLOAD_BASE_URL: "https://cdn.npmmirror.com/binaries/chrome-for-testing",
|
|
660
|
+
PLAYWRIGHT_DOWNLOAD_HOST: "https://cdn.npmmirror.com/binaries/playwright",
|
|
661
|
+
SENTRYCLI_CDNURL: "https://cdn.npmmirror.com/binaries/sentry-cli",
|
|
662
|
+
SAUCECTL_INSTALL_BINARY_MIRROR: "https://cdn.npmmirror.com/binaries/saucectl",
|
|
663
|
+
RE2_DOWNLOAD_MIRROR: "https://cdn.npmmirror.com/binaries/node-re2",
|
|
664
|
+
RE2_DOWNLOAD_SKIP_PATH: "true",
|
|
665
|
+
PRISMA_ENGINES_MIRROR: "https://cdn.npmmirror.com/binaries/prisma",
|
|
666
|
+
npm_config_better_sqlite3_binary_host: "https://cdn.npmmirror.com/binaries/better-sqlite3",
|
|
667
|
+
npm_config_keytar_binary_host: "https://cdn.npmmirror.com/binaries/keytar",
|
|
668
|
+
npm_config_sharp_binary_host: "https://cdn.npmmirror.com/binaries/sharp",
|
|
669
|
+
npm_config_sharp_libvips_binary_host: "https://cdn.npmmirror.com/binaries/sharp-libvips",
|
|
670
|
+
npm_config_robotjs_binary_host: "https://cdn.npmmirror.com/binaries/robotjs"
|
|
671
|
+
};
|
|
672
|
+
|
|
673
|
+
// src/monorepo/mirror/utils.ts
|
|
674
|
+
function setMirror(obj) {
|
|
675
|
+
const platforms = ["linux", "windows", "osx"];
|
|
676
|
+
const prefix = "terminal.integrated.env";
|
|
677
|
+
if (typeof obj === "object" && obj) {
|
|
678
|
+
for (const platform of platforms) {
|
|
679
|
+
(0, import_set_value4.default)(obj, [prefix, platform].join(".").replaceAll(".", "\\."), chinaMirrorsEnvs);
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// src/monorepo/mirror/binaryMirror.ts
|
|
685
|
+
async function setVscodeBinaryMirror(cwd) {
|
|
686
|
+
const targetJsonPath = path8.resolve(cwd, ".vscode/settings.json");
|
|
687
|
+
await fs5.ensureFile(targetJsonPath);
|
|
688
|
+
const json = parse(await fs5.readFile(targetJsonPath, "utf8"), void 0, false);
|
|
689
|
+
json && typeof json === "object" && setMirror(json);
|
|
690
|
+
await fs5.writeFile(targetJsonPath, `${stringify(json, void 0, 2)}
|
|
691
|
+
`, "utf8");
|
|
692
|
+
}
|
|
693
|
+
|
|
687
694
|
// src/monorepo/sync.ts
|
|
688
695
|
init_esm_shims();
|
|
689
696
|
import os from "os";
|
|
@@ -699,9 +706,9 @@ var logger = createConsola();
|
|
|
699
706
|
|
|
700
707
|
// src/monorepo/sync.ts
|
|
701
708
|
async function syncNpmMirror(cwd, options) {
|
|
702
|
-
const packages = await
|
|
709
|
+
const { packages, workspaceDir } = await getWorkspaceData(cwd, options);
|
|
703
710
|
logger.info(`[\u5F53\u524D\u5DE5\u4F5C\u533ARepo]:
|
|
704
|
-
${packages.map((x) => `- ${pc.green(x.manifest.name)} : ${path9.relative(
|
|
711
|
+
${packages.map((x) => `- ${pc.green(x.manifest.name)} : ${path9.relative(workspaceDir, x.rootDir)}`).join("\n")}
|
|
705
712
|
`);
|
|
706
713
|
const set6 = new Set(packages.map((x) => x.manifest.name));
|
|
707
714
|
logger.info(`[\u5373\u5C06\u540C\u6B65\u7684\u5305]:
|
|
@@ -774,7 +781,7 @@ init_esm_shims();
|
|
|
774
781
|
|
|
775
782
|
// package.json
|
|
776
783
|
var name = "@icebreakers/monorepo";
|
|
777
|
-
var version = "1.0
|
|
784
|
+
var version = "1.1.0";
|
|
778
785
|
|
|
779
786
|
// src/scripts.ts
|
|
780
787
|
init_esm_shims();
|
|
@@ -949,11 +956,11 @@ export {
|
|
|
949
956
|
defu,
|
|
950
957
|
require_set_value,
|
|
951
958
|
logger,
|
|
952
|
-
setVscodeBinaryMirror,
|
|
953
959
|
getWorkspacePackages,
|
|
954
960
|
cleanProjects,
|
|
955
961
|
GitClient,
|
|
956
962
|
init,
|
|
963
|
+
setVscodeBinaryMirror,
|
|
957
964
|
syncNpmMirror,
|
|
958
965
|
getFileHash,
|
|
959
966
|
isFileChanged,
|