Skip to content

Commit ea256b7

Browse files
authored
Merge pull request #4 from karpolan/dev
Synch with latest "Create Next App" template
2 parents 317103d + 62fdf60 commit ea256b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3031
-2143
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/node_modules
55
/.pnp
66
.pnp.js
7+
.yarn/install-state.gz
78

89
# testing
910
/coverage
@@ -36,3 +37,4 @@ yarn-error.log*
3637

3738
# typescript
3839
*.tsbuildinfo
40+
next-env.d.ts

README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ Launches the test runner in the interactive watch mode.<br />
4343

4444
Builds the app for production or local development to the `.next` folder.<br />
4545

46-
### `yarn build:static` or `npm run build:static`
47-
48-
_Note: this is deprecated way to build the Next.js app!_
49-
50-
Builds the SSG (static site generator) version of the app in the `out` folder.<br />
51-
5246
## Deploy on Vercel
5347

5448
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.

app/auth/login/page.tsx

Lines changed: 0 additions & 50 deletions
This file was deleted.

app/auth/signup/page.tsx

Lines changed: 0 additions & 3 deletions
This file was deleted.

jest.config.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

jest.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import type { Config } from 'jest';
2+
import nextJest from 'next/jest.js';
3+
4+
// const nextJest = require('next/jest');
5+
6+
const createJestConfig = nextJest({
7+
// Provide the path to your Next.js app to load next.config.* and .env files in your test environment
8+
dir: './',
9+
});
10+
11+
// Add any custom config to be passed to Jest
12+
const customJestConfig: Config = {
13+
coverageProvider: 'v8',
14+
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
15+
moduleNameMapper: {
16+
// Handle module aliases
17+
'^@/(.*)$': '<rootDir>/$1',
18+
},
19+
// testEnvironment: 'jest-environment-jsdom',
20+
testEnvironment: 'jsdom',
21+
// transform: {
22+
// '.+\\.(css|styl|less|sass|scss)$': 'jest-css-modules-transform',
23+
// },
24+
};
25+
26+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
27+
module.exports = createJestConfig(customJestConfig);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Optional: configure or set up a testing framework before each test.
2-
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`
2+
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.*`
33

44
// Used for __tests__/testing-library.js
55
// Learn more: https://github.com/testing-library/jest-dom
6-
import '@testing-library/jest-dom/extend-expect';
6+
import '@testing-library/jest-dom';
77

88
// To get 'next/router' working with tests
99
jest.mock('next/router', () => require('next-router-mock'));

next.config.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

next.config.mjs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** @type {import('next').NextConfig} */
2+
3+
const nextConfig = {
4+
output: 'export', // Use this if you want to create "static generated website" (SSG), result in "/out" folder
5+
trailingSlash: true,
6+
images: { unoptimized: true },
7+
8+
env: {
9+
// TODO: You can add custom env variables here, also check .env.xxx file
10+
AUTHOR: 'KARPOLAN',
11+
// npm_package_name: process.env.npm_package_name,
12+
// npm_package_version: process.env.npm_package_version,
13+
},
14+
15+
reactStrictMode: true,
16+
// reactStrictMode: false,
17+
18+
// Note: redirects() is not working with "next export" :(
19+
// async redirects() {
20+
// const articleRedirects = ARTICLES.map((article) => {
21+
// const slug = article.replace(/ /g, '-');
22+
// return {
23+
// source: `/articles/${slug}`,
24+
// destination: `/article/${slug}`,
25+
// permanent: true,
26+
// };
27+
// });
28+
// return [...articleRedirects];
29+
// },
30+
};
31+
32+
export default nextConfig;

0 commit comments

Comments
 (0)