Skip to content

Commit a83bbfe

Browse files
committed
use pouchdb instead of pouchdb-browser...
for node compat - package is used also by `express` backend package
1 parent 11912b7 commit a83bbfe

File tree

8 files changed

+18
-24
lines changed

8 files changed

+18
-24
lines changed

packages/db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@nilock2/pouchdb-authentication": "^1.0.2",
3131
"@vue-skuilder/common": "workspace:*",
3232
"moment": "^2.29.4",
33-
"pouchdb-browser": "^9.0.0",
33+
"pouchdb": "^9.0.0",
3434
"pouchdb-find": "^9.0.0"
3535
},
3636
"devDependencies": {

packages/db/src/impl/pouch/adminDB.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pouch from 'pouchdb-browser';
1+
import pouch from 'pouchdb';
22
import { ENV } from '@vue-skuilder/common';
33
import {
44
pouchDBincludeCredentialsConfig,

packages/db/src/impl/pouch/classroomDB.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '@/core/interfaces/contentSource';
66
import { ClassroomConfig, ENV } from '@vue-skuilder/common';
77
import moment from 'moment';
8-
import pouch from 'pouchdb-browser';
8+
import pouch from 'pouchdb';
99
import {
1010
getCourseDB,
1111
getStartAndEndKeys,

packages/db/src/impl/pouch/courseAPI.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import pouch from 'pouchdb-browser';
1+
import pouch from 'pouchdb';
22
import { pouchDBincludeCredentialsConfig } from '.';
33
import { ENV } from '@vue-skuilder/common';
44
// import { DataShape } from '../..base-course/Interfaces/DataShape';

packages/db/src/impl/pouch/courseLookupDB.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
const courseLookupDBTitle = 'coursedb-lookup';
2-
import pouch from 'pouchdb-browser';
1+
import pouch from 'pouchdb';
32
import { ENV } from '@vue-skuilder/common';
43

4+
const courseLookupDBTitle = 'coursedb-lookup';
5+
56
interface CourseLookupDoc {
67
_id: string;
78
_rev: string;

packages/db/src/impl/pouch/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ import { ENV } from '@vue-skuilder/common';
33
// import { getCurrentUser } from '../../stores/useAuthStore';
44
import moment, { Moment } from 'moment';
55
import PouchDBAuth from '@nilock2/pouchdb-authentication';
6-
import pouch from 'pouchdb-browser';
6+
import pouch from 'pouchdb';
77
import PouchDBFind from 'pouchdb-find';
88
import process from 'process';
99
import { getUserDB } from './userDB';
1010
import { ScheduledCard } from '@/core/types/user';
1111

12-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
13-
(window as any).process = process; // required as a fix for pouchdb - see #18
12+
const isBrowser = typeof window !== 'undefined';
13+
14+
if (isBrowser) {
15+
(window as any).process = process; // required as a fix for pouchdb - see #18
16+
}
1417

1518
pouch.plugin(PouchDBAuth);
1619
pouch.plugin(PouchDBFind);

packages/db/src/impl/pouch/pouchdb-setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PouchDB from 'pouchdb-browser';
1+
import PouchDB from 'pouchdb';
22
import PouchDBFind from 'pouchdb-find';
33
import PouchDBAuth from '@nilock2/pouchdb-authentication';
44

yarn.lock

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5104,14 +5104,14 @@ __metadata:
51045104
languageName: unknown
51055105
linkType: soft
51065106

5107-
"@vue-skuilder/db@workspace:*, @vue-skuilder/db@workspace:packages/db":
5107+
"@vue-skuilder/db@workspace:*, @vue-skuilder/db@workspace:^, @vue-skuilder/db@workspace:packages/db":
51085108
version: 0.0.0-use.local
51095109
resolution: "@vue-skuilder/db@workspace:packages/db"
51105110
dependencies:
51115111
"@nilock2/pouchdb-authentication": "npm:^1.0.2"
51125112
"@vue-skuilder/common": "workspace:*"
51135113
moment: "npm:^2.29.4"
5114-
pouchdb-browser: "npm:^9.0.0"
5114+
pouchdb: "npm:^9.0.0"
51155115
pouchdb-find: "npm:^9.0.0"
51165116
tsup: "npm:^8.0.2"
51175117
typescript: "npm:~5.7.2"
@@ -5139,6 +5139,7 @@ __metadata:
51395139
"@typescript-eslint/eslint-plugin": "npm:^8.25.0"
51405140
"@typescript-eslint/parser": "npm:^8.25.0"
51415141
"@vue-skuilder/common": "workspace:^"
5142+
"@vue-skuilder/db": "workspace:^"
51425143
axios: "npm:^1.7.4"
51435144
babel-jest: "npm:^29.6.1"
51445145
cookie-parser: "npm:^1.4.7"
@@ -12523,17 +12524,6 @@ __metadata:
1252312524
languageName: node
1252412525
linkType: hard
1252512526

12526-
"pouchdb-browser@npm:^9.0.0":
12527-
version: 9.0.0
12528-
resolution: "pouchdb-browser@npm:9.0.0"
12529-
dependencies:
12530-
spark-md5: "npm:3.0.2"
12531-
uuid: "npm:8.3.2"
12532-
vuvuzela: "npm:1.0.3"
12533-
checksum: 10c0/559b70d08cfa8c8d0f166b27d21f8b745ec32f3db177e5c3e825782157ab02eafd1777702c56e72c020875f2a1ffe370287550db6636f4687bb3a856afab9e82
12534-
languageName: node
12535-
linkType: hard
12536-
1253712527
"pouchdb-collate@npm:9.0.0":
1253812528
version: 9.0.0
1253912529
resolution: "pouchdb-collate@npm:9.0.0"
@@ -12613,7 +12603,7 @@ __metadata:
1261312603
languageName: node
1261412604
linkType: hard
1261512605

12616-
"pouchdb@npm:9.0.0":
12606+
"pouchdb@npm:9.0.0, pouchdb@npm:^9.0.0":
1261712607
version: 9.0.0
1261812608
resolution: "pouchdb@npm:9.0.0"
1261912609
dependencies:

0 commit comments

Comments
 (0)