diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e0fde122..ad513dca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,16 +10,18 @@ jobs: steps: - name: Checkout code uses: nschloe/action-cached-lfs-checkout@v1 + - name: Install just command runner + uses: extractions/setup-just@v2 + with: + just-version: "1.x" - name: Setup Node.js uses: ./.github/actions/setup-nodejs - name: Check source code - run: | - npm run lint - npm run copy:paste:detector + run: just lint - name: Compile source code - run: npm run compile + run: just compile - name: Run unit tests - run: npm run test:unit:coverage + run: just test-unit-coverage - name: Upload code coverage artifact uses: actions/upload-artifact@v4 with: diff --git a/justfile b/justfile new file mode 100644 index 00000000..296c3530 --- /dev/null +++ b/justfile @@ -0,0 +1,36 @@ +default: develop + +astro-sync: + npx astro sync + +astro-check: astro-sync + npx astro check + +prettier-check: + npx prettier --check source + +eslint: + npx eslint . --ext ".ts" + +copy-paste-detection: + npx jscpd source + +lint: astro-check prettier-check eslint copy-paste-detection + +@compile: + npx tsc + +@develop $FORCE_COLOR="1": + npx tsx ./source/start-develop.ts + +@build: + npx astro build + +@preview: + npx astro preview + +@test-unit: compile + npx ava + +@test-unit-coverage: compile + npx c8 ava diff --git a/package.json b/package.json index 63f05c44..b4478c16 100644 --- a/package.json +++ b/package.json @@ -12,17 +12,7 @@ "volta": { "node": "22.2.0" }, - "scripts": { - "lint": "astro sync && astro check && eslint . --ext '.ts' && prettier --check source", - "copy:paste:detector": "jscpd source", - "compile": "tsc", - "develop": "FORCE_COLOR='1' tsx ./source/start-develop.ts", - "build": "astro build", - "preview": "astro preview", - "pretest:unit": "npm run compile", - "test:unit": "ava", - "test:unit:coverage": "c8 npm run test:unit" - }, + "scripts": {}, "dependencies": { "@astrojs/node": "8.3.0", "@astrojs/vue": "4.4.0",