@acala-network/chopsticks 0.8.5-5 → 0.9.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/chopsticks.js +1 -1
- package/{lib → dist/cjs}/plugins/dry-run/dry-run-preimage.js +1 -3
- package/{lib → dist/cjs}/plugins/run-block/index.js +15 -21
- package/{lib → dist/cjs}/utils/generate-html-diff.js +1 -1
- package/dist/esm/cli-options.js +40 -0
- package/dist/esm/cli.js +90 -0
- package/dist/esm/context.js +86 -0
- package/dist/esm/plugins/decode-key/index.js +23 -0
- package/dist/esm/plugins/dry-run/cli.js +42 -0
- package/dist/esm/plugins/dry-run/dry-run-extrinsic.js +29 -0
- package/dist/esm/plugins/dry-run/dry-run-preimage.js +92 -0
- package/dist/esm/plugins/dry-run/rpc.js +101 -0
- package/dist/esm/plugins/index.js +25 -0
- package/dist/esm/plugins/new-block/index.js +67 -0
- package/dist/esm/plugins/run-block/index.js +176 -0
- package/dist/esm/plugins/set-block-build-mode/index.js +25 -0
- package/dist/esm/plugins/set-head/index.js +31 -0
- package/dist/esm/plugins/set-runtime-log-level/index.js +24 -0
- package/dist/esm/plugins/set-storage/index.js +38 -0
- package/dist/esm/plugins/time-travel/index.js +23 -0
- package/dist/esm/plugins/try-runtime/index.js +54 -0
- package/{lib/plugins/types.d.ts → dist/esm/plugins/types.js} +3 -3
- package/dist/esm/rpc/index.js +26 -0
- package/dist/esm/schema/index.js +53 -0
- package/dist/esm/server.js +164 -0
- package/dist/esm/setup-with-server.js +22 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/utils/decoder.js +15 -0
- package/dist/esm/utils/generate-html-diff.js +16 -0
- package/dist/esm/utils/open-html.js +5 -0
- package/dist/esm/utils/override.js +43 -0
- package/dist/esm/utils/tunnel.js +11 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/logger.d.ts +1 -0
- package/dist/types/plugins/dry-run/index.d.ts +2 -0
- package/{lib → dist/types}/plugins/run-block/index.d.ts +14 -6
- package/dist/types/plugins/types.d.ts +11 -0
- package/dist/types/utils/index.d.ts +4 -0
- package/package.json +23 -14
- /package/{lib → dist/cjs}/cli-options.js +0 -0
- /package/{lib → dist/cjs}/cli.js +0 -0
- /package/{lib → dist/cjs}/context.js +0 -0
- /package/{lib → dist/cjs}/index.js +0 -0
- /package/{lib → dist/cjs}/logger.js +0 -0
- /package/{lib → dist/cjs}/plugins/decode-key/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/dry-run/cli.js +0 -0
- /package/{lib → dist/cjs}/plugins/dry-run/dry-run-extrinsic.js +0 -0
- /package/{lib → dist/cjs}/plugins/dry-run/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/dry-run/rpc.js +0 -0
- /package/{lib → dist/cjs}/plugins/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/new-block/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/set-block-build-mode/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/set-head/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/set-runtime-log-level/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/set-storage/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/time-travel/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/try-runtime/index.js +0 -0
- /package/{lib → dist/cjs}/plugins/types.js +0 -0
- /package/{lib → dist/cjs}/rpc/index.js +0 -0
- /package/{lib → dist/cjs}/schema/index.js +0 -0
- /package/{lib → dist/cjs}/server.js +0 -0
- /package/{lib → dist/cjs}/setup-with-server.js +0 -0
- /package/{lib → dist/cjs}/types.js +0 -0
- /package/{lib → dist/cjs}/utils/decoder.js +0 -0
- /package/{lib → dist/cjs}/utils/index.js +0 -0
- /package/{lib → dist/cjs}/utils/open-html.js +0 -0
- /package/{lib → dist/cjs}/utils/override.js +0 -0
- /package/{lib → dist/cjs}/utils/tunnel.js +0 -0
- /package/{lib/index.d.ts → dist/esm/index.js} +0 -0
- /package/{lib/logger.d.ts → dist/esm/logger.js} +0 -0
- /package/{lib/plugins/dry-run/index.d.ts → dist/esm/plugins/dry-run/index.js} +0 -0
- /package/{lib/utils/index.d.ts → dist/esm/utils/index.js} +0 -0
- /package/{lib → dist/types}/cli-options.d.ts +0 -0
- /package/{lib → dist/types}/cli.d.ts +0 -0
- /package/{lib → dist/types}/context.d.ts +0 -0
- /package/{lib → dist/types}/plugins/decode-key/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/dry-run/cli.d.ts +0 -0
- /package/{lib → dist/types}/plugins/dry-run/dry-run-extrinsic.d.ts +0 -0
- /package/{lib → dist/types}/plugins/dry-run/dry-run-preimage.d.ts +0 -0
- /package/{lib → dist/types}/plugins/dry-run/rpc.d.ts +0 -0
- /package/{lib → dist/types}/plugins/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/new-block/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/set-block-build-mode/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/set-head/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/set-runtime-log-level/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/set-storage/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/time-travel/index.d.ts +0 -0
- /package/{lib → dist/types}/plugins/try-runtime/index.d.ts +0 -0
- /package/{lib → dist/types}/rpc/index.d.ts +0 -0
- /package/{lib → dist/types}/schema/index.d.ts +0 -0
- /package/{lib → dist/types}/server.d.ts +0 -0
- /package/{lib → dist/types}/setup-with-server.d.ts +0 -0
- /package/{lib → dist/types}/types.d.ts +0 -0
- /package/{lib → dist/types}/utils/decoder.d.ts +0 -0
- /package/{lib → dist/types}/utils/generate-html-diff.d.ts +0 -0
- /package/{lib → dist/types}/utils/open-html.d.ts +0 -0
- /package/{lib → dist/types}/utils/override.d.ts +0 -0
- /package/{lib → dist/types}/utils/tunnel.d.ts +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { WebSocket, WebSocketServer } from 'ws';
|
|
2
|
+
import { ResponseError } from '@acala-network/chopsticks-core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { defaultLogger, truncate } from './logger';
|
|
5
|
+
const logger = defaultLogger.child({ name: 'ws' });
|
|
6
|
+
const singleRequest = z.object({
|
|
7
|
+
id: z.number(),
|
|
8
|
+
jsonrpc: z.literal('2.0'),
|
|
9
|
+
method: z.string(),
|
|
10
|
+
params: z.array(z.any()).default([]),
|
|
11
|
+
});
|
|
12
|
+
const batchRequest = z.array(singleRequest);
|
|
13
|
+
const requestSchema = z.union([singleRequest, batchRequest]);
|
|
14
|
+
const parseRequest = (request) => {
|
|
15
|
+
try {
|
|
16
|
+
return JSON.parse(request);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const createWS = async (port) => {
|
|
23
|
+
const wss = new WebSocketServer({ port, maxPayload: 1024 * 1024 * 100 });
|
|
24
|
+
const promise = new Promise((resolve) => {
|
|
25
|
+
wss.on('listening', () => {
|
|
26
|
+
resolve([wss, wss.address().port]);
|
|
27
|
+
});
|
|
28
|
+
wss.on('error', (_) => {
|
|
29
|
+
resolve([]);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return promise;
|
|
33
|
+
};
|
|
34
|
+
export const createServer = async (handler, port) => {
|
|
35
|
+
let wss;
|
|
36
|
+
let listenPort;
|
|
37
|
+
for (let i = 0; i < 10; i++) {
|
|
38
|
+
const preferPort = (port ?? 0) > 0 ? (port ?? 0) + i : 0;
|
|
39
|
+
logger.debug('Try starting on port %d', preferPort);
|
|
40
|
+
const [maybeWss, maybeListenPort] = await createWS(preferPort);
|
|
41
|
+
if (maybeWss && maybeListenPort) {
|
|
42
|
+
wss = maybeWss;
|
|
43
|
+
listenPort = maybeListenPort;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!wss || !listenPort) {
|
|
48
|
+
throw new Error(`Failed to create WebsocketServer at port ${port}`);
|
|
49
|
+
}
|
|
50
|
+
wss.on('connection', (ws) => {
|
|
51
|
+
logger.debug('New connection');
|
|
52
|
+
const send = (data) => {
|
|
53
|
+
if (ws.readyState === WebSocket.OPEN) {
|
|
54
|
+
ws.send(JSON.stringify(data));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const subscriptions = {};
|
|
58
|
+
const subscriptionManager = {
|
|
59
|
+
subscribe: (method, subid, onCancel = () => { }) => {
|
|
60
|
+
subscriptions[subid] = onCancel;
|
|
61
|
+
return (data) => {
|
|
62
|
+
if (subscriptions[subid]) {
|
|
63
|
+
logger.trace({ method, subid, data: truncate(data) }, 'Subscription notification');
|
|
64
|
+
send({
|
|
65
|
+
jsonrpc: '2.0',
|
|
66
|
+
method,
|
|
67
|
+
params: {
|
|
68
|
+
result: data,
|
|
69
|
+
subscription: subid,
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
unsubscribe: (subid) => {
|
|
76
|
+
if (subscriptions[subid]) {
|
|
77
|
+
subscriptions[subid](subid);
|
|
78
|
+
delete subscriptions[subid];
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
const processRequest = async (req) => {
|
|
83
|
+
logger.trace({
|
|
84
|
+
id: req.id,
|
|
85
|
+
method: req.method,
|
|
86
|
+
}, 'Received message');
|
|
87
|
+
try {
|
|
88
|
+
const resp = await handler(req, subscriptionManager);
|
|
89
|
+
logger.trace({
|
|
90
|
+
id: req.id,
|
|
91
|
+
method: req.method,
|
|
92
|
+
result: truncate(resp),
|
|
93
|
+
}, 'Response for request');
|
|
94
|
+
return {
|
|
95
|
+
id: req.id,
|
|
96
|
+
jsonrpc: '2.0',
|
|
97
|
+
result: resp ?? null,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
catch (e) {
|
|
101
|
+
logger.info('Error handling request: %s %o', e, e.stack);
|
|
102
|
+
return {
|
|
103
|
+
id: req.id,
|
|
104
|
+
jsonrpc: '2.0',
|
|
105
|
+
error: e instanceof ResponseError ? e : { code: -32603, message: `Internal ${e}` },
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
ws.on('close', () => {
|
|
110
|
+
logger.debug('Connection closed');
|
|
111
|
+
for (const [subid, onCancel] of Object.entries(subscriptions)) {
|
|
112
|
+
onCancel(subid);
|
|
113
|
+
}
|
|
114
|
+
ws.removeAllListeners();
|
|
115
|
+
});
|
|
116
|
+
ws.on('error', () => {
|
|
117
|
+
logger.debug('Connection error');
|
|
118
|
+
for (const [subid, onCancel] of Object.entries(subscriptions)) {
|
|
119
|
+
onCancel(subid);
|
|
120
|
+
}
|
|
121
|
+
ws.removeAllListeners();
|
|
122
|
+
});
|
|
123
|
+
ws.on('message', async (message) => {
|
|
124
|
+
const parsed = await requestSchema.safeParseAsync(parseRequest(message.toString()));
|
|
125
|
+
if (!parsed.success) {
|
|
126
|
+
logger.info('Invalid request: %s', message);
|
|
127
|
+
send({
|
|
128
|
+
id: null,
|
|
129
|
+
jsonrpc: '2.0',
|
|
130
|
+
error: {
|
|
131
|
+
code: -32600,
|
|
132
|
+
message: 'Invalid JSON Request',
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const { data: req } = parsed;
|
|
138
|
+
if (Array.isArray(req)) {
|
|
139
|
+
logger.trace({ req }, 'Received batch request');
|
|
140
|
+
const resp = await Promise.all(req.map(processRequest));
|
|
141
|
+
send(resp);
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
logger.trace({ req }, 'Received single request');
|
|
145
|
+
const resp = await processRequest(req);
|
|
146
|
+
send(resp);
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
port: listenPort,
|
|
152
|
+
close: () => new Promise((resolve, reject) => {
|
|
153
|
+
wss?.clients.forEach((socket) => socket.close());
|
|
154
|
+
wss?.close((err) => {
|
|
155
|
+
if (err) {
|
|
156
|
+
reject(err);
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
resolve();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
}),
|
|
163
|
+
};
|
|
164
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createServer } from './server';
|
|
2
|
+
import { handler } from './rpc';
|
|
3
|
+
import { logger } from '@acala-network/chopsticks-core';
|
|
4
|
+
import { setupContext } from './context';
|
|
5
|
+
export const setupWithServer = async (argv) => {
|
|
6
|
+
const context = await setupContext(argv);
|
|
7
|
+
const port = argv.port ?? 8000;
|
|
8
|
+
if (argv.genesis) {
|
|
9
|
+
// mine 1st block when starting from genesis to set some mock validation data
|
|
10
|
+
await context.chain.newBlock();
|
|
11
|
+
}
|
|
12
|
+
const { close, port: listenPort } = await createServer(handler(context), port);
|
|
13
|
+
logger.info(`${await context.chain.api.getSystemChain()} RPC listening on port ${listenPort}`);
|
|
14
|
+
return {
|
|
15
|
+
...context,
|
|
16
|
+
listenPort,
|
|
17
|
+
async close() {
|
|
18
|
+
await context.chain.close();
|
|
19
|
+
await close();
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { decodeBlockStorageDiff } from '@acala-network/chopsticks-core';
|
|
2
|
+
import { create } from 'jsondiffpatch';
|
|
3
|
+
import _ from 'lodash';
|
|
4
|
+
const diffPatcher = create({
|
|
5
|
+
array: { detectMove: false },
|
|
6
|
+
textDiff: { minLength: Number.MAX_VALUE }, // skip text diff
|
|
7
|
+
});
|
|
8
|
+
export const decodeStorageDiff = async (block, diff) => {
|
|
9
|
+
const [oldState, newState] = await decodeBlockStorageDiff(block, diff);
|
|
10
|
+
const oldStateWithoutEvents = _.cloneDeep(oldState);
|
|
11
|
+
if (oldStateWithoutEvents['system']?.['events']) {
|
|
12
|
+
oldStateWithoutEvents['system']['events'] = [];
|
|
13
|
+
}
|
|
14
|
+
return { oldState, newState, delta: diffPatcher.diff(oldStateWithoutEvents, newState) };
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { decodeStorageDiff } from './decoder';
|
|
2
|
+
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { template } from 'lodash';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
export const generateHtmlDiff = async (block, diff) => {
|
|
6
|
+
const { oldState, delta } = await decodeStorageDiff(block, diff);
|
|
7
|
+
const htmlTemplate = readFileSync(path.join(__dirname, '../../../template/diff.html'), 'utf-8');
|
|
8
|
+
return template(htmlTemplate)({ left: JSON.stringify(oldState), delta: JSON.stringify(delta) });
|
|
9
|
+
};
|
|
10
|
+
export const generateHtmlDiffPreviewFile = async (block, diff, filename) => {
|
|
11
|
+
const html = await generateHtmlDiff(block, diff);
|
|
12
|
+
mkdirSync('./preview', { recursive: true });
|
|
13
|
+
const filePath = `./preview/${filename}.html`;
|
|
14
|
+
writeFileSync(filePath, html);
|
|
15
|
+
return filePath;
|
|
16
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { setStorage } from '@acala-network/chopsticks-core';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import yaml from 'js-yaml';
|
|
4
|
+
import { defaultLogger } from '../logger';
|
|
5
|
+
export const overrideStorage = async (chain, storage, at) => {
|
|
6
|
+
if (storage == null) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
let storageValue;
|
|
10
|
+
if (typeof storage === 'string') {
|
|
11
|
+
if (!existsSync(storage))
|
|
12
|
+
throw Error(`File ${storage} does not exist`);
|
|
13
|
+
storageValue = yaml.load(String(readFileSync(storage)));
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
storageValue = storage;
|
|
17
|
+
}
|
|
18
|
+
const blockHash = await setStorage(chain, storageValue, at);
|
|
19
|
+
defaultLogger.trace({ blockHash, storage }, 'OverrideStorage');
|
|
20
|
+
};
|
|
21
|
+
export const overrideWasm = async (chain, wasmPath, at) => {
|
|
22
|
+
if (wasmPath == null) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const wasm = readFileSync(wasmPath);
|
|
26
|
+
let wasmHex;
|
|
27
|
+
if (wasm.at(0) === 0x30 && wasm.at(1) === 0x78) {
|
|
28
|
+
// starts with 0x
|
|
29
|
+
wasmHex = wasm.toString().trim();
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
wasmHex = '0x' + wasm.toString('hex');
|
|
33
|
+
}
|
|
34
|
+
if (at) {
|
|
35
|
+
const block = await chain.getBlock(at);
|
|
36
|
+
if (!block)
|
|
37
|
+
throw new Error(`Cannot find block ${at}`);
|
|
38
|
+
block.setWasm(wasmHex);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
chain.head.setWasm(wasmHex);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import 'global-agent/bootstrap';
|
|
2
|
+
import npmConf from '@pnpm/npm-conf';
|
|
3
|
+
const npmConfig = npmConf().config;
|
|
4
|
+
global.GLOBAL_AGENT.HTTP_PROXY =
|
|
5
|
+
process.env.HTTP_PROXY ||
|
|
6
|
+
process.env.http_proxy ||
|
|
7
|
+
process.env.HTTPS_PROXY ||
|
|
8
|
+
process.env.https_proxy ||
|
|
9
|
+
npmConfig.get('proxy') ||
|
|
10
|
+
npmConfig.get('https-proxy') ||
|
|
11
|
+
global.GLOBAL_AGENT.HTTP_PROXY;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defaultLogger, truncate } from '@acala-network/chopsticks-core';
|
|
@@ -75,13 +75,21 @@ export interface RunBlockResponse {
|
|
|
75
75
|
*/
|
|
76
76
|
phase: Phase;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* The modified storages of this phase.
|
|
79
79
|
*/
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
storageDiff: {
|
|
81
|
+
/**
|
|
82
|
+
* Raw storage diff in bytes. Only available when `includeRaw` is true.
|
|
83
|
+
*/
|
|
84
|
+
raw?: {
|
|
85
|
+
key: HexString;
|
|
86
|
+
value: HexString | null;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Decoded storage diff. Only available when `includeParsed` is true.
|
|
90
|
+
*/
|
|
91
|
+
parsed?: any;
|
|
92
|
+
}[];
|
|
85
93
|
/**
|
|
86
94
|
* Runtime logs.
|
|
87
95
|
*/
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { rpc as newBlock } from './new-block';
|
|
2
|
+
export { rpc as dryRun } from './dry-run';
|
|
3
|
+
export { rpc as setBlockBuildMode } from './set-block-build-mode';
|
|
4
|
+
export { rpc as setHead } from './set-head';
|
|
5
|
+
export { rpc as setRuntimeLogLevel } from './set-runtime-log-level';
|
|
6
|
+
export { rpc as setStorage } from './set-storage';
|
|
7
|
+
export { rpc as timeTravel } from './time-travel';
|
|
8
|
+
export { rpc as runBlock } from './run-block';
|
|
9
|
+
export type { NewBlockParams } from './new-block';
|
|
10
|
+
export type { DryRunParams } from './dry-run';
|
|
11
|
+
export type { RunBlockParams } from './run-block';
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acala-network/chopsticks",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"author": "Acala Developers <hello@acala.network>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": "./chopsticks.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"clean": "rm -rf
|
|
9
|
-
"build": "tsc -p ./tsconfig.json",
|
|
8
|
+
"clean": "rm -rf dist",
|
|
9
|
+
"build": "yarn clean && tsc -p ./tsconfig.json && tsc -p ./tsconfig.esm.json",
|
|
10
10
|
"script:start": "cd ../..; ts-node --transpile-only -r tsconfig-paths/register packages/chopsticks/src/cli.ts",
|
|
11
11
|
"script:run": "cd ../..; LOG_LEVEL=trace ts-node-dev --transpile-only -r tsconfig-paths/register --inspect --notify=false packages/chopsticks/src/cli.ts -- --config=configs/dev.yml",
|
|
12
12
|
"dev:karura": "cd ../..; ts-node-dev --transpile-only --inspect -r tsconfig-paths/register --notify=false packages/chopsticks/src/cli.ts -- --config=configs/karura.yml",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"docs:prep": "typedoc"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@acala-network/chopsticks-core": "0.
|
|
21
|
-
"@acala-network/chopsticks-db": "0.
|
|
20
|
+
"@acala-network/chopsticks-core": "0.9.0",
|
|
21
|
+
"@acala-network/chopsticks-db": "0.9.0",
|
|
22
22
|
"@pnpm/npm-conf": "^2.2.2",
|
|
23
23
|
"axios": "^1.5.1",
|
|
24
24
|
"dotenv": "^16.3.1",
|
|
@@ -42,24 +42,33 @@
|
|
|
42
42
|
"typescript": "^5.1.6"
|
|
43
43
|
},
|
|
44
44
|
"files": [
|
|
45
|
-
"
|
|
45
|
+
"dist/esm/**",
|
|
46
|
+
"dist/cjs/**",
|
|
47
|
+
"dist/types/**",
|
|
46
48
|
"template",
|
|
47
49
|
"chopsticks.js"
|
|
48
50
|
],
|
|
49
|
-
"main": "./
|
|
50
|
-
"
|
|
51
|
+
"main": "./dist/cjs/index.js",
|
|
52
|
+
"module": "./dist/esm/index.js",
|
|
53
|
+
"types": "./dist/types/index.d.ts",
|
|
51
54
|
"exports": {
|
|
52
55
|
".": {
|
|
53
|
-
"types": "./
|
|
54
|
-
"
|
|
56
|
+
"types": "./dist/types/index.d.ts",
|
|
57
|
+
"require": "./dist/cjs/index.js",
|
|
58
|
+
"import": "./dist/esm/index.js",
|
|
59
|
+
"default": "./dist/esm/index.js"
|
|
55
60
|
},
|
|
56
61
|
"./*": {
|
|
57
|
-
"types": "./
|
|
58
|
-
"
|
|
62
|
+
"types": "./dist/types/index.d.ts",
|
|
63
|
+
"require": "./dist/cjs/index.js",
|
|
64
|
+
"import": "./dist/esm/index.js",
|
|
65
|
+
"default": "./dist/esm/index.js"
|
|
59
66
|
},
|
|
60
67
|
"./plugins/*": {
|
|
61
|
-
"types": "./
|
|
62
|
-
"
|
|
68
|
+
"types": "./dist/types/plugins/*.d.ts",
|
|
69
|
+
"require": "./dist/cjs/plugins/*.js",
|
|
70
|
+
"import": "./dist/esm/plugins/*.js",
|
|
71
|
+
"default": "./dist/esm/plugins/*.js"
|
|
63
72
|
},
|
|
64
73
|
"./package.json": "./package.json"
|
|
65
74
|
}
|
|
File without changes
|
/package/{lib → dist/cjs}/cli.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|