@rocketh/core 0.16.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.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/environment/index.d.ts +17 -0
  4. package/dist/environment/index.d.ts.map +1 -0
  5. package/dist/environment/index.js +630 -0
  6. package/dist/environment/index.js.map +1 -0
  7. package/dist/environment/providers/BaseProvider.d.ts +8 -0
  8. package/dist/environment/providers/BaseProvider.d.ts.map +1 -0
  9. package/dist/environment/providers/BaseProvider.js +10 -0
  10. package/dist/environment/providers/BaseProvider.js.map +1 -0
  11. package/dist/environment/providers/TransactionHashTracker.d.ts +11 -0
  12. package/dist/environment/providers/TransactionHashTracker.d.ts.map +1 -0
  13. package/dist/environment/providers/TransactionHashTracker.js +15 -0
  14. package/dist/environment/providers/TransactionHashTracker.js.map +1 -0
  15. package/dist/environment/utils/artifacts.d.ts +39 -0
  16. package/dist/environment/utils/artifacts.d.ts.map +1 -0
  17. package/dist/environment/utils/artifacts.js +158 -0
  18. package/dist/environment/utils/artifacts.js.map +1 -0
  19. package/dist/environment/utils/chains.d.ts +18 -0
  20. package/dist/environment/utils/chains.d.ts.map +1 -0
  21. package/dist/environment/utils/chains.js +152 -0
  22. package/dist/environment/utils/chains.js.map +1 -0
  23. package/dist/executor/index.d.ts +55 -0
  24. package/dist/executor/index.d.ts.map +1 -0
  25. package/dist/executor/index.js +366 -0
  26. package/dist/executor/index.js.map +1 -0
  27. package/dist/index.d.ts +9 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +9 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/internal/logging.d.ts +11 -0
  32. package/dist/internal/logging.d.ts.map +1 -0
  33. package/dist/internal/logging.js +71 -0
  34. package/dist/internal/logging.js.map +1 -0
  35. package/dist/internal/types.d.ts +5 -0
  36. package/dist/internal/types.d.ts.map +1 -0
  37. package/dist/internal/types.js +2 -0
  38. package/dist/internal/types.js.map +1 -0
  39. package/dist/types.d.ts +494 -0
  40. package/dist/types.d.ts.map +1 -0
  41. package/dist/types.js +2 -0
  42. package/dist/types.js.map +1 -0
  43. package/dist/utils/eth.d.ts +24 -0
  44. package/dist/utils/eth.d.ts.map +1 -0
  45. package/dist/utils/eth.js +62 -0
  46. package/dist/utils/eth.js.map +1 -0
  47. package/dist/utils/extensions.d.ts +32 -0
  48. package/dist/utils/extensions.d.ts.map +1 -0
  49. package/dist/utils/extensions.js +49 -0
  50. package/dist/utils/extensions.js.map +1 -0
  51. package/dist/utils/extensions.test.d.ts +18 -0
  52. package/dist/utils/extensions.test.d.ts.map +1 -0
  53. package/dist/utils/extensions.test.js +35 -0
  54. package/dist/utils/extensions.test.js.map +1 -0
  55. package/dist/utils/json.d.ts +6 -0
  56. package/dist/utils/json.d.ts.map +1 -0
  57. package/dist/utils/json.js +28 -0
  58. package/dist/utils/json.js.map +1 -0
  59. package/package.json +50 -0
