diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..160d8b4 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +npx --no -- commitlint --edit ${1} +npm run commitlint ${1} diff --git a/package.json b/package.json index 9c99ba7..8837ce0 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:preview": "vitepress preview docs", + "lint-stage": "lint-staged", "types": "pnpm -F main run types", "prepare": "husky", "commit": "git-cz", @@ -51,7 +52,5 @@ "vue": "^3.4.15", "zx": "^7.2.3" }, - "lint-staged": { - "*.{js,jsx,ts,tsx,vue}": "eslint" - } + "lint-staged": {} } \ No newline at end of file diff --git a/scripts/build-server.mjs b/scripts/build-server.ts similarity index 94% rename from scripts/build-server.mjs rename to scripts/build-server.ts index c0105f2..5cf5a9f 100644 --- a/scripts/build-server.mjs +++ b/scripts/build-server.ts @@ -1,4 +1,5 @@ #!/usr/bin/env zx +import { $,os } from "zx"; const platform = os.platform(); diff --git a/scripts/build.mjs b/scripts/build.ts similarity index 90% rename from scripts/build.mjs rename to scripts/build.ts index bce21ba..fe34bd0 100644 --- a/scripts/build.mjs +++ b/scripts/build.ts @@ -1,5 +1,7 @@ #!/usr/bin/env zx +import { echo,$ } from "zx"; + echo("开始构建 production ..."); echo("当前所在的目录是:", process.cwd()); diff --git a/scripts/check.ts b/scripts/check.ts index 21f4c1f..18b81df 100644 --- a/scripts/check.ts +++ b/scripts/check.ts @@ -10,8 +10,8 @@ import { printObject } from './utils' // throw new Error(out.stdout) // }) -// // check type and stage -// await Promise.all([$`pnpm type-check`, $`pnpm lint:stage`]).catch((out: ProcessOutput) => { +// check type and stage +// await Promise.all([$`pnpm types`, $`pnpm lint-stage`]).catch((out: ProcessOutput) => { // printObject(out) // throw new Error(out.stdout) // }) diff --git a/scripts/dev.mjs b/scripts/dev.ts similarity index 93% rename from scripts/dev.mjs rename to scripts/dev.ts index 921990b..987793a 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.ts @@ -1,5 +1,7 @@ #!/usr/bin/env zx +import { os, echo, path, fs, $ } from "zx"; + const platform = os.platform(); echo("开始构建 development ..."); diff --git a/scripts/pre-commit.tsno.mjs b/scripts/pre-commit.tsno.mjs index 0457e57..6c43b3a 100644 --- a/scripts/pre-commit.tsno.mjs +++ b/scripts/pre-commit.tsno.mjs @@ -31,4 +31,4 @@ await Promise.resolve().then(() => (init_check(), check_exports)).catch((out) => }); console.log('printf "\u68C0\u6D4B\u901A\u8FC7, \u521B\u5EFA commit \u4E2D...\n'); await $`git add .`; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibm9kZV9tb2R1bGVzLy5wbnBtL3Rzbm9AMi4wLjAvbm9kZV9tb2R1bGVzL3Rzbm8vZGlzdC9jbGllbnQuanMiLCAic2NyaXB0cy9jaGVjay50cyIsICJzY3JpcHRzL3ByZS1jb21taXQudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7Y3JlYXRlUmVxdWlyZSBhcyBfXyQkY3JlYXRlUmVxdWlyZX0gZnJvbSAnbW9kdWxlJzt2YXIgcmVxdWlyZT1fXyQkY3JlYXRlUmVxdWlyZShcImZpbGU6Ly8vVXNlcnMvZGlhb3poZW55dWFuL1dvcmtzcGFjZS9Qcm9ncmFtL20zdTgtZG93bmxvYWRlci9ub2RlX21vZHVsZXMvLnBucG0vdHNub0AyLjAuMC9ub2RlX21vZHVsZXMvdHNuby9kaXN0L2NsaWVudC5qc1wiKTtcbmltcG9ydCB7XG4gIGNvbG9yc1xufSBmcm9tIFwiLi9jaHVuay1GSERYWE9LWS5qc1wiO1xuXG5cbi8vIHNyYy9jbGllbnQudHNcbnZhciBmZXRjaCA9ICh1cmwsIGluaXQpID0+IGltcG9ydChcIi4vc3JjLTRRN1E2N0MzLmpzXCIpLnRoZ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