hardhat 3.1.10 → 3.1.12
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/CHANGELOG.md +26 -0
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/artifact-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/artifacts/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts +3 -5
- package/dist/src/internal/builtin-plugins/coverage/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/helpers.js +7 -19
- package/dist/src/internal/builtin-plugins/coverage/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.js +42 -0
- package/dist/src/internal/builtin-plugins/coverage/hook-handlers/test.js.map +1 -0
- package/dist/src/internal/builtin-plugins/coverage/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/index.js +1 -0
- package/dist/src/internal/builtin-plugins/coverage/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.d.ts +53 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js +288 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts +0 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js +2 -14
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts +8 -5
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js +20 -18
- package/dist/src/internal/builtin-plugins/gas-analytics/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.d.ts +7 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.js +42 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js +36 -2
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts +45 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js +276 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.js.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts +22 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.d.ts.map +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js +88 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.js.map +1 -0
- package/dist/src/internal/builtin-plugins/index.js +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js +17 -20
- package/dist/src/internal/builtin-plugins/network-manager/edr/edr-provider.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.js +2 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.d.ts +0 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.js +0 -6
- package/dist/src/internal/builtin-plugins/network-manager/edr/type-validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts +1 -3
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js +0 -49
- package/dist/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-results.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-results.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/build-results.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts +1 -0
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +13 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.d.ts +2 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts +13 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +30 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts +3 -12
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/types.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/utils.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/utils.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.d.ts +8 -6
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.js +103 -27
- package/dist/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/config.js +2 -2
- package/dist/src/internal/builtin-plugins/solidity/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js +5 -0
- package/dist/src/internal/builtin-plugins/solidity/hook-handlers/hre.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity/tasks/build.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts +3 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/config.js +9 -0
- package/dist/src/internal/builtin-plugins/solidity-test/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/edr-artifacts.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js +4 -10
- package/dist/src/internal/builtin-plugins/solidity-test/helpers.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js +0 -1
- package/dist/src/internal/builtin-plugins/solidity-test/index.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts +2 -2
- package/dist/src/internal/builtin-plugins/solidity-test/runner.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js +3 -3
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts +5 -0
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js +21 -27
- package/dist/src/internal/builtin-plugins/solidity-test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts +15 -10
- package/dist/src/internal/builtin-plugins/solidity-test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/telemetry/task-action.js +3 -2
- package/dist/src/internal/builtin-plugins/telemetry/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/test/task-action.js +62 -13
- package/dist/src/internal/builtin-plugins/test/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts +27 -0
- package/dist/src/internal/builtin-plugins/test/type-extensions.d.ts.map +1 -1
- package/dist/src/internal/cli/banner-manager.d.ts +26 -0
- package/dist/src/internal/cli/banner-manager.d.ts.map +1 -0
- package/dist/src/internal/cli/banner-manager.js +146 -0
- package/dist/src/internal/cli/banner-manager.js.map +1 -0
- package/dist/src/internal/cli/init/init.d.ts.map +1 -1
- package/dist/src/internal/cli/init/init.js +8 -0
- package/dist/src/internal/cli/init/init.js.map +1 -1
- package/dist/src/internal/cli/main.d.ts.map +1 -1
- package/dist/src/internal/cli/main.js +18 -1
- package/dist/src/internal/cli/main.js.map +1 -1
- package/dist/src/internal/cli/telemetry/analytics/subprocess.js +2 -0
- package/dist/src/internal/cli/telemetry/analytics/subprocess.js.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/anonymize-paths.js +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.d.ts +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.js +47 -38
- package/dist/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.js +1 -1
- package/dist/src/types/artifacts.d.ts +32 -3
- package/dist/src/types/artifacts.d.ts.map +1 -1
- package/dist/src/types/network.d.ts +1 -1
- package/dist/src/types/solidity/build-system.d.ts +56 -10
- package/dist/src/types/solidity/build-system.d.ts.map +1 -1
- package/dist/src/types/solidity/build-system.js +26 -2
- package/dist/src/types/solidity/build-system.js.map +1 -1
- package/dist/src/types/solidity/resolved-file.d.ts +2 -2
- package/dist/src/types/tasks.d.ts +8 -0
- package/dist/src/types/tasks.d.ts.map +1 -1
- package/dist/src/types/tasks.js.map +1 -1
- package/dist/src/types/test.d.ts +18 -0
- package/dist/src/types/test.d.ts.map +1 -1
- package/dist/src/types/utils.d.ts +16 -0
- package/dist/src/types/utils.d.ts.map +1 -1
- package/dist/src/utils/result.d.ts +33 -0
- package/dist/src/utils/result.d.ts.map +1 -0
- package/dist/src/utils/result.js +43 -0
- package/dist/src/utils/result.js.map +1 -0
- package/package.json +6 -5
- package/src/internal/builtin-plugins/artifacts/artifact-manager.ts +4 -1
- package/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts +4 -1
- package/src/internal/builtin-plugins/coverage/helpers.ts +11 -29
- package/src/internal/builtin-plugins/coverage/hook-handlers/test.ts +68 -0
- package/src/internal/builtin-plugins/coverage/index.ts +1 -0
- package/src/internal/builtin-plugins/gas-analytics/function-gas-snapshots.ts +473 -0
- package/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.ts +3 -17
- package/src/internal/builtin-plugins/gas-analytics/helpers.ts +38 -27
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts +68 -0
- package/src/internal/builtin-plugins/gas-analytics/index.ts +37 -2
- package/src/internal/builtin-plugins/gas-analytics/snapshot-cheatcodes.ts +454 -0
- package/src/internal/builtin-plugins/gas-analytics/tasks/solidity-test/task-action.ts +172 -0
- package/src/internal/builtin-plugins/index.ts +1 -1
- package/src/internal/builtin-plugins/network-manager/edr/edr-provider.ts +21 -28
- package/src/internal/builtin-plugins/network-manager/edr/stack-traces/stack-trace-generation-errors.ts +5 -2
- package/src/internal/builtin-plugins/network-manager/edr/type-validation.ts +0 -13
- package/src/internal/builtin-plugins/network-manager/edr/utils/convert-to-edr.ts +0 -64
- package/src/internal/builtin-plugins/solidity/build-results.ts +3 -1
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +15 -5
- package/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/dependency-graph.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +36 -6
- package/src/internal/builtin-plugins/solidity/build-system/resolver/types.ts +3 -9
- package/src/internal/builtin-plugins/solidity/build-system/resolver/utils.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/solc-config-selection.ts +125 -28
- package/src/internal/builtin-plugins/solidity/config.ts +2 -2
- package/src/internal/builtin-plugins/solidity/hook-handlers/hre.ts +8 -0
- package/src/internal/builtin-plugins/solidity/tasks/build.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/config.ts +15 -0
- package/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts +2 -2
- package/src/internal/builtin-plugins/solidity-test/helpers.ts +6 -14
- package/src/internal/builtin-plugins/solidity-test/index.ts +0 -1
- package/src/internal/builtin-plugins/solidity-test/runner.ts +3 -3
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +47 -40
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +17 -10
- package/src/internal/builtin-plugins/telemetry/task-action.ts +4 -2
- package/src/internal/builtin-plugins/test/task-action.ts +88 -24
- package/src/internal/builtin-plugins/test/type-extensions.ts +42 -0
- package/src/internal/cli/banner-manager.ts +234 -0
- package/src/internal/cli/init/init.ts +8 -0
- package/src/internal/cli/main.ts +19 -1
- package/src/internal/cli/telemetry/analytics/subprocess.ts +2 -0
- package/src/internal/cli/telemetry/sentry/anonymize-paths.ts +1 -1
- package/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.ts +98 -50
- package/src/internal/core/user-interruptions.ts +1 -1
- package/src/types/artifacts.ts +40 -3
- package/src/types/hre.ts +1 -1
- package/src/types/network.ts +1 -1
- package/src/types/solidity/build-system.ts +75 -14
- package/src/types/solidity/resolved-file.ts +2 -2
- package/src/types/tasks.ts +10 -0
- package/src/types/test.ts +20 -0
- package/src/types/utils.ts +14 -0
- package/src/utils/result.ts +57 -0
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +9 -9
- package/templates/hardhat-3/02-mocha-ethers/package.json +10 -10
- package/templates/hardhat-3/03-minimal/package.json +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.d.ts +0 -19
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.d.ts.map +0 -1
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.js +0 -2
- package/dist/src/internal/builtin-plugins/network-manager/edr/types/output.js.map +0 -1
- package/src/internal/builtin-plugins/network-manager/edr/types/output.ts +0 -19
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable -- This file is vendored from https://github.com/getsentry/sentry-javascript/blob/9.4.0/packages/node/src/integrations/contextlines.ts */
|
|
2
|
-
import { createReadStream } from
|
|
3
|
-
import { createInterface } from
|
|
4
|
-
import { LRUMap, defineIntegration, logger, snipLine } from
|
|
5
|
-
import { DEBUG_BUILD } from
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import { LRUMap, defineIntegration, logger, snipLine } from "@sentry/core";
|
|
5
|
+
import { DEBUG_BUILD } from "../debug-build.js";
|
|
6
6
|
const LRU_FILE_CONTENTS_CACHE = new LRUMap(10);
|
|
7
7
|
const LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap(20);
|
|
8
8
|
const DEFAULT_LINES_OF_CONTEXT = 7;
|
|
9
|
-
const INTEGRATION_NAME =
|
|
9
|
+
const INTEGRATION_NAME = "ContextLines";
|
|
10
10
|
// Determines the upper bound of lineno/colno that we will attempt to read. Large colno values are likely to be
|
|
11
11
|
// minified code while large lineno values are likely to be bundled code.
|
|
12
12
|
// Exported for testing purposes.
|
|
@@ -31,22 +31,22 @@ function emplace(map, key, contents) {
|
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Determines if context lines should be skipped for a file.
|
|
34
|
-
* - .min.(mjs|cjs|js) files are and not useful since they
|
|
34
|
+
* - .min.(mjs|cjs|js) files are and not useful since they don't point to the original source
|
|
35
35
|
* - node: prefixed modules are part of the runtime and cannot be resolved to a file
|
|
36
36
|
* - data: skip json, wasm and inline js https://nodejs.org/api/esm.html#data-imports
|
|
37
37
|
*/
|
|
38
38
|
function shouldSkipContextLinesForFile(path) {
|
|
39
39
|
// Test the most common prefix and extension first. These are the ones we
|
|
40
40
|
// are most likely to see in user applications and are the ones we can break out of first.
|
|
41
|
-
if (path.startsWith(
|
|
41
|
+
if (path.startsWith("node:"))
|
|
42
42
|
return true;
|
|
43
|
-
if (path.endsWith(
|
|
43
|
+
if (path.endsWith(".min.js"))
|
|
44
44
|
return true;
|
|
45
|
-
if (path.endsWith(
|
|
45
|
+
if (path.endsWith(".min.cjs"))
|
|
46
46
|
return true;
|
|
47
|
-
if (path.endsWith(
|
|
47
|
+
if (path.endsWith(".min.mjs"))
|
|
48
48
|
return true;
|
|
49
|
-
if (path.startsWith(
|
|
49
|
+
if (path.startsWith("data:"))
|
|
50
50
|
return true;
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
@@ -84,7 +84,7 @@ function makeLineReaderRanges(lines, linecontext) {
|
|
|
84
84
|
}
|
|
85
85
|
let i = 0;
|
|
86
86
|
const line = lines[0];
|
|
87
|
-
if (typeof line !==
|
|
87
|
+
if (typeof line !== "number") {
|
|
88
88
|
return [];
|
|
89
89
|
}
|
|
90
90
|
let current = makeContextRange(line, linecontext);
|
|
@@ -96,7 +96,7 @@ function makeLineReaderRanges(lines, linecontext) {
|
|
|
96
96
|
}
|
|
97
97
|
// If the next line falls into the current range, extend the current range to lineno + linecontext.
|
|
98
98
|
const next = lines[i + 1];
|
|
99
|
-
if (typeof next !==
|
|
99
|
+
if (typeof next !== "number") {
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
if (next <= current[1]) {
|
|
@@ -119,7 +119,7 @@ function getContextLinesFromFile(path, ranges, output) {
|
|
|
119
119
|
// as it will cause the 'line' event to
|
|
120
120
|
// be emitted before the listener is attached.
|
|
121
121
|
const stream = createReadStream(path);
|
|
122
|
-
const
|
|
122
|
+
const lineRead = createInterface({
|
|
123
123
|
input: stream,
|
|
124
124
|
});
|
|
125
125
|
// We need to explicitly destroy the stream to prevent memory leaks,
|
|
@@ -146,16 +146,16 @@ function getContextLinesFromFile(path, ranges, output) {
|
|
|
146
146
|
// Mark file path as failed to read and prevent multiple read attempts.
|
|
147
147
|
LRU_FILE_CONTENTS_FS_READ_FAILED.set(path, 1);
|
|
148
148
|
DEBUG_BUILD && logger.error(`Failed to read file: ${path}. Error: ${e}`);
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
lineRead.close();
|
|
150
|
+
lineRead.removeAllListeners();
|
|
151
151
|
destroyStreamAndResolve();
|
|
152
152
|
}
|
|
153
153
|
// We need to handle the error event to prevent the process from crashing in < Node 16
|
|
154
154
|
// https://github.com/nodejs/node/pull/31603
|
|
155
|
-
stream.on(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
stream.on("error", onStreamError);
|
|
156
|
+
lineRead.on("error", onStreamError);
|
|
157
|
+
lineRead.on("close", destroyStreamAndResolve);
|
|
158
|
+
lineRead.on("line", (line) => {
|
|
159
159
|
lineNumber++;
|
|
160
160
|
if (lineNumber < rangeStart)
|
|
161
161
|
return;
|
|
@@ -164,16 +164,16 @@ function getContextLinesFromFile(path, ranges, output) {
|
|
|
164
164
|
if (lineNumber >= rangeEnd) {
|
|
165
165
|
if (currentRangeIndex === ranges.length - 1) {
|
|
166
166
|
// We need to close the file stream and remove listeners, else the reader will continue to run our listener;
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
lineRead.close();
|
|
168
|
+
lineRead.removeAllListeners();
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
171
|
currentRangeIndex++;
|
|
172
172
|
const range = ranges[currentRangeIndex];
|
|
173
173
|
if (range === undefined) {
|
|
174
174
|
// This should never happen as it means we have a bug in the context.
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
lineRead.close();
|
|
176
|
+
lineRead.removeAllListeners();
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
rangeStart = range[0];
|
|
@@ -203,8 +203,8 @@ async function addSourceContext(event, contextLines) {
|
|
|
203
203
|
const frame = exception.stacktrace.frames[i];
|
|
204
204
|
const filename = frame?.filename;
|
|
205
205
|
if (!frame ||
|
|
206
|
-
typeof filename !==
|
|
207
|
-
typeof frame.lineno !==
|
|
206
|
+
typeof filename !== "string" ||
|
|
207
|
+
typeof frame.lineno !== "number" ||
|
|
208
208
|
shouldSkipContextLinesForFile(filename) ||
|
|
209
209
|
shouldSkipContextLinesForFrame(frame)) {
|
|
210
210
|
continue;
|
|
@@ -222,7 +222,7 @@ async function addSourceContext(event, contextLines) {
|
|
|
222
222
|
}
|
|
223
223
|
const readlinePromises = [];
|
|
224
224
|
for (const file of files) {
|
|
225
|
-
// If we failed to read this before,
|
|
225
|
+
// If we failed to read this before, don't try reading it again.
|
|
226
226
|
if (LRU_FILE_CONTENTS_FS_READ_FAILED.get(file)) {
|
|
227
227
|
continue;
|
|
228
228
|
}
|
|
@@ -234,7 +234,7 @@ async function addSourceContext(event, contextLines) {
|
|
|
234
234
|
filesToLineRanges.sort((a, b) => a - b);
|
|
235
235
|
// Check if the contents are already in the cache and if we can avoid reading the file again.
|
|
236
236
|
const ranges = makeLineReaderRanges(filesToLineRanges, contextLines);
|
|
237
|
-
if (ranges.every(r => rangeExistsInContentCache(file, r))) {
|
|
237
|
+
if (ranges.every((r) => rangeExistsInContentCache(file, r))) {
|
|
238
238
|
continue;
|
|
239
239
|
}
|
|
240
240
|
const cache = emplace(LRU_FILE_CONTENTS_CACHE, file, {});
|
|
@@ -242,13 +242,15 @@ async function addSourceContext(event, contextLines) {
|
|
|
242
242
|
}
|
|
243
243
|
// The promise rejections are caught in order to prevent them from short circuiting Promise.all
|
|
244
244
|
await Promise.all(readlinePromises).catch(() => {
|
|
245
|
-
DEBUG_BUILD &&
|
|
245
|
+
DEBUG_BUILD &&
|
|
246
|
+
logger.log("Failed to read one or more source files and resolve context lines");
|
|
246
247
|
});
|
|
247
248
|
// Perform the same loop as above, but this time we can assume all files are in the cache
|
|
248
249
|
// and attempt to add source context to frames.
|
|
249
250
|
if (contextLines > 0 && event.exception?.values) {
|
|
250
251
|
for (const exception of event.exception.values) {
|
|
251
|
-
if (exception.stacktrace?.frames &&
|
|
252
|
+
if (exception.stacktrace?.frames &&
|
|
253
|
+
exception.stacktrace.frames.length > 0) {
|
|
252
254
|
addSourceContextToFrames(exception.stacktrace.frames, contextLines, LRU_FILE_CONTENTS_CACHE);
|
|
253
255
|
}
|
|
254
256
|
}
|
|
@@ -260,7 +262,9 @@ async function addSourceContext(event, contextLines) {
|
|
|
260
262
|
function addSourceContextToFrames(frames, contextLines, cache) {
|
|
261
263
|
for (const frame of frames) {
|
|
262
264
|
// Only add context if we have a filename and it hasn't already been added
|
|
263
|
-
if (frame.filename &&
|
|
265
|
+
if (frame.filename &&
|
|
266
|
+
frame.context_line === undefined &&
|
|
267
|
+
typeof frame.lineno === "number") {
|
|
264
268
|
const contents = cache.get(frame.filename);
|
|
265
269
|
if (contents === undefined) {
|
|
266
270
|
continue;
|
|
@@ -285,33 +289,36 @@ export function addContextToFrame(lineno, frame, contextLines, contents) {
|
|
|
285
289
|
// When there is no line number in the frame, attaching context is nonsensical and will even break grouping.
|
|
286
290
|
// We already check for lineno before calling this, but since StackFrame lineno ism optional, we check it again.
|
|
287
291
|
if (frame.lineno === undefined || contents === undefined) {
|
|
288
|
-
DEBUG_BUILD &&
|
|
292
|
+
DEBUG_BUILD &&
|
|
293
|
+
logger.error("Cannot resolve context for frame with no lineno or file contents");
|
|
289
294
|
return;
|
|
290
295
|
}
|
|
291
296
|
frame.pre_context = [];
|
|
292
297
|
for (let i = makeRangeStart(lineno, contextLines); i < lineno; i++) {
|
|
293
|
-
// We always expect the start context as line numbers cannot be negative. If we
|
|
298
|
+
// We always expect the start context as line numbers cannot be negative. If we don't find a line, then
|
|
294
299
|
// something went wrong somewhere. Clear the context and return without adding any linecontext.
|
|
295
300
|
const line = contents[i];
|
|
296
301
|
if (line === undefined) {
|
|
297
302
|
clearLineContext(frame);
|
|
298
|
-
DEBUG_BUILD &&
|
|
303
|
+
DEBUG_BUILD &&
|
|
304
|
+
logger.error(`Could not find line ${i} in file ${frame.filename}`);
|
|
299
305
|
return;
|
|
300
306
|
}
|
|
301
307
|
frame.pre_context.push(line);
|
|
302
308
|
}
|
|
303
|
-
// We should always have the context line. If we
|
|
309
|
+
// We should always have the context line. If we don't, something went wrong, so we clear the context and return
|
|
304
310
|
// without adding any linecontext.
|
|
305
311
|
if (contents[lineno] === undefined) {
|
|
306
312
|
clearLineContext(frame);
|
|
307
|
-
DEBUG_BUILD &&
|
|
313
|
+
DEBUG_BUILD &&
|
|
314
|
+
logger.error(`Could not find line ${lineno} in file ${frame.filename}`);
|
|
308
315
|
return;
|
|
309
316
|
}
|
|
310
317
|
frame.context_line = contents[lineno];
|
|
311
318
|
const end = makeRangeEnd(lineno, contextLines);
|
|
312
319
|
frame.post_context = [];
|
|
313
320
|
for (let i = lineno + 1; i <= end; i++) {
|
|
314
|
-
// Since we
|
|
321
|
+
// Since we don't track when the file ends, we cant clear the context if we don't find a line as it could
|
|
315
322
|
// just be that we reached the end of the file.
|
|
316
323
|
const line = contents[i];
|
|
317
324
|
if (line === undefined) {
|
|
@@ -334,7 +341,9 @@ function makeContextRange(line, linecontext) {
|
|
|
334
341
|
}
|
|
335
342
|
/** Exported only for tests, as a type-safe variant. */
|
|
336
343
|
export const _contextLinesIntegration = ((options = {}) => {
|
|
337
|
-
const contextLines = options.frameContextLines !== undefined
|
|
344
|
+
const contextLines = options.frameContextLines !== undefined
|
|
345
|
+
? options.frameContextLines
|
|
346
|
+
: DEFAULT_LINES_OF_CONTEXT;
|
|
338
347
|
return {
|
|
339
348
|
name: INTEGRATION_NAME,
|
|
340
349
|
processEvent(event) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextlines.js","sourceRoot":"","sources":["../../../../../../../../src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.ts"],"names":[],"mappings":"AAAA,2JAA2J;AAE3J,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,uBAAuB,GAAG,IAAI,MAAM,CAAiC,EAAE,CAAC,CAAC;AAC/E,MAAM,gCAAgC,GAAG,IAAI,MAAM,CAAY,EAAE,CAAC,CAAC;AACnE,MAAM,wBAAwB,GAAG,CAAC,CAAC;AACnC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AACxC,+GAA+G;AAC/G,yEAAyE;AACzE,iCAAiC;AACjC,MAAM,CAAC,MAAM,sBAAsB,GAAW,IAAI,CAAC;AACnD,MAAM,CAAC,MAAM,uBAAuB,GAAW,KAAK,CAAC;AAYrD;;GAEG;AACH,MAAM,UAAU,qBAAqB;IACnC,uBAAuB,CAAC,KAAK,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,SAAS,OAAO,
|
|
1
|
+
{"version":3,"file":"contextlines.js","sourceRoot":"","sources":["../../../../../../../../src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.ts"],"names":[],"mappings":"AAAA,2JAA2J;AAE3J,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAAE,WAA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QACtB,YAAY,CAAC,KAAK;YAChB,OAAO,gBAAgB,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;AACJ,CAAC,CAAyB,CAAC;AAE3B;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAQ,iBAAiB,CAC3D,wBAAwB,CACzB,CAAC"}
|
|
@@ -59,7 +59,7 @@ async function defaultRequestSecretInput(_context, interruptor, inputDescription
|
|
|
59
59
|
if (initialMessage === undefined) {
|
|
60
60
|
initialMessage = out;
|
|
61
61
|
}
|
|
62
|
-
assertHardhatInvariant(rlAsAny.output !== undefined, "
|
|
62
|
+
assertHardhatInvariant(rlAsAny.output !== undefined, "Expected readline output to be defined");
|
|
63
63
|
// We show the initial message as is
|
|
64
64
|
if (out.startsWith(initialMessage)) {
|
|
65
65
|
rlAsAny.output.write(initialMessage);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SolidityBuildInfo } from "./solidity/solidity-artifacts.js";
|
|
2
|
+
import type { NonNeverKeys } from "./utils.js";
|
|
2
3
|
/**
|
|
3
4
|
* A map of bare contract names and fully qualified contract names to their
|
|
4
5
|
* artifacts that will be completed by Hardhat's build system using module
|
|
@@ -10,6 +11,31 @@ export interface ArtifactMap {
|
|
|
10
11
|
* Returns the artifact type for the bare or fully qualified contract name.
|
|
11
12
|
*/
|
|
12
13
|
export type GetArtifactByName<ContractNameT extends string> = ContractNameT extends keyof ArtifactMap ? ArtifactMap[ContractNameT] : Artifact;
|
|
14
|
+
/**
|
|
15
|
+
* A type that represents the contract names (bare and fully qualified) of all
|
|
16
|
+
* the artifacts that have been built in a project. This enables the
|
|
17
|
+
* autocomplete of the TS Language Server to list the actual contracts, without
|
|
18
|
+
* leading to a compilation error for general strings, so it doesn't fail
|
|
19
|
+
* before `hardhat build` is run.
|
|
20
|
+
*
|
|
21
|
+
* This is meant to be used in functions like this:
|
|
22
|
+
* @example
|
|
23
|
+
* ```
|
|
24
|
+
* function doSomething<ContractNameT extends ArtifactContractNames>(
|
|
25
|
+
* contractName: ContractNameT,
|
|
26
|
+
* ...
|
|
27
|
+
* ): DoSomethingReturnType<ContractNameT> {
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
export type ArtifactContractNames = keyof ArtifactMap extends never ? string : NonNeverKeys<ArtifactMap>;
|
|
31
|
+
/**
|
|
32
|
+
* A type that represents a string that should match an artifact contract name,
|
|
33
|
+
* but it doesn't fail if the string is not a contract name. It's mostly used
|
|
34
|
+
* to offer autocompletion.
|
|
35
|
+
*
|
|
36
|
+
* @see {@link ArtifactContractNames}
|
|
37
|
+
*/
|
|
38
|
+
export type StringWithArtifactContractNamesAutocompletion = ArtifactContractNames | (string & {});
|
|
13
39
|
/**
|
|
14
40
|
* The ArtifactManager is responsible for reading and writing artifacts from
|
|
15
41
|
* the Hardhat build system.
|
|
@@ -21,13 +47,16 @@ export interface ArtifactManager {
|
|
|
21
47
|
* @param contractNameOrFullyQualifiedName The name of the contract.
|
|
22
48
|
* It can be a contract bare contract name (e.g. "Token") if it's
|
|
23
49
|
* unique in your project, or a fully qualified contract name
|
|
24
|
-
* (e.g. "contract/token.sol:Token") otherwise.
|
|
50
|
+
* (e.g. "contract/token.sol:Token") otherwise. TypeScript's language server
|
|
51
|
+
* autocompletes the names of the contracts that have already been built. If
|
|
52
|
+
* your contract name isn't in the list, you can still use it, and/or run
|
|
53
|
+
* `hardhat build` to get it in the list.
|
|
25
54
|
*
|
|
26
55
|
* @throws Throws an error if a non-unique contract name is used,
|
|
27
56
|
* indicating which fully qualified names can be used instead.
|
|
28
57
|
* @throws Throws an error if the artifact doesn't exist.
|
|
29
58
|
*/
|
|
30
|
-
readArtifact<ContractNameT extends
|
|
59
|
+
readArtifact<ContractNameT extends StringWithArtifactContractNamesAutocompletion>(contractNameOrFullyQualifiedName: ContractNameT): Promise<GetArtifactByName<ContractNameT>>;
|
|
31
60
|
/**
|
|
32
61
|
* Returns the absolute path to the given artifact.
|
|
33
62
|
*
|
|
@@ -208,7 +237,7 @@ export interface LinkReferences {
|
|
|
208
237
|
* is the id of the AST node that represents the variable.
|
|
209
238
|
*/
|
|
210
239
|
export interface ImmutableReferences {
|
|
211
|
-
[
|
|
240
|
+
[immutableId: string]: Array<{
|
|
212
241
|
start: number;
|
|
213
242
|
length: number;
|
|
214
243
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/types/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/types/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;GAIG;AAGH,MAAM,WAAW,WAAW;CAAG;AAE/B;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,aAAa,SAAS,MAAM,IACxD,aAAa,SAAS,MAAM,WAAW,GACnC,WAAW,CAAC,aAAa,CAAC,GAC1B,QAAQ,CAAC;AAEf;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,WAAW,SAAS,KAAK,GAC/D,MAAM,GACN,YAAY,CAAC,WAAW,CAAC,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,MAAM,6CAA6C,GACrD,qBAAqB,GACrB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;OAcG;IACH,YAAY,CACV,aAAa,SAAS,6CAA6C,EAEnE,gCAAgC,EAAE,aAAa,GAC9C,OAAO,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC;IAE7C;;;;;;;;OAQG;IACH,eAAe,CAAC,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,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,sBAAsB,EAAE,cAAc,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAEnD;;;;;OAKG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,sBAAsB,EAAE,MAAM,GAAG;QAChC,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACjE,CAAC;CACH;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,CAAC,WAAW,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GAAG,iBAAiB,CAAC"}
|
|
@@ -57,7 +57,7 @@ export type RunCompilationJobOptions = Pick<BuildOptions, "quiet" | "buildProfil
|
|
|
57
57
|
*/
|
|
58
58
|
export interface CompileBuildInfoOptions {
|
|
59
59
|
/**
|
|
60
|
-
* If `true`, this option
|
|
60
|
+
* If `true`, this option forces the build system to recompile the build info,
|
|
61
61
|
* even if its output is cached.
|
|
62
62
|
*/
|
|
63
63
|
force?: boolean;
|
|
@@ -67,33 +67,67 @@ export interface CompileBuildInfoOptions {
|
|
|
67
67
|
quiet?: boolean;
|
|
68
68
|
}
|
|
69
69
|
export declare enum CompilationJobCreationErrorReason {
|
|
70
|
-
|
|
70
|
+
/**
|
|
71
|
+
* The root file's own pragmas are incompatible with all configured compilers.
|
|
72
|
+
*/
|
|
71
73
|
NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT = "NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT",
|
|
74
|
+
/**
|
|
75
|
+
* A dependency's own pragmas are incompatible with all configured compilers.
|
|
76
|
+
*/
|
|
77
|
+
NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY = "NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY",
|
|
78
|
+
/**
|
|
79
|
+
* Root and a transitive import path have contradictory pragmas (invalid range / empty intersection).
|
|
80
|
+
*/
|
|
81
|
+
IMPORT_OF_INCOMPATIBLE_FILE = "IMPORT_OF_INCOMPATIBLE_FILE",
|
|
82
|
+
/**
|
|
83
|
+
* Root and a transitive import path have a valid range but no configured compiler satisfies it.
|
|
84
|
+
*/
|
|
85
|
+
NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH = "NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH",
|
|
86
|
+
/**
|
|
87
|
+
* The override version doesn't satisfy the root file's own pragmas.
|
|
88
|
+
*/
|
|
72
89
|
INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION = "INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION",
|
|
73
|
-
|
|
90
|
+
/**
|
|
91
|
+
* A dependency's pragmas are incompatible with the override version.
|
|
92
|
+
*/
|
|
93
|
+
OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY = "OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY",
|
|
94
|
+
/**
|
|
95
|
+
* Generic fallback — no single compiler works for root + all dependencies.
|
|
96
|
+
*/
|
|
97
|
+
NO_COMPATIBLE_SOLC_VERSION_FOUND = "NO_COMPATIBLE_SOLC_VERSION_FOUND"
|
|
74
98
|
}
|
|
75
99
|
export interface BaseCompilationJobCreationError {
|
|
100
|
+
success: false;
|
|
76
101
|
buildProfile: string;
|
|
77
102
|
rootFilePath: string;
|
|
78
103
|
formattedReason: string;
|
|
79
104
|
}
|
|
80
|
-
export interface
|
|
105
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot extends BaseCompilationJobCreationError {
|
|
81
106
|
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT;
|
|
82
107
|
}
|
|
83
|
-
export interface
|
|
84
|
-
reason: CompilationJobCreationErrorReason.
|
|
108
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency extends BaseCompilationJobCreationError {
|
|
109
|
+
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY;
|
|
110
|
+
incompatibleImportPath: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface CompilationJobCreationErrorImportOfIncompatibleFile extends BaseCompilationJobCreationError {
|
|
113
|
+
reason: CompilationJobCreationErrorReason.IMPORT_OF_INCOMPATIBLE_FILE;
|
|
114
|
+
incompatibleImportPath: string[];
|
|
115
|
+
}
|
|
116
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath extends BaseCompilationJobCreationError {
|
|
117
|
+
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH;
|
|
118
|
+
incompatibleImportPath: string[];
|
|
85
119
|
}
|
|
86
120
|
export interface CompilationJobCreationErrorIncompatibleOverriddenSolcVersion extends BaseCompilationJobCreationError {
|
|
87
121
|
reason: CompilationJobCreationErrorReason.INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION;
|
|
88
122
|
}
|
|
89
|
-
export interface
|
|
90
|
-
reason: CompilationJobCreationErrorReason.
|
|
123
|
+
export interface CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency extends BaseCompilationJobCreationError {
|
|
124
|
+
reason: CompilationJobCreationErrorReason.OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY;
|
|
91
125
|
incompatibleImportPath: string[];
|
|
92
126
|
}
|
|
93
|
-
export interface
|
|
127
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionFound extends BaseCompilationJobCreationError {
|
|
94
128
|
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOUND;
|
|
95
129
|
}
|
|
96
|
-
export type CompilationJobCreationError =
|
|
130
|
+
export type CompilationJobCreationError = CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot | CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency | CompilationJobCreationErrorImportOfIncompatibleFile | CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath | CompilationJobCreationErrorIncompatibleOverriddenSolcVersion | CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency | CompilationJobCreationErrorNoCompatibleSolcVersionFound;
|
|
97
131
|
/**
|
|
98
132
|
* The restult of building a file.
|
|
99
133
|
*/
|
|
@@ -129,6 +163,10 @@ export interface CacheHitInfo {
|
|
|
129
163
|
* The keys in the maps of this interface are Root File Paths, which means either absolute paths or `npm:<package>/<file>` URIs.
|
|
130
164
|
*/
|
|
131
165
|
export interface GetCompilationJobsResult {
|
|
166
|
+
/**
|
|
167
|
+
* A flag to distinguish between a successful and a failed result.
|
|
168
|
+
*/
|
|
169
|
+
success: true;
|
|
132
170
|
/**
|
|
133
171
|
* Map from root file path to compilation job for files that need compilation.
|
|
134
172
|
*/
|
|
@@ -191,8 +229,16 @@ export interface SolidityBuildSystem {
|
|
|
191
229
|
* @param options The options to use when building the files.
|
|
192
230
|
* @returns An `Map` of the files to their build results, or an error if
|
|
193
231
|
* there was a problem when trying to create the necessary compilation jobs.
|
|
232
|
+
* @see `isSuccessfulBuildResult` to check if the build result is successful.
|
|
194
233
|
*/
|
|
195
234
|
build(rootFilePaths: string[], options?: BuildOptions): Promise<CompilationJobCreationError | Map<string, FileBuildResult>>;
|
|
235
|
+
/**
|
|
236
|
+
* Returns true if the given build result is successful.
|
|
237
|
+
*
|
|
238
|
+
* @param buildResult Result of the `build` method.
|
|
239
|
+
* @returns True if the build result is successful.
|
|
240
|
+
*/
|
|
241
|
+
isSuccessfulBuildResult(buildResult: CompilationJobCreationError | Map<string, FileBuildResult>): buildResult is Map<string, FileBuildResult>;
|
|
196
242
|
/**
|
|
197
243
|
* Returns the CompilationJobs that would be used to build the provided files.
|
|
198
244
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-system.d.ts","sourceRoot":"","sources":["../../../../src/types/solidity/build-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,YAAY,EACZ,uBAAuB,CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,YAAY,EACZ,OAAO,GAAG,cAAc,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oBAAY,iCAAiC;IAC3C,gCAAgC,
|
|
1
|
+
{"version":3,"file":"build-system.d.ts","sourceRoot":"","sources":["../../../../src/types/solidity/build-system.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,YAAY,EACZ,uBAAuB,CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,YAAY,EACZ,OAAO,GAAG,cAAc,CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,oBAAY,iCAAiC;IAC3C;;OAEG;IAC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AC9B,KAAK,EAAE,mBAAmB,EAC1B,kBAAkB,CAAC,EAAE,OAAO,GAC3B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;;;;OAOG;IACH,aAAa,CACX,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,UAAU,CAAA;KAAE,GAC/B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC;;;;;;;;;;;;OAYG;IACH,gBAAgB,CACd,aAAa,EAAE,MAAM,EAAE,EACvB,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,UAAU,CAAA;KAAE,GAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;;;;OAWG;IACH,gBAAgB,CACd,SAAS,EAAE,iBAAiB,EAC5B,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE3B;;OAEG;IACH,qBAAqB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D;AAED,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC"}
|
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
export var CompilationJobCreationErrorReason;
|
|
2
2
|
(function (CompilationJobCreationErrorReason) {
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The root file's own pragmas are incompatible with all configured compilers.
|
|
5
|
+
*/
|
|
4
6
|
CompilationJobCreationErrorReason["NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT"] = "NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT";
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* A dependency's own pragmas are incompatible with all configured compilers.
|
|
9
|
+
*/
|
|
10
|
+
CompilationJobCreationErrorReason["NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY"] = "NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY";
|
|
11
|
+
/**
|
|
12
|
+
* Root and a transitive import path have contradictory pragmas (invalid range / empty intersection).
|
|
13
|
+
*/
|
|
6
14
|
CompilationJobCreationErrorReason["IMPORT_OF_INCOMPATIBLE_FILE"] = "IMPORT_OF_INCOMPATIBLE_FILE";
|
|
15
|
+
/**
|
|
16
|
+
* Root and a transitive import path have a valid range but no configured compiler satisfies it.
|
|
17
|
+
*/
|
|
18
|
+
CompilationJobCreationErrorReason["NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH"] = "NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH";
|
|
19
|
+
/**
|
|
20
|
+
* The override version doesn't satisfy the root file's own pragmas.
|
|
21
|
+
*/
|
|
22
|
+
CompilationJobCreationErrorReason["INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION"] = "INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION";
|
|
23
|
+
/**
|
|
24
|
+
* A dependency's pragmas are incompatible with the override version.
|
|
25
|
+
*/
|
|
26
|
+
CompilationJobCreationErrorReason["OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY"] = "OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY";
|
|
27
|
+
/**
|
|
28
|
+
* Generic fallback — no single compiler works for root + all dependencies.
|
|
29
|
+
*/
|
|
30
|
+
CompilationJobCreationErrorReason["NO_COMPATIBLE_SOLC_VERSION_FOUND"] = "NO_COMPATIBLE_SOLC_VERSION_FOUND";
|
|
7
31
|
})(CompilationJobCreationErrorReason || (CompilationJobCreationErrorReason = {}));
|
|
8
32
|
/**
|
|
9
33
|
* The restult of building a file.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-system.js","sourceRoot":"","sources":["../../../../src/types/solidity/build-system.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"build-system.js","sourceRoot":"","sources":["../../../../src/types/solidity/build-system.ts"],"names":[],"mappings":"AAqFA,MAAM,CAAN,IAAY,iCAmCX;AAnCD,WAAY,iCAAiC;IAC3C;;OAEG;IACH,kHAA6E,CAAA;IAE7E;;OAEG;IACH,8HAAyF,CAAA;IAEzF;;OAEG;IACH,gGAA2D,CAAA;IAE3D;;OAEG;IACH,oJAA+G,CAAA;IAE/G;;OAEG;IACH,kHAA6E,CAAA;IAE7E;;OAEG;IACH,kJAA6G,CAAA;IAE7G;;OAEG;IACH,0GAAqE,CAAA;AACvE,CAAC,EAnCW,iCAAiC,KAAjC,iCAAiC,QAmC5C;AAyDD;;GAEG;AACH,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,8CAAuB,CAAA;IACvB,sDAA+B,CAAA;IAC/B,sDAA+B,CAAA;AACjC,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface ResolvedNpmPackage {
|
|
5
5
|
/**
|
|
6
|
-
* The name of the package, potentially
|
|
6
|
+
* The name of the package, potentially scoped.
|
|
7
7
|
*/
|
|
8
8
|
name: string;
|
|
9
9
|
/**
|
|
@@ -87,7 +87,7 @@ export interface NpmPackageResolvedFile {
|
|
|
87
87
|
package: ResolvedNpmPackage;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* The
|
|
90
|
+
* The result of resolving a file or import using a Resolver.
|
|
91
91
|
*/
|
|
92
92
|
export type ResolvedFile = ProjectResolvedFile | NpmPackageResolvedFile;
|
|
93
93
|
/**
|
|
@@ -147,6 +147,10 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
147
147
|
*
|
|
148
148
|
* This method cannot be used together with {@link setInlineAction} on the same
|
|
149
149
|
* task. Use one or the other.
|
|
150
|
+
*
|
|
151
|
+
* Task actions may return a {@link Result} to signal success or failure.
|
|
152
|
+
* If a task returns a failed `Result`, the CLI will set the process exit code
|
|
153
|
+
* to 1.
|
|
150
154
|
*/
|
|
151
155
|
setAction(action: LazyActionObject<NewTaskActionFunction<TaskArgumentsT>>): NewTaskDefinitionBuilder<TaskArgumentsT, "LAZY_ACTION">;
|
|
152
156
|
/**
|
|
@@ -160,6 +164,10 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
160
164
|
*
|
|
161
165
|
* This method cannot be used together with {@link setAction} on the same
|
|
162
166
|
* task. Use one or the other.
|
|
167
|
+
*
|
|
168
|
+
* Task actions may return a {@link Result} to signal success or failure.
|
|
169
|
+
* If a task returns a failed `Result`, the CLI will set the process exit code
|
|
170
|
+
* to 1.
|
|
163
171
|
*/
|
|
164
172
|
setInlineAction(inlineAction: NewTaskActionFunction<TaskArgumentsT>): NewTaskDefinitionBuilder<TaskArgumentsT, "INLINE_ACTION">;
|
|
165
173
|
/**
|