zixulu 1.68.21 → 1.69.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/index.js CHANGED
@@ -2121,6 +2121,7 @@ async function removeComment(path) {
2121
2121
  consola.success("\u5220\u9664\u6CE8\u91CA\u6210\u529F");
2122
2122
  }
2123
2123
  async function removeFileOrFolderFromGit(input) {
2124
+ input = input.replace(/\\/g, "/");
2124
2125
  let recursive = false;
2125
2126
  try {
2126
2127
  const stats = await stat(input);
@@ -4625,6 +4626,40 @@ async function winget() {
4625
4626
  if (global.__ZIXULU_PROXY__) args.push("--proxy", "http://127.0.0.1:7890");
4626
4627
  spawnAsync("winget", args);
4627
4628
  }
4629
+ const verdaccio_script = `import { spawnSync } from "child_process"
4630
+
4631
+ spawnSync("docker compose down", { cwd: "verdaccio", shell: true, stdio: "inherit" })
4632
+
4633
+ spawnSync("rimraf verdaccio", { shell: true, stdio: "inherit" })
4634
+
4635
+ spawnSync("7z x verdaccio.zip", { shell: true, stdio: "inherit" })
4636
+
4637
+ spawnSync("docker compose up -d", { cwd: "verdaccio", shell: true, stdio: "inherit" })
4638
+ `;
4639
+ async function verdaccio() {
4640
+ await mkdir("verdaccio", {
4641
+ recursive: true
4642
+ });
4643
+ const setting = await readZixuluSetting();
4644
+ let { verdaccioPath } = await inquirer_0.prompt({
4645
+ type: "input",
4646
+ name: "verdaccioPath",
4647
+ message: "\u8BF7\u8F93\u5165 verdaccio \u6587\u4EF6\u5939\u7684\u4F4D\u7F6E",
4648
+ default: setting.verdaccioPath
4649
+ });
4650
+ verdaccioPath = verdaccioPath.replace(/^"|"$/g, "");
4651
+ verdaccioPath = external_path_resolve(verdaccioPath);
4652
+ const stats = await stat(verdaccioPath);
4653
+ if (!stats.isDirectory()) throw new Error("verdaccio \u6587\u4EF6\u5939\u4E0D\u5B58\u5728");
4654
+ setting.verdaccioPath = verdaccioPath;
4655
+ await writeZixuluSetting(setting);
4656
+ const { base } = parse(verdaccioPath);
4657
+ await zip({
4658
+ input: verdaccioPath,
4659
+ output: join("verdaccio", `${base}.zip`)
4660
+ });
4661
+ await writeFile(join("verdaccio", "syncVerdaccio.mjs"), verdaccio_script, "utf-8");
4662
+ }
4628
4663
  setDefaultOptions({
4629
4664
  shell: true,
4630
4665
  stdio: "inherit"
@@ -4771,6 +4806,7 @@ program.command("clear-docker-log").alias("cdl").description("\u6E05\u9664 docke
4771
4806
  program.command("update-docker-compose").alias("udc").description("\u66F4\u65B0 docker compose \u955C\u50CF").action(updateDockerCompose);
4772
4807
  program.command("sync-cursor-ext-to-code").alias("sce2c").description("\u540C\u6B65 cursor \u6269\u5C55\u5230 vscode").action(syncCursorExtToCode);
4773
4808
  program.command("create-prisma-debugger").alias("cpd").description("\u521B\u5EFA prisma \u8C03\u8BD5\u5668").action(createPrismaDebugger);
4809
+ program.command("verdaccio").description("\u540C\u6B65 verdaccio \u914D\u7F6E").action(verdaccio);
4774
4810
  program.parse();
4775
4811
 
4776
4812
  //# sourceMappingURL=index.js.map