@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.
Files changed (81) hide show
  1. package/LICENSE.md +193 -0
  2. package/README.md +149 -2
  3. package/bundle/154.index.js +462 -0
  4. package/bundle/230.index.js +569 -0
  5. package/bundle/25.index.js +9569 -0
  6. package/bundle/267.index.js +1386 -0
  7. package/bundle/308.index.js +5121 -0
  8. package/bundle/367.index.js +4 -0
  9. package/bundle/369.index.js +3443 -0
  10. package/bundle/529.index.js +3596 -0
  11. package/bundle/576.index.js +36 -0
  12. package/bundle/610.index.js +86 -0
  13. package/bundle/617.index.js +1612 -0
  14. package/bundle/628.index.js +152 -0
  15. package/bundle/633.index.js +86 -0
  16. package/bundle/697.index.js +410 -0
  17. package/bundle/7183ea1c1bf0a5da980d.js +214 -0
  18. package/bundle/748.index.js +672 -0
  19. package/bundle/78.index.js +372 -0
  20. package/bundle/841.index.js +2093 -0
  21. package/bundle/868.index.js +290 -0
  22. package/bundle/902.index.js +173 -0
  23. package/bundle/956.index.js +9901 -0
  24. package/bundle/aleo_wasm.wasm +0 -0
  25. package/bundle/aleo_wasm1.wasm +0 -0
  26. package/bundle/build/Release/bigint_buffer.node +0 -0
  27. package/bundle/file.js +12 -0
  28. package/bundle/index.js +4 -0
  29. package/bundle/package.json +3 -0
  30. package/bundle/worker-pipeline.js +38 -0
  31. package/bundle/worker.js +54 -0
  32. package/bundle/worker1.js +171 -0
  33. package/bundle/worker2.js +19834 -0
  34. package/bundle/worker3.js +19834 -0
  35. package/examples/aleo/core-config.yaml +19 -0
  36. package/examples/ccip/ccip-warp-route.yaml +26 -0
  37. package/examples/ccip/multi-chain-ccip-warp-route.yaml +81 -0
  38. package/examples/chain-config.yaml +42 -0
  39. package/examples/contract-artifacts.yaml +20 -0
  40. package/examples/core-config.yaml +19 -0
  41. package/examples/cosmosnative/core-config.yaml +20 -0
  42. package/examples/cosmosnative/warp-route-deployment.yaml +21 -0
  43. package/examples/crosschain/README.md +31 -0
  44. package/examples/crosschain/cosmosnative/core-config.yaml +69 -0
  45. package/examples/crosschain/ethereum/core-config.yaml +70 -0
  46. package/examples/crosschain/radix/core-config.yaml +96 -0
  47. package/examples/fork/file-transactions.yaml +5 -0
  48. package/examples/fork/timelock-testing.yaml +36 -0
  49. package/examples/fork/warp-route-update.yaml +100 -0
  50. package/examples/hooks.yaml +70 -0
  51. package/examples/ism-advanced.yaml +33 -0
  52. package/examples/ism.yaml +13 -0
  53. package/examples/radix/core-config.yaml +29 -0
  54. package/examples/sealevel/core-config-apply.yaml +7 -0
  55. package/examples/sealevel/core-config-composite-ism.yaml +21 -0
  56. package/examples/sealevel/core-config.yaml +12 -0
  57. package/examples/sealevel/igp-hook-config.yaml +13 -0
  58. package/examples/sealevel/warp-config-routing-message-id-multisig-ism.yaml +21 -0
  59. package/examples/starknet/core-config.yaml +20 -0
  60. package/examples/submit/strategy/file-strategy.yaml +8 -0
  61. package/examples/submit/strategy/gnosis-chain-strategy.yaml +10 -0
  62. package/examples/submit/strategy/gnosis-chain-tx-builder-strategy.yaml +6 -0
  63. package/examples/submit/strategy/gnosis-strategy-avalanche.yaml +4 -0
  64. package/examples/submit/strategy/gnosis-tx-builder-ica-strategy.yaml +20 -0
  65. package/examples/submit/strategy/ica-timelock-strategy.yaml +15 -0
  66. package/examples/submit/strategy/impersonated-account-strategy.yaml +4 -0
  67. package/examples/submit/strategy/json-rpc-chain-strategy.yaml +8 -0
  68. package/examples/submit/strategy/json-rpc-ica-strategy.yaml +13 -0
  69. package/examples/submit/strategy/json-rpc-strategy.yaml +3 -0
  70. package/examples/submit/strategy/json-rpc-timelock-strategy.yaml +17 -0
  71. package/examples/submit/strategy/starknet-json-rpc-chain-strategy.yaml +11 -0
  72. package/examples/submit/transactions/anvil-transactions.yaml +10 -0
  73. package/examples/submit/transactions/avalanche-transactions.json +8 -0
  74. package/examples/submit/transactions/sepolia-transactions.json +8 -0
  75. package/examples/tron-core-config.yaml +18 -0
  76. package/examples/warp-base.yaml +24 -0
  77. package/examples/warp-config-predicate-mainnet.yaml +14 -0
  78. package/examples/warp-deployed-predicate-mainnet.yaml +19 -0
  79. package/examples/warp-ethereum.yaml +19 -0
  80. package/examples/warp-route-deployment.yaml +21 -0
  81. package/package.json +117 -3
