pear-electron 1.7.17 → 1.7.18
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 +1 -3
- package/package.json +2 -1
- package/pre.js +5 -4
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
> Pear User-Interface Library for Electron
|
|
4
4
|
|
|
5
|
-
**Status: WIP**
|
|
6
|
-
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```sh
|
|
@@ -55,7 +53,7 @@ Inside the pear-electron runtime desktop application, pear-electron resolves to
|
|
|
55
53
|
|
|
56
54
|
**index.html**:
|
|
57
55
|
```html
|
|
58
|
-
<script src="./app.js" type="module"
|
|
56
|
+
<script src="./app.js" type="module">
|
|
59
57
|
```
|
|
60
58
|
|
|
61
59
|
**app.js**:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pear-electron",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.18",
|
|
4
4
|
"description": "Pear User-Interface Library for Electron",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"paparam": "^1.6.1",
|
|
77
77
|
"pear-api": "^1.28.6",
|
|
78
78
|
"pear-ipc": "^6.4.0",
|
|
79
|
+
"pear-pipe": "^1.0.1",
|
|
79
80
|
"script-linker": "^2.5.3",
|
|
80
81
|
"streamx": "^2.20.2",
|
|
81
82
|
"url-file-url": "^1.0.4",
|
package/pre.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/* global Pear */
|
|
3
3
|
const Localdrive = require('localdrive')
|
|
4
4
|
const cenc = require('compact-encoding')
|
|
5
|
+
const pipe = require('pear-pipe')()
|
|
5
6
|
function srcs (html) {
|
|
6
7
|
return [
|
|
7
8
|
...(html.replace(/<!--[\s\S]*?-->/g, '').matchAll(/<script\b[^>]*?\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+))/gis))
|
|
@@ -22,14 +23,14 @@ async function configure (options) {
|
|
|
22
23
|
return options
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
pipe.on('end', () => { Pear.pipe.end() })
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
pipe.once('data', (data) => {
|
|
28
29
|
const options = cenc.decode(cenc.any, data)
|
|
29
30
|
configure(options).then((config) => {
|
|
30
31
|
const buffer = cenc.encode(cenc.any, { tag: 'configure', data: config })
|
|
31
|
-
|
|
32
|
+
pipe.end(buffer)
|
|
32
33
|
}, (err) => {
|
|
33
|
-
|
|
34
|
+
pipe.destroy(err)
|
|
34
35
|
})
|
|
35
36
|
})
|