Skip to content

Commit 6dbb668

Browse files
committed
Convert to TypeScript and pnpm
1 parent f67c842 commit 6dbb668

File tree

11 files changed

+3202
-138
lines changed

11 files changed

+3202
-138
lines changed

.changeset/weak-cats-accept.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"homebridge-roomba2": minor
3+
---
4+
5+
Convert to using TypeScript and pnpm for development

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
22
package-lock.json
3+
/dist
4+
/*.tgz

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*.md
2+
/.changeset
3+
/src
4+
/.nvmrc
5+
/.eslintrc.js
6+
/tsconfig.json
7+
/*.tgz
8+
/pnpm-lock.yaml

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,50 @@ With `autoRefreshEnabled` set to `true` the plugin will connect to Roomba every
9898

9999
With `autoRefreshEnabled` and `keepAlive` both set to `false` the plugin connects to Roomba when its status is requested by HomeKit. This will cause HomeKit to show an "Updating" status for your Roomba until its status is returned.
100100

101+
## Building
102+
103+
The homebridge-roomba2 plugin uses [TypeScript](https://www.typescriptlang.org), [`pnpm`](https://pnpm.io) and
104+
[`nvm`](https://github.com/nvm-sh/nvm).
105+
106+
`nvm` is used to control the version of node used. You can skip the `nvm` step if you manage your own
107+
node versions.
108+
109+
Use `nvm` to select the required node version:
110+
111+
```shell
112+
nvm use
113+
```
114+
115+
or, if you don't have the required node version installed:
116+
117+
```shell
118+
nvm install
119+
```
120+
121+
Install `pnpm`, if you haven't already:
122+
123+
```shell
124+
npm -g install pnpm
125+
```
126+
127+
Prepare the project:
128+
129+
```shell
130+
pnpm install
131+
```
132+
133+
Build the project:
134+
135+
```shell
136+
pnpm build
137+
```
138+
139+
or
140+
141+
```shell
142+
pnpm watch
143+
```
144+
101145
## Credits
102146

103147
STVMallen - [Original plugin](https://github.com/stvmallen/homebridge-roomba-stv)

package.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@
2424
"Roomba"
2525
],
2626
"license": "MIT",
27-
"main": "",
27+
"main": "./dist/index.js",
2828
"repository": {
2929
"type": "git",
3030
"url": "git://github.com/karlvr/homebridge-roomba2.git"
3131
},
3232
"scripts": {
33-
"getrobotpwd": "cd node_modules/dorita980 && npm install && node ./bin/getpassword.js"
33+
"build": "tsc",
34+
"clean": "rimraf dist",
35+
"getrobotpwd": "cd node_modules/dorita980 && npm install && node ./bin/getpassword.js",
36+
"watch": "tsc --watch"
3437
},
3538
"devDependencies": {
36-
"@changesets/cli": "^2.17.0"
39+
"@changesets/cli": "^2.17.0",
40+
"@types/promise-timeout": "^1.3.0",
41+
"homebridge": "^1.3.4",
42+
"rimraf": "^3.0.2",
43+
"typescript": "^4.4.3"
3744
}
3845
}

0 commit comments

Comments
 (0)