Skip to content

Commit 247f034

Browse files
committed
Initial commit
0 parents  commit 247f034

33 files changed

Lines changed: 6925 additions & 0 deletions

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Checklist(清单):
2+
3+
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x].(请遵循此清单,并在每个 [ ] 中输入 x,如下所示:[x]。) -->
4+
5+
- [ ] Labels
6+
- [ ] Assignees
7+
- [ ] Reviewers
8+
9+
<!--If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.(如果 pull request 关闭一个 GitHub issue,请用 GitHub issue 编号替换下面的 XXXXX)-->
10+
11+
Closes #XXXXX

.github/workflows/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI & CD
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
Build-and-Deploy:
8+
env:
9+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
16+
uses: actions/checkout@v2
17+
18+
- uses: amondnet/vercel-action@v20
19+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
20+
with:
21+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
24+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
25+
working-directory: ./
26+
vercel-args: --prod

.github/workflows/pull-request.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Pull Request
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
jobs:
7+
Build-and-Deploy:
8+
env:
9+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
10+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
11+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
16+
uses: actions/checkout@v2
17+
18+
- uses: amondnet/vercel-action@v20
19+
if: ${{ env.VERCEL_TOKEN && env.VERCEL_ORG_ID && env.VERCEL_PROJECT_ID }}
20+
with:
21+
vercel-token: ${{ secrets.VERCEL_TOKEN }}
22+
github-token: ${{ secrets.GITHUB_TOKEN }}
23+
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
24+
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
25+
working-directory: ./

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel
35+
36+
# typescript
37+
*.tsbuildinfo
38+
39+
# IDE
40+
.vscode/settings.json

.husky/pre-commit

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm test

.husky/pre-push

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
. "$(dirname "$0")/_/husky.sh"
4+
5+
npm run build

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug Jest",
6+
"type": "node",
7+
"request": "launch",
8+
"port": 9229,
9+
"runtimeArgs": [
10+
"--inspect-brk",
11+
"${workspaceRoot}/node_modules/jest/bin/jest.js",
12+
"--runInBand"
13+
],
14+
"console": "integratedTerminal",
15+
"internalConsoleOptions": "neverOpen"
16+
}
17+
]
18+
}

README.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Next-Bootstrap.ts
2+
3+
[React][1] project scaffold based on [TypeScript][2], [Next.js][3] & [Bootstrap][4]. And this project bootstrapped with [`create-next-app`][5].
4+
5+
[![NPM Dependency](https://david-dm.org/idea2app/next-bootstrap-ts.svg)][6]
6+
[![CI & CD](https://github.com/idea2app/next-bootstrap-ts/workflows/CI%20&%20CD/badge.svg)][7]
7+
8+
## Technology stack
9+
10+
- Language: [TypeScript v4][2]
11+
- Component engine: [Nextjs v12][3]
12+
- Component suite: [Bootstrap v5][4]
13+
- Test framework: [Jest][8] + [Playwright][9]
14+
- CI / CD: GitHub [Actions][10] + [Vercel][11]
15+
16+
## Getting Started
17+
18+
First, run the development server:
19+
20+
```bash
21+
npm run dev
22+
# or
23+
yarn dev
24+
```
25+
26+
Open http://localhost:3000 with your browser to see the result.
27+
28+
You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
29+
30+
[API routes][12] can be accessed on http://localhost:3000/api/hello. This endpoint can be edited in `pages/api/hello.ts`.
31+
32+
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes][12] instead of React pages.
33+
34+
## Learn More
35+
36+
To learn more about Next.js, take a look at the following resources:
37+
38+
- [Next.js Documentation][13] - learn about Next.js features and API.
39+
- [Learn Next.js][14] - an interactive Next.js tutorial.
40+
41+
You can check out [the Next.js GitHub repository][15] - your feedback and contributions are welcome!
42+
43+
## Deploy on Vercel
44+
45+
The easiest way to deploy your Next.js app is to use the [Vercel Platform][11] from the creators of Next.js.
46+
47+
Check out our [Next.js deployment documentation][16] for more details.
48+
49+
## End-to-End testing
50+
51+
### NPM script
52+
53+
```shell
54+
npm run e2e
55+
```
56+
57+
### VS Code
58+
59+
press <key>F5</key>
60+
61+
### Learn more
62+
63+
1. Runner & Assert framework: [Jest][8]
64+
2. Browser Operation library: [Playwright][9] & [its community][17]
65+
66+
[1]: https://reactjs.org/
67+
[2]: https://www.typescriptlang.org/
68+
[3]: https://nextjs.org/
69+
[4]: https://getbootstrap.com/
70+
[5]: https://github.com/vercel/next.js/tree/canary/packages/create-next-app
71+
[6]: https://david-dm.org/idea2app/next-bootstrap-ts
72+
[7]: https://github.com/idea2app/next-bootstrap-ts/actions
73+
[8]: https://jestjs.io/
74+
[9]: https://playwright.dev/
75+
[10]: https://github.com/features/actions
76+
[11]: https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme
77+
[12]: https://nextjs.org/docs/api-routes/introduction
78+
[13]: https://nextjs.org/docs
79+
[14]: https://nextjs.org/learn
80+
[15]: https://github.com/vercel/next.js/
81+
[16]: https://nextjs.org/docs/deployment
82+
[17]: https://playwright.tech/

components/Editor.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { Editor as Core, EditorProps } from 'idea-react';
2+
3+
import List from '@editorjs/list';
4+
import Code from '@editorjs/code';
5+
import LinkTool from '@editorjs/link';
6+
import Image from '@editorjs/image';
7+
import Header from '@editorjs/header';
8+
import Quote from '@editorjs/quote';
9+
10+
const Tools = {
11+
list: List,
12+
code: Code,
13+
linkTool: LinkTool,
14+
image: Image,
15+
header: Header,
16+
quote: Quote,
17+
};
18+
19+
export default function Editor(props: Omit<EditorProps, 'tools'>) {
20+
return <Core tools={Tools} {...props} />;
21+
}

0 commit comments

Comments
 (0)