Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: install and init husky and commitlint #300

Merged
merged 6 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- DOCTOC SKIP -->

## Description

<!-- Describe your changes in detail -->
Expand Down
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit "$1"
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yarn doctoc .
yarn lint-staged
7 changes: 7 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"**/*.{js,jsx,ts,tsx}": [
"yarn format:code --max-warnings=0",
"yarn test:staged"
],
"**/*.{html,json,css,scss,md,mdx}": ["yarn format:markup"]
}
174 changes: 78 additions & 96 deletions CHANGELOG.md

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@

:baby: Staff interface for Kulttuurin kummilapset / Culture Kids :violin:

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [About](#about)
- [Deployments](#deployments)
- [See also](#see-also)
- [Development](#development)
- [Getting started](#getting-started)
- [Authorizing login to kukkuu-admin](#authorizing-login-to-kukkuu-admin)
- [Using local kukkuu backend](#using-local-kukkuu-backend)
- [Using remote kukkuu backend](#using-remote-kukkuu-backend)
- [Setting up Tunnistamo and Kukkuu API locally with Docker](#setting-up-tunnistamo-and-kukkuu-api-locally-with-docker)
- [Set Tunnistamo hostname](#set-tunnistamo-hostname)
- [Create a new OAuth app on GitHub](#create-a-new-oauth-app-on-github)
- [Install local Tunnistamo](#install-local-tunnistamo)
- [Using the Helsinki-Profile Keycloak instead of Tunnistamo](#using-the-helsinki-profile-keycloak-instead-of-tunnistamo)
- [Install Kukkuu API locally](#install-kukkuu-api-locally)
- [Available Scripts](#available-scripts)
- [`yarn start`](#yarn-start)
- [`yarn test`](#yarn-test)
- [`yarn build`](#yarn-build)
- [`yarn graphql-types`](#yarn-graphql-types)
- [`yarn test:browser`](#yarn-testbrowser)
- [Test JWT issuance for browser tests](#test-jwt-issuance-for-browser-tests)
- [Debugging](#debugging)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## About

More information about the Culture Kids project is available in the UI project:
Expand Down
23 changes: 23 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'fix',
'docs',
'chore',
'build',
'style',
'refactor',
'ci',
'test',
'revert',
'perf',
'vercel',
],
],
},
};
20 changes: 14 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@
"typecheck": "tsc",
"test": "cross-env TZ=Europe/Helsinki vitest run",
"test:coverage": "cross-env TZ=Europe/Helsinki NODE_OPTIONS=--max-old-space-size=8192 vitest run --coverage",
"test:staged": "cross-env TZ=Europe/Helsinki vitest related --run",
"test:watch": "cross-env TZ=Europe/Helsinki vitest",
"eject": "react-scripts eject",
"lint": "eslint src",
"format:code": "eslint --ext js,ts,tsx src --fix",
"format:markup": "prettier --config .prettierrc.json --write src/**/*.css",
"generate:graphql": "cross-env DOTENV_CONFIG_PATH=./.env graphql-codegen -r dotenv/config --config ./codegen.ts",
"test:browser": "testcafe \"chrome --window-size='1920,1080' --disable-search-engine-choice-screen\" browser-tests/ --live",
"test:browser:wsl2win": "testcafe 'path:`/mnt/c/Program Files/Google/Chrome/Application/chrome.exe`' browser-tests/ --live --dev --lang=fi-FI",
"test:browser:ci": "testcafe \"chrome:headless --disable-gpu --window-size='1920,1080' --disable-search-engine-choice-screen\" --lang=fi-FI -s path=report,takeOnFails=true --video report --reporter spec,html:report/index.html browser-tests/",
"test:browser:ci:chromium": "testcafe \"chromium:headless --disable-gpu --window-size='1920,1080' --disable-search-engine-choice-screen\" --lang=fi-FI -s path=report,takeOnFails=true --video report --reporter spec,html:report/index.html browser-tests/"
"test:browser:ci:chromium": "testcafe \"chromium:headless --disable-gpu --window-size='1920,1080' --disable-search-engine-choice-screen\" --lang=fi-FI -s path=report,takeOnFails=true --video report --reporter spec,html:report/index.html browser-tests/",
"prepare": "husky"
},
"browserslist": {
"production": [
Expand Down Expand Up @@ -54,6 +57,8 @@
"@types/react-dom": "^18.2.8",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^8.18.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/coverage-v8": "^2.1.8",
"@vitest/eslint-plugin": "^1.1.16",
Expand Down Expand Up @@ -91,25 +96,28 @@
"react-idle-timer": "^5.7.2",
"typescript": "<5.4.0",
"vite": "^6.0.3",
"vite-plugin-eslint": "^1.8.1",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^2.1.8",
"vitest-localstorage-mock": "^0.1.2",
"vitest-sonar-reporter": "^2.0.0",
"vite-plugin-eslint": "^1.8.1",
"yup": "^1.3.2",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^8.18.1"
"yup": "^1.3.2"
},
"devDependencies": {
"@commitlint/cli": "^19.6.1",
"@commitlint/config-conventional": "^19.6.0",
"@ffmpeg-installer/ffmpeg": "^1.1.0",
"@graphql-codegen/add": "^5.0.0",
"@graphql-codegen/cli": "^5.0.0",
"@graphql-codegen/typescript": "^4.0.1",
"@graphql-codegen/typescript-operations": "^4.0.1",
"@graphql-codegen/typescript-react-apollo": "^4.1.0",
"@testing-library/testcafe": "^5.0.0",
"doctoc": "^2.2.1",
"full-icu": "^1.5.0",
"husky": "^9.1.7",
"jsdom": "^25.0.1",
"lint-staged": "^15.3.0",
"testcafe": "^3.3.0",
"testcafe-reporter-html": "^1.4.6"
}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/styles/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto',
'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans',
'Helvetica Neue', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
Expand Down
Loading