diff --git a/frontend-react/package.json b/frontend-react/package.json index d6047cf8..5d1d2ae5 100644 --- a/frontend-react/package.json +++ b/frontend-react/package.json @@ -1,6 +1,7 @@ { "name": "@wuespace/telestion", "description": "Telestion is a framework for building ground station / mission control applications.", + "homepage": "https://telestion.wuespace.de/", "keywords": [ "telestion", "ground station", @@ -10,9 +11,24 @@ "spacecrafts", "spaceflight" ], - "author": "WüSpace e.V.", + "author": { + "name": "WüSpace e. V.", + "email": "telestion@wuespace.de", + "url": "https://telestion.wuespace.de/" + }, + "contributors": [ + { + "name": "Zuri Klaschka", + "email": "zuri.klaschka@wuespace.de", + "url": "https://github.com/pklaschka" + }, + { + "name": "Ludwig Richter", + "email": "ludwig.richter@wuespace.de", + "url": "https://github.com/fussel178" + } + ], "license": "MIT", - "private": true, "version": "1.0.0-alpha.0", "type": "module", "files": [ @@ -39,6 +55,11 @@ "ci:style": "prettier --list-different .", "ci:test": "vitest" }, + "repository": { + "type": "git", + "url": "git+https://github.com/wuespace/telestion.git", + "directory": "frontend-react" + }, "dependencies": { "@popperjs/core": "^2.11.8", "bootstrap": "^5.3.2", @@ -51,8 +72,12 @@ "react-router-dom": "^6.19.0", "zod": "^3.22.4" }, + "peerDependencies": { + "react": "18" + }, "devDependencies": { "@cucumber/cucumber": "^10.0.1", + "@types/node": "^20.10.4", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", "@typescript-eslint/eslint-plugin": "^6.10.0", @@ -73,6 +98,7 @@ "typedoc-plugin-zod": "^1.1.0", "typescript": "^5.2.2", "vite": "^5.0.5", + "vite-plugin-banner": "^0.7.1", "vitest": "^1.0.4" } } diff --git a/frontend-react/pnpm-lock.yaml b/frontend-react/pnpm-lock.yaml index a1c40e0c..c7a67338 100644 --- a/frontend-react/pnpm-lock.yaml +++ b/frontend-react/pnpm-lock.yaml @@ -40,6 +40,9 @@ devDependencies: '@cucumber/cucumber': specifier: ^10.0.1 version: 10.0.1 + '@types/node': + specifier: ^20.10.4 + version: 20.10.4 '@types/react': specifier: ^18.2.37 version: 18.2.37 @@ -99,10 +102,13 @@ devDependencies: version: 5.2.2 vite: specifier: ^5.0.5 - version: 5.0.5(sass@1.69.5) + version: 5.0.5(@types/node@20.10.4)(sass@1.69.5) + vite-plugin-banner: + specifier: ^0.7.1 + version: 0.7.1 vitest: specifier: ^1.0.4 - version: 1.0.4(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5) + version: 1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5) packages: @@ -889,6 +895,12 @@ packages: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true + /@types/node@20.10.4: + resolution: {integrity: sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==} + dependencies: + undici-types: 5.26.5 + dev: true + /@types/normalize-package-data@2.4.4: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true @@ -1075,7 +1087,7 @@ packages: vite: ^4 || ^5 dependencies: '@swc/core': 1.3.96 - vite: 5.0.5(sass@1.69.5) + vite: 5.0.5(@types/node@20.10.4)(sass@1.69.5) transitivePeerDependencies: - '@swc/helpers' dev: true @@ -1122,7 +1134,7 @@ packages: pathe: 1.1.1 picocolors: 1.0.0 sirv: 2.0.3 - vitest: 1.0.4(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5) + vitest: 1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5) dev: true /@vitest/utils@1.0.4: @@ -3848,6 +3860,10 @@ packages: react: 18.2.0 dev: false + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true + /upper-case-first@2.0.2: resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==} dependencies: @@ -3885,7 +3901,7 @@ packages: extsprintf: 1.4.1 dev: true - /vite-node@1.0.4(sass@1.69.5): + /vite-node@1.0.4(@types/node@20.10.4)(sass@1.69.5): resolution: {integrity: sha512-9xQQtHdsz5Qn8hqbV7UKqkm8YkJhzT/zr41Dmt5N7AlD8hJXw/Z7y0QiD5I8lnTthV9Rvcvi0QW7PI0Fq83ZPg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -3894,7 +3910,7 @@ packages: debug: 4.3.4(supports-color@8.1.1) pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.5(sass@1.69.5) + vite: 5.0.5(@types/node@20.10.4)(sass@1.69.5) transitivePeerDependencies: - '@types/node' - less @@ -3906,7 +3922,11 @@ packages: - terser dev: true - /vite@5.0.5(sass@1.69.5): + /vite-plugin-banner@0.7.1: + resolution: {integrity: sha512-Bww2Xd5tOGsZ1yZ9rQiGneryvsL1u86znPrqeQjCsXPsG72pnSdV5lcQA+cy8UNDguMqyTJiCevlNUbLnT85UA==} + dev: true + + /vite@5.0.5(@types/node@20.10.4)(sass@1.69.5): resolution: {integrity: sha512-OekeWqR9Ls56f3zd4CaxzbbS11gqYkEiBtnWFFgYR2WV8oPJRRKq0mpskYy/XaoCL3L7VINDhqqOMNDiYdGvGg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -3934,6 +3954,7 @@ packages: terser: optional: true dependencies: + '@types/node': 20.10.4 esbuild: 0.19.5 postcss: 8.4.32 rollup: 4.5.0 @@ -3942,7 +3963,7 @@ packages: fsevents: 2.3.3 dev: true - /vitest@1.0.4(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5): + /vitest@1.0.4(@types/node@20.10.4)(@vitest/ui@1.0.4)(happy-dom@12.10.3)(sass@1.69.5): resolution: {integrity: sha512-s1GQHp/UOeWEo4+aXDOeFBJwFzL6mjycbQwwKWX2QcYfh/7tIerS59hWQ20mxzupTJluA2SdwiBuWwQHH67ckg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -3967,6 +3988,7 @@ packages: jsdom: optional: true dependencies: + '@types/node': 20.10.4 '@vitest/expect': 1.0.4 '@vitest/runner': 1.0.4 '@vitest/snapshot': 1.0.4 @@ -3987,8 +4009,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.1 tinypool: 0.8.1 - vite: 5.0.5(sass@1.69.5) - vite-node: 1.0.4(sass@1.69.5) + vite: 5.0.5(@types/node@20.10.4)(sass@1.69.5) + vite-node: 1.0.4(@types/node@20.10.4)(sass@1.69.5) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/frontend-react/vite.config.ts b/frontend-react/vite.config.ts index d7d7ea94..3c8d21be 100644 --- a/frontend-react/vite.config.ts +++ b/frontend-react/vite.config.ts @@ -1,10 +1,20 @@ /// -import { resolve } from 'path'; +import { resolve } from 'node:path'; import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react-swc'; +import banner from 'vite-plugin-banner'; import packageJson from './package.json' assert { type: 'json' }; +const bannerText = { + name: packageJson.name, + version: packageJson.version, + description: packageJson.description, + author: `${packageJson.author.name} <${packageJson.author.email}>`, + homepage: packageJson.homepage, + license: 'Copyright (c) 2023 WüSpace e. V.' +}; + // https://vitejs.dev/config/ export default defineConfig({ build: { @@ -23,8 +33,12 @@ export default defineConfig({ } } }, - plugins: [react()], + plugins: [react(), banner(transformBanner(bannerText))], test: { environment: 'happy-dom' } }); + +function transformBanner(banner: Record) { + return '/**\n' + Object.entries(banner).map(([key, value]) => ` * ${key}: ${value}\n`).join('') + '**/'; +}