Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Commit

Permalink
Use just command runner instead of npm scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
screendriver committed Jun 14, 2024
1 parent dffc7da commit 44494f6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 16 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
36 changes: 36 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -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
12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 44494f6

Please sign in to comment.