Skip to content

Commit f346e63

Browse files
authored
Merge pull request GlobalHive#95 from AdamDrewsTR/modernization
Modernization
2 parents c2cc82d + 8ef6523 commit f346e63

22 files changed

Lines changed: 8839 additions & 1822 deletions

.codacy.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
---
2+
# Codacy configuration for VueJS Tour project
3+
4+
# CRITICAL: Exclude config files FIRST to prevent any engine from analyzing them
5+
exclude_paths:
6+
- 'vite.config.ts'
7+
- 'vite.config.js'
8+
- 'vitest.config.ts'
9+
- '*.config.ts'
10+
- '*.config.js'
11+
12+
engines:
13+
# ESLint for JavaScript/TypeScript/Vue linting
14+
eslint:
15+
enabled: true
16+
exclude_paths:
17+
- 'vite.config.*'
18+
- 'vitest.config.*'
19+
- '*.d.ts'
20+
- 'env.d.ts'
21+
- 'docs/.vitepress/**'
22+
configuration:
23+
rules:
24+
"@typescript-eslint/no-unused-vars": "off"
25+
26+
# TypeScript linting
27+
typescript:
28+
enabled: true
29+
exclude_paths:
30+
- '*.d.ts'
31+
- 'env.d.ts'
32+
- 'vite.config.ts'
33+
- 'vite.config.js'
34+
- 'vite.config.d.ts'
35+
- 'vitest.config.ts'
36+
- 'vitest.config.js'
37+
- 'src/Types.ts' # Public API interface definitions
38+
39+
# Duplication detection
40+
duplication:
41+
enabled: true
42+
exclude_paths:
43+
- 'test/**'
44+
- 'docs/**'
45+
- 'coverage/**'
46+
47+
# Code complexity analysis
48+
metrics:
49+
enabled: true
50+
exclude_paths:
51+
- 'test/**'
52+
- 'docs/**'
53+
- 'coverage/**'
54+
- 'vite.config.*'
55+
- 'vitest.config.*'
56+
57+
# CSS/SCSS linting
58+
csslint:
59+
enabled: true
60+
exclude_paths:
61+
- 'coverage/**'
62+
- 'docs/**'
63+
64+
# Additional global exclude patterns (config files already excluded at top)
65+
exclude_patterns:
66+
# Dependencies and build artifacts
67+
- 'node_modules/**'
68+
- 'dist/**'
69+
- 'coverage/**'
70+
- '.vitepress/cache/**'
71+
72+
# Test files (if you want to exclude from analysis)
73+
- 'test/**'
74+
75+
# Configuration files that don't need deep analysis
76+
- '*.config.*'
77+
- '*.d.ts'
78+
- 'env.d.ts'
79+
- 'tsconfig*.json'
80+
81+
# Documentation build artifacts
82+
- 'docs/.vitepress/dist/**'
83+
84+
# Generated files
85+
- '*.tsbuildinfo'
86+
- '*.gif'
87+
- '*.png'
88+
- '*.jpg'
89+
- '*.jpeg'
90+
- '*.svg'
91+
- '*.ico'
92+
93+
# Package files
94+
- '*.tgz'
95+
- '*.tar.gz'
96+
- 'package-lock.json'
97+
- 'yarn.lock'
98+
- 'pnpm-lock.yaml'
99+
100+
# IDE and editor files
101+
- '.vscode/**'
102+
- '.idea/**'
103+
- '*.swp'
104+
- '*.swo'
105+
- '*~'
106+
107+
# OS generated files
108+
- '.DS_Store'
109+
- 'Thumbs.db'
110+
111+
# File size limits (optional)
112+
file_size_limit: 5000 # Lines
113+
114+
# Complexity thresholds (optional)
115+
complexity_threshold: 15

.eslintignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Build outputs
2+
dist/
3+
coverage/
4+
node_modules/
5+
6+
# Configuration files
7+
*.config.ts
8+
*.config.js
9+
*.d.ts
10+
*.tsbuildinfo
11+
12+
# Specific files to exclude from linting
13+
vite.config.ts
14+
vite.config.js
15+
vitest.config.ts
16+
env.d.ts

.eslintrc.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
node: true,
5+
browser: true,
6+
},
7+
extends: [
8+
'plugin:vue/vue3-recommended',
9+
'@vue/eslint-config-typescript/recommended',
10+
'@vue/eslint-config-prettier',
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2020,
14+
project: ['./tsconfig.json', './tsconfig.node.json'],
15+
},
16+
rules: {
17+
// Allow unused parameters in TypeScript interfaces and type definitions
18+
'@typescript-eslint/no-unused-vars': [
19+
'warn',
20+
{
21+
argsIgnorePattern: '^_',
22+
varsIgnorePattern: '^_',
23+
// Ignore interface and type declaration parameters
24+
args: 'none',
25+
},
26+
],
27+
},
28+
overrides: [
29+
{
30+
files: ['src/Types.ts'],
31+
rules: {
32+
// Disable unused vars completely for Types.ts since interface parameter names are for documentation
33+
'@typescript-eslint/no-unused-vars': 'off',
34+
},
35+
},
36+
{
37+
files: ['*.config.ts', '*.config.js'],
38+
rules: {
39+
// Allow any type assertions in config files
40+
'@typescript-eslint/no-explicit-any': 'off',
41+
'@typescript-eslint/ban-ts-comment': 'off',
42+
'@typescript-eslint/no-unsafe-call': 'off',
43+
'@typescript-eslint/no-unsafe-member-access': 'off',
44+
'@typescript-eslint/no-unsafe-assignment': 'off',
45+
},
46+
},
47+
],
48+
};

