-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2b89aed
Showing
90 changed files
with
16,878 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": [ | ||
["@babel/preset-env", {"targets": {"node": "current"}}], | ||
"@babel/preset-typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"unused-imports" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"warn", | ||
{ | ||
"argsIgnorePattern": "^_", | ||
"varsIgnorePattern": "^_", | ||
"caughtErrorsIgnorePattern": "^_" | ||
} | ||
], | ||
"eqeqeq": "off", | ||
"import/no-anonymous-default-export": "off", | ||
"unused-imports/no-unused-imports": "error", | ||
"quotes": [ | ||
"error", | ||
"double" | ||
], | ||
"semi": [ | ||
"error", | ||
"never" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/dist | ||
|
||
# editor | ||
.idea | ||
.vscode | ||
*.code-workspace | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.svd | ||
*.userprefs | ||
*.csproj | ||
*.pidb | ||
*.user | ||
*.unityproj | ||
*.booproj | ||
ExportedObj/ | ||
*.xcuserstate | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.eslintcache | ||
|
||
# log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"bracketSpacing": false, | ||
"trailingComma": "es5", | ||
"arrowParens": "avoid" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# nb-crdt | ||
|
||
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/notebox) | ||
|
||
A block based Conflict-free Replicated Data Type that enables collaborative editing across multiple participants allowing for flexible data sharing across spreadsheets, boards, rich text, and more. | ||
|
||
## Development | ||
|
||
### Prerequisites | ||
``` | ||
npm install | ||
``` | ||
|
||
### Test | ||
``` | ||
npm test | ||
``` | ||
|
||
## Checkout Points | ||
for synchronization, just investigate | ||
- `domain/entity/block` | ||
- `domain/entity/contribution` | ||
|
||
for making an editor, all the interfaces you need are in | ||
- `domain/usecase/replica` | ||
|
||
## Key Concepts | ||
- `replicaID` | ||
- is an identifier for writers or devices | ||
- `note` | ||
- consists of `blocks` | ||
- `block` | ||
- `block-props` | ||
- nested json object for block properties | ||
- each leaf has its own stamp | ||
- `replicaID` | ||
- `timestamp` | ||
- `text` | ||
- consists of `spans` | ||
- `span` | ||
- `point` | ||
- position identifier | ||
- `content` | ||
- `attrs` | ||
- length | ||
- `text-props` | ||
- flat json object | ||
- `stamp` | ||
- string (UTF16) | ||
- `version` | ||
- per `replicaID` | ||
- `block-props` version | ||
- `text-points` or `DB_RECORD-point` version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"testEnvironment": "node", | ||
"roots": ["<rootDir>/src"], | ||
"coveragePathIgnorePatterns": ["<rootDir>/dist/"], | ||
"testMatch": [ | ||
"<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}", | ||
"<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}" | ||
], | ||
"moduleNameMapper": { | ||
"@/(.*)": "<rootDir>/src/$1" | ||
} | ||
} |
Oops, something went wrong.