@@ -0,0 +1,214 @@
1
+ import 'core-js/proposals/json-parse-with-source.js';
2
+ import { webcrypto } from 'node:crypto';
3
+ import * as $fs from 'node:fs';
4
+ import $mime from 'mime/lite';
5
+ import $xmlhttprequest from 'xmlhttprequest-ssl';
6
+ import * as $worker from 'node:worker_threads';
7
+ import * as $os from 'node:os';
8
+
9
+ if (globalThis.crypto == null) {
10
+ globalThis.crypto = webcrypto;
11
+ }
12
+
13
+ const oldFetch = globalThis.fetch;
14
+ let supports = null;
15
+ async function checkFetch() {
16
+ try {
17
+ await oldFetch(new URL("file:"));
18
+ return true;
19
+ }
20
+ catch (e) {
21
+ return false;
22
+ }
23
+ }
24
+ async function supportsFetch() {
25
+ if (supports === null) {
26
+ supports = checkFetch();
27
+ }
28
+ return await supports;
29
+ }
30
+ // We always polyfill fetch because Node's fetch doesn't support file URLs.
31
+ globalThis.fetch = async function (resource, options) {
32
+ const request = new Request(resource, options);
33
+ const url = new URL(request.url);
34
+ if (!(await supportsFetch()) && url.protocol === "file:") {
35
+ const readStream = $fs.createReadStream(url);
36
+ const headers = {};
37
+ const type = $mime.getType(url.pathname);
38
+ if (type) {
39
+ headers["Content-Type"] = type;
40
+ }
41
+ return new Response(readStream, {
42
+ status: 200,
43
+ statusText: "OK",
44
+ headers,
45
+ });
46
+ }
47
+ else {
48
+ return await oldFetch(request);
49
+ }
50
+ };
51
+
52
+ // @ts-ignore
53
+ if (globalThis.XMLHttpRequest == null) {
54
+ globalThis.XMLHttpRequest = class extends $xmlhttprequest.XMLHttpRequest {
55
+ constructor(opts) {
56
+ super({ syncPolicy: "enabled", ...opts });
57
+ }
58
+ };
59
+ }
60
+
61
+ // This is technically not a part of the Worker polyfill,
62
+ // but Workers are used for multi-threading, so this is often
63
+ // needed when writing Worker code.
64
+ if (globalThis.navigator == null) {
65
+ globalThis.navigator = {
66
+ hardwareConcurrency: $os.availableParallelism(),
67
+ };
68
+ }
69
+ if (globalThis.Worker == null) {
70
+ globalThis.Worker = class Worker extends EventTarget {
71
+ _worker;
72
+ constructor(url, options) {
73
+ super();
74
+ if (url instanceof URL) {
75
+ if (url.protocol !== "file:") {
76
+ throw new Error("Worker only supports file: URLs");
77
+ }
78
+ url = url.href;
79
+ }
80
+ else {
81
+ throw new Error("Filepaths are unreliable, use `new URL(\"...\", import.meta.url)` instead.");
82
+ }
83
+ if (!options || options.type !== "module") {
84
+ throw new Error("Workers must use \`type: \"module\"\`");
85
+ }
86
+ const code = `
87
+ import("node:worker_threads")
88
+ .then(({ workerData }) => {
89
+ return import(workerData.polyfill)
90
+ .then(() => import(workerData.url))
91
+ })
92
+ .catch((e) => {
93
+ // TODO maybe it should send a message to the parent?
94
+ console.error(e.stack);
95
+ });
96
+ `;
97
+ this._worker = new $worker.Worker(code, {
98
+ eval: true,
99
+ workerData: {
100
+ url,
101
+ polyfill: new URL("node-polyfill.js", import.meta.url).href,
102
+ },
103
+ });
104
+ this._worker.on("message", (data) => {
105
+ this.dispatchEvent(new MessageEvent("message", { data }));
106
+ });
107
+ this._worker.on("messageerror", (error) => {
108
+ throw new Error("UNIMPLEMENTED");
109
+ });
110
+ this._worker.on("error", (error) => {
111
+ // TODO attach the error to the event somehow
112
+ const event = new Event("error");
113
+ this.dispatchEvent(event);
114
+ });
115
+ }
116
+ set onmessage(f) {
117
+ throw new Error("UNIMPLEMENTED");
118
+ }
119
+ set onmessageerror(f) {
120
+ throw new Error("UNIMPLEMENTED");
121
+ }
122
+ set onerror(f) {
123
+ throw new Error("UNIMPLEMENTED");
124
+ }
125
+ postMessage(value, transfer) {
126
+ this._worker.postMessage(value, transfer);
127
+ }
128
+ terminate() {
129
+ this._worker.terminate();
130
+ }
131
+ // This is Node-specific, it allows the process to exit
132
+ // even if the Worker is still running.
133
+ unref() {
134
+ this._worker.unref();
135
+ }
136
+ };
137
+ }
138
+ if (!$worker.isMainThread) {
139
+ const globals = globalThis;
140
+ // This is used to create the onmessage, onmessageerror, and onerror setters
141
+ const makeSetter = (prop, event) => {
142
+ let oldvalue;
143
+ Object.defineProperty(globals, prop, {
144
+ get() {
145
+ return oldvalue;
146
+ },
147
+ set(value) {
148
+ if (oldvalue) {
149
+ globals.removeEventListener(event, oldvalue);
150
+ }
151
+ oldvalue = value;
152
+ if (oldvalue) {
153
+ globals.addEventListener(event, oldvalue);
154
+ }
155
+ },
156
+ });
157
+ };
158
+ // This makes sure that `f` is only run once
159
+ const memoize = (f) => {
160
+ let run = false;
161
+ return () => {
162
+ if (!run) {
163
+ run = true;
164
+ f();
165
+ }
166
+ };
167
+ };
168
+ // We only start listening for messages / errors when the worker calls addEventListener
169
+ const startOnMessage = memoize(() => {
170
+ $worker.parentPort.on("message", (data) => {
171
+ workerEvents.dispatchEvent(new MessageEvent("message", { data }));
172
+ });
173
+ });
174
+ const startOnMessageError = memoize(() => {
175
+ throw new Error("UNIMPLEMENTED");
176
+ });
177
+ const startOnError = memoize(() => {
178
+ $worker.parentPort.on("error", (data) => {
179
+ workerEvents.dispatchEvent(new Event("error"));
180
+ });
181
+ });
182
+ // Node workers don't have top-level events, so we have to make our own
183
+ const workerEvents = new EventTarget();
184
+ globals.close = () => {
185
+ process.exit();
186
+ };
187
+ globals.addEventListener = (type, callback, options) => {
188
+ workerEvents.addEventListener(type, callback, options);
189
+ if (type === "message") {
190
+ startOnMessage();
191
+ }
192
+ else if (type === "messageerror") {
193
+ startOnMessageError();
194
+ }
195
+ else if (type === "error") {
196
+ startOnError();
197
+ }
198
+ };
199
+ globals.removeEventListener = (type, callback, options) => {
200
+ workerEvents.removeEventListener(type, callback, options);
201
+ };
202
+ function postMessage(value, transfer) {
203
+ $worker.parentPort.postMessage(value, transfer);
204
+ }
205
+ globals.postMessage = postMessage;
206
+ makeSetter("onmessage", "message");
207
+ makeSetter("onmessageerror", "messageerror");
208
+ makeSetter("onerror", "error");
209
+ }
210
+
211
+ if (!globalThis.self) {
212
+ globalThis.self = globalThis;
213
+ }
214
+ //# sourceMappingURL=node-polyfill.js.map