Skip to content

Commit 3a90a3e

Browse files
committed
docs: ✏️ Examples update
1 parent 5f8a7d7 commit 3a90a3e

Some content is hidden

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

63 files changed

+2744
-2203
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ yarn-error.log*
4747
Thumbs.db
4848

4949
# testing
50-
coverage
50+
coverage
51+
52+
# Next.js
53+
.next

examples/next/.eslintrc.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"extends": ["plugin:@nrwl/nx/react-typescript", "next", "next/core-web-vitals", "../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*", ".next/**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {
8+
"@next/next/no-html-link-for-pages": ["error", "examples/next/pages"]
9+
}
10+
},
11+
{
12+
"files": ["*.ts", "*.tsx"],
13+
"rules": {}
14+
},
15+
{
16+
"files": ["*.js", "*.jsx"],
17+
"rules": {}
18+
}
19+
],
20+
"rules": {
21+
"@next/next/no-html-link-for-pages": "off"
22+
},
23+
"env": {
24+
"jest": true
25+
}
26+
}
File renamed without changes.

examples/nextjs/api/index.ts renamed to examples/next/api/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { setupWorker } from "msw";
2-
import { setupServer } from "msw/lib/node";
2+
import { setupServer } from "msw/node";
3+
34
import { handlers } from "./mocks";
45

56
export * from "./builder";
File renamed without changes.

examples/nextjs/assets/index.css renamed to examples/next/assets/index.css

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
body {
2+
display: unset !important;
23
margin: 0;
34
}
45

File renamed without changes.

examples/nextjs/components/sidebar.tsx renamed to examples/next/components/sidebar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ListItemButton from "@mui/material/ListItemButton";
66
import ListItemText from "@mui/material/ListItemText";
77
import { useRouter } from "next/router";
88

9-
import { DETAILS_PAGE, FORM_PAGE, LIST_PAGE } from "constants/routing.constants";
9+
import { DETAILS_PAGE, FORM_PAGE, LIST_PAGE } from "../constants/routing.constants";
1010

1111
const links = [DETAILS_PAGE, LIST_PAGE, FORM_PAGE];
1212
const drawerWidth = 240;
File renamed without changes.

examples/next/jest.config.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* eslint-disable */
2+
export default {
3+
displayName: "next",
4+
preset: "../../jest.preset.js",
5+
transform: {
6+
"^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "@nrwl/react/plugins/jest",
7+
"^.+\\.[tj]sx?$": "babel-jest",
8+
},
9+
moduleFileExtensions: ["ts", "tsx", "js", "jsx"],
10+
coverageDirectory: "../../coverage/examples/next",
11+
};
File renamed without changes.
File renamed without changes.

examples/nextjs/next.config.js renamed to examples/next/next.config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
//@ts-check
2+
13
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const withNx = require("@nrwl/next/plugins/with-nx");
4+
const { withNx } = require("@nrwl/next/plugins/with-nx");
35

46
/**
57
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
File renamed without changes.
File renamed without changes.

examples/nextjs/pages/details/details.page.tsx renamed to examples/next/pages/details/details.page.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import IconButton from "@mui/material/IconButton";
77
import RefreshIcon from "@mui/icons-material/Refresh";
88
import PlayArrowIcon from "@mui/icons-material/PlayArrow";
99
import StopIcon from "@mui/icons-material/Stop";
10-
import { Viewer } from "components/viewer";
11-
import { Request } from "components/request";
12-
import { getUser } from "api";
10+
11+
import { Viewer } from "../../components/viewer";
12+
import { Request } from "../../components/request";
13+
import { getUser } from "../../api";
1314

1415
const refreshTime = DateInterval.second * 10;
1516
const initialDate = +new Date();

examples/nextjs/pages/form/form.page.tsx renamed to examples/next/pages/form/form.page.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import React from "react";
33
import { Box, Button, Typography } from "@mui/material";
44
import { useSubmit, useQueue } from "@hyper-fetch/react";
5-
import { patchUser, postUser, postFile } from "api";
6-
import { Request } from "components/request";
7-
import { Viewer } from "components/viewer";
8-
import { RequestCard } from "components/request.card";
5+
6+
import { patchUser, postUser, postFile } from "../../api";
7+
import { Request } from "../../components/request";
8+
import { Viewer } from "../../components/viewer";
9+
import { RequestCard } from "../../components/request.card";
910

1011
export const FormPage: React.FC = () => {
1112
// Post
File renamed without changes.

examples/nextjs/pages/list/list.page.tsx renamed to examples/next/pages/list/list.page.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import { useFetch } from "@hyper-fetch/react";
44
import TextField from "@mui/material/TextField";
55
import { Button, IconButton, Stack } from "@mui/material";
66
import RefreshIcon from "@mui/icons-material/Refresh";
7-
import { getUsers } from "api";
8-
import { Request } from "components/request";
9-
import { Viewer } from "components/viewer";
7+
8+
import { getUsers } from "../../api";
9+
import { Request } from "../../components/request";
10+
import { Viewer } from "../../components/viewer";
1011

1112
const initialDate = +new Date();
1213

examples/nextjs/project.json renamed to examples/next/project.json

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
11
{
2+
"name": "next",
23
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3-
"sourceRoot": "examples/nextjs",
4+
"sourceRoot": "examples/next",
45
"projectType": "application",
56
"targets": {
67
"build": {
78
"executor": "@nrwl/next:build",
89
"outputs": ["{options.outputPath}"],
910
"defaultConfiguration": "production",
1011
"options": {
11-
"root": "examples/nextjs",
12-
"outputPath": "dist/examples/nextjs"
12+
"root": "examples/next",
13+
"outputPath": "dist/examples/next"
1314
},
1415
"configurations": {
15-
"development": {}
16+
"development": {
17+
"outputPath": "examples/next"
18+
},
19+
"production": {}
1620
}
1721
},
1822
"serve": {
1923
"executor": "@nrwl/next:server",
2024
"defaultConfiguration": "development",
2125
"options": {
22-
"buildTarget": "nextjs:build",
26+
"buildTarget": "next:build",
2327
"dev": true
2428
},
2529
"configurations": {
2630
"development": {
27-
"buildTarget": "nextjs:build:development",
31+
"buildTarget": "next:build:development",
2832
"dev": true
33+
},
34+
"production": {
35+
"buildTarget": "next:build:production",
36+
"dev": false
2937
}
3038
}
3139
},
3240
"export": {
3341
"executor": "@nrwl/next:export",
3442
"options": {
35-
"buildTarget": "nextjs:build:production"
43+
"buildTarget": "next:build:production"
44+
}
45+
},
46+
"test": {
47+
"executor": "@nrwl/jest:jest",
48+
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
49+
"options": {
50+
"jestConfig": "examples/next/jest.config.ts",
51+
"passWithNoTests": true
3652
}
3753
},
3854
"lint": {
3955
"executor": "@nrwl/linter:eslint",
4056
"outputs": ["{options.outputFile}"],
4157
"options": {
42-
"lintFilePatterns": ["examples/nextjs/**/*.{ts,tsx,js,jsx}"]
58+
"lintFilePatterns": ["examples/next/**/*.{ts,tsx,js,jsx}"]
4359
}
4460
}
4561
},

examples/next/public/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)