Skip to content

Commit 48bc56b

Browse files
authored
Merge pull request #746 from SlideRuleEarth/carlos-dev4
CI/CD development #745
2 parents 027d622 + c482a99 commit 48bc56b

File tree

9 files changed

+1957
-1323
lines changed

9 files changed

+1957
-1323
lines changed

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd web-client && npx lint-staged

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ deploy-docs-to-testsliderule: ## Deploy the docs to the testsliderule.org cloudf
155155
destroy-docs-testsliderule: ## Destroy the web client from the testsliderule.org cloudfront and remove the S3 bucket
156156
make destroy DOMAIN=docs.testsliderule.org S3_BUCKET=testsliderule-docs DOMAIN_APEX=testsliderule.org
157157

158-
.PHONY: check-vars typecheck lint test-unit test-unit-watch coverage-unit test-e2e test-all ci-check
158+
.PHONY: check-vars typecheck lint lint-fix lint-staged pre-commit-check test-unit test-unit-watch coverage-unit test-e2e test-all ci-check
159159
# =========================
160160
# Testing / Quality targets
161161
# =========================
@@ -166,6 +166,15 @@ typecheck: ## Run TypeScript type checking
166166
lint: ## Run ESLint
167167
cd web-client && npm run lint
168168

169+
lint-fix: ## Run ESLint with auto-fix
170+
cd web-client && npm run lint:fix
171+
172+
lint-staged: ## Run lint-staged on staged files (used by pre-commit hook)
173+
cd web-client && npx lint-staged
174+
175+
pre-commit-check: lint-staged ## Manually run pre-commit checks without committing
176+
@echo "✅ Pre-commit checks passed!"
177+
169178
test-unit: ## Run Vitest unit tests (CI-friendly)
170179
cd web-client && npm run test:unit
171180

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"test:local": "ENV=local npx playwright test",
1717
"test:test": "ENV=test npx playwright test",
1818
"test:prod": "ENV=prod npx playwright test",
19-
"convert:icons": "node convert-maki-icons.js"
19+
"convert:icons": "node convert-maki-icons.js",
20+
"prepare": "husky"
2021
},
2122
"keywords": [],
2223
"author": "",

web-client/.eslintrc.cjs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module.exports = {
1313
ecmaVersion: 'latest',
1414
parser: '@typescript-eslint/parser',
1515
sourceType: 'module',
16-
project: './tsconfig.app.json',
16+
project: ['./tsconfig.app.json', './tsconfig.vitest.json'],
1717
tsconfigRootDir: __dirname,
1818
extraFileExtensions: ['.vue']
1919
},
@@ -25,5 +25,13 @@ module.exports = {
2525
'require-await': 'warn',
2626
// Require functions that return promises to be marked async
2727
'@typescript-eslint/promise-function-async': 'warn'
28-
}
28+
},
29+
overrides: [
30+
{
31+
files: ['tests/**/*.{ts,tsx,js,jsx}'],
32+
env: {
33+
node: true
34+
}
35+
}
36+
]
2937
}

web-client/.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm test

0 commit comments

Comments
 (0)