Skip to content

Commit ed8fc15

Browse files
committed
chore: Improved prettier, eslint and vitest config and stuff
1 parent 4501386 commit ed8fc15

22 files changed

+54
-78
lines changed

.github/workflows/main.yml

-3
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,12 @@ jobs:
1818
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_checks.yml@v4.0.0
1919
needs:
2020
- install_deps
21-
with:
22-
PNPM_FLAGS: --recursive
2321

2422
run_unit_tests:
2523
name: Run unit tests
2624
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_unit_tests.yml@v4.0.0
2725
needs:
2826
- install_deps
2927
with:
30-
PNPM_FLAGS: --recursive
3128
COVERAGE_FILENAME: reports/vitest/coverage/cobertura-coverage.xml
3229
COVERAGE_FAIL_BELOW_MIN: 100

.github/workflows/pull_request.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
name: Run code checks
1515
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_checks.yml@v4.0.0
1616
needs:
17-
- install_deps
17+
- install_deps
1818

1919
run_unit_tests:
2020
name: Run unit tests
2121
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_unit_tests.yml@v4.0.0
2222
needs:
23-
- install_deps
23+
- install_deps
2424
with:
2525
COVERAGE_FILENAME: reports/vitest/coverage/cobertura-coverage.xml
2626
COVERAGE_FAIL_BELOW_MIN: 100

.github/workflows/release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
push:
66
tags:
7-
- v*
7+
- v*
88

99
jobs:
1010
install_deps:
@@ -15,13 +15,13 @@ jobs:
1515
name: Run code checks
1616
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_checks.yml@v4.0.0
1717
needs:
18-
- install_deps
18+
- install_deps
1919

2020
run_unit_tests:
2121
name: Run unit tests
2222
uses: spuxx1701/ci-cd/.github/workflows/pnpm_run_unit_tests.yml@v4.0.0
2323
needs:
24-
- install_deps
24+
- install_deps
2525
with:
2626
COVERAGE_FILENAME: reports/vitest/coverage/cobertura-coverage.xml
2727
COVERAGE_FAIL_BELOW_MIN: 100
@@ -30,13 +30,13 @@ jobs:
3030
name: Build artifact
3131
uses: spuxx1701/ci-cd/.github/workflows/pnpm_build.yml@v4.0.0
3232
needs:
33-
- run_checks
34-
- run_unit_tests
33+
- run_checks
34+
- run_unit_tests
3535

3636
publish:
3737
name: Publish artifact
3838
uses: spuxx1701/ci-cd/.github/workflows/pnpm_publish.yml@v4.0.0
3939
needs:
40-
- build
40+
- build
4141
secrets:
4242
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ dist-ssr
1313
*.local
1414

1515
# Reports
16-
coverage/
1716
reports/
1817
pnpm-publish-summary.json
1918

.prettierignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
pnpm-lock.yaml
1+
pnpm-lock.yaml
2+
reports/
3+
dist/
4+
.github/

.prettierrc.cjs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
module.exports ={
2-
"singleQuote": true,
3-
"trailingComma": "all",
4-
"printWidth": 120
5-
}
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
printWidth: 120,
5+
};

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# web-libs
2+
23
A metarepository containing various libraries I maintain for my typical web stack.

package.json

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
"url": "https://github.com/spuxx1701/web-libs/issues"
2121
},
2222
"packageManager": "pnpm@9.6.0",
23+
"scripts": {
24+
"test": "pnpm run test:unit",
25+
"test:unit": "vitest run --coverage",
26+
"check": "pnpm types && pnpm run lint && pnpm run prettier-check",
27+
"types": "tsc --noEmit",
28+
"lint": "eslint . --ext ts,tsx",
29+
"prettier-check": "prettier --check .",
30+
"format": "prettier --write ."
31+
},
2332
"devDependencies": {
2433
"typescript": "5.5.4",
2534
"@types/node": "22.0.0",

packages/browser-utils/.eslintrc.cjs

-5
This file was deleted.

packages/browser-utils/.prettierignore

-2
This file was deleted.

packages/browser-utils/.prettierrc.cjs

-5
This file was deleted.

packages/browser-utils/package.json

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@
1818
"package.json"
1919
],
2020
"scripts": {
21-
"start": "vite dev app",
22-
"build": "vite build",
23-
"test": "pnpm run test:unit",
24-
"test:unit": "vitest run --coverage --reporter=default --reporter=junit --outputFile='reports/junit/junit.xml'",
25-
"check": "pnpm types && pnpm run lint && pnpm run prettier-check",
26-
"types": "tsc --noEmit",
27-
"lint": "eslint . --ext ts,tsx",
28-
"prettier-check": "prettier --check .",
29-
"format": "prettier --write ."
21+
"build": "vite build"
3022
},
3123
"peerDependencies": {
3224
"@modyfi/vite-plugin-yaml": "^1.1.0"

packages/js-utils/.eslintrc.cjs

-5
This file was deleted.

packages/js-utils/.prettierignore

-2
This file was deleted.

packages/js-utils/.prettierrc.cjs

-5
This file was deleted.

packages/js-utils/package.json

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,7 @@
1818
"package.json"
1919
],
2020
"scripts": {
21-
"build": "vite build",
22-
"test": "pnpm run test:unit",
23-
"test:unit": "vitest run --coverage --reporter=default --reporter=junit --outputFile='reports/junit/junit.xml'",
24-
"check": "pnpm types && pnpm run lint && pnpm run prettier-check",
25-
"types": "tsc --noEmit",
26-
"lint": "eslint . --ext ts,tsx",
27-
"prettier-check": "prettier --check .",
28-
"format": "prettier --write ."
21+
"build": "vite build"
2922
},
3023
"peerDependencies": {
3124
"@modyfi/vite-plugin-yaml": "^1.1.0"

pnpm-workspace.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
packages:
2-
- 'packages/*'
3-
- 'test-apps/*'
2+
- 'packages/*'
3+
- 'test-apps/*'

test-apps/react/.eslintrc.cjs

-5
This file was deleted.

test-apps/react/.prettierignore

-1
This file was deleted.

test-apps/react/.prettierrc.cjs

-5
This file was deleted.

test-apps/react/package.json

+1-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"type": "module",
55
"private": true,
66
"scripts": {
7-
"dev": "vite dev",
8-
"check": "pnpm types && pnpm run lint && pnpm run prettier-check",
9-
"types": "tsc --noEmit",
10-
"lint": "eslint . --ext ts,tsx",
11-
"prettier-check": "prettier --check .",
12-
"format": "prettier --write ."
7+
"dev": "vite dev"
138
},
149
"dependencies": {
1510
"@spuxx/js-utils": "workspace:@spuxx/browser-utils@*",

vitest.config.ts

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/// <reference types="vitest" />
2+
import baseConfig from './vite.config';
3+
import { mergeConfig, defineConfig } from 'vite';
4+
5+
export default mergeConfig(
6+
baseConfig,
7+
defineConfig({
8+
test: {
9+
setupFiles: ['tests/vitest/vitest.setup.ts'],
10+
reporters: ['default', 'junit'],
11+
outputFile: 'reports/junit/junit.xml',
12+
coverage: {
13+
provider: 'v8',
14+
all: true,
15+
include: ['packages/**/*.ts'],
16+
exclude: ['src/main.ts', '**/*types.ts'],
17+
reportsDirectory: 'reports/vitest/coverage',
18+
reporter: ['text', 'cobertura'],
19+
},
20+
},
21+
}),
22+
);

0 commit comments

Comments
 (0)