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

[examples] Switch Next.js examples to ESM, remove unnecessary type #125

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

karlhorky
Copy link

@karlhorky karlhorky commented Jun 7, 2024

Hi @oliviertassinari and others, first of all, thanks for Pigment CSS! I will recommend this to our students at @upleveled :)

Quick PR to fix the Next.js "manual installation" example:

  1. next.config.mjs is now ESM by default since a while
  2. Use common settings from create-next-app

karlhorky added 2 commits June 7, 2024 16:30
Signed-off-by: Karl Horky <karl.horky@gmail.com>
Signed-off-by: Karl Horky <karl.horky@gmail.com>
@karlhorky karlhorky marked this pull request as draft June 7, 2024 14:36
@karlhorky karlhorky changed the title Switch Next.js example to ESM, remove unnecessary type Switch Next.js examples to ESM, remove unnecessary type Jun 7, 2024
@karlhorky karlhorky marked this pull request as ready for review June 7, 2024 14:43
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 7, 2024

Cool. I guess we should update https://github.com/mui/pigment-css/blob/master/examples/pigment-css-nextjs-ts/ too?

@oliviertassinari oliviertassinari added the examples Relating to /examples label Jun 7, 2024
@karlhorky
Copy link
Author

  • I was wrong about the Metadata import, I added it back now
  • updated the example

Comment on lines -3 to +10
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"moduleResolution": "bundler",
Copy link
Author

Choose a reason for hiding this comment

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

new tsconfig.json defaults

Comment on lines +1 to +3
{
"extends": "next/core-web-vitals"
}
Copy link
Author

Choose a reason for hiding this comment

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

default ESLint config with create-next-app

Comment on lines -24 to +22
"@/*": ["./src/*"]
"@/*": ["./*"]
Copy link
Author

Choose a reason for hiding this comment

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

default is non-src dir

@oliviertassinari oliviertassinari changed the title Switch Next.js examples to ESM, remove unnecessary type [examples] Switch Next.js examples to ESM, remove unnecessary type Jun 9, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples Relating to /examples PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants