Skip to content

Commit b513a7a

Browse files
committed
initial implementation
1 parent 988b56c commit b513a7a

33 files changed

+18365
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
db.sqlite
133+
.DS_Store

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.11.0

.vscode/extensions.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
// See http://go.microsoft.com/fwlink/?LinkId=827846
3+
// for the documentation about the extensions.json format
4+
"recommendations": ["dbaeumer.vscode-eslint"]
5+
}

.vscode/settings.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true,
4+
"[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
5+
"[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
6+
"[typescriptreact]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode"
8+
},
9+
"search.exclude": {
10+
"packages/editor/public/types": true,
11+
"packages/website/docs/.vitepress": false,
12+
"**/.*": false
13+
},
14+
"typescript.tsdk": "node_modules/typescript/lib",
15+
"[xml]": {
16+
"editor.defaultFormatter": "redhat.vscode-xml"
17+
}
18+
}

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
# BlockNote-demo-nextjs-hocuspocus
1+
# BlockNote-demo-nextjs-hocuspocus
2+
3+
This is a demo of BlockNote with Next.js, HocusPocus with comments and thread storage handled via a REST API (built using Hono).
4+
5+
## Setup
6+
7+
The two projects are in the `hocuspocus-server` and `next-app` folders.
8+
(we didn't set up a monorepo for this demo).
9+
10+
Run `npm install` in both folders.
11+
12+
To run the server, run `npm run dev` in the `hocuspocus-server` folder.
13+
14+
To run the next app, run `npm run dev` in the `next-app` folder.

hocuspocus-server/.eslintrc.cjs

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
const typeScriptExtensions = [".ts", ".cts", ".mts", ".tsx"];
2+
3+
const allExtensions = [...typeScriptExtensions, ".js", ".jsx"];
4+
5+
module.exports = {
6+
root: true,
7+
extends: [
8+
"eslint:recommended",
9+
"plugin:@typescript-eslint/recommended",
10+
"react-app",
11+
"react-app/jest",
12+
],
13+
parser: "@typescript-eslint/parser",
14+
plugins: ["import", "@typescript-eslint"],
15+
settings: {
16+
"import/extensions": allExtensions,
17+
"import/external-module-folders": ["node_modules", "node_modules/@types"],
18+
"import/parsers": {
19+
"@typescript-eslint/parser": typeScriptExtensions,
20+
},
21+
"import/resolver": {
22+
node: {
23+
extensions: allExtensions,
24+
},
25+
},
26+
},
27+
ignorePatterns: ["**/ui/*"],
28+
rules: {
29+
"no-console": "error",
30+
curly: 1,
31+
"import/extensions": ["error", "always", { ignorePackages: true }],
32+
"import/no-extraneous-dependencies": [
33+
"error",
34+
{
35+
devDependencies: true,
36+
peerDependencies: true,
37+
optionalDependencies: false,
38+
bundledDependencies: false,
39+
},
40+
],
41+
// would be nice to enable these rules later, but they are too noisy right now
42+
"@typescript-eslint/no-non-null-assertion": "off",
43+
"@typescript-eslint/no-explicit-any": "off",
44+
"@typescript-eslint/ban-ts-comment": "off",
45+
"import/no-cycle": "error",
46+
// doesn't work:
47+
// "import/no-restricted-paths": [
48+
// "error",
49+
// {
50+
// zones: [
51+
// {
52+
// target: "./src/**/*",
53+
// from: "./types/**/*",
54+
// message: "Import from this module to types is not allowed.",
55+
// },
56+
// ],
57+
// },
58+
// ],
59+
},
60+
};

0 commit comments

Comments
 (0)