Skip to content

Commit

Permalink
migrate to vite
Browse files Browse the repository at this point in the history
  • Loading branch information
Logicer16 committed Nov 23, 2024
1 parent cc7ae62 commit 454e7ef
Show file tree
Hide file tree
Showing 11 changed files with 564 additions and 32 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ on:
release:
types: [published]
jobs:
Test:
uses: ./.github/workflows/test.yml
permissions:
checks: write
with:
report: false
secrets: inherit

Publish:
runs-on: ubuntu-latest
permissions:
Expand All @@ -22,12 +30,6 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Run ESLint
run: pnpm lint:ci

- name: Run Prettier
run: pnpm prettier:ci

- name: Publish to npm
run: pnpm publish --access public --no-git-checks
env:
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: Test
on:
push: {}
pull_request: {}
workflow_call:
inputs:
report:
default: true
type: boolean

jobs:
GenerateMatrix:
Expand Down Expand Up @@ -49,6 +54,7 @@ jobs:
continue-on-error: true

- name: Annotate ESLint Results
if: ${{ inputs.report }}
uses: ataylorme/eslint-annotate-action@v3
with:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Expand Down Expand Up @@ -91,18 +97,22 @@ jobs:
- name: Build
run: pnpm build

- name: Type Check
run: pnpm tsc

- name: Test with vitest
if: ${{ !cancelled() }}
run: pnpm run test --coverage --reporter junit --outputFile ./coverage/junit.xml
run: pnpm run test:ci --coverage --reporter junit --outputFile ./coverage/junit.xml

- name: Upload coverage to Codecov
if: ${{ inputs.report }}
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
if: ${{ !cancelled() && inputs.report }}
uses: codecov/test-results-action@v1
with:
fail_ci_if_error: true
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"typescript.updateImportsOnFileMove.enabled": "always",
"markdown.extension.toc.levels": "2..6",
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": ["wgconfgen"]
"cSpell.words": ["wgconfgen", "vite"]
}
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@
},
"scripts": {
"preinstall": "pnpx only-allow pnpm",
"build": "tsc",
"start": "tsc && node dist/index.js",
"build": "vite build",
"style": "npm run lint && npm run prettier",
"lint": "eslint . --fix --cache",
"lint:ci": "eslint . --cache",
"prettier": "prettier --write .",
"prettier:ci": "prettier --check .",
"test": "vitest",
"test": "pnpm run tsc && pnpm run test:ci",
"test:ci": "vitest",
"coverage": "vitest run --coverage",
"tsc": "tsc",
"type-coverage": "type-coverage"
},
"repository": {
Expand All @@ -40,7 +41,7 @@
},
"homepage": "https://github.com/Logicer16/wgconfgen#readme",
"engines": {
"node": "^20.10.0",
"node": "^20.11.0",
"pnpm": ">=8.10.0"
},
"devDependencies": {
Expand All @@ -56,6 +57,9 @@
"ts-plugin-type-coverage": "^2.29.7",
"type-coverage": "^2.29.7",
"typescript": "~5.4.5",
"vite": "^5.4.11",
"vite-plugin-dts": "^4.3.0",
"vite-plugin-externalize-deps": "^0.8.0",
"vitest": "^2.1.5"
},
"typeCoverage": {
Expand All @@ -65,5 +69,8 @@
"ignoreCatch": true,
"reportSemanticError": true
},
"packageManager": "[email protected]+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2"
"packageManager": "[email protected]+sha256.cea6d0bdf2de3a0549582da3983c70c92ffc577ff4410cbf190817ddc35137c2",
"dependencies": {
"yaml": "^2.6.1"
}
}
Loading

0 comments on commit 454e7ef

Please sign in to comment.