muhammara 2.1.0 → 2.2.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.
- package/CHANGELOG.md +13 -1
- package/node_modules/@mapbox/node-pre-gyp/CHANGELOG.md +3 -0
- package/node_modules/@mapbox/node-pre-gyp/package.json +6 -7
- package/node_modules/ansi-regex/package.json +1 -2
- package/node_modules/brace-expansion/package.json +2 -1
- package/node_modules/gauge/CHANGELOG.md +163 -0
- package/node_modules/gauge/LICENSE +13 -0
- package/node_modules/gauge/README.md +1 -1
- package/node_modules/gauge/{lib/base-theme.js → base-theme.js} +3 -7
- package/node_modules/gauge/{lib/error.js → error.js} +0 -0
- package/node_modules/gauge/{lib/has-color.js → has-color.js} +0 -0
- package/node_modules/gauge/{lib/index.js → index.js} +32 -89
- package/node_modules/gauge/package.json +42 -37
- package/node_modules/gauge/{lib/plumbing.js → plumbing.js} +1 -3
- package/node_modules/gauge/{lib/process.js → process.js} +0 -0
- package/node_modules/gauge/{lib/progress-bar.js → progress-bar.js} +5 -11
- package/node_modules/gauge/{lib/render-template.js → render-template.js} +24 -68
- package/node_modules/gauge/{lib/set-immediate.js → set-immediate.js} +0 -0
- package/node_modules/gauge/{lib/set-interval.js → set-interval.js} +0 -0
- package/node_modules/gauge/{lib/spin.js → spin.js} +0 -0
- package/node_modules/gauge/{lib/template-item.js → template-item.js} +6 -21
- package/node_modules/gauge/{lib/theme-set.js → theme-set.js} +23 -31
- package/node_modules/gauge/{lib/themes.js → themes.js} +13 -13
- package/node_modules/gauge/{lib/wide-truncate.js → wide-truncate.js} +3 -9
- package/node_modules/minimatch/README.md +22 -1
- package/node_modules/minimatch/minimatch.js +93 -69
- package/node_modules/minimatch/package.json +11 -10
- package/node_modules/minipass/index.js +6 -1
- package/node_modules/minipass/package.json +5 -5
- package/node_modules/node-fetch/lib/index.es.js +28 -2
- package/node_modules/node-fetch/lib/index.js +28 -2
- package/node_modules/node-fetch/lib/index.mjs +28 -2
- package/node_modules/node-fetch/package.json +13 -5
- package/node_modules/npmlog/LICENSE +15 -0
- package/node_modules/npmlog/{lib/log.js → log.js} +9 -9
- package/node_modules/npmlog/package.json +20 -31
- package/node_modules/object-assign/index.js +90 -0
- package/node_modules/object-assign/license +21 -0
- package/node_modules/object-assign/package.json +74 -0
- package/node_modules/object-assign/readme.md +61 -0
- package/node_modules/signal-exit/index.js +4 -2
- package/node_modules/signal-exit/package.json +5 -5
- package/package.json +1 -1
- package/src/deps/PDFWriter/CMakeLists.txt +8 -0
- package/src/deps/PDFWriter/DecryptionHelper.cpp +10 -8
- package/src/deps/PDFWriter/Deletable.h +46 -0
- package/src/deps/PDFWriter/DocumentContext.h +3 -3
- package/src/deps/PDFWriter/IDeletable.h +6 -0
- package/src/deps/PDFWriter/InputLZWDecodeStream.cpp +208 -0
- package/src/deps/PDFWriter/InputLZWDecodeStream.h +77 -0
- package/src/deps/PDFWriter/InputStreamSkipperStream.cpp +1 -1
- package/src/deps/PDFWriter/JPEGImageHandler.h +2 -2
- package/src/deps/PDFWriter/ObjectsContext.cpp +5 -0
- package/src/deps/PDFWriter/ObjectsContext.h +1 -0
- package/src/deps/PDFWriter/PDFDocumentHandler.cpp +19 -3
- package/src/deps/PDFWriter/PDFObject.cpp +13 -11
- package/src/deps/PDFWriter/PDFObject.h +7 -5
- package/src/deps/PDFWriter/PDFObjectParser.cpp +8 -0
- package/src/deps/PDFWriter/PDFObjectParser.h +6 -0
- package/src/deps/PDFWriter/PDFParser.cpp +25 -13
- package/src/deps/PDFWriter/PDFParserTokenizer.cpp +25 -24
- package/src/deps/PDFWriter/PDFParserTokenizer.h +1 -0
- package/src/deps/PDFWriter/PDFWriter.h +2 -2
- package/src/deps/PDFWriter/binding.gyp +2 -0
- package/node_modules/gauge/LICENSE.md +0 -20
- package/node_modules/gauge/lib/demo.js +0 -45
- package/node_modules/npmlog/LICENSE.md +0 -20
- package/src/deps/PDFWriter/InputPredictorPNGAverageStream.cpp +0 -120
- package/src/deps/PDFWriter/InputPredictorPNGAverageStream.h +0 -49
- package/src/deps/PDFWriter/InputPredictorPNGNoneStream.cpp +0 -109
- package/src/deps/PDFWriter/InputPredictorPNGNoneStream.h +0 -47
- package/src/deps/PDFWriter/InputPredictorPNGPaethStream.cpp +0 -136
- package/src/deps/PDFWriter/InputPredictorPNGPaethStream.h +0 -51
- package/src/deps/PDFWriter/InputPredictorPNGSubStream.cpp +0 -113
- package/src/deps/PDFWriter/InputPredictorPNGSubStream.h +0 -47
- package/src/deps/PDFWriter/InputPredictorPNGUpStream.cpp +0 -120
- package/src/deps/PDFWriter/InputPredictorPNGUpStream.h +0 -49
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.2.0] - 2022-03-05
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Update PDFWriter dependency to the newest available versoin
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- Electron version: 17.0, 17.1
|
|
19
|
+
- NodeJs 17.6.0
|
|
20
|
+
|
|
10
21
|
## [2.1.0] - 2021-12-03
|
|
11
22
|
|
|
12
23
|
### Added
|
|
@@ -195,7 +206,8 @@ with the following changes.
|
|
|
195
206
|
|
|
196
207
|
* Initial release
|
|
197
208
|
|
|
198
|
-
[Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.
|
|
209
|
+
[Unreleased]: https://github.com/julianhille/MuhammaraJS/compare/2.2.0...HEAD
|
|
210
|
+
[2.2.0]: https://github.com/julianhille/MuhammaraJS/compare/2.1.0...2.2.0
|
|
199
211
|
[2.1.0]: https://github.com/julianhille/MuhammaraJS/compare/2.0.0...2.1.0
|
|
200
212
|
[2.0.0]: https://github.com/julianhille/MuhammaraJS/compare/1.10.0...2.0.0
|
|
201
213
|
[1.10.0]: https://github.com/julianhille/MuhammaraJS/compare/1.9.0...1.10.0
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "@mapbox/node-pre-gyp@^1.0.5",
|
|
3
|
-
"_id": "@mapbox/node-pre-gyp@1.0.
|
|
3
|
+
"_id": "@mapbox/node-pre-gyp@1.0.8",
|
|
4
4
|
"_inBundle": false,
|
|
5
|
-
"_integrity": "sha512-
|
|
5
|
+
"_integrity": "sha512-CMGKi28CF+qlbXh26hDe6NxCd7amqeAzEqnS6IHeO6LoaKyM/n+Xw3HT1COdq8cuioOdlKdqn/hCmqPUOMOywg==",
|
|
6
6
|
"_location": "/@mapbox/node-pre-gyp",
|
|
7
7
|
"_phantomChildren": {},
|
|
8
8
|
"_requested": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"_requiredBy": [
|
|
20
20
|
"/"
|
|
21
21
|
],
|
|
22
|
-
"_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.
|
|
23
|
-
"_shasum": "
|
|
22
|
+
"_resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.8.tgz",
|
|
23
|
+
"_shasum": "32abc8a5c624bc4e46c43d84dfb8b26d33a96f58",
|
|
24
24
|
"_spec": "@mapbox/node-pre-gyp@^1.0.5",
|
|
25
25
|
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS",
|
|
26
26
|
"author": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"make-dir": "^3.1.0",
|
|
41
41
|
"node-fetch": "^2.6.5",
|
|
42
42
|
"nopt": "^5.0.0",
|
|
43
|
-
"npmlog": "^
|
|
43
|
+
"npmlog": "^5.0.1",
|
|
44
44
|
"rimraf": "^3.0.2",
|
|
45
45
|
"semver": "^7.3.5",
|
|
46
46
|
"tar": "^6.1.11"
|
|
@@ -50,7 +50,6 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@mapbox/cloudfriend": "^5.1.0",
|
|
52
52
|
"@mapbox/eslint-config-mapbox": "^3.0.0",
|
|
53
|
-
"action-walk": "^2.2.0",
|
|
54
53
|
"aws-sdk": "^2.1012.0",
|
|
55
54
|
"codecov": "^3.8.3",
|
|
56
55
|
"eslint": "^7.32.0",
|
|
@@ -94,5 +93,5 @@
|
|
|
94
93
|
"update-crosswalk": "node scripts/abi_crosswalk.js",
|
|
95
94
|
"upload-coverage": "nyc report --reporter json && codecov --clear --flags=unit --file=./coverage/coverage-final.json"
|
|
96
95
|
},
|
|
97
|
-
"version": "1.0.
|
|
96
|
+
"version": "1.0.8"
|
|
98
97
|
}
|
|
@@ -16,13 +16,12 @@
|
|
|
16
16
|
"fetchSpec": "^5.0.1"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
|
-
"/gauge",
|
|
20
19
|
"/strip-ansi"
|
|
21
20
|
],
|
|
22
21
|
"_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
|
23
22
|
"_shasum": "082cb2c89c9fe8659a311a53bd6a4dc5301db304",
|
|
24
23
|
"_spec": "ansi-regex@^5.0.1",
|
|
25
|
-
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/
|
|
24
|
+
"_where": "/home/runner/work/MuhammaraJS/MuhammaraJS/node_modules/strip-ansi",
|
|
26
25
|
"author": {
|
|
27
26
|
"name": "Sindre Sorhus",
|
|
28
27
|
"email": "sindresorhus@gmail.com",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
"fetchSpec": "^1.1.7"
|
|
17
17
|
},
|
|
18
18
|
"_requiredBy": [
|
|
19
|
-
"/minimatch"
|
|
19
|
+
"/minimatch",
|
|
20
|
+
"/mocha/minimatch"
|
|
20
21
|
],
|
|
21
22
|
"_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
|
22
23
|
"_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
### v3.0.0
|
|
2
|
+
* Drops support for Node v4, v6, v7 and v8
|
|
3
|
+
|
|
4
|
+
### v2.7.4
|
|
5
|
+
|
|
6
|
+
* Reset colors prior to ending a line, to eliminate flicker when a line
|
|
7
|
+
is trucated between start and end color sequences.
|
|
8
|
+
|
|
9
|
+
### v2.7.3
|
|
10
|
+
|
|
11
|
+
* Only create our onExit handler when we're enabled and remove it when we're
|
|
12
|
+
disabled. This stops us from creating multiple onExit handlers when
|
|
13
|
+
multiple gauge objects are being used.
|
|
14
|
+
* Fix bug where if a theme name were given instead of a theme object, it
|
|
15
|
+
would crash.
|
|
16
|
+
* Remove supports-color because it's not actually used. Uhm. Yes, I just
|
|
17
|
+
updated it. >.>
|
|
18
|
+
|
|
19
|
+
### v2.7.2
|
|
20
|
+
|
|
21
|
+
* Use supports-color instead of has-color (as the module has been renamed)
|
|
22
|
+
|
|
23
|
+
### v2.7.1
|
|
24
|
+
|
|
25
|
+
* Bug fix: Calls to show/pulse while the progress bar is disabled should still
|
|
26
|
+
update our internal representation of what would be shown should it be enabled.
|
|
27
|
+
|
|
28
|
+
### v2.7.0
|
|
29
|
+
|
|
30
|
+
* New feature: Add new `isEnabled` method to allow introspection of the gauge's
|
|
31
|
+
"enabledness" as controlled by `.enable()` and `.disable()`.
|
|
32
|
+
|
|
33
|
+
### v2.6.0
|
|
34
|
+
|
|
35
|
+
* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge
|
|
36
|
+
is already enabled or disabled respectively. This prevents leaking event
|
|
37
|
+
listeners, amongst other weirdness.
|
|
38
|
+
* New feature: Template items can have default values that will be used if no
|
|
39
|
+
value was otherwise passed in.
|
|
40
|
+
|
|
41
|
+
### v2.5.3
|
|
42
|
+
|
|
43
|
+
* Default to `enabled` only if we have a tty. Users can always override
|
|
44
|
+
this by passing in the `enabled` option explicitly or by calling calling
|
|
45
|
+
`gauge.enable()`.
|
|
46
|
+
|
|
47
|
+
### v2.5.2
|
|
48
|
+
|
|
49
|
+
* Externalized `./console-strings.js` into `console-control-strings`.
|
|
50
|
+
|
|
51
|
+
### v2.5.1
|
|
52
|
+
|
|
53
|
+
* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the
|
|
54
|
+
node profiler.
|
|
55
|
+
* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add
|
|
56
|
+
a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012))
|
|
57
|
+
|
|
58
|
+
### v2.5.0
|
|
59
|
+
|
|
60
|
+
* Add way to programmatically fetch a list of theme names in a themeset
|
|
61
|
+
(`Themeset.getThemeNames`).
|
|
62
|
+
|
|
63
|
+
### v2.4.0
|
|
64
|
+
|
|
65
|
+
* Add support for setting themesets on existing gauge objects.
|
|
66
|
+
* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when
|
|
67
|
+
your terminal is interleaving output from multiple filehandles (ie, stdout
|
|
68
|
+
& stderr).
|
|
69
|
+
|
|
70
|
+
### v2.3.1
|
|
71
|
+
|
|
72
|
+
* Fix a refactor bug in setTheme where it wasn't accepting the various types
|
|
73
|
+
of args it should.
|
|
74
|
+
|
|
75
|
+
### v2.3.0
|
|
76
|
+
|
|
77
|
+
#### FEATURES
|
|
78
|
+
|
|
79
|
+
* Add setTemplate & setTheme back in.
|
|
80
|
+
* Add support for named themes, you can now ask for things like 'colorASCII'
|
|
81
|
+
and 'brailleSpinner'. Of course, you can still pass in theme objects.
|
|
82
|
+
Additionally you can now pass in an object with `hasUnicode`, `hasColor` and
|
|
83
|
+
`platform` keys in order to override our guesses as to those values when
|
|
84
|
+
selecting a default theme from the themeset.
|
|
85
|
+
* Make the output stream optional (it defaults to `process.stderr` now).
|
|
86
|
+
* Add `setWriteTo(stream[, tty])` to change the output stream and,
|
|
87
|
+
optionally, tty.
|
|
88
|
+
|
|
89
|
+
#### BUG FIXES & REFACTORING
|
|
90
|
+
|
|
91
|
+
* Abort the display phase early if we're supposed to be hidden and we are.
|
|
92
|
+
* Stop printing a bunch of spaces at the end of lines, since we're already
|
|
93
|
+
using an erase-to-end-of-line code anyway.
|
|
94
|
+
* The unicode themes were missing the subsection separator.
|
|
95
|
+
|
|
96
|
+
### v2.2.1
|
|
97
|
+
|
|
98
|
+
* Fix image in readme
|
|
99
|
+
|
|
100
|
+
### v2.2.0
|
|
101
|
+
|
|
102
|
+
* All new themes API– reference themes by name and pass in custom themes and
|
|
103
|
+
themesets (themesets get platform support autodetection done on them to
|
|
104
|
+
select the best theme). Theme mixins let you add features to all existing
|
|
105
|
+
themes.
|
|
106
|
+
* Much, much improved test coverage.
|
|
107
|
+
|
|
108
|
+
### v2.1.0
|
|
109
|
+
|
|
110
|
+
* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks
|
|
111
|
+
to @yongtw123 for pointing out this had snuck in.
|
|
112
|
+
* Fiddled with the demo output to make it easier to see the spinner spin. Also
|
|
113
|
+
added prints before each platforms test output.
|
|
114
|
+
* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for
|
|
115
|
+
finding this. Then I was lazy and made a new commit instead of using his
|
|
116
|
+
PR. Again, thank you for your patience @KenenY.
|
|
117
|
+
* Drastically speed up travis testing.
|
|
118
|
+
* Add a small javascript demo (demo.js) for showing off the various themes
|
|
119
|
+
(and testing them on diff platforms).
|
|
120
|
+
* Change: The subsection separator from ⁄ and / (different chars) to >.
|
|
121
|
+
* Fix crasher: A show or pulse without a label would cause the template renderer
|
|
122
|
+
to complain about a missing value.
|
|
123
|
+
* New feature: Add the ability to disable the clean-up-on-exit behavior.
|
|
124
|
+
Not something I expect to be widely desirable, but important if you have
|
|
125
|
+
multiple distinct gauge instances in your app.
|
|
126
|
+
* Use our own color support detection.
|
|
127
|
+
The `has-color` module proved too magic for my needs, making assumptions
|
|
128
|
+
as to which stream we write to and reading command line arguments.
|
|
129
|
+
|
|
130
|
+
### v2.0.0
|
|
131
|
+
|
|
132
|
+
This is a major rewrite of the internals. Externally there are fewer
|
|
133
|
+
changes:
|
|
134
|
+
|
|
135
|
+
* On node>0.8 gauge object now prints updates at a fixed rate. This means
|
|
136
|
+
that when you call `show` it may wate up to `updateInterval` ms before it
|
|
137
|
+
actually prints an update. You override this behavior with the
|
|
138
|
+
`fixedFramerate` option.
|
|
139
|
+
* The gauge object now keeps the cursor hidden as long as it's enabled and
|
|
140
|
+
shown.
|
|
141
|
+
* The constructor's arguments have changed, now it takes a mandatory output
|
|
142
|
+
stream and an optional options object. The stream no longer needs to be
|
|
143
|
+
an `ansi`ified stream, although it can be if you want (but we won't make
|
|
144
|
+
use of its special features).
|
|
145
|
+
* Previously the gauge was disabled by default if `process.stdout` wasn't a
|
|
146
|
+
tty. Now it always defaults to enabled. If you want the previous
|
|
147
|
+
behavior set the `enabled` option to `process.stdout.isTTY`.
|
|
148
|
+
* The constructor's options have changed– see the docs for details.
|
|
149
|
+
* Themes are entirely different. If you were using a custom theme, or
|
|
150
|
+
referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then
|
|
151
|
+
you'll need to change your code. You can get the equivalent of the latter
|
|
152
|
+
with:
|
|
153
|
+
```
|
|
154
|
+
var themes = require('gauge/themes')
|
|
155
|
+
var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform
|
|
156
|
+
```
|
|
157
|
+
The default themes no longer use any ambiguous width characters, so even
|
|
158
|
+
if you choose to display those as wide your progress bar should still
|
|
159
|
+
display correctly.
|
|
160
|
+
* Templates are entirely different and if you were using a custom one, you
|
|
161
|
+
should consult the documentation to learn how to recreate it. If you were
|
|
162
|
+
using the default, be aware that it has changed and the result looks quite
|
|
163
|
+
a bit different.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
|
|
2
|
+
|
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
5
|
+
copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
8
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
9
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
10
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
11
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
12
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
13
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -4,15 +4,11 @@ var progressBar = require('./progress-bar.js')
|
|
|
4
4
|
|
|
5
5
|
module.exports = {
|
|
6
6
|
activityIndicator: function (values, theme, width) {
|
|
7
|
-
if (values.spun == null)
|
|
8
|
-
return
|
|
9
|
-
}
|
|
7
|
+
if (values.spun == null) return
|
|
10
8
|
return spin(theme, values.spun)
|
|
11
9
|
},
|
|
12
10
|
progressbar: function (values, theme, width) {
|
|
13
|
-
if (values.completed == null)
|
|
14
|
-
return
|
|
15
|
-
}
|
|
11
|
+
if (values.completed == null) return
|
|
16
12
|
return progressBar(theme, width, values.completed)
|
|
17
|
-
}
|
|
13
|
+
}
|
|
18
14
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -32,7 +32,7 @@ function Gauge (arg1, arg2) {
|
|
|
32
32
|
this._status = {
|
|
33
33
|
spun: 0,
|
|
34
34
|
section: '',
|
|
35
|
-
subsection: ''
|
|
35
|
+
subsection: ''
|
|
36
36
|
}
|
|
37
37
|
this._paused = false // are we paused for back pressure?
|
|
38
38
|
this._disabled = true // are all progress bar updates disabled?
|
|
@@ -50,10 +50,10 @@ function Gauge (arg1, arg2) {
|
|
|
50
50
|
this._theme = options.theme
|
|
51
51
|
var theme = this._computeTheme(options.theme)
|
|
52
52
|
var template = options.template || [
|
|
53
|
-
{
|
|
54
|
-
{
|
|
55
|
-
{
|
|
56
|
-
{
|
|
53
|
+
{type: 'progressbar', length: 20},
|
|
54
|
+
{type: 'activityIndicator', kerning: 1, length: 1},
|
|
55
|
+
{type: 'section', kerning: 1, default: ''},
|
|
56
|
+
{type: 'subsection', kerning: 1, default: ''}
|
|
57
57
|
]
|
|
58
58
|
this.setWriteTo(writeTo, options.tty)
|
|
59
59
|
var PlumbingClass = options.Plumbing || Plumbing
|
|
@@ -79,28 +79,17 @@ Gauge.prototype.isEnabled = function () {
|
|
|
79
79
|
|
|
80
80
|
Gauge.prototype.setTemplate = function (template) {
|
|
81
81
|
this._gauge.setTemplate(template)
|
|
82
|
-
if (this._showing)
|
|
83
|
-
this._requestRedraw()
|
|
84
|
-
}
|
|
82
|
+
if (this._showing) this._requestRedraw()
|
|
85
83
|
}
|
|
86
84
|
|
|
87
85
|
Gauge.prototype._computeTheme = function (theme) {
|
|
88
|
-
if (!theme) {
|
|
89
|
-
theme = {}
|
|
90
|
-
}
|
|
86
|
+
if (!theme) theme = {}
|
|
91
87
|
if (typeof theme === 'string') {
|
|
92
88
|
theme = this._themes.getTheme(theme)
|
|
93
|
-
} else if (
|
|
94
|
-
theme &&
|
|
95
|
-
(Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)
|
|
96
|
-
) {
|
|
89
|
+
} else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) {
|
|
97
90
|
var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode
|
|
98
91
|
var useColor = theme.hasColor == null ? hasColor : theme.hasColor
|
|
99
|
-
theme = this._themes.getDefault({
|
|
100
|
-
hasUnicode: useUnicode,
|
|
101
|
-
hasColor: useColor,
|
|
102
|
-
platform: theme.platform,
|
|
103
|
-
})
|
|
92
|
+
theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform})
|
|
104
93
|
}
|
|
105
94
|
return theme
|
|
106
95
|
}
|
|
@@ -112,17 +101,13 @@ Gauge.prototype.setThemeset = function (themes) {
|
|
|
112
101
|
|
|
113
102
|
Gauge.prototype.setTheme = function (theme) {
|
|
114
103
|
this._gauge.setTheme(this._computeTheme(theme))
|
|
115
|
-
if (this._showing)
|
|
116
|
-
this._requestRedraw()
|
|
117
|
-
}
|
|
104
|
+
if (this._showing) this._requestRedraw()
|
|
118
105
|
this._theme = theme
|
|
119
106
|
}
|
|
120
107
|
|
|
121
108
|
Gauge.prototype._requestRedraw = function () {
|
|
122
109
|
this._needsRedraw = true
|
|
123
|
-
if (!this._fixedFramerate)
|
|
124
|
-
this._doRedraw()
|
|
125
|
-
}
|
|
110
|
+
if (!this._fixedFramerate) this._doRedraw()
|
|
126
111
|
}
|
|
127
112
|
|
|
128
113
|
Gauge.prototype.getWidth = function () {
|
|
@@ -131,39 +116,25 @@ Gauge.prototype.getWidth = function () {
|
|
|
131
116
|
|
|
132
117
|
Gauge.prototype.setWriteTo = function (writeTo, tty) {
|
|
133
118
|
var enabled = !this._disabled
|
|
134
|
-
if (enabled)
|
|
135
|
-
this.disable()
|
|
136
|
-
}
|
|
119
|
+
if (enabled) this.disable()
|
|
137
120
|
this._writeTo = writeTo
|
|
138
121
|
this._tty = tty ||
|
|
139
122
|
(writeTo === process.stderr && process.stdout.isTTY && process.stdout) ||
|
|
140
123
|
(writeTo.isTTY && writeTo) ||
|
|
141
124
|
this._tty
|
|
142
|
-
if (this._gauge)
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
if (enabled) {
|
|
146
|
-
this.enable()
|
|
147
|
-
}
|
|
125
|
+
if (this._gauge) this._gauge.setWidth(this.getWidth())
|
|
126
|
+
if (enabled) this.enable()
|
|
148
127
|
}
|
|
149
128
|
|
|
150
129
|
Gauge.prototype.enable = function () {
|
|
151
|
-
if (!this._disabled)
|
|
152
|
-
return
|
|
153
|
-
}
|
|
130
|
+
if (!this._disabled) return
|
|
154
131
|
this._disabled = false
|
|
155
|
-
if (this._tty)
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
if (this._showing) {
|
|
159
|
-
this.show()
|
|
160
|
-
}
|
|
132
|
+
if (this._tty) this._enableEvents()
|
|
133
|
+
if (this._showing) this.show()
|
|
161
134
|
}
|
|
162
135
|
|
|
163
136
|
Gauge.prototype.disable = function () {
|
|
164
|
-
if (this._disabled)
|
|
165
|
-
return
|
|
166
|
-
}
|
|
137
|
+
if (this._disabled) return
|
|
167
138
|
if (this._showing) {
|
|
168
139
|
this._lastUpdateAt = null
|
|
169
140
|
this._showing = false
|
|
@@ -171,9 +142,7 @@ Gauge.prototype.disable = function () {
|
|
|
171
142
|
this._showing = true
|
|
172
143
|
}
|
|
173
144
|
this._disabled = true
|
|
174
|
-
if (this._tty)
|
|
175
|
-
this._disableEvents()
|
|
176
|
-
}
|
|
145
|
+
if (this._tty) this._disableEvents()
|
|
177
146
|
}
|
|
178
147
|
|
|
179
148
|
Gauge.prototype._enableEvents = function () {
|
|
@@ -183,29 +152,19 @@ Gauge.prototype._enableEvents = function () {
|
|
|
183
152
|
this._tty.on('resize', this._$$handleSizeChange)
|
|
184
153
|
if (this._fixedFramerate) {
|
|
185
154
|
this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval)
|
|
186
|
-
if (this.redrawTracker.unref)
|
|
187
|
-
this.redrawTracker.unref()
|
|
188
|
-
}
|
|
155
|
+
if (this.redrawTracker.unref) this.redrawTracker.unref()
|
|
189
156
|
}
|
|
190
157
|
}
|
|
191
158
|
|
|
192
159
|
Gauge.prototype._disableEvents = function () {
|
|
193
160
|
this._tty.removeListener('resize', this._$$handleSizeChange)
|
|
194
|
-
if (this._fixedFramerate)
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
if (this._removeOnExit) {
|
|
198
|
-
this._removeOnExit()
|
|
199
|
-
}
|
|
161
|
+
if (this._fixedFramerate) clearInterval(this.redrawTracker)
|
|
162
|
+
if (this._removeOnExit) this._removeOnExit()
|
|
200
163
|
}
|
|
201
164
|
|
|
202
165
|
Gauge.prototype.hide = function (cb) {
|
|
203
|
-
if (this._disabled)
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
if (!this._showing) {
|
|
207
|
-
return cb && process.nextTick(cb)
|
|
208
|
-
}
|
|
166
|
+
if (this._disabled) return cb && process.nextTick(cb)
|
|
167
|
+
if (!this._showing) return cb && process.nextTick(cb)
|
|
209
168
|
this._showing = false
|
|
210
169
|
this._doRedraw()
|
|
211
170
|
cb && setImmediate(cb)
|
|
@@ -222,24 +181,16 @@ Gauge.prototype.show = function (section, completed) {
|
|
|
222
181
|
this._status[key] = section[key]
|
|
223
182
|
}
|
|
224
183
|
}
|
|
225
|
-
if (completed != null)
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
if (this._disabled) {
|
|
229
|
-
return
|
|
230
|
-
}
|
|
184
|
+
if (completed != null) this._status.completed = completed
|
|
185
|
+
if (this._disabled) return
|
|
231
186
|
this._requestRedraw()
|
|
232
187
|
}
|
|
233
188
|
|
|
234
189
|
Gauge.prototype.pulse = function (subsection) {
|
|
235
190
|
this._status.subsection = subsection || ''
|
|
236
191
|
this._status.spun++
|
|
237
|
-
if (this._disabled)
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
if (!this._showing) {
|
|
241
|
-
return
|
|
242
|
-
}
|
|
192
|
+
if (this._disabled) return
|
|
193
|
+
if (!this._showing) return
|
|
243
194
|
this._requestRedraw()
|
|
244
195
|
}
|
|
245
196
|
|
|
@@ -249,14 +200,10 @@ Gauge.prototype._handleSizeChange = function () {
|
|
|
249
200
|
}
|
|
250
201
|
|
|
251
202
|
Gauge.prototype._doRedraw = function () {
|
|
252
|
-
if (this._disabled || this._paused)
|
|
253
|
-
return
|
|
254
|
-
}
|
|
203
|
+
if (this._disabled || this._paused) return
|
|
255
204
|
if (!this._fixedFramerate) {
|
|
256
205
|
var now = Date.now()
|
|
257
|
-
if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval)
|
|
258
|
-
return
|
|
259
|
-
}
|
|
206
|
+
if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return
|
|
260
207
|
this._lastUpdateAt = now
|
|
261
208
|
}
|
|
262
209
|
if (!this._showing && this._onScreen) {
|
|
@@ -267,9 +214,7 @@ Gauge.prototype._doRedraw = function () {
|
|
|
267
214
|
}
|
|
268
215
|
return this._writeTo.write(result)
|
|
269
216
|
}
|
|
270
|
-
if (!this._showing && !this._onScreen)
|
|
271
|
-
return
|
|
272
|
-
}
|
|
217
|
+
if (!this._showing && !this._onScreen) return
|
|
273
218
|
if (this._showing && !this._onScreen) {
|
|
274
219
|
this._onScreen = true
|
|
275
220
|
this._needsRedraw = true
|
|
@@ -277,9 +222,7 @@ Gauge.prototype._doRedraw = function () {
|
|
|
277
222
|
this._writeTo.write(this._gauge.hideCursor())
|
|
278
223
|
}
|
|
279
224
|
}
|
|
280
|
-
if (!this._needsRedraw)
|
|
281
|
-
return
|
|
282
|
-
}
|
|
225
|
+
if (!this._needsRedraw) return
|
|
283
226
|
if (!this._writeTo.write(this._gauge.show(this._status))) {
|
|
284
227
|
this._paused = true
|
|
285
228
|
this._writeTo.on('drain', callWith(this, function () {
|