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

Pakettien päivittäminen | antti/update-packages #60

Merged
merged 24 commits into from
Feb 28, 2025

Conversation

anttiasmala
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Dec 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lahjalista ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 28, 2025 10:11am

…t. Everything worked perfectly fine with Prisma 6 but for updating packages --force had to be used
.eslintrc.json Outdated
Comment on lines 55 to 60
"plugins": ["@tanstack/query"],
"extends": [
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:import/typescript"
"plugin:import/typescript",
"plugin:@tanstack/eslint-plugin-query/recommended"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Liittyy tanstack-brancheihin, jonka pohjalta väsäsin tätä branchia

…revent n/no-extraneous-import for now. The rule can be disabled if needed but let's go with this for now
…eprecated .eslintrc.json method and replace it with the upcoming Flat Config method
Comment on lines 1 to +24
package.json

PACKAGES NOT UPDATED, NOT WORKING AT THE MOMENT 19.09.2024

Minor Backwards-compatible features
❯ ◯ typescript 5.4.5 → 5.6.2
Seuraavia paketteja ei ole päivitetty

Major Potentially breaking API changes
@types/node 20.12.4 → 22.5.5
@typescript-eslint/eslint-plugin 7.5.0 → 8.6.0
◯ eslint 8.57.0 → 9.10.0
❯ ◯ @prisma/client 5.20.0 → 6.2.1
@types/node 20.12.4 → 22.10.6
◯ prisma 5.20.0 → 6.2.1

`@prisma/client`iä ja `prisma`a ei ole päivitetty, koska `lucia-auth`in peer-dependency ei tue vielä Prisma v6:sta. Kyseisestä asiasta on tehty PR https://github.com/lucia-auth/lucia/pull/1760 jos tuota ei ole korjattu helmikuuhun mennessä, korjataan itse tai keksitään jokin muu ratkaisu

`@types/node`a ei ole päivitetty, koska pitänee seurata package.json:in node-versiota

#########################################################################

**Testaa näitä päivittämisen yhteydessä**

- [] poista oma testaustietokanta ja lisää tietokanta uudelleen `npm run prisma db push`

- [] kokeile ESLint ettei heitä virheitä

- [] testaa sivu että normaalikäyttö toimii (rekistöröinti, kirjautuminen, lahjan (lisääminen, poistaminen, muokkaaminen), palaute)

- [] API-endpointtien testaaminen
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vaihdoin tekstin tässä tiedostossa vastaamaan nykyistä

Lisäsin myös TODO-listan pakettien päivittämisen jälkeen. Helpompi muistaa

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lisäsin myös TODO-listan pakettien päivittämisen jälkeen. Helpompi muistaa

Tämmöisiä kannattaa suosia, tuommoiset unohtuu nopeasti.

import '~/styles/globals.css';
import '../styles/globals.css';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import '~/styles/globals.css'; vaihdettu import '../styles/globals.css';

Ilman vaihdosta seuraava virheilmoitus tulee: no-extraneous-import https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-extraneous-import.md

Tuo virhekoodi mun mielestä ihan hyvä, joten en itse sitä ehkä poistaisi. Yritin myös lisätä globals.css:n sallituksi, mutta ilmeisesti hyväksyy vain moduleita

Mennäänkö ../-tavalla vai mennäänkö turvallisemmalla ~/-tavalla ja lisätään vain seuraava rivi: // eslint-disable-next-line n/no-extraneous-import? 😄

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tämä on hyvä muutos, pidetään.

Copy link
Collaborator Author

@anttiasmala anttiasmala Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isoin muutos tässä on se, että siirrytään .eslintrc.*stä eslint.config.(m)js:n (Flat Config) käyttöön

.eslintrc.*n tuki näyttäisi loppuvan ESLint 10:n kohdalla, joka tulee melko pian. Viittaus: https://eslint.org/blog/2023/10/flat-config-rollout-plans/#eslintrc-removed-in-eslint-v10.0.0

Käytin tämän tiedoston luomiseen ESLintin ohjetta https://eslint.org/docs/latest/use/configure/migration-guide. Tämä tiedosto tuli npx @eslint/migrate-config .eslintrc.json -komennolla. Jouduin tekemään jonkin verran muokkauksia, jotta sain siitä toimivan

Tässä kesti erittäin kauan tehdä. Tämmöinen "konffaus" ei ole yhtään tuttua ja en oikein tiennyt mistä aloittaa / mitä pitää tehdä 😄

Omissa testeissä homma näytti toimivan, mutta katotaan mikä on lopputulos 🤣

Säilytin kaikki samat säännöt mitä meillä olikin. Yhden pienen muokkauksen tein, mutta siitä toisessa kommentissa lisää

Comment on lines +77 to +80
// Handled by import/typescript
// n/no-missing-import is used here instead of node/no-missing-import because seems like eslint-plugin-node is not updated frequently
// node/no-missing-import: https://github.com/mysticatea/eslint-plugin-node | n/no-missing-import: https://github.com/eslint-community/eslint-plugin-n
'n/no-missing-import': 'off',
Copy link
Collaborator Author

@anttiasmala anttiasmala Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tässä on ainoa muokkaus ruleseihin. Vaihdoin node/ -> n/. Tuota eslint-plugin-nodea ei näytetä päivittävän samalla tavalla. Sanottakoon se, että en tiedä onko tarpeellinen muutos

eslint-plugin-noden Github: https://github.com/mysticatea/eslint-plugin-node

eslint-plugin-n Github: https://github.com/eslint-community/eslint-plugin-n

Tässä vielä issue, jossa päädyttiin tekemään tuo uusi eslint-plugin-n mysticatea/eslint-plugin-node#300

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Joo tuo oli hyvä muutos 👍 Pitääkin tehdä se myös omissa repoissa.

Comment on lines +99 to +102
{
// .next folder added to ignores. This is otherwise being ESLinted
ignores: ['**/.next/'],
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tässä luultavasti on meikän konffaustaidoissa vika. Eli ilman ignorausta .next-kansio ajetan myös ESLintillä

Onko kyseinen kansio ajettu aikaisemmin ESLintillä?

Copy link
Owner

@samuliasmala samuliasmala Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aiemmin next lint komento piti sisällään kansiot missä eslint ajettiin. Siihen on varmasti tullut jokin muutos uuden version myötä, kun nyt vaatii tuon ignoren.

Comment on lines +56 to +58
"@eslint/compat": "1.2.5",
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.18.0",
Copy link
Collaborator Author

@anttiasmala anttiasmala Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nämä kolme devDependeciä liittyi tähän: https://eslint.org/docs/latest/use/configure/migration-guide

Eivät liene tarpeellisia enää

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Itseasiassa @eslint/compat ja @eslint/eslintrc ovatkin käytössä. @eslint/js ei ole, koska säännöt otetaan TypeScriptin configeista

@anttiasmala
Copy link
Collaborator Author

anttiasmala commented Feb 20, 2025

ESLint näköjään kaatuu täällä Githubissa. Syy on ilmeisestikin siinä ettei --ext-komentoa ole Flat Configissa (ainakin mitä Githubista näkee, en tiedä näetkö jostain tarkemmin 😄 )

"By default, ESLint lints files that match the patterns **/.js, **/.cjs, and **/*.mjs. Those files are always matched unless you explicitly exclude them using global ignores." Viittaus: https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores

Lisäsin configiin files: ['**/*.ts?(x)'],, jonka pitäisi ajaa sekä .ts että .tsx tiedostot

Testasin myös lisätä .js-tiedoston ja virheen siihen. ESLint tarkisti tiedoston ja toimi kuten pitää 👍

Copy link
Owner

@samuliasmala samuliasmala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mergesin mainin tähän kuun muuten "Files changed" ei ollut aivan ajantasalla. Mut toimii ja valmis mergettäväksi.

@samuliasmala
Copy link
Owner

samuliasmala commented Feb 26, 2025

ESLint näköjään kaatuu täällä Githubissa. Syy on ilmeisestikin siinä ettei --ext-komentoa ole Flat Configissa (ainakin mitä Githubista näkee, en tiedä näetkö jostain tarkemmin 😄 )

Sanoisin että helpoin tapa korjata tämä on korvata wearerequired/lint-action@v2 yksinkertaisella npm run lint komennolla pull-request-lint.yml tiedostossa:

      - name: Run linters
        run: npm run lint

Tätä me käytetään joissakin repoissa.

@anttiasmala
Copy link
Collaborator Author

ESLint näköjään kaatuu täällä Githubissa. Syy on ilmeisestikin siinä ettei --ext-komentoa ole Flat Configissa (ainakin mitä Githubista näkee, en tiedä näetkö jostain tarkemmin 😄 )

Sanoisin että helpoin tapa korjata tämä on korvata wearerequired/lint-action@v2 yksinkertaisella npm run lint komennolla pull-request-lint.yml tiedostossa:

      - name: Run linters
        run: npm run lint

Tätä me käytetään joissakin repoissa.

En tiennytkään pull-request-lint.yml:n olemassa olosta, ajattelin jotenkin että nuo korjataan jostain Vercelin omasta systeemistä. Semmoisesta mihin mulla ei oo pääsyä 😄

Kokeilen korjata tuon, kiitos! 👍

@anttiasmala
Copy link
Collaborator Author

Näytti lähtevän pelittämään tuolla sun ohjeella, kiitos! 👍

@anttiasmala anttiasmala merged commit 3243c34 into main Feb 28, 2025
3 checks passed
@anttiasmala anttiasmala deleted the antti/update-packages branch February 28, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants