Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80d2fcc
commit e932b14
Showing
14 changed files
with
3,190 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* eslint-disable no-console */ | ||
import * as childProcess from 'child_process'; | ||
import { sync as rimrafSync } from 'rimraf'; | ||
|
||
const TEST_APP_DIR = 'test/buildProcess/testApp'; | ||
|
||
/** | ||
* Run the given shell command, piping the shell process's `stdin`, `stdout`, and `stderr` to that of the current | ||
* process if this script is run with the `--debug` flag. Returns contents of `stdout`. | ||
*/ | ||
function run(cmd: string, options?: childProcess.ExecSyncOptions): string { | ||
return String( | ||
childProcess.execSync(cmd, { | ||
stdio: process.argv.includes('--debug') ? 'inherit' : 'ignore', | ||
...options, | ||
}), | ||
); | ||
} | ||
|
||
// Note: We use a file dependency for the SDK, rather than linking it, because if it's linked, nextjs rolls the entire | ||
// SDK and all of its dependencies into a bundle, making it impossible to tell (from the NFT file, at least) what's | ||
// being included. | ||
console.log('Installing dependencies...'); | ||
process.chdir(TEST_APP_DIR); | ||
rimrafSync('node_modules'); | ||
run('yarn'); | ||
|
||
console.log('Building app...'); | ||
rimrafSync('.next'); | ||
run('yarn build'); | ||
|
||
console.log('App built. Running tests...'); | ||
process.chdir('..'); | ||
try { | ||
// Even if this script hasn't been run with the `--debug` flag, we want the output of tests to be shown. | ||
run('yarn jest tests', { stdio: 'inherit' }); | ||
} catch (err) { | ||
console.log('\nNot all build process tests passed.'); | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
This file contains 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. | ||
|
||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. | ||
|
||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. |
This file contains 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// const nextConfig = { | ||
// } | ||
// | ||
// module.exports = nextConfig | ||
|
||
const { withSentryConfig } = require('@sentry/nextjs'); | ||
|
||
const moduleExports = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
eslint: { | ||
ignoreDuringBuilds: true, | ||
}, | ||
sentry: { | ||
// Suppress the warning message from `handleSourcemapHidingOptionWarning` in `src/config/webpack.ts` | ||
// TODO (v8): This can come out in v8, because this option will get a default value | ||
hideSourceMaps: false, | ||
}, | ||
}; | ||
const SentryWebpackPluginOptions = { | ||
dryRun: true, | ||
silent: true, | ||
}; | ||
|
||
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "testapp", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint" | ||
}, | ||
"dependencies": { | ||
"@sentry/nextjs": "file:../../../", | ||
"@vercel/nft": "latest", | ||
"next": "13.0.1", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"jest": "^29.3.1" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/nextjs/test/buildProcess/testApp/sentry.client.config.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
}); |
5 changes: 5 additions & 0 deletions
5
packages/nextjs/test/buildProcess/testApp/sentry.server.config.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as Sentry from '@sentry/nextjs'; | ||
|
||
Sentry.init({ | ||
dsn: 'https://public@dsn.ingest.sentry.io/1337', | ||
}); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"dogs": "are great" | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function MyApp({ Component, pageProps }) { | ||
return <Component {...pageProps} />; | ||
} | ||
|
||
export default MyApp; |
8 changes: 8 additions & 0 deletions
8
packages/nextjs/test/buildProcess/testApp/src/pages/api/dogs.js
This file contains 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import * as fs from 'fs'; | ||
import * as path from 'path'; | ||
|
||
export default function handler(req, res) { | ||
const dogData = JSON.parse(fs.readFileSync(path.resolve('../../dogs.json'))); | ||
dogData.test = 'something'; | ||
res.status(200).json(dogData); | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home() { | ||
return <div>This is the homepage.</div>; | ||
} |
Oops, something went wrong.