zixulu 1.68.21 → 1.69.1
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 +39 -2
- package/dist/index.js.map +1 -1
- package/dist/src/utils/readZixuluSetting.d.ts +1 -0
- package/dist/src/utils/verdaccio.d.ts +1 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/utils/addEslint.ts +3 -3
- package/src/utils/readZixuluSetting.ts +1 -0
- package/src/utils/removeFileOrFolderFromGit.ts +1 -0
- package/src/utils/verdaccio.ts +53 -0
package/dist/index.js
CHANGED
|
@@ -1572,11 +1572,11 @@ function getEslintConfig({ isReact }) {
|
|
|
1572
1572
|
import js from "@eslint/js"${isReact ? `
|
|
1573
1573
|
import reactHooks from "eslint-plugin-react-hooks"
|
|
1574
1574
|
import reactRefresh from "eslint-plugin-react-refresh"` : ""}
|
|
1575
|
-
import { globalIgnores } from "eslint/config"
|
|
1575
|
+
import { defineConfig, globalIgnores } from "eslint/config"
|
|
1576
1576
|
import globals from "globals"
|
|
1577
1577
|
import tseslint from "typescript-eslint"
|
|
1578
1578
|
|
|
1579
|
-
export default
|
|
1579
|
+
export default defineConfig([
|
|
1580
1580
|
globalIgnores(["node_modules", "dist", "build", "public"]),
|
|
1581
1581
|
{
|
|
1582
1582
|
files: ["**/*.{js,mjs,ts${isReact ? ",tsx" : ""}}"],
|
|
@@ -1619,6 +1619,7 @@ async function addEslint() {
|
|
|
1619
1619
|
await promises_writeFile("eslint.config.mjs", config);
|
|
1620
1620
|
const packages = [
|
|
1621
1621
|
"@eslint/js",
|
|
1622
|
+
"eslint",
|
|
1622
1623
|
"typescript-eslint",
|
|
1623
1624
|
"globals"
|
|
1624
1625
|
];
|
|
@@ -2121,6 +2122,7 @@ async function removeComment(path) {
|
|
|
2121
2122
|
consola.success("\u5220\u9664\u6CE8\u91CA\u6210\u529F");
|
|
2122
2123
|
}
|
|
2123
2124
|
async function removeFileOrFolderFromGit(input) {
|
|
2125
|
+
input = input.replace(/\\/g, "/");
|
|
2124
2126
|
let recursive = false;
|
|
2125
2127
|
try {
|
|
2126
2128
|
const stats = await stat(input);
|
|
@@ -4625,6 +4627,40 @@ async function winget() {
|
|
|
4625
4627
|
if (global.__ZIXULU_PROXY__) args.push("--proxy", "http://127.0.0.1:7890");
|
|
4626
4628
|
spawnAsync("winget", args);
|
|
4627
4629
|
}
|
|
4630
|
+
const verdaccio_script = `import { spawnSync } from "child_process"
|
|
4631
|
+
|
|
4632
|
+
spawnSync("docker compose down", { cwd: "verdaccio", shell: true, stdio: "inherit" })
|
|
4633
|
+
|
|
4634
|
+
spawnSync("rimraf verdaccio", { shell: true, stdio: "inherit" })
|
|
4635
|
+
|
|
4636
|
+
spawnSync("7z x verdaccio.zip", { shell: true, stdio: "inherit" })
|
|
4637
|
+
|
|
4638
|
+
spawnSync("docker compose up -d", { cwd: "verdaccio", shell: true, stdio: "inherit" })
|
|
4639
|
+
`;
|
|
4640
|
+
async function verdaccio() {
|
|
4641
|
+
await mkdir("verdaccio", {
|
|
4642
|
+
recursive: true
|
|
4643
|
+
});
|
|
4644
|
+
const setting = await readZixuluSetting();
|
|
4645
|
+
let { verdaccioPath } = await inquirer_0.prompt({
|
|
4646
|
+
type: "input",
|
|
4647
|
+
name: "verdaccioPath",
|
|
4648
|
+
message: "\u8BF7\u8F93\u5165 verdaccio \u6587\u4EF6\u5939\u7684\u4F4D\u7F6E",
|
|
4649
|
+
default: setting.verdaccioPath
|
|
4650
|
+
});
|
|
4651
|
+
verdaccioPath = verdaccioPath.replace(/^"|"$/g, "");
|
|
4652
|
+
verdaccioPath = external_path_resolve(verdaccioPath);
|
|
4653
|
+
const stats = await stat(verdaccioPath);
|
|
4654
|
+
if (!stats.isDirectory()) throw new Error("verdaccio \u6587\u4EF6\u5939\u4E0D\u5B58\u5728");
|
|
4655
|
+
setting.verdaccioPath = verdaccioPath;
|
|
4656
|
+
await writeZixuluSetting(setting);
|
|
4657
|
+
const { base } = parse(verdaccioPath);
|
|
4658
|
+
await zip({
|
|
4659
|
+
input: verdaccioPath,
|
|
4660
|
+
output: join("verdaccio", `${base}.zip`)
|
|
4661
|
+
});
|
|
4662
|
+
await writeFile(join("verdaccio", "syncVerdaccio.mjs"), verdaccio_script, "utf-8");
|
|
4663
|
+
}
|
|
4628
4664
|
setDefaultOptions({
|
|
4629
4665
|
shell: true,
|
|
4630
4666
|
stdio: "inherit"
|
|
@@ -4771,6 +4807,7 @@ program.command("clear-docker-log").alias("cdl").description("\u6E05\u9664 docke
|
|
|
4771
4807
|
program.command("update-docker-compose").alias("udc").description("\u66F4\u65B0 docker compose \u955C\u50CF").action(updateDockerCompose);
|
|
4772
4808
|
program.command("sync-cursor-ext-to-code").alias("sce2c").description("\u540C\u6B65 cursor \u6269\u5C55\u5230 vscode").action(syncCursorExtToCode);
|
|
4773
4809
|
program.command("create-prisma-debugger").alias("cpd").description("\u521B\u5EFA prisma \u8C03\u8BD5\u5668").action(createPrismaDebugger);
|
|
4810
|
+
program.command("verdaccio").description("\u540C\u6B65 verdaccio \u914D\u7F6E").action(verdaccio);
|
|
4774
4811
|
program.parse();
|
|
4775
4812
|
|
|
4776
4813
|
//# sourceMappingURL=index.js.map
|