@recoillink/cli 0.0.0-stage → 45.0.1
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/LICENSE.md +193 -0
- package/README.md +149 -2
- package/bundle/154.index.js +462 -0
- package/bundle/230.index.js +569 -0
- package/bundle/25.index.js +9569 -0
- package/bundle/267.index.js +1386 -0
- package/bundle/308.index.js +5121 -0
- package/bundle/367.index.js +4 -0
- package/bundle/369.index.js +3443 -0
- package/bundle/529.index.js +3596 -0
- package/bundle/576.index.js +36 -0
- package/bundle/610.index.js +86 -0
- package/bundle/617.index.js +1612 -0
- package/bundle/628.index.js +152 -0
- package/bundle/633.index.js +86 -0
- package/bundle/697.index.js +410 -0
- package/bundle/7183ea1c1bf0a5da980d.js +214 -0
- package/bundle/748.index.js +672 -0
- package/bundle/78.index.js +372 -0
- package/bundle/841.index.js +2093 -0
- package/bundle/868.index.js +290 -0
- package/bundle/902.index.js +173 -0
- package/bundle/956.index.js +9901 -0
- package/bundle/aleo_wasm.wasm +0 -0
- package/bundle/aleo_wasm1.wasm +0 -0
- package/bundle/build/Release/bigint_buffer.node +0 -0
- package/bundle/file.js +12 -0
- package/bundle/index.js +4 -0
- package/bundle/package.json +3 -0
- package/bundle/worker-pipeline.js +38 -0
- package/bundle/worker.js +54 -0
- package/bundle/worker1.js +171 -0
- package/bundle/worker2.js +19834 -0
- package/bundle/worker3.js +19834 -0
- package/examples/aleo/core-config.yaml +19 -0
- package/examples/ccip/ccip-warp-route.yaml +26 -0
- package/examples/ccip/multi-chain-ccip-warp-route.yaml +81 -0
- package/examples/chain-config.yaml +42 -0
- package/examples/contract-artifacts.yaml +20 -0
- package/examples/core-config.yaml +19 -0
- package/examples/cosmosnative/core-config.yaml +20 -0
- package/examples/cosmosnative/warp-route-deployment.yaml +21 -0
- package/examples/crosschain/README.md +31 -0
- package/examples/crosschain/cosmosnative/core-config.yaml +69 -0
- package/examples/crosschain/ethereum/core-config.yaml +70 -0
- package/examples/crosschain/radix/core-config.yaml +96 -0
- package/examples/fork/file-transactions.yaml +5 -0
- package/examples/fork/timelock-testing.yaml +36 -0
- package/examples/fork/warp-route-update.yaml +100 -0
- package/examples/hooks.yaml +70 -0
- package/examples/ism-advanced.yaml +33 -0
- package/examples/ism.yaml +13 -0
- package/examples/radix/core-config.yaml +29 -0
- package/examples/sealevel/core-config-apply.yaml +7 -0
- package/examples/sealevel/core-config-composite-ism.yaml +21 -0
- package/examples/sealevel/core-config.yaml +12 -0
- package/examples/sealevel/igp-hook-config.yaml +13 -0
- package/examples/sealevel/warp-config-routing-message-id-multisig-ism.yaml +21 -0
- package/examples/starknet/core-config.yaml +20 -0
- package/examples/submit/strategy/file-strategy.yaml +8 -0
- package/examples/submit/strategy/gnosis-chain-strategy.yaml +10 -0
- package/examples/submit/strategy/gnosis-chain-tx-builder-strategy.yaml +6 -0
- package/examples/submit/strategy/gnosis-strategy-avalanche.yaml +4 -0
- package/examples/submit/strategy/gnosis-tx-builder-ica-strategy.yaml +20 -0
- package/examples/submit/strategy/ica-timelock-strategy.yaml +15 -0
- package/examples/submit/strategy/impersonated-account-strategy.yaml +4 -0
- package/examples/submit/strategy/json-rpc-chain-strategy.yaml +8 -0
- package/examples/submit/strategy/json-rpc-ica-strategy.yaml +13 -0
- package/examples/submit/strategy/json-rpc-strategy.yaml +3 -0
- package/examples/submit/strategy/json-rpc-timelock-strategy.yaml +17 -0
- package/examples/submit/strategy/starknet-json-rpc-chain-strategy.yaml +11 -0
- package/examples/submit/transactions/anvil-transactions.yaml +10 -0
- package/examples/submit/transactions/avalanche-transactions.json +8 -0
- package/examples/submit/transactions/sepolia-transactions.json +8 -0
- package/examples/tron-core-config.yaml +18 -0
- package/examples/warp-base.yaml +24 -0
- package/examples/warp-config-predicate-mainnet.yaml +14 -0
- package/examples/warp-deployed-predicate-mainnet.yaml +19 -0
- package/examples/warp-ethereum.yaml +19 -0
- package/examples/warp-route-deployment.yaml +21 -0
- package/package.json +117 -3
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bundle/file.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const pino = require('./pino')
|
|
4
|
+
const { once } = require('events')
|
|
5
|
+
|
|
6
|
+
module.exports = async function (opts = {}) {
|
|
7
|
+
const destOpts = Object.assign({}, opts, { dest: opts.destination || 1, sync: false })
|
|
8
|
+
delete destOpts.destination
|
|
9
|
+
const destination = pino.destination(destOpts)
|
|
10
|
+
await once(destination, 'ready')
|
|
11
|
+
return destination
|
|
12
|
+
}
|
package/bundle/index.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const EE = require('events')
|
|
4
|
+
const loadTransportStreamBuilder = require('./transport-stream')
|
|
5
|
+
const { pipeline, PassThrough } = require('stream')
|
|
6
|
+
|
|
7
|
+
// This file is not checked by the code coverage tool,
|
|
8
|
+
// as it is not reliable.
|
|
9
|
+
|
|
10
|
+
/* istanbul ignore file */
|
|
11
|
+
|
|
12
|
+
module.exports = async function ({ targets }) {
|
|
13
|
+
const streams = await Promise.all(targets.map(async (t) => {
|
|
14
|
+
const fn = await loadTransportStreamBuilder(t.target)
|
|
15
|
+
const stream = await fn(t.options)
|
|
16
|
+
return stream
|
|
17
|
+
}))
|
|
18
|
+
const ee = new EE()
|
|
19
|
+
|
|
20
|
+
const stream = new PassThrough({
|
|
21
|
+
autoDestroy: true,
|
|
22
|
+
destroy (_, cb) {
|
|
23
|
+
ee.on('error', cb)
|
|
24
|
+
ee.on('closed', cb)
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
pipeline(stream, ...streams, function (err) {
|
|
29
|
+
if (err && err.code !== 'ERR_STREAM_PREMATURE_CLOSE') {
|
|
30
|
+
ee.emit('error', err)
|
|
31
|
+
return
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
ee.emit('closed')
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
return stream
|
|
38
|
+
}
|
package/bundle/worker.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const pino = require('../pino.js')
|
|
4
|
+
const build = require('pino-abstract-transport')
|
|
5
|
+
const loadTransportStreamBuilder = require('./transport-stream')
|
|
6
|
+
|
|
7
|
+
// This file is not checked by the code coverage tool,
|
|
8
|
+
// as it is not reliable.
|
|
9
|
+
|
|
10
|
+
/* istanbul ignore file */
|
|
11
|
+
|
|
12
|
+
module.exports = async function ({ targets, levels, dedupe }) {
|
|
13
|
+
targets = await Promise.all(targets.map(async (t) => {
|
|
14
|
+
const fn = await loadTransportStreamBuilder(t.target)
|
|
15
|
+
const stream = await fn(t.options)
|
|
16
|
+
return {
|
|
17
|
+
level: t.level,
|
|
18
|
+
stream
|
|
19
|
+
}
|
|
20
|
+
}))
|
|
21
|
+
return build(process, {
|
|
22
|
+
parse: 'lines',
|
|
23
|
+
metadata: true,
|
|
24
|
+
close (err, cb) {
|
|
25
|
+
let expected = 0
|
|
26
|
+
for (const transport of targets) {
|
|
27
|
+
expected++
|
|
28
|
+
transport.stream.on('close', closeCb)
|
|
29
|
+
transport.stream.end()
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function closeCb () {
|
|
33
|
+
if (--expected === 0) {
|
|
34
|
+
cb(err)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
function process (stream) {
|
|
41
|
+
const multi = pino.multistream(targets, { levels, dedupe })
|
|
42
|
+
// TODO manage backpressure
|
|
43
|
+
stream.on('data', function (chunk) {
|
|
44
|
+
const { lastTime, lastMsg, lastObj, lastLevel } = this
|
|
45
|
+
multi.lastLevel = lastLevel
|
|
46
|
+
multi.lastTime = lastTime
|
|
47
|
+
multi.lastMsg = lastMsg
|
|
48
|
+
multi.lastObj = lastObj
|
|
49
|
+
|
|
50
|
+
// TODO handle backpressure
|
|
51
|
+
multi.write(chunk + '\n')
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const { realImport, realRequire } = require('real-require')
|
|
4
|
+
const { workerData, parentPort } = require('worker_threads')
|
|
5
|
+
const { WRITE_INDEX, READ_INDEX } = require('./indexes')
|
|
6
|
+
const { waitDiff } = require('./wait')
|
|
7
|
+
|
|
8
|
+
const {
|
|
9
|
+
dataBuf,
|
|
10
|
+
filename,
|
|
11
|
+
stateBuf
|
|
12
|
+
} = workerData
|
|
13
|
+
|
|
14
|
+
let destination
|
|
15
|
+
|
|
16
|
+
const state = new Int32Array(stateBuf)
|
|
17
|
+
const data = Buffer.from(dataBuf)
|
|
18
|
+
|
|
19
|
+
async function start () {
|
|
20
|
+
let worker
|
|
21
|
+
try {
|
|
22
|
+
if (filename.endsWith('.ts') || filename.endsWith('.cts')) {
|
|
23
|
+
// TODO: add support for the TSM modules loader ( https://github.com/lukeed/tsm ).
|
|
24
|
+
if (!process[Symbol.for('ts-node.register.instance')]) {
|
|
25
|
+
realRequire('ts-node/register')
|
|
26
|
+
} else if (process.env.TS_NODE_DEV) {
|
|
27
|
+
realRequire('ts-node-dev')
|
|
28
|
+
}
|
|
29
|
+
// TODO: Support ES imports once tsc, tap & ts-node provide better compatibility guarantees.
|
|
30
|
+
// Remove extra forwardslash on Windows
|
|
31
|
+
worker = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))
|
|
32
|
+
} else {
|
|
33
|
+
worker = (await realImport(filename))
|
|
34
|
+
}
|
|
35
|
+
} catch (error) {
|
|
36
|
+
// A yarn user that tries to start a ThreadStream for an external module
|
|
37
|
+
// provides a filename pointing to a zip file.
|
|
38
|
+
// eg. require.resolve('pino-elasticsearch') // returns /foo/pino-elasticsearch-npm-6.1.0-0c03079478-6915435172.zip/bar.js
|
|
39
|
+
// The `import` will fail to try to load it.
|
|
40
|
+
// This catch block executes the `require` fallback to load the module correctly.
|
|
41
|
+
// In fact, yarn modifies the `require` function to manage the zipped path.
|
|
42
|
+
// More details at https://github.com/pinojs/pino/pull/1113
|
|
43
|
+
// The error codes may change based on the node.js version (ENOTDIR > 12, ERR_MODULE_NOT_FOUND <= 12 )
|
|
44
|
+
if ((error.code === 'ENOTDIR' || error.code === 'ERR_MODULE_NOT_FOUND') &&
|
|
45
|
+
filename.startsWith('file://')) {
|
|
46
|
+
worker = realRequire(decodeURIComponent(filename.replace('file://', '')))
|
|
47
|
+
} else if (error.code === undefined || error.code === 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING') {
|
|
48
|
+
// When bundled with pkg, an undefined error is thrown when called with realImport
|
|
49
|
+
// When bundled with pkg and using node v20, an ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING error is thrown when called with realImport
|
|
50
|
+
// More info at: https://github.com/pinojs/thread-stream/issues/143
|
|
51
|
+
worker = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))
|
|
52
|
+
} else {
|
|
53
|
+
throw error
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Depending on how the default export is performed, and on how the code is
|
|
58
|
+
// transpiled, we may find cases of two nested "default" objects.
|
|
59
|
+
// See https://github.com/pinojs/pino/issues/1243#issuecomment-982774762
|
|
60
|
+
if (typeof worker === 'object') worker = worker.default
|
|
61
|
+
if (typeof worker === 'object') worker = worker.default
|
|
62
|
+
|
|
63
|
+
destination = await worker(workerData.workerData)
|
|
64
|
+
|
|
65
|
+
destination.on('error', function (err) {
|
|
66
|
+
Atomics.store(state, WRITE_INDEX, -2)
|
|
67
|
+
Atomics.notify(state, WRITE_INDEX)
|
|
68
|
+
|
|
69
|
+
Atomics.store(state, READ_INDEX, -2)
|
|
70
|
+
Atomics.notify(state, READ_INDEX)
|
|
71
|
+
|
|
72
|
+
parentPort.postMessage({
|
|
73
|
+
code: 'ERROR',
|
|
74
|
+
err
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
destination.on('close', function () {
|
|
79
|
+
// process._rawDebug('worker close emitted')
|
|
80
|
+
const end = Atomics.load(state, WRITE_INDEX)
|
|
81
|
+
Atomics.store(state, READ_INDEX, end)
|
|
82
|
+
Atomics.notify(state, READ_INDEX)
|
|
83
|
+
setImmediate(() => {
|
|
84
|
+
process.exit(0)
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// No .catch() handler,
|
|
90
|
+
// in case there is an error it goes
|
|
91
|
+
// to unhandledRejection
|
|
92
|
+
start().then(function () {
|
|
93
|
+
parentPort.postMessage({
|
|
94
|
+
code: 'READY'
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
process.nextTick(run)
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
function run () {
|
|
101
|
+
const current = Atomics.load(state, READ_INDEX)
|
|
102
|
+
const end = Atomics.load(state, WRITE_INDEX)
|
|
103
|
+
|
|
104
|
+
// process._rawDebug(`pre state ${current} ${end}`)
|
|
105
|
+
|
|
106
|
+
if (end === current) {
|
|
107
|
+
if (end === data.length) {
|
|
108
|
+
waitDiff(state, READ_INDEX, end, Infinity, run)
|
|
109
|
+
} else {
|
|
110
|
+
waitDiff(state, WRITE_INDEX, end, Infinity, run)
|
|
111
|
+
}
|
|
112
|
+
return
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// process._rawDebug(`post state ${current} ${end}`)
|
|
116
|
+
|
|
117
|
+
if (end === -1) {
|
|
118
|
+
// process._rawDebug('end')
|
|
119
|
+
destination.end()
|
|
120
|
+
return
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const toWrite = data.toString('utf8', current, end)
|
|
124
|
+
// process._rawDebug('worker writing: ' + toWrite)
|
|
125
|
+
|
|
126
|
+
const res = destination.write(toWrite)
|
|
127
|
+
|
|
128
|
+
if (res) {
|
|
129
|
+
Atomics.store(state, READ_INDEX, end)
|
|
130
|
+
Atomics.notify(state, READ_INDEX)
|
|
131
|
+
setImmediate(run)
|
|
132
|
+
} else {
|
|
133
|
+
destination.once('drain', function () {
|
|
134
|
+
Atomics.store(state, READ_INDEX, end)
|
|
135
|
+
Atomics.notify(state, READ_INDEX)
|
|
136
|
+
run()
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
process.on('unhandledRejection', function (err) {
|
|
142
|
+
parentPort.postMessage({
|
|
143
|
+
code: 'ERROR',
|
|
144
|
+
err
|
|
145
|
+
})
|
|
146
|
+
process.exit(1)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
process.on('uncaughtException', function (err) {
|
|
150
|
+
parentPort.postMessage({
|
|
151
|
+
code: 'ERROR',
|
|
152
|
+
err
|
|
153
|
+
})
|
|
154
|
+
process.exit(1)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
process.once('exit', exitCode => {
|
|
158
|
+
if (exitCode !== 0) {
|
|
159
|
+
process.exit(exitCode)
|
|
160
|
+
return
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (destination?.writableNeedDrain && !destination?.writableEnded) {
|
|
164
|
+
parentPort.postMessage({
|
|
165
|
+
code: 'WARNING',
|
|
166
|
+
err: new Error('ThreadStream: process exited before destination stream was drained. this may indicate that the destination stream try to write to a another missing stream')
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
process.exit(0)
|
|
171
|
+
})
|