@@ -0,0 +1,366 @@
1
+ import { withEnvironment } from '../utils/extensions.js';
2
+ import { getChainByName, getChainConfig } from '../environment/utils/chains.js';
3
+ import { JSONRPCHTTPProvider } from 'eip-1193-jsonrpc-provider';
4
+ import { createEnvironment } from '../environment/index.js';
5
+ import { logger, setLogLevel, spin } from '../internal/logging.js';
6
+ import { getRoughGasPriceEstimate } from '../utils/eth.js';
7
+ import { formatEther } from 'viem';
8
+ /**
9
+ * Setup function that creates the execute function for deploy scripts. It allow to specify a set of functions that will be available in the environment.
10
+ *
11
+ * @param functions - An object of utility functions that expect Environment as their first parameter
12
+ * @returns An execute function that provides an enhanced environment with curried functions
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const functions = {
17
+ * deploy: (env: Environment) => ((contractName: string, args: any[]) => Promise<void>),
18
+ * verify: (env: Environment) => ((address: string) => Promise<boolean>)
19
+ * };
20
+ *
21
+ * const {deployScript} = setup(functions);
22
+ *
23
+ * export default deployScript(async (env, args) => {
24
+ * // env now includes both the original environment AND the curried functions
25
+ * await env.deploy('MyContract', []); // No need to pass env
26
+ * await env.verify('0x123...'); // No need to pass env
27
+ *
28
+ * // Original environment properties are still available
29
+ * console.log(env.network.name);
30
+ * const deployment = env.get('MyContract');
31
+ * }, { tags: ['deploy'] });
32
+ * ```
33
+ */
34
+ export function setupDeployScripts(extensions) {
35
+ function enhancedExecute(callback, options) {
36
+ const scriptModule = (env, args) => {
37
+ // Create the enhanced environment by combining the original environment with extensions
38
+ const curriedFunctions = withEnvironment(env, extensions);
39
+ const enhancedEnv = Object.assign(Object.create(Object.getPrototypeOf(env)), env, curriedFunctions);
40
+ return callback(enhancedEnv, args);
41
+ };
42
+ scriptModule.tags = options.tags;
43
+ scriptModule.dependencies = options.dependencies;
44
+ scriptModule.id = options.id;
45
+ scriptModule.runAtTheEnd = options.runAtTheEnd;
46
+ return scriptModule;
47
+ }
48
+ return {
49
+ deployScript: enhancedExecute,
50
+ };
51
+ }
52
+ export function resolveConfig(configFile, overrides) {
53
+ const config = {
54
+ deployments: 'deployments',
55
+ defaultPollingInterval: 1,
56
+ ...configFile,
57
+ scripts: configFile?.scripts
58
+ ? typeof configFile.scripts === 'string'
59
+ ? [configFile.scripts]
60
+ : configFile.scripts.length == 0
61
+ ? ['deploy']
62
+ : configFile.scripts
63
+ : ['deploy'],
64
+ };
65
+ if (overrides) {
66
+ for (const key of Object.keys(overrides)) {
67
+ if (overrides[key] !== undefined) {
68
+ config[key] = overrides[key];
69
+ }
70
+ }
71
+ }
72
+ return config;
73
+ }
74
+ export async function getChainIdForEnvironment(config, environmentName, provider) {
75
+ if (config?.environments?.[environmentName]?.chain) {
76
+ const chainAsNumber = typeof config.environments[environmentName].chain === 'number'
77
+ ? config.environments[environmentName].chain
78
+ : parseInt(config.environments[environmentName].chain);
79
+ if (!isNaN(chainAsNumber)) {
80
+ return chainAsNumber;
81
+ }
82
+ const chainFound = getChainByName(config.environments[environmentName].chain);
83
+ if (chainFound) {
84
+ return chainFound.id;
85
+ }
86
+ else {
87
+ throw new Error(`environment ${environmentName} chain id cannot be found, specify it in the rocketh config`);
88
+ }
89
+ }
90
+ else {
91
+ const chainFound = getChainByName(environmentName);
92
+ if (chainFound) {
93
+ return chainFound.id;
94
+ }
95
+ else {
96
+ if (provider) {
97
+ const chainIdAsHex = await provider.request({ method: 'eth_chainId' });
98
+ return Number(chainIdAsHex);
99
+ }
100
+ else {
101
+ throw new Error(`environment ${environmentName} chain id cannot be found, specify it in the rocketh config`);
102
+ }
103
+ }
104
+ }
105
+ }
106
+ export function getEnvironmentName(executionParams) {
107
+ const environmentProvided = executionParams.environment || executionParams.network;
108
+ let environmentName = 'memory';
109
+ if (environmentProvided) {
110
+ if (typeof environmentProvided === 'string') {
111
+ environmentName = environmentProvided;
112
+ }
113
+ else if ('fork' in environmentProvided) {
114
+ environmentName = environmentProvided.fork;
115
+ }
116
+ }
117
+ const fork = typeof environmentProvided !== 'string';
118
+ return { name: environmentName, fork };
119
+ }
120
+ export function resolveExecutionParams(config, executionParameters, chainId) {
121
+ const { name: environmentName, fork } = getEnvironmentName(executionParameters);
122
+ // TODO fork chainId resolution option to keep the network being used
123
+ let chainConfig = getChainConfig(fork ? 31337 : chainId, config);
124
+ let chainInfo = chainConfig.info;
125
+ const environmentConfig = config?.environments?.[environmentName];
126
+ const actualChainConfig = environmentConfig?.overrides
127
+ ? {
128
+ ...chainConfig,
129
+ ...environmentConfig.overrides,
130
+ properties: {
131
+ ...chainConfig?.properties,
132
+ ...environmentConfig.overrides.properties,
133
+ },
134
+ }
135
+ : chainConfig;
136
+ if (actualChainConfig?.properties) {
137
+ chainInfo = { ...chainInfo, properties: actualChainConfig.properties };
138
+ }
139
+ // let environmentTags: string[] = actualChainConfig.tags.concat(environmentConfig?.tags); // TODO
140
+ const environmentTags = actualChainConfig.tags;
141
+ let scripts = ['deploy'];
142
+ if (config.scripts) {
143
+ if (typeof config.scripts === 'string') {
144
+ scripts = [config.scripts];
145
+ }
146
+ else {
147
+ scripts = [...config.scripts];
148
+ }
149
+ }
150
+ if (environmentConfig?.scripts) {
151
+ if (typeof environmentConfig.scripts === 'string') {
152
+ scripts = [environmentConfig.scripts];
153
+ }
154
+ else {
155
+ scripts = [...environmentConfig.scripts];
156
+ }
157
+ }
158
+ const provider = executionParameters.provider || new JSONRPCHTTPProvider(actualChainConfig.rpcUrl);
159
+ let saveDeployments = executionParameters.saveDeployments;
160
+ if (saveDeployments === undefined) {
161
+ if (!executionParameters.provider) {
162
+ saveDeployments = true;
163
+ }
164
+ else {
165
+ if (environmentName === 'memory' || environmentName === 'hardhat' || environmentName === 'default') {
166
+ // networkTags['memory'] = true;
167
+ saveDeployments = false;
168
+ }
169
+ else {
170
+ saveDeployments = true;
171
+ }
172
+ }
173
+ }
174
+ return {
175
+ askBeforeProceeding: executionParameters.askBeforeProceeding || false,
176
+ chain: chainInfo,
177
+ logLevel: executionParameters.logLevel || 0, // TODO
178
+ pollingInterval: actualChainConfig.pollingInterval,
179
+ reportGasUse: executionParameters.reportGasUse || false,
180
+ saveDeployments,
181
+ tags: executionParameters.tags || [],
182
+ environment: {
183
+ name: environmentName,
184
+ tags: environmentTags,
185
+ fork,
186
+ deterministicDeployment: actualChainConfig.deterministicDeployment,
187
+ },
188
+ extra: executionParameters.extra,
189
+ provider,
190
+ scripts,
191
+ };
192
+ }
193
+ export async function loadEnvironment(config, executionParams, deploymentStore) {
194
+ const userConfig = await resolveConfig(config, executionParams.config);
195
+ const { name: environmentName, fork } = getEnvironmentName(executionParams);
196
+ const chainId = await getChainIdForEnvironment(userConfig, environmentName, executionParams.provider);
197
+ const resolvedExecutionParams = resolveExecutionParams(userConfig, executionParams, chainId);
198
+ // console.log(JSON.stringify(resolvedConfig, null, 2));
199
+ const { external, internal } = await createEnvironment(userConfig, resolvedExecutionParams, deploymentStore);
200
+ return external;
201
+ }
202
+ export function createExecutor(deploymentStore, promptExecutor) {
203
+ async function resolveConfigAndExecuteDeployScriptModules(moduleObjects, userConfig, executionParams, args) {
204
+ executionParams = executionParams || {};
205
+ const resolveduserConfig = resolveConfig(userConfig, executionParams.config);
206
+ const { name: environmentName, fork } = getEnvironmentName(executionParams);
207
+ const chainId = await getChainIdForEnvironment(resolveduserConfig, environmentName, executionParams.provider);
208
+ const resolvedExecutionParams = resolveExecutionParams(resolveduserConfig, executionParams, chainId);
209
+ return executeDeployScriptModules(moduleObjects, resolveduserConfig, resolvedExecutionParams, args);
210
+ }
211
+ async function executeDeployScriptModules(moduleObjects, userConfig, resolvedExecutionParams, args) {
212
+ setLogLevel(typeof resolvedExecutionParams.logLevel === 'undefined' ? 0 : resolvedExecutionParams.logLevel);
213
+ const scriptModuleById = {};
214
+ const scriptIdBags = {};
215
+ const ids = [];
216
+ for (const moduleObject of moduleObjects) {
217
+ const id = moduleObject.id;
218
+ let scriptModule = moduleObject.module;
219
+ scriptModuleById[id] = scriptModule;
220
+ let scriptTags = scriptModule.tags;
221
+ if (scriptTags !== undefined) {
222
+ if (typeof scriptTags === 'string') {
223
+ scriptTags = [scriptTags];
224
+ }
225
+ for (const tag of scriptTags) {
226
+ if (tag.indexOf(',') >= 0) {
227
+ throw new Error('Tag cannot contains commas');
228
+ }
229
+ const bag = scriptIdBags[tag] || [];
230
+ scriptIdBags[tag] = bag;
231
+ bag.push(id);
232
+ }
233
+ }
234
+ if (resolvedExecutionParams.tags !== undefined && resolvedExecutionParams.tags.length > 0) {
235
+ let found = false;
236
+ if (scriptTags !== undefined) {
237
+ for (const tagToFind of resolvedExecutionParams.tags) {
238
+ for (const tag of scriptTags) {
239
+ if (tag === tagToFind) {
240
+ ids.push(id);
241
+ found = true;
242
+ break;
243
+ }
244
+ }
245
+ if (found) {
246
+ break;
247
+ }
248
+ }
249
+ }
250
+ }
251
+ else {
252
+ ids.push(id);
253
+ }
254
+ }
255
+ const { internal, external } = await createEnvironment(userConfig, resolvedExecutionParams, deploymentStore);
256
+ await internal.recoverTransactionsIfAny();
257
+ const scriptsRegisteredToRun = {};
258
+ const scriptsToRun = [];
259
+ const scriptsToRunAtTheEnd = [];
260
+ function recurseDependencies(id) {
261
+ if (scriptsRegisteredToRun[id]) {
262
+ return;
263
+ }
264
+ const scriptModule = scriptModuleById[id];
265
+ if (scriptModule.dependencies) {
266
+ for (const dependency of scriptModule.dependencies) {
267
+ const scriptFilePathsToAdd = scriptIdBags[dependency];
268
+ if (scriptFilePathsToAdd) {
269
+ for (const scriptFilenameToAdd of scriptFilePathsToAdd) {
270
+ recurseDependencies(scriptFilenameToAdd);
271
+ }
272
+ }
273
+ }
274
+ }
275
+ if (!scriptsRegisteredToRun[id]) {
276
+ if (scriptModule.runAtTheEnd) {
277
+ scriptsToRunAtTheEnd.push({
278
+ id: id,
279
+ func: scriptModule,
280
+ });
281
+ }
282
+ else {
283
+ scriptsToRun.push({
284
+ id: id,
285
+ func: scriptModule,
286
+ });
287
+ }
288
+ scriptsRegisteredToRun[id] = true;
289
+ }
290
+ }
291
+ for (const id of ids) {
292
+ recurseDependencies(id);
293
+ }
294
+ if (resolvedExecutionParams.askBeforeProceeding) {
295
+ console.log(`Network: ${external.name} \n \t Chain: ${external.network.chain.name} \n \t Tags: ${Object.keys(external.tags).join(',')}`);
296
+ const gasPriceEstimate = await getRoughGasPriceEstimate(external.network.provider);
297
+ const prompt = await promptExecutor({
298
+ type: 'confirm',
299
+ name: 'proceed',
300
+ message: `gas price is currently in this range:
301
+ slow: ${formatEther(gasPriceEstimate.slow.maxFeePerGas)} (priority: ${formatEther(gasPriceEstimate.slow.maxPriorityFeePerGas)})
302
+ average: ${formatEther(gasPriceEstimate.average.maxFeePerGas)} (priority: ${formatEther(gasPriceEstimate.average.maxPriorityFeePerGas)})
303
+ fast: ${formatEther(gasPriceEstimate.fast.maxFeePerGas)} (priority: ${formatEther(gasPriceEstimate.fast.maxPriorityFeePerGas)})
304
+
305
+ Do you want to proceed (note that gas price can change for each tx)`,
306
+ });
307
+ if (!prompt.proceed) {
308
+ process.exit();
309
+ }
310
+ }
311
+ for (const deployScript of scriptsToRun.concat(scriptsToRunAtTheEnd)) {
312
+ if (deployScript.func.id && external.hasMigrationBeenDone(deployScript.func.id)) {
313
+ logger.info(`skipping ${deployScript.id} as migrations already executed and complete`);
314
+ continue;
315
+ }
316
+ let skip = false;
317
+ const spinner = spin(`- Executing ${deployScript.id}`);
318
+ // if (deployScript.func.skip) {
319
+ // const spinner = spin(` - skip?()`);
320
+ // try {
321
+ // skip = await deployScript.func.skip(external, args);
322
+ // spinner.succeed(skip ? `skipping ${filename}` : undefined);
323
+ // } catch (e) {
324
+ // spinner.fail();
325
+ // throw e;
326
+ // }
327
+ // }
328
+ if (!skip) {
329
+ let result;
330
+ try {
331
+ result = await deployScript.func(external, args);
332
+ spinner.succeed(`\n`);
333
+ }
334
+ catch (e) {
335
+ spinner.fail();
336
+ throw e;
337
+ }
338
+ if (result && typeof result === 'boolean') {
339
+ if (!deployScript.func.id) {
340
+ throw new Error(`${deployScript.id} return true to not be executed again, but does not provide an id. the script function needs to have the field "id" to be set`);
341
+ }
342
+ internal.recordMigration(deployScript.func.id);
343
+ }
344
+ }
345
+ }
346
+ if (resolvedExecutionParams.reportGasUse) {
347
+ const provider = external.network.provider;
348
+ const transactionHashes = provider.transactionHashes;
349
+ let totalGasUsed = 0;
350
+ for (const hash of transactionHashes) {
351
+ const transactionReceipt = await provider.request({ method: 'eth_getTransactionReceipt', params: [hash] });
352
+ if (transactionReceipt) {
353
+ const gasUsed = Number(transactionReceipt.gasUsed);
354
+ totalGasUsed += gasUsed;
355
+ }
356
+ }
357
+ console.log({ totalGasUsed });
358
+ }
359
+ return external;
360
+ }
361
+ return {
362
+ executeDeployScriptModules,
363
+ resolveConfigAndExecuteDeployScriptModules,
364
+ };
365
+ }
366
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,cAAc,EAAE,cAAc,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oBAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;wBAC3B,MAAM,IAAI,KAAK,CACd,GAAG,YAAY,CAAC,EAAE,+HAA+H,CACjJ,CAAC;oBACH,CAAC;oBACD,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;gBAChD,CAAC;YACF,CAAC;QACF,CAAC;QAED,IAAI,uBAAuB,CAAC,YAAY,EAAE,CAAC;YAC1C,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;YAC3C,MAAM,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;YAErD,IAAI,YAAY,GAAG,CAAC,CAAC;YACrB,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;gBACtC,MAAM,kBAAkB,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAC,MAAM,EAAE,2BAA2B,EAAE,MAAM,EAAE,CAAC,IAAI,CAAC,EAAC,CAAC,CAAC;gBACzG,IAAI,kBAAkB,EAAE,CAAC;oBACxB,MAAM,OAAO,GAAG,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;oBACnD,YAAY,IAAI,OAAO,CAAC;gBACzB,CAAC;YACF,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,EAAC,YAAY,EAAC,CAAC,CAAC;QAC7B,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,OAAO;QACN,0BAA0B;QAC1B,0CAA0C;KAC1C,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { setupDeployScripts, loadEnvironment, resolveConfig, resolveExecutionParams, getChainIdForEnvironment, getEnvironmentName, createExecutor, } from './executor/index.js';
2
+ export { createEnvironment, loadDeployments } from './environment/index.js';
3
+ export { getChainConfig, chainByCanonicalName, getChainByName } from './environment/utils/chains.js';
4
+ export { mergeArtifacts, mergeABIs } from './environment/utils/artifacts.js';
5
+ export { getGasPriceEstimate, getRoughGasPriceEstimate } from './utils/eth.js';
6
+ export { bigIntToStringReplacer } from './utils/json.js';
7
+ export { withEnvironment } from './utils/extensions.js';
8
+ export { setLogLevel, log, logger, spin } from './internal/logging.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAC,cAAc,EAAE,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAC,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export { setupDeployScripts, loadEnvironment, resolveConfig, resolveExecutionParams, getChainIdForEnvironment, getEnvironmentName, createExecutor, } from './executor/index.js';
2
+ export { createEnvironment, loadDeployments } from './environment/index.js';
3
+ export { getChainConfig, chainByCanonicalName, getChainByName } from './environment/utils/chains.js';
4
+ export { mergeArtifacts, mergeABIs } from './environment/utils/artifacts.js';
5
+ export { getGasPriceEstimate, getRoughGasPriceEstimate } from './utils/eth.js';
6
+ export { bigIntToStringReplacer } from './utils/json.js';
7
+ export { withEnvironment } from './utils/extensions.js';
8
+ export { setLogLevel, log, logger, spin } from './internal/logging.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,wBAAwB,EACxB,kBAAkB,EAClB,cAAc,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,wBAAwB,CAAC;AAE1E,OAAO,EAAC,cAAc,EAAE,oBAAoB,EAAE,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAC,cAAc,EAAE,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,wBAAwB,EAAC,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAC,sBAAsB,EAAC,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAC,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare function setLogLevel(level: number): void;
2
+ export declare const logger: import("named-logs").Logger;
3
+ export type ProgressIndicator = {
4
+ start(msg?: string): ProgressIndicator;
5
+ stop(): ProgressIndicator;
6
+ succeed(msg?: string): ProgressIndicator;
7
+ fail(msg?: string): ProgressIndicator;
8
+ };
9
+ export declare function spin(message?: string): ProgressIndicator;
10
+ export declare function log(message: string): void;
11
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/internal/logging.ts"],"names":[],"mappings":"AAMA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,QAOxC;AAED,eAAO,MAAM,MAAM,6BAAkB,CAAC;AAEtC,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACvC,IAAI,IAAI,iBAAiB,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACzC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;CACtC,CAAC;AA4CF,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAOxD;AAED,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,QAIlC"}
@@ -0,0 +1,71 @@
1
+ import { logs } from 'named-logs';
2
+ import { hookup, factory as Logging } from 'named-logs-console';
3
+ // import ora from 'ora-cjs';
4
+ hookup();
5
+ export function setLogLevel(level) {
6
+ Logging.level = level;
7
+ if (Logging.level > 0) {
8
+ Logging.enable();
9
+ }
10
+ else {
11
+ Logging.disable();
12
+ }
13
+ }
14
+ export const logger = logs('rocketh');
15
+ const loggerProgressIndicator = {
16
+ start(msg) {
17
+ if (msg) {
18
+ console.log(msg);
19
+ }
20
+ return this;
21
+ },
22
+ stop() {
23
+ return this;
24
+ },
25
+ succeed(msg) {
26
+ if (msg) {
27
+ console.log(msg);
28
+ }
29
+ return this;
30
+ },
31
+ fail(msg) {
32
+ if (msg) {
33
+ console.error(msg);
34
+ }
35
+ return this;
36
+ },
37
+ };
38
+ const voidProgressIndicator = {
39
+ start() {
40
+ return this;
41
+ },
42
+ stop() {
43
+ return this;
44
+ },
45
+ succeed() {
46
+ return this;
47
+ },
48
+ fail() {
49
+ return this;
50
+ },
51
+ };
52
+ // export function spin(message: string): PartialOra {
53
+ // return Logging.level > 0 ? ora(message).start() : voidProgressIndicator;
54
+ // }
55
+ // let lastSpin = ora('rocketh');
56
+ let lastSpin = loggerProgressIndicator;
57
+ export function spin(message) {
58
+ if (Logging.level > 0) {
59
+ lastSpin = lastSpin.start(message);
60
+ return lastSpin;
61
+ }
62
+ else {
63
+ return voidProgressIndicator;
64
+ }
65
+ }
66
+ export function log(message) {
67
+ if (Logging.level > 0) {
68
+ console.log(message);
69
+ }
70
+ }
71
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../src/internal/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAC,MAAM,EAAE,OAAO,IAAI,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAC9D,6BAA6B;AAC7B,MAAM,EAAE,CAAC;AAET,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC;IACtB,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,MAAM,EAAE,CAAC;IAClB,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AAQtC,MAAM,uBAAuB,GAAsB;IAClD,KAAK,CAAC,GAAY;QACjB,IAAI,GAAG,EAAE,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI;QACH,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,CAAC,GAAY;QACnB,IAAI,GAAG,EAAE,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI,CAAC,GAAY;QAChB,IAAI,GAAG,EAAE,CAAC;YACT,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACpB,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AACF,MAAM,qBAAqB,GAAsB;IAChD,KAAK;QACJ,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI;QACH,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO;QACN,OAAO,IAAI,CAAC;IACb,CAAC;IACD,IAAI;QACH,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAC;AACF,sDAAsD;AACtD,4EAA4E;AAC5E,IAAI;AAEJ,iCAAiC;AACjC,IAAI,QAAQ,GAAG,uBAAuB,CAAC;AACvC,MAAM,UAAU,IAAI,CAAC,OAAgB;IACpC,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QACvB,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,QAAQ,CAAC;IACjB,CAAC;SAAM,CAAC;QACP,OAAO,qBAAqB,CAAC;IAC9B,CAAC;AACF,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,OAAe;IAClC,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;AACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type InternalEnvironment = {
2
+ recoverTransactionsIfAny(): Promise<void>;
3
+ recordMigration(id: string): void;
4
+ };
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG;IACjC,wBAAwB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/internal/types.ts"],"names":[],"mappings":""}