.github/workflows/ci.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
test:
11+
name: Test & Build
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [18, 20, 22]
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js ${{ matrix.node-version }}
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: ${{ matrix.node-version }}
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Run type checking
32+
run: npm run type-check
33+
34+
- name: Run tests
35+
run: npm run test:run
36+
37+
- name: Run tests with coverage
38+
run: npm run test:coverage
39+
40+
- name: Upload coverage to Codecov
41+
if: matrix.node-version == 20
42+
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
43+
with:
44+
file: ./coverage/lcov.info
45+
flags: unittests
46+
name: codecov-umbrella
47+
fail_ci_if_error: false
48+
49+
- name: Build library
50+
run: npm run build-only
51+
52+
- name: Build documentation
53+
run: npm run docs:build
54+
continue-on-error: true
55+
56+
- name: Check for build artifacts
57+
run: |
58+
ls -la dist/
59+
test -f dist/vuejs-tour.js
60+
test -f dist/vuejs-tour.umd.cjs
61+
test -f dist/vuejs-tour.d.ts
62+
test -f dist/style.css
63+
64+
lint:
65+
name: Lint & Format Check
66+
runs-on: ubuntu-latest
67+
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Setup Node.js
73+
uses: actions/setup-node@v4
74+
with:
75+
node-version: 20
76+
cache: 'npm'
77+
78+
- name: Install dependencies
79+
run: npm ci
80+
81+
- name: Run linting
82+
run: npm run lint
83+
84+
- name: Check code formatting
85+
run: |
86+
npm run format
87+
git diff --exit-code -- ':!*.tsbuildinfo' || (echo "Code is not formatted. Run 'npm run format' to fix." && exit 1)
88+
89+
security:
90+
name: Security Audit
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- name: Checkout code
95+
uses: actions/checkout@v4
96+
97+
- name: Setup Node.js
98+
uses: actions/setup-node@v4
99+
with:
100+
node-version: 20
101+
cache: 'npm'
102+
103+
- name: Install dependencies
104+
run: npm ci
105+
106+
- name: Run security audit
107+
run: npm audit --audit-level=high
108+
109+
publish-coverage:
110+
name: Publish Test Coverage
111+
runs-on: ubuntu-latest
112+
needs: [test]
113+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
114+
115+
steps:
116+
- name: Checkout code
117+
uses: actions/checkout@v4
118+
119+
- name: Setup Node.js
120+
uses: actions/setup-node@v4
121+
with:
122+
node-version: 20
123+
cache: 'npm'
124+
125+
- name: Install dependencies
126+
run: npm ci
127+
128+
- name: Generate coverage report
129+
run: npm run test:coverage
130+
131+
- name: Generate coverage badge
132+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
133+
with:
134+
script: |
135+
const fs = require('fs');
136+
const path = 'coverage/coverage-summary.json';
137+
if (fs.existsSync(path)) {
138+
const coverage = JSON.parse(fs.readFileSync(path, 'utf8'));
139+
const pct = coverage.total.lines.pct;
140+
console.log(`Coverage: ${pct}%`);
141+
}
142+
143+
- name: Upload coverage reports
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: coverage-reports
147+
path: |
148+
coverage/
149+
!coverage/tmp/
150+
retention-days: 30

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ dist-ssr
2929
docs/.vitepress/dist
3030
docs/.vitepress/cache
3131
*.tgz
32+
.vitepress/cache/*
33+
coverage/*
34+
35+
# TypeScript build info and generated config files
36+
*.tsbuildinfo
37+
vite.config.js
38+
vite.config.d.ts

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
coverage
4+
*.local
5+
.DS_Store
6+
.vitepress/cache
7+
.vitepress/dist

.prettierrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"trailingComma": "es5",
6+
"printWidth": 80,
7+
"vueIndentScriptAndStyle": false,
8+
"endOfLine": "lf"
9+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,4 @@ For more information about the available props and methods, check out the [docum
151151

152152
## Something Missing?
153153

154-
If you have a feature request or found a bug, [let us know](https://github.com/GlobalHive/vuejs-tour/issues) by submitting an issue.
154+
If you have a feature request or found a bug, [let us know](https://github.com/GlobalHive/vuejs-tour/issues) by submitting an issue.

0 commit comments

Comments
 (0)