document-drive 1.17.2 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/package.json +11 -9
- package/src/server/index.ts +325 -232
- package/src/server/listener/manager.ts +136 -126
- package/src/server/listener/transmitter/pull-responder.ts +4 -11
- package/src/server/listener/transmitter/switchboard-push.ts +3 -12
- package/src/server/types.ts +114 -144
package/README.md
CHANGED
|
@@ -1 +1,84 @@
|
|
|
1
1
|
# Document Drive
|
|
2
|
+
|
|
3
|
+
### Quickstart
|
|
4
|
+
|
|
5
|
+
#### Prerequisites
|
|
6
|
+
|
|
7
|
+
First, ensure your node version is compatible:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=20"
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
For example, to use `20.10.0`:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx install 20.10.0
|
|
19
|
+
npx use 20.10.0
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Next, ensure you have PNPM 9 installed, _which is not the latest version_, and install packages
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npx pnpm@9 install
|
|
26
|
+
pnpm install
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Finally, create a `.env`:
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
cp .env.example .env
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### Testing
|
|
36
|
+
|
|
37
|
+
Many of our tests require Postgres to run. This is why we've included a `docker-compose.test.yml`. Spin it up:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
docker compose -f docker-compose.test.yml -d
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Then ensure that the db schema is up to date with:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
pnpm migrate
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Finally, run tests with:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
pnpm test
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Or run tests on a file watcher with:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
pnpm test:watch
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Troubleshooting
|
|
62
|
+
|
|
63
|
+
#### `package.json` scripts fail with "Cannot find module"
|
|
64
|
+
|
|
65
|
+
Remove modules from this project _and_ the parent project.
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
rm -rf node_modules ../node_modules
|
|
69
|
+
pnpm install
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### I need to clear the test database.
|
|
73
|
+
|
|
74
|
+
The `docker-compose` file is configured to mount the postgres volume to the local directory, `.db`. This makes clearing the db very easy:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
rm -rf .db
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Be sure to set the database up again with:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
pnpm migrate
|
|
84
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "document-drive",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./src/index.ts",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"nanoevents": "^9.0.0",
|
|
34
34
|
"prisma": "^5.18.0",
|
|
35
35
|
"sanitize-filename": "^1.6.3",
|
|
36
|
-
"@powerhousedao/scalars": "1.
|
|
37
|
-
"document-model
|
|
38
|
-
"document-model": "
|
|
36
|
+
"@powerhousedao/scalars": "1.23.0",
|
|
37
|
+
"document-model": "2.20.0",
|
|
38
|
+
"document-model-libs": "1.132.0"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"@prisma/client": "^5.18.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"redis": "^4.6.15",
|
|
45
45
|
"sequelize": "^6.37.3",
|
|
46
46
|
"sqlite3": "^5.1.7",
|
|
47
|
-
"@powerhousedao/scalars": "1.
|
|
47
|
+
"@powerhousedao/scalars": "1.23.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@prisma/client": "5.17.0",
|
|
@@ -65,18 +65,20 @@
|
|
|
65
65
|
"sqlite3": "^5.1.7",
|
|
66
66
|
"vitest-fetch-mock": "^0.3.0",
|
|
67
67
|
"webdriverio": "^9.0.9",
|
|
68
|
-
"document-model": "2.
|
|
69
|
-
"document-model-libs": "1.
|
|
68
|
+
"document-model": "2.20.0",
|
|
69
|
+
"document-model-libs": "1.132.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"check-types": "tsc --build",
|
|
73
|
+
"check-types:watch": "tsc --build --watch",
|
|
73
74
|
"postlint": "npm run check-types",
|
|
74
75
|
"lint": "eslint .",
|
|
75
76
|
"lint:nx": "eslint . --fix --quiet",
|
|
76
77
|
"release": "semantic-release",
|
|
77
78
|
"test": "vitest run --coverage --exclude \"test/flaky/**\"",
|
|
78
|
-
"test:watch": "vitest
|
|
79
|
+
"test:watch": "vitest --coverage --exclude \"test/flaky/**\"",
|
|
79
80
|
"clean": "rimraf dist",
|
|
80
|
-
"clean:node_modules": "rimraf node_modules"
|
|
81
|
+
"clean:node_modules": "rimraf node_modules",
|
|
82
|
+
"migrate": "prisma generate && prisma db push"
|
|
81
83
|
}
|
|
82
84
|
}
|