mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 15:16:07 -06:00
refactor: simplify npm scripts and streamline CI workflow
Consolidate package.json scripts from 17 to 10 by removing redundant test variants and combining type-check + lint into a single 'check' command. Update CI workflow to use simplified commands and merge separate unit/integration test steps into unified test execution. Update documentation to reflect new script structure.
This commit is contained in:
20
.github/workflows/ci.yml
vendored
20
.github/workflows/ci.yml
vendored
@@ -38,14 +38,11 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Run linting
|
- name: Type checking and linting
|
||||||
run: pnpm lint
|
run: pnpm check
|
||||||
|
|
||||||
- name: Type checking
|
|
||||||
run: pnpm type-check
|
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: pnpm prettier --check .
|
run: pnpm format:check
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
test:
|
test:
|
||||||
@@ -70,18 +67,13 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run tests with coverage
|
||||||
run: pnpm test:run:coverage
|
run: pnpm test:coverage
|
||||||
env:
|
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
|
|
||||||
- name: Run integration tests
|
|
||||||
run: pnpm test:integration:coverage
|
|
||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
- name: Run tests with junit reporter
|
- name: Run tests with junit reporter
|
||||||
run: pnpm vitest run --reporter=junit --outputFile=test-report.junit.xml
|
run: pnpm test -- --reporter=junit --outputFile=test-report.junit.xml
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -124,14 +124,13 @@ The development server will be available at `http://localhost:3000`.
|
|||||||
# Run tests
|
# Run tests
|
||||||
pnpm test
|
pnpm test
|
||||||
|
|
||||||
# Run tests with UI
|
# Run tests with coverage
|
||||||
pnpm test:ui
|
pnpm test:coverage
|
||||||
|
|
||||||
# Type checking
|
# Type checking and linting
|
||||||
pnpm type-check
|
pnpm check
|
||||||
|
|
||||||
# Linting
|
# Fix linting issues
|
||||||
pnpm lint
|
|
||||||
pnpm lint:fix
|
pnpm lint:fix
|
||||||
|
|
||||||
# Code formatting
|
# Code formatting
|
||||||
|
|||||||
16
package.json
16
package.json
@@ -5,21 +5,13 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"lint": "eslint .",
|
"start": "next start",
|
||||||
|
"test": "vitest run",
|
||||||
|
"test:coverage": "vitest run --coverage",
|
||||||
|
"check": "tsc --noEmit && eslint .",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"format": "prettier --write .",
|
"format": "prettier --write .",
|
||||||
"format:check": "prettier --check .",
|
"format:check": "prettier --check .",
|
||||||
"start": "next start",
|
|
||||||
"test": "vitest",
|
|
||||||
"test:ui": "vitest --ui",
|
|
||||||
"test:run": "vitest run --exclude '**/*.integration.test.{ts,tsx}'",
|
|
||||||
"test:run:coverage": "vitest run --coverage --exclude '**/*.integration.test.{ts,tsx}'",
|
|
||||||
"test:integration": "vitest run src/__tests__/rdap-integration.test.ts",
|
|
||||||
"test:integration:coverage": "vitest run --coverage src/__tests__/rdap-integration.test.ts",
|
|
||||||
"test:all": "vitest run",
|
|
||||||
"test:coverage": "vitest run --coverage",
|
|
||||||
"test:all:coverage": "vitest run --coverage",
|
|
||||||
"type-check": "tsc --noEmit",
|
|
||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user