pear-mobile 2.0.2 → 4.0.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.
Files changed (2) hide show
  1. package/index.js +2 -3
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -7,16 +7,15 @@ const fs = require('bare-fs')
7
7
  module.exports = class PearRuntime extends ReadyResouce {
8
8
  constructor(opts = {}) {
9
9
  super()
10
- opts.name = opts.name || opts.app
11
- if (!opts.name) throw new Error('need to pass name or app')
12
10
  if (!opts.dir) opts.dir = dir.persistent()
13
11
 
14
12
  this.dir = opts.dir
15
13
  this.storage = opts.storage || path.join(this.dir, 'app-storage')
16
14
 
17
- const appPath = path.join(opts.dir, 'pear-runtime', 'upgrade')
15
+ const appPath = path.join(opts.dir, 'pear-runtime', 'ota')
18
16
  if (!fs.existsSync(appPath)) fs.mkdirSync(appPath, { recursive: true, force: true })
19
17
  this.updater = new PearRuntimeUpdater({ ...opts, app: appPath })
18
+ this.updater.on('error', (err) => this.emit('error', err))
20
19
  }
21
20
 
22
21
  async _open() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pear-mobile",
3
- "version": "2.0.2",
3
+ "version": "4.0.0",
4
4
  "description": "Embeddable Pear runtime for mobile applications",
5
5
  "main": "index.js",
6
6
  "exports": {
@@ -41,7 +41,7 @@
41
41
  "bare-fs": "^4.5.5",
42
42
  "bare-path": "^3.0.0",
43
43
  "bare-storage": "^1.0.1",
44
- "pear-runtime-updater": "^1.0.0",
44
+ "pear-runtime-updater": "^2.0.0",
45
45
  "ready-resource": "^1.2.0"
46
46
  }
47
47
  }