-
Notifications
You must be signed in to change notification settings - Fork 0
9 readme dokumentasjon #46
Merged
+16
−61
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0b7181b
Begin write readme
sivertlv 56cc2e1
Correct information and add AI declaration to README
henrygr e931b31
Add AI-css line in readme
362a2b4
Mer readme
1caa26f
Mer doc
532b500
run pre-commit
bf1c6ad
proof reading
684f464
fix typos
77d4825
fix typos
c8614af
Fix typo on Continuous
nicolare d8a0c26
Add how-to
henrygr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,73 +1,15 @@ | ||
| # React + TypeScript + Vite | ||
| http://it2810-09.idi.ntnu.no/project1/ | ||
|
|
||
| This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. | ||
| # Vær app | ||
|
|
||
| Currently, two official plugins are available: | ||
| Vi valgte å lage en vær-app fordi det ga en klar funksjonsprofil og oppfattet letthet av å lære av andre eksempler, samt mange vær-api og velge fra. Selve trodde også arkiteturen på siden ble lettere å lage. YR/metrologisk institutt's API ble tatt i bruk da vi trodde de hadde den beste dataen og at den var godt dokumentert, og gjennom Open-meteo's geocoding API ble tatt i bruk for å finne koordinater basert på stedsnavn, ettersom dette var det første geocoding APIet vi fant som ikke trengte en API key. | ||
|
|
||
| - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) | ||
| - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) | ||
| Tech-stack er valgt i tråd med oppgavebeskrivelsen, derav React med Typescript, vite, tanstack query og HTML WEB storage api, samt et par andre npm packages for hjelpe med utviklingshastiget og lesbarhet av koden. Eslint og Prettier har blitt tatt i bruk, blant annet gjennom script i repo, samt i Continious Integration pipelinen i GitHub actions, som påtvinger riktig linting og formattering før pull request kan godkjennes. | ||
|
|
||
| ## React Compiler | ||
| Tester er skrevet for de fleste komponenter og hooks for meterologisk api. Test under test/hooks/fetchCities/useGetCityCoordinates.test.ts verifiserer at hook henter data fra rest-api og at deg gjøres riktig antall ganger. fetchWeather/useGetWeather.test.ts tester at sanitizeAltitude gir passende altitude verdier som skal brukes til rest-api kall. Tester under tests/components tester at riktig elementer med riktig innhold havner i nettleser ved runtime. | ||
kristnu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). | ||
| ## KI deklarsjon | ||
|
|
||
| ## Expanding the ESLint configuration | ||
| KI ble brukt i utviklingsprosessen for å støtte utviklings- og debuggingsprosessen. Litt kode har også blitt generert, hovedsaklig i CI/CD-scriptet for å deploye, ettersom ingen av oss hadde erfaring med apache, eller bruk av self-hosted action runners. I tilfeller hvor KI kode har blitt generert og brukt har den blitt sett over av et medlem av gruppa. KI har også blitt primært brukt for skriving av css for ViewCity komponent, mens andre css stylings er skrevet for hånd. | ||
|
|
||
| If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: | ||
|
|
||
| ```js | ||
| export default defineConfig([ | ||
| globalIgnores(["dist"]), | ||
| { | ||
| files: ["**/*.{ts,tsx}"], | ||
| extends: [ | ||
| // Other configs... | ||
|
|
||
| // Remove tseslint.configs.recommended and replace with this | ||
| tseslint.configs.recommendedTypeChecked, | ||
| // Alternatively, use this for stricter rules | ||
| tseslint.configs.strictTypeChecked, | ||
| // Optionally, add this for stylistic rules | ||
| tseslint.configs.stylisticTypeChecked, | ||
|
|
||
| // Other configs... | ||
| ], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: ["./tsconfig.node.json", "./tsconfig.app.json"], | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| // other options... | ||
| }, | ||
| }, | ||
| ]) | ||
| ``` | ||
|
|
||
| You can also install [eslint-plugin-react-x](https://npmx.dev/package/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://npmx.dev/package/eslint-plugin-react-dom) for React-specific lint rules: | ||
|
|
||
| ```js | ||
| // eslint.config.js | ||
| import reactX from "eslint-plugin-react-x" | ||
| import reactDom from "eslint-plugin-react-dom" | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(["dist"]), | ||
| { | ||
| files: ["**/*.{ts,tsx}"], | ||
| extends: [ | ||
| // Other configs... | ||
| // Enable lint rules for React | ||
| reactX.configs["recommended-typescript"], | ||
| // Enable lint rules for React DOM | ||
| reactDom.configs.recommended, | ||
| ], | ||
| languageOptions: { | ||
| parserOptions: { | ||
| project: ["./tsconfig.node.json", "./tsconfig.app.json"], | ||
| tsconfigRootDir: import.meta.dirname, | ||
| }, | ||
| // other options... | ||
| }, | ||
| }, | ||
| ]) | ||
| ``` | ||
| Gruppen erfarte at KI var nyttig til å forklare, foreslå og diskutere under utvikling, dog at noen kode forslag spesifikt virket overkompliserte eller vanskelig å lese/tyde. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.