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

fix(package): update exports to import/require #2366

Merged
merged 11 commits into from
Sep 28, 2022
Prev Previous commit
Next Next commit
docs: add nextjs example
  • Loading branch information
joshblack committed Sep 23, 2022
commit b80ca12ce7efaee361e5c5c6890070f83cb19385
1 change: 1 addition & 0 deletions examples/nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.next
5 changes: 5 additions & 0 deletions examples/nextjs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
16 changes: 16 additions & 0 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "nextjs",
"private": true,
"scripts": {
"build": "next build",
"develop": "next",
"start": "next start"
},
"dependencies": {
"@primer/react": "file:../../",
"next": "12.3.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"styled-components": "4.4.1"
}
}
12 changes: 12 additions & 0 deletions examples/nextjs/src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {ThemeProvider, BaseStyles} from '@primer/react'
import React from 'react'

export default function App({Component, pageProps}) {
return (
<ThemeProvider>
<BaseStyles>
<Component {...pageProps} />
</BaseStyles>
</ThemeProvider>
)
}
6 changes: 6 additions & 0 deletions examples/nextjs/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {Button} from '@primer/react'
import React from 'react'

export default function IndexPage() {
return <Button>Hello world</Button>
}
30 changes: 30 additions & 0 deletions examples/nextjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx"
],
"exclude": [
"node_modules"
]
}
Loading