Skip to content

Commit

Permalink
feat: next web init, nextjs 12
Browse files Browse the repository at this point in the history
  • Loading branch information
LeezQ committed Nov 4, 2022
1 parent 598a1ff commit 0fb3ab8
Show file tree
Hide file tree
Showing 11 changed files with 329 additions and 1,999 deletions.
120 changes: 0 additions & 120 deletions .vscode/settings.json

This file was deleted.

38 changes: 1 addition & 37 deletions packages/next-web/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
{
"extends": ["next", "next/core-web-vitals"],
"rules": {
"no-alert": "error",
"react/no-children-prop": 0,
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"@next/next/no-img-element": 0
},
"plugins": ["simple-import-sort"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"rules": {
"simple-import-sort/imports": [
"error",
{
"groups": [
// Packages `react` related packages come first.
["^react", "^@?\\w"],
["^(@chakra-ui)/(/.*|$/)"],
// Internal packages.
["^(@/components|@/constants|@/utils)(/.*|$)"],
// Side effect imports.
["^\\u0000"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
["^(./store)(/.*|$)"],
// Style imports.
["^.+\\.?(css|scss)$"]
]
}
]
}
}
]
"extends": "next/core-web-vitals"
}
94 changes: 19 additions & 75 deletions packages/next-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,79 +11,23 @@ pnpm run dev

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

tree:
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.

```
.
├── README.md
├── components
│   ├── Header
│   │   └── index.tsx
│   └── Layout
│   ├── Basic.tsx
│   └── Function.tsx
├── constants
│   └── index.ts
├── locales
│   ├── en
│   │   └── message.js
│   └── zh-CN
│   └── message.js
├── next-env.d.ts
├── next.config.js
├── package.json
├── pages
│   ├── _app.tsx
│   ├── _document.tsx
│   ├── api
│   │   ├── app.ts
│   │   └── response.ts
│   ├── app
│   │   ├── [id]
│   │   │   ├── databases
│   │   │   │   └── index.tsx
│   │   │   ├── functions
│   │   │   │   ├── [function_id].tsx
│   │   │   │   ├── index.module.scss
│   │   │   │   ├── mockFuncTextString.tsx
│   │   │   │   ├── mods
│   │   │   │   │   ├── CreateModal
│   │   │   │   │   │   └── index.tsx
│   │   │   │   │   ├── DebugPannel
│   │   │   │   │   │   └── index.tsx
│   │   │   │   │   ├── DependecePanel
│   │   │   │   │   │   ├── index.module.scss
│   │   │   │   │   │   └── index.tsx
│   │   │   │   │   ├── FunctionPanel
│   │   │   │   │   │   ├── index.module.scss
│   │   │   │   │   │   └── index.tsx
│   │   │   │   │   └── List
│   │   │   │   │   └── index.tsx
│   │   │   │   └── store.ts
│   │   │   ├── index.tsx
│   │   │   ├── mods
│   │   │   │   └── SiderBar
│   │   │   │   ├── index.module.scss
│   │   │   │   └── index.tsx
│   │   │   └── storages
│   │   │   └── index.tsx
│   │   ├── index.tsx
│   │   └── mods
│   │   └── CrateDialog
│   │   └── index.tsx
│   ├── globals.css
│   ├── home
│   │   └── index.tsx
│   └── index.tsx
├── pnpm-lock.yaml
├── postcss.config.js
├── public
│   ├── favicon.ico
│   ├── logo.png
│   └── vercel.svg
├── tailwind.config.js
├── tsconfig.json
└── utils
├── i18n.ts
└── request.ts
```
[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.ts`.

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.
8 changes: 3 additions & 5 deletions packages/next-web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
experimental: {
newNextLinkBehavior: true,
// fallbackNodePolyfills: false
appDir: true,
},
};
}

module.exports = nextConfig;
module.exports = nextConfig
23 changes: 3 additions & 20 deletions packages/next-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,26 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@chakra-ui/icons": "^2.0.11",
"@chakra-ui/react": "^2.3.6",
"@emotion/react": "^11",
"@emotion/styled": "^11",
"@lingui/cli": "3.14.0",
"@lingui/core": "^3.14.0",
"@lingui/macro": "3.14.0",
"@lingui/react": "3.14.0",
"@monaco-editor/react": "^4.4.6",
"@tanstack/react-query": "^4.13.0",
"axios": "^1.1.3",
"click-to-react-component": "^1.0.8",
"clsx": "^1.2.1",
"framer-motion": "^6",
"immer": "^9.0.16",
"next": "12.3.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"sass": "^1.55.0",
"zustand": "^4.1.4"
"react-dom": "18.2.0"
},
"devDependencies": {
"@types/node": "18.11.7",
"@types/react": "18.0.23",
"@types/react-dom": "18.0.7",
"autoprefixer": "^10.4.13",
"eslint": "8.26.0",
"eslint-config-next": "12.3.1",
"eslint-plugin-simple-import-sort": "^8.0.0",
"postcss": "^8.4.18",
"tailwindcss": "^3.2.1",
"typescript": "4.8.4"
}
}
}
Loading

0 comments on commit 0fb3ab8

Please sign in to comment.