Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
chore: upgrade project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
deleonio committed Nov 9, 2024
1 parent 072f63c commit f392166
Show file tree
Hide file tree
Showing 13 changed files with 1,199 additions and 1,918 deletions.
13 changes: 0 additions & 13 deletions .eslintrc.cjs

This file was deleted.

7 changes: 7 additions & 0 deletions .github/dod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dod:
- Meaningful pull request title for the release notes
- Pull request is linked to an issue
- All changes relate to the issue
- No commented out code in the final commit
- Manual test performed successfully (if applicable)
- Documentation or migration has been updated (if applicable)
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
run: pnpm i --no-frozen-lockfile
- name: Install Playwright
run: pnpm exec playwright install
# - name: Unused
# run: pnpm unused
- name: Format
run: pnpm format
- name: Build
run: pnpm build
- name: Lint
run: pnpm lint
- name: Unused
run: pnpm unused
- name: Build
run: pnpm build
- name: Test
run: pnpm test
- uses: actions/upload-artifact@v4
Expand Down
63 changes: 31 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: [ "develop", "main", "release/*" ]
branches: ['develop', 'main', 'release/*']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "develop" ]
branches: ['develop']
schedule:
- cron: '23 1 * * 6'

Expand All @@ -39,45 +39,44 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript-typescript' ]
language: ['javascript-typescript']
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: '/language:${{matrix.language}}'
24 changes: 24 additions & 0 deletions .github/workflows/dod-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Definition of Done
on:
pull_request:
types: [opened, edited, synchronize]

concurrency:
group: pr-{{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
check-dod:
runs-on: ubuntu-20.04
steps:
- name: Print Pull Request ID
run: |
echo "Pull Request Number: ${{ github.event.pull_request.number }}"
- name: Clone Repo
uses: actions/checkout@v3
- name: Check DoD
uses: platisd/definition-of-done@master
with:
dod_yaml: '.github/dod.yml'
message_header: 'The A11y and PO reviews will only take place after all other DoD steps have been completed by the Developer:'
github_token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["src/index.ts"],
"ignore": ["src/assets/**"],
"ignoreBinaries": ["playwright"],
"ignoreDependencies": ["nodemon", "sass"],
"project": ["src/**/*.ts"]
}
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**/assets/**
pnpm-lock.yaml
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Um die _Design Tokens_ anzupassen, reicht ein einfaches Stylesheet, das die gew
```

```html

<!doctype html>
<html lang="de" dir="ltr">
<head>
Expand All @@ -123,7 +122,7 @@ Um die _Design Tokens_ anzupassen, reicht ein einfaches Stylesheet, das die gew
<link rel="shortcut icon" type="image/x-icon" href="assets/kolibri.ico" />

<link rel="stylesheet" href="assets/codicons/codicon.css" />
<!--- <link rel="stylesheet" href="assets/fontawesome-free/css/all.min.css" />-->
<!--- <link rel="stylesheet" href="assets/fontawesome-free/css/all.min.css" />-->
<link rel="stylesheet" href="assets/noto-sans/noto-sans.css" />
<link rel="stylesheet" href="main.css" />
<meta name="robots" content="noindex" />
Expand All @@ -135,7 +134,6 @@ Um die _Design Tokens_ anzupassen, reicht ein einfaches Stylesheet, das die gew
<noscript>Diese Webseite erfordert, dass Sie JavaScript aktivieren.</noscript>
</body>
</html>

```

### Snapshot-Tests für visuelle Änderungen
Expand Down Expand Up @@ -173,4 +171,4 @@ Die folgenden Methoden können verwendet werden, um die Snapshots zu aktualisier
gh workflow run update-snapshots.yml -r main
```

Diese Schritte stellen sicher, dass visuelle Snapshots systematisch aktualisiert werden, um die Integrität des Testprozesses zu gewährleisten.
Diese Schritte stellen sicher, dass visuelle Snapshots systematisch aktualisiert werden, um die Integrität des Testprozesses zu gewährleisten.
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
ignores: ['dist/*'],
});

export default [
...compat.extends('eslint:recommended', 'plugin:@typescript-eslint/recommended'),
{
ignores: ['dist/*'],
files: ['src/**/*.ts'],
plugins: {
'@typescript-eslint': typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: 'module',

parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
},
},

rules: {
'@typescript-eslint/no-namespace': 'off',
},
},
];
36 changes: 21 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,42 @@
"sideEffects": false,
"scripts": {
"build": "rollup -c",
"clean": "git clean -f -d -X",
"dev": "rollup -c --watch",
"format": "prettier --check --write src",
"lint": "tsc --noemit && eslint src",
"format": "prettier --check .",
"lint": "tsc --noemit && eslint . --ignore-pattern \"dist/*\"",
"prepack": "pnpm build",
"start": "npm-run-all --parallel dev serve",
"start": "npm-run-all2 --parallel dev serve",
"serve": "sh serve.sh",
"test": "THEME_MODULE=dist THEME_EXPORT=BWSt kolibri-visual-test",
"test-update": "THEME_MODULE=dist THEME_EXPORT=BWSt kolibri-visual-test --update-snapshots theme-snapshots.spec.js",
"pretest": "pnpm build",
"pretest-update": "pnpm build",
"unused": "knip",
"update": "ncu -t minor -u && ncu"
},
"devDependencies": {
"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.14.0",
"@public-ui/components": "2.1.4",
"@public-ui/visual-tests": "2.1.4",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-typescript": "11.1.6",
"@rollup/plugin-commonjs": "28.0.1",
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-typescript": "12.1.1",
"@types/node": "ts5.5",
"@typescript-eslint/eslint-plugin": "7.17.0",
"@typescript-eslint/parser": "7.17.0",
"eslint": "8.57.0",
"nodemon": "3.1.4",
"npm-check-updates": "16.14.20",
"postcss": "8.4.39",
"@typescript-eslint/eslint-plugin": "8.13.0",
"@typescript-eslint/parser": "8.13.0",
"eslint": "9.14.0",
"knip": "5.36.3",
"nodemon": "3.1.7",
"npm-check-updates": "17.1.10",
"npm-run-all2": "7.0.1",
"postcss": "8.4.47",
"prettier": "3.3.3",
"rollup": "4.19.0",
"rollup": "4.24.4",
"rollup-plugin-postcss": "4.0.2",
"sass": "1.77.8",
"typescript": "5.5.4"
"sass": "1.80.6",
"typescript": "5.6.3"
},
"peerDependencies": {
"@public-ui/components": "2.1.4"
Expand Down
Loading

0 comments on commit f392166

Please sign in to comment.