-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add nextjs package #1012
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
base: main
Are you sure you want to change the base?
feat: add nextjs package #1012
Changes from 5 commits
33d4692
a30767d
320d44b
817625a
f0e053b
c4838de
cb00301
d8738b8
7f276dd
463de29
8023116
710e1c9
6a374d1
4d91244
c84c9b8
dfd79e8
d6f8784
5447ac1
ebc91c9
03fb9d1
59e5592
e716008
beadaf6
d7780ce
2199d98
2d185c3
fe017b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ build/ | |
| coverage/ | ||
| dist/ | ||
| tmp/ | ||
| .next/ | ||
|
|
||
| # Ignore archives | ||
| *.7z | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| html, | ||
| body { | ||
| min-block-size: 100%; | ||
|
eelcobosklopper marked this conversation as resolved.
Outdated
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||
| import type { Metadata } from 'next'; | ||||||
| import './globals.css'; | ||||||
| import './theme.css'; | ||||||
|
|
||||||
| export const metadata: Metadata = { | ||||||
| description: 'A Next.js example project using components from the NL Design System', | ||||||
| title: 'NL Design System', | ||||||
| }; | ||||||
|
|
||||||
| export default function RootLayout({ | ||||||
| children, | ||||||
| }: Readonly<{ | ||||||
| children: React.ReactNode; | ||||||
| }>) { | ||||||
| return ( | ||||||
| <html lang="en" className="ma-theme"> | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| <body>{children}</body> | ||||||
| </html> | ||||||
| ); | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { Button } from '@/components/Button/Button'; | ||
| import { Heading } from '@/components/Heading/Heading'; | ||
| import { Link } from '@/components/Link/Link'; | ||
| import { Paragraph } from '@/components/Paragraph/Paragraph'; | ||
| import { SkipLink } from '@/components/SkipLink/SkipLink'; | ||
|
|
||
| const Home = () => { | ||
| return ( | ||
| <div> | ||
| <SkipLink href="#main">Naar de hoofdinhoud</SkipLink> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Waar is |
||
| <Heading level={1}>Voorbeeldpagina</Heading> | ||
| <Paragraph>Lets get started!</Paragraph> | ||
| <Button purpose="primary">Click me</Button> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Buttons kunnen het best in een ActionGroup ipv los, zoals die van Utrecht |
||
| <Paragraph> | ||
| <Link href="https://nldesignsystem.nl">NL Design System</Link> | ||
| </Paragraph> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default Home; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In een aparte branch heb ik deze file vervangen met
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ik stel voor om hier in eerste instantie het start-thema te importeren, zonder duplicatie Dan kan later de |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { Button } from '@nl-design-system-candidate/button-react'; | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mijn IDE (VScode) doet geen autocomplete omdat Typescript deze exports niet kan indexeren. Als ik de Button als een const exporteer dan pakt hij hem wel op maar Sonar vindt dit weer niet leuk.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zou je een issue willen aanmaken bij de candidate repo voor matige developer experience met TypeScript autocomplete? Als jij een oplossing hebt hoor ik het graag, ik denk dat dit van jou uit zou kunnen komen.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Het is niet een candidate repo issue maar hoe het component hier wordt ge-ïmporteerd en exporteerd. Ik loop tegen hetzelfde aan in de documentatie repo voor bijvoorbeeld Het is fijn om dit soort import/export component files te hebben zodat je als developer 1 centrale plek hebt voor je Button implementie. Dan is switchen tussen een community button of een candidate button minder gedoe. Ik heb alleen nog geen betere manier gevonden dan dit te doen: Maar ik kan niet geloven dat anderen hier geen last van hebben dus ik ben heel benieuwd hoe zij dit hebben opgelost 😅 |
||
| import '@nl-design-system-candidate/button-css/button.css'; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { Heading } from '@nl-design-system-candidate/heading-react'; | ||
| import '@nl-design-system-candidate/heading-css/heading.css'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { Link } from '@nl-design-system-candidate/link-react'; | ||
| import '@nl-design-system-candidate/link-css/link.css'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { Paragraph } from '@nl-design-system-candidate/paragraph-react'; | ||
| import '@nl-design-system-candidate/paragraph-css/paragraph.css'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { SkipLink } from '@nl-design-system-candidate/skip-link-react'; | ||
| import '@nl-design-system-candidate/skip-link-css/skip-link.css'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| /// <reference types="next" /> | ||
| /// <reference types="next/image-types/global" /> | ||
| import './.next/dev/types/routes.d.ts'; | ||
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import type { NextConfig } from 'next'; | ||
|
|
||
| const nextConfig: NextConfig = { | ||
| /* config options here */ | ||
| reactCompiler: true, | ||
| }; | ||
|
|
||
| export default nextConfig; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| { | ||
| "name": "@example/nextjs", | ||
| "author": "Community for NL Design System", | ||
| "description": "A Next.js example project using components from the NL Design System", | ||
| "license": "EUPL-1.2", | ||
| "keywords": [ | ||
| "nl-design-system" | ||
| ], | ||
| "private": true, | ||
| "repository": { | ||
| "type": "git+ssh", | ||
| "url": "git@github.com:nl-design-system/example.git", | ||
| "directory": "packages/nextjs" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zullen we deze package verplaatsen naar
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verplaatst naar /apps/next/ |
||
| }, | ||
| "scripts": { | ||
| "build": "next build", | ||
| "dev": "next dev", | ||
| "lint:css": "stylelint --allow-empty-input '**/*.{css,scss}'", | ||
| "lint:js": "eslint", | ||
| "lint:prettier": "prettier --write .", | ||
| "lint": "pnpm run --sequential '/^lint:.+$/'", | ||
| "prepare": "husky", | ||
|
eelcobosklopper marked this conversation as resolved.
Outdated
|
||
| "start": "next start" | ||
| }, | ||
| "dependencies": { | ||
| "@nl-design-system-candidate/button-css": "1.1.0", | ||
| "@nl-design-system-candidate/button-react": "1.1.0", | ||
| "@nl-design-system-candidate/code-block-css": "1.2.0", | ||
| "@nl-design-system-candidate/code-block-react": "1.4.0", | ||
| "@nl-design-system-candidate/code-css": "3.0.0", | ||
| "@nl-design-system-candidate/code-react": "2.0.0", | ||
| "@nl-design-system-candidate/color-sample-css": "1.0.5", | ||
| "@nl-design-system-candidate/color-sample-react": "1.2.2", | ||
| "@nl-design-system-candidate/data-badge-css": "1.0.5", | ||
| "@nl-design-system-candidate/data-badge-react": "1.1.7", | ||
| "@nl-design-system-candidate/heading-css": "1.1.3", | ||
| "@nl-design-system-candidate/heading-react": "1.1.7", | ||
| "@nl-design-system-candidate/link-css": "2.0.3", | ||
| "@nl-design-system-candidate/link-react": "1.1.8", | ||
| "@nl-design-system-candidate/mark-css": "1.0.5", | ||
| "@nl-design-system-candidate/mark-react": "1.1.7", | ||
| "@nl-design-system-candidate/number-badge-css": "1.1.5", | ||
| "@nl-design-system-candidate/number-badge-react": "1.3.2", | ||
| "@nl-design-system-candidate/paragraph-css": "2.1.3", | ||
| "@nl-design-system-candidate/paragraph-react": "2.2.2", | ||
| "@nl-design-system-candidate/skip-link-css": "1.0.5", | ||
| "@nl-design-system-candidate/skip-link-react": "1.1.7", | ||
| "next": "16.2.10", | ||
| "react": "19.2.4", | ||
| "react-dom": "19.2.4" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/runtime": "7.29.7", | ||
| "@nl-design-system/eslint-config": "2.4.0", | ||
| "@nl-design-system/tsconfig": "1.0.5", | ||
| "@types/node": "20.19.43", | ||
|
eelcobosklopper marked this conversation as resolved.
Outdated
|
||
| "@types/react": "19.2.17", | ||
| "@types/react-dom": "19.2.3", | ||
| "babel-plugin-react-compiler": "1.0.0", | ||
| "typescript": "5.9.3" | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "extends": "@nl-design-system/tsconfig", | ||
| "compilerOptions": { | ||
| "allowSyntheticDefaultImports": true, // depricated and will stop functioning in v7. Added to overwrite usage in @nl-design-system/tsconfig | ||
|
eelcobosklopper marked this conversation as resolved.
Outdated
|
||
| "lib": ["dom", "dom.iterable", "esnext"], | ||
| "allowJs": false, // was true, don't think this is needed. | ||
| "noEmit": true, // gives room for other compiler tools | ||
| "module": "esnext", // overwrite NodeNext because this is a Frontend project | ||
| "moduleResolution": "bundler", // overwrite NodeNext because this is a Frontend project | ||
| "isolatedModules": true, | ||
| "incremental": true, // store tsbuildinfo files to improve subsequent build speed | ||
| "plugins": [ | ||
| { | ||
| "name": "next" | ||
| } | ||
| ], | ||
| "paths": { | ||
| "@/*": ["./*"] | ||
| } | ||
| }, | ||
| "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts", "**/*.mts"], | ||
| "exclude": ["node_modules"] | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.