taskchef 3.0.0 → 3.0.2
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/.codex-plugin/plugin.json +1 -1
- package/node_modules/graceful-fs/LICENSE +15 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +53 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/node_modules/proper-lockfile/LICENSE +21 -0
- package/node_modules/proper-lockfile/README.md +183 -0
- package/node_modules/proper-lockfile/index.js +40 -0
- package/node_modules/proper-lockfile/lib/adapter.js +85 -0
- package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
- package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
- package/node_modules/proper-lockfile/package.json +71 -0
- package/node_modules/retry/.npmignore +3 -0
- package/node_modules/retry/.travis.yml +15 -0
- package/node_modules/retry/License +21 -0
- package/node_modules/retry/Makefile +18 -0
- package/node_modules/retry/README.md +227 -0
- package/node_modules/retry/equation.gif +0 -0
- package/node_modules/retry/example/dns.js +31 -0
- package/node_modules/retry/example/stop.js +40 -0
- package/node_modules/retry/index.js +1 -0
- package/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/retry/lib/retry_operation.js +158 -0
- package/node_modules/retry/package.json +32 -0
- package/node_modules/retry/test/common.js +10 -0
- package/node_modules/retry/test/integration/test-forever.js +24 -0
- package/node_modules/retry/test/integration/test-retry-operation.js +258 -0
- package/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
- package/node_modules/retry/test/integration/test-timeouts.js +69 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -0
- package/package.json +5 -2
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// Note: since nyc uses this module to output coverage, any lines
|
|
2
|
+
// that are in the direct sync flow of nyc's outputCoverage are
|
|
3
|
+
// ignored, since we can never get coverage for them.
|
|
4
|
+
// grab a reference to node's real process object right away
|
|
5
|
+
var process = global.process
|
|
6
|
+
|
|
7
|
+
const processOk = function (process) {
|
|
8
|
+
return process &&
|
|
9
|
+
typeof process === 'object' &&
|
|
10
|
+
typeof process.removeListener === 'function' &&
|
|
11
|
+
typeof process.emit === 'function' &&
|
|
12
|
+
typeof process.reallyExit === 'function' &&
|
|
13
|
+
typeof process.listeners === 'function' &&
|
|
14
|
+
typeof process.kill === 'function' &&
|
|
15
|
+
typeof process.pid === 'number' &&
|
|
16
|
+
typeof process.on === 'function'
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// some kind of non-node environment, just no-op
|
|
20
|
+
/* istanbul ignore if */
|
|
21
|
+
if (!processOk(process)) {
|
|
22
|
+
module.exports = function () {
|
|
23
|
+
return function () {}
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
var assert = require('assert')
|
|
27
|
+
var signals = require('./signals.js')
|
|
28
|
+
var isWin = /^win/i.test(process.platform)
|
|
29
|
+
|
|
30
|
+
var EE = require('events')
|
|
31
|
+
/* istanbul ignore if */
|
|
32
|
+
if (typeof EE !== 'function') {
|
|
33
|
+
EE = EE.EventEmitter
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var emitter
|
|
37
|
+
if (process.__signal_exit_emitter__) {
|
|
38
|
+
emitter = process.__signal_exit_emitter__
|
|
39
|
+
} else {
|
|
40
|
+
emitter = process.__signal_exit_emitter__ = new EE()
|
|
41
|
+
emitter.count = 0
|
|
42
|
+
emitter.emitted = {}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Because this emitter is a global, we have to check to see if a
|
|
46
|
+
// previous version of this library failed to enable infinite listeners.
|
|
47
|
+
// I know what you're about to say. But literally everything about
|
|
48
|
+
// signal-exit is a compromise with evil. Get used to it.
|
|
49
|
+
if (!emitter.infinite) {
|
|
50
|
+
emitter.setMaxListeners(Infinity)
|
|
51
|
+
emitter.infinite = true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = function (cb, opts) {
|
|
55
|
+
/* istanbul ignore if */
|
|
56
|
+
if (!processOk(global.process)) {
|
|
57
|
+
return function () {}
|
|
58
|
+
}
|
|
59
|
+
assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
|
|
60
|
+
|
|
61
|
+
if (loaded === false) {
|
|
62
|
+
load()
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
var ev = 'exit'
|
|
66
|
+
if (opts && opts.alwaysLast) {
|
|
67
|
+
ev = 'afterexit'
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var remove = function () {
|
|
71
|
+
emitter.removeListener(ev, cb)
|
|
72
|
+
if (emitter.listeners('exit').length === 0 &&
|
|
73
|
+
emitter.listeners('afterexit').length === 0) {
|
|
74
|
+
unload()
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
emitter.on(ev, cb)
|
|
78
|
+
|
|
79
|
+
return remove
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var unload = function unload () {
|
|
83
|
+
if (!loaded || !processOk(global.process)) {
|
|
84
|
+
return
|
|
85
|
+
}
|
|
86
|
+
loaded = false
|
|
87
|
+
|
|
88
|
+
signals.forEach(function (sig) {
|
|
89
|
+
try {
|
|
90
|
+
process.removeListener(sig, sigListeners[sig])
|
|
91
|
+
} catch (er) {}
|
|
92
|
+
})
|
|
93
|
+
process.emit = originalProcessEmit
|
|
94
|
+
process.reallyExit = originalProcessReallyExit
|
|
95
|
+
emitter.count -= 1
|
|
96
|
+
}
|
|
97
|
+
module.exports.unload = unload
|
|
98
|
+
|
|
99
|
+
var emit = function emit (event, code, signal) {
|
|
100
|
+
/* istanbul ignore if */
|
|
101
|
+
if (emitter.emitted[event]) {
|
|
102
|
+
return
|
|
103
|
+
}
|
|
104
|
+
emitter.emitted[event] = true
|
|
105
|
+
emitter.emit(event, code, signal)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// { <signal>: <listener fn>, ... }
|
|
109
|
+
var sigListeners = {}
|
|
110
|
+
signals.forEach(function (sig) {
|
|
111
|
+
sigListeners[sig] = function listener () {
|
|
112
|
+
/* istanbul ignore if */
|
|
113
|
+
if (!processOk(global.process)) {
|
|
114
|
+
return
|
|
115
|
+
}
|
|
116
|
+
// If there are no other listeners, an exit is coming!
|
|
117
|
+
// Simplest way: remove us and then re-send the signal.
|
|
118
|
+
// We know that this will kill the process, so we can
|
|
119
|
+
// safely emit now.
|
|
120
|
+
var listeners = process.listeners(sig)
|
|
121
|
+
if (listeners.length === emitter.count) {
|
|
122
|
+
unload()
|
|
123
|
+
emit('exit', null, sig)
|
|
124
|
+
/* istanbul ignore next */
|
|
125
|
+
emit('afterexit', null, sig)
|
|
126
|
+
/* istanbul ignore next */
|
|
127
|
+
if (isWin && sig === 'SIGHUP') {
|
|
128
|
+
// "SIGHUP" throws an `ENOSYS` error on Windows,
|
|
129
|
+
// so use a supported signal instead
|
|
130
|
+
sig = 'SIGINT'
|
|
131
|
+
}
|
|
132
|
+
/* istanbul ignore next */
|
|
133
|
+
process.kill(process.pid, sig)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
module.exports.signals = function () {
|
|
139
|
+
return signals
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var loaded = false
|
|
143
|
+
|
|
144
|
+
var load = function load () {
|
|
145
|
+
if (loaded || !processOk(global.process)) {
|
|
146
|
+
return
|
|
147
|
+
}
|
|
148
|
+
loaded = true
|
|
149
|
+
|
|
150
|
+
// This is the number of onSignalExit's that are in play.
|
|
151
|
+
// It's important so that we can count the correct number of
|
|
152
|
+
// listeners on signals, and don't wait for the other one to
|
|
153
|
+
// handle it instead of us.
|
|
154
|
+
emitter.count += 1
|
|
155
|
+
|
|
156
|
+
signals = signals.filter(function (sig) {
|
|
157
|
+
try {
|
|
158
|
+
process.on(sig, sigListeners[sig])
|
|
159
|
+
return true
|
|
160
|
+
} catch (er) {
|
|
161
|
+
return false
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
|
|
165
|
+
process.emit = processEmit
|
|
166
|
+
process.reallyExit = processReallyExit
|
|
167
|
+
}
|
|
168
|
+
module.exports.load = load
|
|
169
|
+
|
|
170
|
+
var originalProcessReallyExit = process.reallyExit
|
|
171
|
+
var processReallyExit = function processReallyExit (code) {
|
|
172
|
+
/* istanbul ignore if */
|
|
173
|
+
if (!processOk(global.process)) {
|
|
174
|
+
return
|
|
175
|
+
}
|
|
176
|
+
process.exitCode = code || /* istanbul ignore next */ 0
|
|
177
|
+
emit('exit', process.exitCode, null)
|
|
178
|
+
/* istanbul ignore next */
|
|
179
|
+
emit('afterexit', process.exitCode, null)
|
|
180
|
+
/* istanbul ignore next */
|
|
181
|
+
originalProcessReallyExit.call(process, process.exitCode)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var originalProcessEmit = process.emit
|
|
185
|
+
var processEmit = function processEmit (ev, arg) {
|
|
186
|
+
if (ev === 'exit' && processOk(global.process)) {
|
|
187
|
+
/* istanbul ignore else */
|
|
188
|
+
if (arg !== undefined) {
|
|
189
|
+
process.exitCode = arg
|
|
190
|
+
}
|
|
191
|
+
var ret = originalProcessEmit.apply(this, arguments)
|
|
192
|
+
/* istanbul ignore next */
|
|
193
|
+
emit('exit', process.exitCode, null)
|
|
194
|
+
/* istanbul ignore next */
|
|
195
|
+
emit('afterexit', process.exitCode, null)
|
|
196
|
+
/* istanbul ignore next */
|
|
197
|
+
return ret
|
|
198
|
+
} else {
|
|
199
|
+
return originalProcessEmit.apply(this, arguments)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "signal-exit",
|
|
3
|
+
"version": "3.0.7",
|
|
4
|
+
"description": "when you want to fire an event no matter how a process exits.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "tap",
|
|
8
|
+
"snap": "tap",
|
|
9
|
+
"preversion": "npm test",
|
|
10
|
+
"postversion": "npm publish",
|
|
11
|
+
"prepublishOnly": "git push origin --follow-tags"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"index.js",
|
|
15
|
+
"signals.js"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/tapjs/signal-exit.git"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"signal",
|
|
23
|
+
"exit"
|
|
24
|
+
],
|
|
25
|
+
"author": "Ben Coe <ben@npmjs.com>",
|
|
26
|
+
"license": "ISC",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/tapjs/signal-exit/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/tapjs/signal-exit",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"chai": "^3.5.0",
|
|
33
|
+
"coveralls": "^3.1.1",
|
|
34
|
+
"nyc": "^15.1.0",
|
|
35
|
+
"standard-version": "^9.3.1",
|
|
36
|
+
"tap": "^15.1.1"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// This is not the set of all possible signals.
|
|
2
|
+
//
|
|
3
|
+
// It IS, however, the set of all signals that trigger
|
|
4
|
+
// an exit on either Linux or BSD systems. Linux is a
|
|
5
|
+
// superset of the signal names supported on BSD, and
|
|
6
|
+
// the unknown signals just fail to register, so we can
|
|
7
|
+
// catch that easily enough.
|
|
8
|
+
//
|
|
9
|
+
// Don't bother with SIGKILL. It's uncatchable, which
|
|
10
|
+
// means that we can't fire any callbacks anyway.
|
|
11
|
+
//
|
|
12
|
+
// If a user does happen to register a handler on a non-
|
|
13
|
+
// fatal signal like SIGWINCH or something, and then
|
|
14
|
+
// exit, it'll end up firing `process.emit('exit')`, so
|
|
15
|
+
// the handler will be fired anyway.
|
|
16
|
+
//
|
|
17
|
+
// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
|
18
|
+
// artificially, inherently leave the process in a
|
|
19
|
+
// state from which it is not safe to try and enter JS
|
|
20
|
+
// listeners.
|
|
21
|
+
module.exports = [
|
|
22
|
+
'SIGABRT',
|
|
23
|
+
'SIGALRM',
|
|
24
|
+
'SIGHUP',
|
|
25
|
+
'SIGINT',
|
|
26
|
+
'SIGTERM'
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
if (process.platform !== 'win32') {
|
|
30
|
+
module.exports.push(
|
|
31
|
+
'SIGVTALRM',
|
|
32
|
+
'SIGXCPU',
|
|
33
|
+
'SIGXFSZ',
|
|
34
|
+
'SIGUSR2',
|
|
35
|
+
'SIGTRAP',
|
|
36
|
+
'SIGSYS',
|
|
37
|
+
'SIGQUIT',
|
|
38
|
+
'SIGIOT'
|
|
39
|
+
// should detect profiler and enable/disable accordingly.
|
|
40
|
+
// see #21
|
|
41
|
+
// 'SIGPROF'
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (process.platform === 'linux') {
|
|
46
|
+
module.exports.push(
|
|
47
|
+
'SIGIO',
|
|
48
|
+
'SIGPOLL',
|
|
49
|
+
'SIGPWR',
|
|
50
|
+
'SIGSTKFLT',
|
|
51
|
+
'SIGUNUSED'
|
|
52
|
+
)
|
|
53
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taskchef",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "A non-blocking interactive dispatcher for visible Codex tasks.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Favo Yang",
|
|
@@ -41,5 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"proper-lockfile": "^4.1.2"
|
|
44
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"bundleDependencies": [
|
|
46
|
+
"proper-lockfile"
|
|
47
|
+
]
|
|
45
48
|
}
|