Skip to content

Commit

Permalink
Merge pull request #125 from caorushizi/feat/player
Browse files Browse the repository at this point in the history
refactor: 📦️  remove tsno
  • Loading branch information
caorushizi authored Mar 20, 2024
2 parents a884f69 + bac3057 commit d908850
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 244 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec tsno run ./scripts/pre-commit.ts
pnpm exec tsx ./scripts/pre-commit.ts
3 changes: 1 addition & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// eslint-disable-next-line no-undef
module.exports = {
export default {
extends: ["@commitlint/config-conventional"], // extends can be nested
parserPreset: "conventional-changelog-conventionalcommits",
prompt: {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"version": "0.1.0",
"description": "electron-template",
"main": "index.js",
"type": "module",
"scripts": {
"dev": "tsno run scripts/dev.ts && pnpm --parallel -F \"./packages/*\" run dev",
"build": "tsno run scripts/build.ts",
"dev": "tsx scripts/dev.ts && pnpm --parallel -F \"./packages/*\" run dev",
"build": "tsx scripts/build.ts",
"build:plugin": "pnpm -F plugin run build",
"build:main": "pnpm -F main run build",
"build:renderer": "pnpm -F renderer run build",
Expand Down Expand Up @@ -50,7 +51,7 @@
"husky": "^9.0.10",
"lint-staged": "^15.2.2",
"prettier": "3.2.5",
"tsno": "^2.0.0",
"tsx": "^4.7.1",
"vitepress": "1.0.0-beta.3",
"vue": "^3.4.15",
"zx": "^7.2.3"
Expand Down
234 changes: 10 additions & 224 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 5 additions & 14 deletions scripts/dev.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
#!/usr/bin/env zx

import { os, echo, path, fs, $ } from "zx";

const platform = os.platform();
import { fileURLToPath } from 'url';
import { echo, path, fs, $ } from "zx";

echo("开始构建 development ...");
echo("当前所在的目录是:", process.cwd());

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const root = path.resolve(__dirname, "..");
const main = path.resolve(root, "packages/main");
const app = path.resolve(main, "app");
const bin = path.resolve(app, "bin");

let filename = path.resolve(bin, `${platform}/server`);
if (platform == "win32") {
filename += ".exe";
}

if (!fs.existsSync(filename)) {
await $`npm run build:server`;
}

if (!fs.existsSync(path.resolve(app, "plugin"))) {
await $`npm run build:plugin`;
Expand Down

0 comments on commit d908850

Please sign in to comment.