Skip to content

Commit 85b5f61

Browse files
authored
Convert to pnpm (#1611)
* Converted to pnpm * Upgrade dreambase-library for TSON-simplified fix * Converted travis scripts to use pnpm * Switched to pnpm in scripts and documentation * Update node in travis ci * Adding missing dev dep: webpack * reinstalled webpack in test-dexie-relationships * Trying to workaround pnpm bug
1 parent bd2ae88 commit 85b5f61

File tree

33 files changed

+4451
-5241
lines changed

33 files changed

+4451
-5241
lines changed

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers=true

.travis.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
cache:
2+
npm: false
3+
directories:
4+
- "~/.pnpm-store"
5+
before_install:
6+
- curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
7+
- pnpm config set store-dir ~/.pnpm-store
8+
install:
9+
- pnpm install
110
language: node_js
2-
before_install: if [[ `npm -v` != 7* ]]; then npm i -g npm@7; fi
311
addons:
412
firefox: "85.0"
513
node_js:
6-
- "12"
14+
- "16"
715
matrix:
816
fast_finish: true
917
services:
@@ -24,7 +32,7 @@ branches:
2432
- master-2
2533
- master-1
2634
script:
27-
- npm run build
35+
- pnpm run build
2836
- cd $TF
2937
- pwd
3038
- bash ./travis.sh

CONTRIBUTING.md

+16-11
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ We appreciate contributions in forms of:
1313
Contribute while developing your own app
1414
========================================
1515

16-
Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie --save` for the app your are developing.
16+
Dexie uses pnpm package manager. Refer to [pnpm.io/installation](https://pnpm.io/installation) for how to install pnpm.
17+
18+
Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie` for the app your are developing.
1719

1820
1. Fork Dexie.js from the web gui on github
1921
2. Clone your fork locally by launching a shell/command window and cd to a neutral place (like `~repos/`, `c:\repos` or whatever)
@@ -22,39 +24,42 @@ Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie`
2224
```
2325
git clone https://github.com/YOUR-USERNAME/Dexie.js.git dexie
2426
cd dexie
25-
npm install
26-
npm run build
27-
npm link
27+
pnpm install
28+
pnpm run build
29+
npm link # Or yarn link or pnpm link --global depending on what package manager you are using.
2830
```
2931
3. cd to your app directory and write:
3032
```
31-
npm link dexie
33+
npm link dexie # Or yarn link dexie / pnpm link dexie depending on your package manager.
3234
```
3335
34-
Your app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `npm run build` or `npm run watch`. The latter will react on any source file change and rebuild the dist files.
36+
Your app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `pnpm run build` or `pnpm run watch`. The latter will react on any source file change and rebuild the dist files.
3537
3638
That's it. Now you're up and running to test and commit changes to files under dexie/src/* or dexie/test/* and the changes will instantly affect the app you are developing.
3739
40+
If you're on yarn or pnpm, do the same procedures using yarn link / pnpm link.
41+
3842
Pull requests are more than welcome. Some advices are:
3943
40-
* Run npm test before making a pull request.
44+
* Run pnpm test before making a pull request.
4145
* If you find an issue, a unit test that reproduces it is lovely ;). If you don't know where to put it, put it in `test/tests-misc.js`. We use qunit. Just look at existing tests in `tests-misc.js` to see how they should be written. Tests are transpiled in the build script so you can use ES6 if you like.
4246
4347
Build
4448
-----
4549
```
46-
npm install
47-
npm run build
50+
# To install pnpm, see https://pnpm.io/installation
51+
pnpm install
52+
pnpm run build
4853
```
4954
5055
Test
5156
----
5257
```
53-
npm test
58+
pnpm test
5459
```
5560
5661
Watch
5762
-----
5863
```
59-
npm run watch
64+
pnpm run watch
6065
```

README.md

+5-30
Original file line numberDiff line numberDiff line change
@@ -229,50 +229,25 @@ https://unpkg.com/dexie@latest/dist/dexie.d.ts
229229
230230
Contributing
231231
============
232-
Here is a little cheat-sheet for how to symlink your app's `node_modules/dexie` to a place where you can edit the source, version control your changes and create pull requests back to Dexie. Assuming you've already ran `npm install dexie --save` for the app your are developing.
233-
234-
1. Fork Dexie.js from the web gui on github
235-
2. Clone your fork locally by launching a shell/command window and cd to a neutral place (like `~repos/`, `c:\repos` or whatever)
236-
3. Run the following commands:
237-
238-
```
239-
git clone https://github.com/YOUR-USERNAME/Dexie.js.git dexie
240-
cd dexie
241-
npm install
242-
npm run build
243-
npm link
244-
```
245-
3. cd to your app directory and write:
246-
```
247-
npm link dexie
248-
```
249-
250-
Your app's `node_modules/dexie/` is now sym-linked to the Dexie.js clone on your hard drive so any change you do there will propagate to your app. Build dexie.js using `npm run build` or `npm run watch`. The latter will react on any source file change and rebuild the dist files.
251-
252-
That's it. Now you're up and running to test and commit changes to files under dexie/src/* or dexie/test/* and the changes will instantly affect the app you are developing.
253-
254-
Pull requests are more than welcome. Some advices are:
255-
256-
* Run npm test before making a pull request.
257-
* If you find an issue, a unit test that reproduces it is lovely ;). If you don't know where to put it, put it in `test/tests-misc.js`. We use qunit. Just look at existing tests in `tests-misc.js` to see how they should be written. Tests are transpiled in the build script so you can use ES6 if you like.
232+
See [CONTRIBUTING.md](CONTRIBUTING.md)
258233
259234
Build
260235
-----
261236
```
262-
npm install
263-
npm run build
237+
pnpm install
238+
pnpm run build
264239
```
265240
266241
Test
267242
----
268243
```
269-
npm test
244+
pnpm test
270245
```
271246
272247
Watch
273248
-----
274249
```
275-
npm run watch
250+
pnpm run watch
276251
```
277252
278253

addons/Dexie.Observable/package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "dexie-observable",
33
"version": "4.0.0-beta.13",
4+
"packageManager": "^[email protected]",
45
"description": "Addon to Dexie that makes it possible to observe database changes no matter if they occur on other db instance or other window.",
56
"main": "dist/dexie-observable.js",
67
"module": "dist/dexie-observable.es.js",
@@ -36,7 +37,7 @@
3637
"scripts": {
3738
"build": "just-build",
3839
"watch": "just-build --watch",
39-
"test": "npm run build && npm run test:typings && npm run test:unit && npm run test:integration",
40+
"test": "pnpm run build && pnpm run test:typings && pnpm run test:unit && pnpm run test:integration",
4041
"test:unit": "karma start test/unit/karma.conf.js --single-run",
4142
"test:integration": "karma start test/integration/karma.conf.js --single-run",
4243
"test:typings": "just-build test-typings",
@@ -69,22 +70,22 @@
6970
],
7071
"test": [
7172
"# Build the unit tests (integration tests need no build)",
72-
"tsc --allowJs --moduleResolution node --lib es2015,dom -t es5 -m es2015 --outDir tools/tmp/es5/test --rootDir ../.. --sourceMap test/unit/unit-tests-all.js [--watch 'Compilation complete.']",
73-
"rollup -c tools/build-configs/rollup.tests.config.js",
74-
"eslint test/unit --cache --ignore-pattern bundle.js"
73+
"tsc --allowJs --moduleResolution node --lib es2018,dom -t es5 -m es2015 --outDir tools/tmp/es5/test --rootDir ../.. --sourceMap test/unit/unit-tests-all.js [--watch 'Compilation complete.']",
74+
"rollup -c tools/build-configs/rollup.tests.config.js"
7575
],
7676
"test-typings": [
7777
"tsc -p test/typings/"
7878
]
7979
},
8080
"homepage": "https://dexie.org",
8181
"peerDependencies": {
82-
"dexie": "^3.0.2 || ^4.0.0-alpha.1"
82+
"dexie": "workspace:^3.0.2 || ^4.0.0-alpha.1"
8383
},
8484
"devDependencies": {
85-
"dexie": "^3.0.2 || ^4.0.0-alpha.1",
85+
"@types/node": "^18.7.14",
86+
"dexie": "workspace:^3.0.2 || ^4.0.0-alpha.1",
8687
"eslint": "^7.27.0",
87-
"just-build": "^0.9.19",
88+
"just-build": "^0.9.24",
8889
"qunit": "^2.9.2",
8990
"uglify-js": "^3.5.6"
9091
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash -e
22
echo "Installing dependencies for dexie-observable"
3-
npm install >/dev/null
4-
npm run build
5-
npm run test:integration
3+
pnpm install >/dev/null
4+
pnpm run build
5+
pnpm run test:integration

addons/Dexie.Observable/test/typings/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"strictNullChecks": true,
77
"outDir": "../../tools/tmp/test-typings",
88
"moduleResolution": "node",
9-
"lib": ["dom", "es2015"]
9+
"lib": ["dom", "es2018"]
1010
},
1111
"files": [
1212
"test-typings.ts"
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -e
22
echo "Installing dependencies for dexie-observable"
3-
npm install >/dev/null
4-
npm run build
5-
npm run test:typings
6-
npm run test:unit
3+
pnpm install >/dev/null
4+
pnpm run build
5+
pnpm run test:typings
6+
pnpm run test:unit

addons/Dexie.Syncable/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "dexie-syncable",
33
"version": "4.0.0-beta.13",
4+
"packageManager": "^[email protected]",
45
"description": "Addon to Dexie that makes it possible to sync indexeDB with remote databases.",
56
"main": "dist/dexie-syncable.js",
67
"module": "dist/dexie-syncable.es.js",
@@ -35,7 +36,7 @@
3536
"scripts": {
3637
"build": "just-build",
3738
"watch": "just-build --watch",
38-
"test": "npm run build && npm run test:typings && npm run test:unit && npm run test:integration",
39+
"test": "pnpm run build && pnpm run test:typings && pnpm run test:unit && pnpm run test:integration",
3940
"test:unit": "karma start test/unit/karma.conf.js --single-run",
4041
"test:integration": "karma start test/integration/karma.conf.js --single-run",
4142
"test:typings": "tsc -p test/test-typings/",
@@ -70,14 +71,14 @@
7071
},
7172
"homepage": "https://dexie.org",
7273
"peerDependencies": {
73-
"dexie": "^3.0.2 || ^4.0.0-alpha.1",
74-
"dexie-observable": "^3.0.0-beta.9"
74+
"dexie": "workspace:^3.0.2 || ^4.0.0-alpha.1",
75+
"dexie-observable": "workspace:^"
7576
},
7677
"devDependencies": {
77-
"dexie": "^3.0.2 || ^4.0.0-alpha.1",
78-
"dexie-observable": "^3.0.0-beta.9",
78+
"dexie": "workspace:^3.0.2 || ^4.0.0-alpha.1",
79+
"dexie-observable": "workspace:^",
7980
"eslint": "^5.16.0",
80-
"just-build": "^0.9.19",
81+
"just-build": "^0.9.24",
8182
"qunit": "^2.9.2",
8283
"uglify-js": "^3.5.6"
8384
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/bin/bash -e
22
cd ../../../Dexie.Observable
33
echo "Installing dependencies for dexie-observable"
4-
npm install >/dev/null
4+
pnpm install >/dev/null
55
echo "Building dexie-observable"
6-
npm run build
6+
pnpm run build
77
cd -
88
echo "Installing dependencies for dexie-syncable"
9-
npm install >/dev/null
9+
pnpm install >/dev/null
1010
echo "Building dexie-syncable"
11-
npm run build
11+
pnpm run build
1212

13-
npm run test:integration
13+
pnpm run test:integration
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash -e
22
cd ../../../Dexie.Observable
33
echo "Installing dependencies for dexie-observable"
4-
npm install >/dev/null
4+
pnpm install >/dev/null
55
echo "Building dexie-observable"
6-
npm run build
6+
pnpm run build
77
cd -
88
echo "Installing dependencies for dexie-syncable"
9-
npm install >/dev/null
9+
pnpm install >/dev/null
1010
echo "Building dexie-syncable"
11-
npm run build
11+
pnpm run build
1212

13-
npm run test:typings
14-
npm run test:unit
13+
pnpm run test:typings
14+
pnpm run test:unit

addons/dexie-cloud/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "dexie-cloud-addon",
33
"version": "4.0.0-beta.21",
4+
"packageManager": "^[email protected]",
45
"description": "Dexie addon that syncs with to Dexie Cloud",
56
"main": "dist/umd/dexie-cloud-addon.js",
67
"module": "dist/module-es5/dexie-cloud-addon.js",
@@ -21,7 +22,7 @@
2122
"url": "https://github.com/dexie/Dexie.js.git"
2223
},
2324
"scripts": {
24-
"test": "just-build test && npm run test-unit",
25+
"test": "just-build test && pnpm run test-unit",
2526
"test-unit": "karma start test/unit/karma.conf.js --single-run",
2627
"build": "just-build && bash ./copydts.sh",
2728
"watch": "just-build --watch",
@@ -87,7 +88,7 @@
8788
"@rollup/plugin-commonjs": "^18.0.0",
8889
"@rollup/plugin-node-resolve": "^11.2.1",
8990
"@types/node": "*",
90-
"dreambase-library": "^1.0.13",
91+
"dreambase-library": "^1.0.18",
9192
"just-build": "*",
9293
"karma": "*",
9394
"karma-browserstack-launcher": "*",
@@ -106,10 +107,10 @@
106107
"universal-imports": "^1.0.3"
107108
},
108109
"dependencies": {
109-
"dexie-cloud-common": "^1.0.23"
110+
"dexie-cloud-common": "workspace:^1.0.23"
110111
},
111112
"peerDependencies": {
112-
"dexie": "^4.0.0-alpha.3",
113+
"dexie": "workspace:^4.0.0-alpha.3",
113114
"rxjs": "^7.x"
114115
}
115116
}

addons/dexie-cloud/src/default-ui/LoginDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function LoginDialog({
1818
}: DXCGenericUserInteraction<string, { [name: string]: DXCInputField }>) {
1919
const [params, setParams] = useState<{ [param: string]: string }>({});
2020

21-
const firstFieldRef = useRef<HTMLInputElement>();
21+
const firstFieldRef = useRef<HTMLInputElement>(null);
2222
useLayoutEffect(()=>firstFieldRef.current?.focus(), []);
2323

2424
return (

addons/dexie-cloud/test/tsconfig.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
{
22
"compilerOptions": {
3-
"jsx": "react",
4-
"jsxFactory": "h",
5-
"jsxFragmentFactory": "Fragment",
6-
"target": "es5",
73
"module": "es2015",
4+
"target": "ES5",
5+
"declaration": true,
86
"importHelpers": true,
97
"strictNullChecks": true,
108
"noImplicitAny": false,
119
"noImplicitReturns": true,
1210
"moduleResolution": "node",
13-
"lib": ["es2018", "dom"],
11+
"lib": ["ES2018", "DOM"],
1412
"forceConsistentCasingInFileNames": true,
15-
"outDir": "../tools/tmp/",
1613
"sourceMap": true,
1714
"rootDir": "..",
18-
"downlevelIteration": true
15+
"jsx": "react",
16+
"jsxFactory": "h",
17+
"jsxFragmentFactory": "Fragment",
18+
"downlevelIteration": true,
19+
"outDir": "../tools/tmp/",
1920
},
2021
"include": [
2122
"../src/",

0 commit comments

Comments
 (0)