hardhat 3.1.9 → 3.1.11
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 +33 -0
- package/dist/src/config.d.ts +20 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +31 -0
- package/dist/src/config.js.map +1 -1
- 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/coverage-manager.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.js +33 -21
- package/dist/src/internal/builtin-plugins/coverage/coverage-manager.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/flatten/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/flatten/task-action.js +1 -1
- package/dist/src/internal/builtin-plugins/flatten/task-action.js.map +1 -1
- package/dist/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.js +2 -2
- 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 +3 -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 +7 -19
- 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 +1 -0
- package/dist/src/internal/builtin-plugins/gas-analytics/index.js.map +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/network-manager/hook-handlers/config.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/config.js +58 -20
- package/dist/src/internal/builtin-plugins/network-manager/hook-handlers/config.js.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.js +8 -0
- package/dist/src/internal/builtin-plugins/network-manager/type-validation.js.map +1 -1
- package/dist/src/internal/builtin-plugins/node/task-action.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/node/task-action.js +1 -2
- package/dist/src/internal/builtin-plugins/node/task-action.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 +14 -6
- 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/compiler/downloader.d.ts +0 -3
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js +3 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.d.ts +2 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.js +4 -2
- package/dist/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.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 +5 -2
- 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/dependency-resolver.js +8 -2
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/error-messages.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/error-messages.js +19 -5
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/error-messages.js.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts +21 -2
- 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 +84 -25
- 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/type-extensions.d.ts +22 -0
- package/dist/src/internal/builtin-plugins/solidity/type-extensions.d.ts.map +1 -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 +1 -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/runner.d.ts +1 -1
- package/dist/src/internal/builtin-plugins/solidity-test/runner.js +1 -1
- 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 +16 -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 +1 -0
- 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 +40 -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/error-handler.d.ts.map +1 -1
- package/dist/src/internal/cli/error-handler.js +15 -0
- package/dist/src/internal/cli/error-handler.js.map +1 -1
- 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/reporter.d.ts.map +1 -1
- package/dist/src/internal/cli/telemetry/sentry/reporter.js +4 -0
- package/dist/src/internal/cli/telemetry/sentry/reporter.js.map +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/config-validation.d.ts +3 -3
- package/dist/src/internal/core/config-validation.d.ts.map +1 -1
- package/dist/src/internal/core/config-validation.js +48 -18
- package/dist/src/internal/core/config-validation.js.map +1 -1
- package/dist/src/internal/core/tasks/builders.d.ts +26 -16
- package/dist/src/internal/core/tasks/builders.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/builders.js +65 -6
- package/dist/src/internal/core/tasks/builders.js.map +1 -1
- package/dist/src/internal/core/tasks/resolved-task.d.ts +2 -2
- package/dist/src/internal/core/tasks/resolved-task.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/resolved-task.js +23 -9
- package/dist/src/internal/core/tasks/resolved-task.js.map +1 -1
- package/dist/src/internal/core/tasks/task-manager.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/task-manager.js +14 -6
- package/dist/src/internal/core/tasks/task-manager.js.map +1 -1
- package/dist/src/internal/core/tasks/validations.d.ts +2 -0
- package/dist/src/internal/core/tasks/validations.d.ts.map +1 -1
- package/dist/src/internal/core/tasks/validations.js +11 -0
- package/dist/src/internal/core/tasks/validations.js.map +1 -1
- package/dist/src/internal/core/user-interruptions.js +1 -1
- package/dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.d.ts +2 -0
- package/dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.d.ts.map +1 -0
- package/dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js +12 -0
- package/dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js.map +1 -0
- package/dist/src/internal/using-hardhat2-plugin-errors.d.ts +35 -0
- package/dist/src/internal/using-hardhat2-plugin-errors.d.ts.map +1 -0
- package/dist/src/internal/using-hardhat2-plugin-errors.js +98 -0
- package/dist/src/internal/using-hardhat2-plugin-errors.js.map +1 -0
- package/dist/src/plugins.d.ts +8 -0
- package/dist/src/plugins.d.ts.map +1 -1
- package/dist/src/plugins.js +13 -0
- package/dist/src/plugins.js.map +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/index.d.ts +15 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +15 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/network.d.ts +1 -1
- package/dist/src/types/plugins.d.ts +2 -2
- 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/errors.d.ts +18 -0
- package/dist/src/types/solidity/errors.d.ts.map +1 -1
- package/dist/src/types/solidity/errors.js.map +1 -1
- package/dist/src/types/solidity/resolved-file.d.ts +2 -2
- package/dist/src/types/tasks.d.ts +103 -34
- 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 +11 -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 +12 -7
- package/src/config.ts +37 -0
- 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/coverage-manager.ts +57 -50
- 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/flatten/task-action.ts +1 -0
- package/src/internal/builtin-plugins/gas-analytics/gas-analytics-manager.ts +4 -4
- package/src/internal/builtin-plugins/gas-analytics/helpers.ts +11 -29
- package/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts +68 -0
- package/src/internal/builtin-plugins/gas-analytics/index.ts +1 -0
- 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/network-manager/hook-handlers/config.ts +65 -21
- package/src/internal/builtin-plugins/network-manager/type-validation.ts +9 -0
- package/src/internal/builtin-plugins/node/task-action.ts +2 -2
- package/src/internal/builtin-plugins/solidity/build-results.ts +3 -1
- package/src/internal/builtin-plugins/solidity/build-system/build-system.ts +16 -5
- package/src/internal/builtin-plugins/solidity/build-system/compiler/compiler.ts +1 -1
- package/src/internal/builtin-plugins/solidity/build-system/compiler/downloader.ts +7 -6
- package/src/internal/builtin-plugins/solidity/build-system/dependency-graph-building.ts +23 -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 +17 -3
- package/src/internal/builtin-plugins/solidity/build-system/resolver/error-messages.ts +19 -5
- package/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.ts +139 -35
- 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/type-extensions.ts +28 -0
- package/src/internal/builtin-plugins/solidity-test/config.ts +1 -0
- package/src/internal/builtin-plugins/solidity-test/edr-artifacts.ts +2 -2
- package/src/internal/builtin-plugins/solidity-test/runner.ts +1 -1
- package/src/internal/builtin-plugins/solidity-test/task-action.ts +36 -38
- package/src/internal/builtin-plugins/solidity-test/type-extensions.ts +1 -0
- package/src/internal/builtin-plugins/telemetry/task-action.ts +4 -2
- package/src/internal/builtin-plugins/test/task-action.ts +71 -25
- package/src/internal/builtin-plugins/test/type-extensions.ts +42 -0
- package/src/internal/cli/banner-manager.ts +234 -0
- package/src/internal/cli/error-handler.ts +18 -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/reporter.ts +5 -0
- package/src/internal/cli/telemetry/sentry/vendor/integrations/contextlines.ts +98 -50
- package/src/internal/core/config-validation.ts +67 -18
- package/src/internal/core/tasks/builders.ts +174 -30
- package/src/internal/core/tasks/resolved-task.ts +31 -13
- package/src/internal/core/tasks/task-manager.ts +23 -5
- package/src/internal/core/tasks/validations.ts +40 -0
- package/src/internal/core/user-interruptions.ts +1 -1
- package/src/internal/deprecated-module-imported-from-hardhat2-plugin.ts +12 -0
- package/src/internal/using-hardhat2-plugin-errors.ts +108 -0
- package/src/plugins.ts +16 -0
- package/src/types/artifacts.ts +40 -3
- package/src/types/hre.ts +1 -1
- package/src/types/index.ts +14 -0
- package/src/types/network.ts +1 -1
- package/src/types/plugins.ts +2 -2
- package/src/types/solidity/build-system.ts +75 -14
- package/src/types/solidity/errors.ts +22 -0
- package/src/types/solidity/resolved-file.ts +2 -2
- package/src/types/tasks.ts +143 -36
- package/src/types/test.ts +12 -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 +11 -11
- package/templates/hardhat-3/02-mocha-ethers/package.json +16 -16
- 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
|
@@ -48,6 +48,20 @@ export declare enum TaskDefinitionType {
|
|
|
48
48
|
NEW_TASK = "NEW_TASK",
|
|
49
49
|
TASK_OVERRIDE = "TASK_OVERRIDE"
|
|
50
50
|
}
|
|
51
|
+
export type TaskAction = {
|
|
52
|
+
action: LazyActionObject<NewTaskActionFunction>;
|
|
53
|
+
inlineAction?: never;
|
|
54
|
+
} | {
|
|
55
|
+
inlineAction: NewTaskActionFunction;
|
|
56
|
+
action?: never;
|
|
57
|
+
};
|
|
58
|
+
export type TaskOverrideAction = {
|
|
59
|
+
action: LazyActionObject<TaskOverrideActionFunction>;
|
|
60
|
+
inlineAction?: never;
|
|
61
|
+
} | {
|
|
62
|
+
inlineAction: TaskOverrideActionFunction;
|
|
63
|
+
action?: never;
|
|
64
|
+
};
|
|
51
65
|
/**
|
|
52
66
|
* Empty task definition. It is meant to be used as a placeholder task that only
|
|
53
67
|
* prints information about its subtasks.
|
|
@@ -62,26 +76,32 @@ export interface EmptyTaskDefinition {
|
|
|
62
76
|
description: string;
|
|
63
77
|
}
|
|
64
78
|
/**
|
|
65
|
-
* The definition of a new task.
|
|
79
|
+
* The base definition of a new task.
|
|
66
80
|
*/
|
|
67
|
-
export interface
|
|
81
|
+
export interface BaseTaskDefinition {
|
|
68
82
|
type: TaskDefinitionType.NEW_TASK;
|
|
69
83
|
id: string[];
|
|
70
84
|
description: string;
|
|
71
|
-
action: LazyActionObject<NewTaskActionFunction>;
|
|
72
85
|
options: Record<string, OptionDefinition>;
|
|
73
86
|
positionalArguments: PositionalArgumentDefinition[];
|
|
74
87
|
}
|
|
75
88
|
/**
|
|
76
|
-
*
|
|
89
|
+
* The definition of a new task.
|
|
90
|
+
*/
|
|
91
|
+
export type NewTaskDefinition = BaseTaskDefinition & TaskAction;
|
|
92
|
+
/**
|
|
93
|
+
* The base definition of an override of an existing task.
|
|
77
94
|
*/
|
|
78
|
-
export interface
|
|
95
|
+
export interface BaseTaskOverrideDefinition {
|
|
79
96
|
type: TaskDefinitionType.TASK_OVERRIDE;
|
|
80
97
|
id: string[];
|
|
81
98
|
description?: string;
|
|
82
|
-
action: LazyActionObject<TaskOverrideActionFunction>;
|
|
83
99
|
options: Record<string, OptionDefinition>;
|
|
84
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* An override of an existing task.
|
|
103
|
+
*/
|
|
104
|
+
export type TaskOverrideDefinition = BaseTaskOverrideDefinition & TaskOverrideAction;
|
|
85
105
|
/**
|
|
86
106
|
* The definition of a task, as used in the plugins and user config. They are
|
|
87
107
|
* declarative descriptions of the task, which are later processed to create the
|
|
@@ -103,8 +123,11 @@ export interface EmptyTaskDefinitionBuilder {
|
|
|
103
123
|
}
|
|
104
124
|
/**
|
|
105
125
|
* A builder for creating NewTaskDefinitions.
|
|
126
|
+
*
|
|
127
|
+
* @template TaskArgumentsT The arguments of the task.
|
|
128
|
+
* @template ActionTypeT Tracks if the action is "LAZY_ACTION" (Plugin Safe) or "INLINE_ACTION".
|
|
106
129
|
*/
|
|
107
|
-
export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments> {
|
|
130
|
+
export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments, ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" = "MISSING_ACTION"> {
|
|
108
131
|
/**
|
|
109
132
|
* Sets the description of the task.
|
|
110
133
|
*/
|
|
@@ -112,13 +135,41 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
112
135
|
/**
|
|
113
136
|
* Sets the action of the task.
|
|
114
137
|
*
|
|
115
|
-
* It
|
|
116
|
-
*
|
|
138
|
+
* It must be provided as a lazy import function that returns a module with
|
|
139
|
+
* a default export, like `() => import("./my-action.js")`.
|
|
140
|
+
*
|
|
141
|
+
* Note that plugins cannot use inline actions (see {@link setInlineAction}).
|
|
142
|
+
* They must use this method with a lazy import.
|
|
117
143
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* This method can only be called once per task definition. Calling it multiple
|
|
146
|
+
* times will result in a runtime error.
|
|
147
|
+
*
|
|
148
|
+
* This method cannot be used together with {@link setInlineAction} on the same
|
|
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.
|
|
154
|
+
*/
|
|
155
|
+
setAction(action: LazyActionObject<NewTaskActionFunction<TaskArgumentsT>>): NewTaskDefinitionBuilder<TaskArgumentsT, "LAZY_ACTION">;
|
|
156
|
+
/**
|
|
157
|
+
* Sets the inline action of the task.
|
|
158
|
+
*
|
|
159
|
+
* It must be provided as a function.
|
|
160
|
+
*
|
|
161
|
+
* @remarks
|
|
162
|
+
* This method can only be called once per task definition. Calling it multiple
|
|
163
|
+
* times will result in a runtime error.
|
|
164
|
+
*
|
|
165
|
+
* This method cannot be used together with {@link setAction} on the same
|
|
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.
|
|
120
171
|
*/
|
|
121
|
-
|
|
172
|
+
setInlineAction(inlineAction: NewTaskActionFunction<TaskArgumentsT>): NewTaskDefinitionBuilder<TaskArgumentsT, "INLINE_ACTION">;
|
|
122
173
|
/**
|
|
123
174
|
* Adds an option to the task.
|
|
124
175
|
*
|
|
@@ -135,7 +186,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
135
186
|
type?: TypeT;
|
|
136
187
|
defaultValue: ArgumentTypeToValueType<TypeT>;
|
|
137
188
|
hidden?: boolean;
|
|
138
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
189
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
139
190
|
/**
|
|
140
191
|
* Adds an option of flag type and default value false.
|
|
141
192
|
*/
|
|
@@ -144,7 +195,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
144
195
|
shortName?: string;
|
|
145
196
|
description?: string;
|
|
146
197
|
hidden?: boolean;
|
|
147
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT
|
|
198
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT>, ActionTypeT>;
|
|
148
199
|
/**
|
|
149
200
|
* Adds an option of level type and default value 0.
|
|
150
201
|
*/
|
|
@@ -153,7 +204,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
153
204
|
shortName?: string;
|
|
154
205
|
description?: string;
|
|
155
206
|
defaultValue?: number;
|
|
156
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT
|
|
207
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT>, ActionTypeT>;
|
|
157
208
|
/**
|
|
158
209
|
* Adds a positional argument to the task.
|
|
159
210
|
*
|
|
@@ -175,7 +226,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
175
226
|
description?: string;
|
|
176
227
|
type?: TypeT;
|
|
177
228
|
defaultValue?: ArgumentTypeToValueType<TypeT>;
|
|
178
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
229
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
179
230
|
/**
|
|
180
231
|
* Adds a variadic positional argument to the task.
|
|
181
232
|
*
|
|
@@ -195,16 +246,23 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
195
246
|
description?: string;
|
|
196
247
|
type?: TypeT;
|
|
197
248
|
defaultValue?: Array<ArgumentTypeToValueType<TypeT>>;
|
|
198
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT[], TaskArgumentsT
|
|
249
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT[], TaskArgumentsT>, ActionTypeT>;
|
|
199
250
|
/**
|
|
200
251
|
* Builds the NewTaskDefinition.
|
|
201
252
|
*/
|
|
202
|
-
build(): NewTaskDefinition
|
|
253
|
+
build(): ActionTypeT extends "LAZY_ACTION" ? Extract<NewTaskDefinition, {
|
|
254
|
+
action: LazyActionObject<NewTaskActionFunction>;
|
|
255
|
+
}> : ActionTypeT extends "INLINE_ACTION" ? Extract<NewTaskDefinition, {
|
|
256
|
+
inlineAction: NewTaskActionFunction;
|
|
257
|
+
}> : never;
|
|
203
258
|
}
|
|
204
259
|
/**
|
|
205
|
-
* A builder for overriding existing tasks
|
|
260
|
+
* A builder for overriding existing tasks
|
|
261
|
+
*
|
|
262
|
+
* @template TaskArgumentsT The arguments of the task.
|
|
263
|
+
* @template ActionTypeT Tracks if the action is "LAZY_ACTION" (Plugin Safe) or "INLINE_ACTION".
|
|
206
264
|
*/
|
|
207
|
-
export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments> {
|
|
265
|
+
export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments, ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" = "MISSING_ACTION"> {
|
|
208
266
|
/**
|
|
209
267
|
* Sets a new description for the task.
|
|
210
268
|
*/
|
|
@@ -214,7 +272,13 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
214
272
|
*
|
|
215
273
|
* @see NewTaskDefinitionBuilder.setAction
|
|
216
274
|
*/
|
|
217
|
-
setAction(action: LazyActionObject<TaskOverrideActionFunction<TaskArgumentsT>>):
|
|
275
|
+
setAction(action: LazyActionObject<TaskOverrideActionFunction<TaskArgumentsT>>): TaskOverrideDefinitionBuilder<TaskArgumentsT, "LAZY_ACTION">;
|
|
276
|
+
/**
|
|
277
|
+
* Sets a new inline action for the task.
|
|
278
|
+
*
|
|
279
|
+
* @see NewTaskDefinitionBuilder.setInlineAction
|
|
280
|
+
*/
|
|
281
|
+
setInlineAction(inlineAction: TaskOverrideActionFunction<TaskArgumentsT>): TaskOverrideDefinitionBuilder<TaskArgumentsT, "INLINE_ACTION">;
|
|
218
282
|
/**
|
|
219
283
|
* Adds a new option to the task.
|
|
220
284
|
*
|
|
@@ -227,7 +291,7 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
227
291
|
type?: TypeT;
|
|
228
292
|
defaultValue: ArgumentTypeToValueType<TypeT>;
|
|
229
293
|
hidden?: boolean;
|
|
230
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
294
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
231
295
|
/**
|
|
232
296
|
* Adds an option of flag type and default value false.
|
|
233
297
|
*/
|
|
@@ -236,7 +300,7 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
236
300
|
shortName?: string;
|
|
237
301
|
description?: string;
|
|
238
302
|
hidden?: boolean;
|
|
239
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT
|
|
303
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT>, ActionTypeT>;
|
|
240
304
|
/**
|
|
241
305
|
* Adds an option of level type and default value 0.
|
|
242
306
|
*/
|
|
@@ -245,33 +309,38 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
245
309
|
shortName?: string;
|
|
246
310
|
description?: string;
|
|
247
311
|
defaultValue?: number;
|
|
248
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT
|
|
312
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT>, ActionTypeT>;
|
|
249
313
|
/**
|
|
250
314
|
* Builds the TaskOverrideDefinition.
|
|
251
315
|
*/
|
|
252
|
-
build(): TaskOverrideDefinition
|
|
316
|
+
build(): ActionTypeT extends "LAZY_ACTION" ? Extract<TaskOverrideDefinition, {
|
|
317
|
+
action: LazyActionObject<TaskOverrideActionFunction>;
|
|
318
|
+
}> : ActionTypeT extends "INLINE_ACTION" ? Extract<TaskOverrideDefinition, {
|
|
319
|
+
inlineAction: TaskOverrideActionFunction;
|
|
320
|
+
}> : never;
|
|
253
321
|
}
|
|
254
322
|
/**
|
|
255
323
|
* The actions associated to the task, in order.
|
|
256
324
|
*
|
|
257
325
|
* Each of them has the pluginId of the plugin that defined it, if any, and the
|
|
258
|
-
* action itself.
|
|
326
|
+
* action itself. The action is stored either in `action` or `inlineAction`.
|
|
327
|
+
* Note that `inlineAction` is reserved for user tasks and is not allowed for plugins.
|
|
259
328
|
*
|
|
260
|
-
* Note that the first action is a `NewTaskActionFunction
|
|
261
|
-
* `undefined
|
|
329
|
+
* Note that the first action is a `NewTaskActionFunction` or undefined.
|
|
330
|
+
* `undefined` is only used for empty tasks.
|
|
262
331
|
*
|
|
263
|
-
* The rest of the actions always have a `TaskOverrideActionFunction
|
|
264
|
-
* `string`.
|
|
332
|
+
* The rest of the actions always have a `TaskOverrideActionFunction`.
|
|
265
333
|
*/
|
|
266
334
|
export type TaskActions = [
|
|
267
335
|
{
|
|
268
336
|
pluginId?: string;
|
|
269
|
-
|
|
270
|
-
|
|
337
|
+
} & (TaskAction | {
|
|
338
|
+
action?: undefined;
|
|
339
|
+
inlineAction?: undefined;
|
|
340
|
+
}),
|
|
271
341
|
...Array<{
|
|
272
342
|
pluginId?: string;
|
|
273
|
-
|
|
274
|
-
}>
|
|
343
|
+
} & TaskOverrideAction>
|
|
275
344
|
];
|
|
276
345
|
/**
|
|
277
346
|
* A task.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EACZ,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAO1D,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAiB,yBAAyB;QACxC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;KAC7B;CACF;AAKD,OAAO,QAAQ,aAAa,CA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EG;IACH,OAAO,EAAE,WAAW,CAAC;IAErB;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAEvC;;OAEG;IACH,mBAAmB,EAAE,4BAA4B,EAAE,CAAC;IAEpD;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE5B;;OAEG;IACH,GAAG,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,SAAS,IAAI,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,OAAO,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC;CACZ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../../src/types/tasks.ts"],"names":[],"mappings":"AAsEA;;GAEG;AACH,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,+CAAyB,CAAA;IACzB,2CAAqB,CAAA;IACrB,qDAA+B,CAAA;AACjC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B"}
|
package/dist/src/types/test.d.ts
CHANGED
|
@@ -2,4 +2,15 @@ export interface HardhatTestUserConfig {
|
|
|
2
2
|
}
|
|
3
3
|
export interface HardhatTestConfig {
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Summary of a test run, containing counts of test outcomes and optional
|
|
7
|
+
* failure output.
|
|
8
|
+
*/
|
|
9
|
+
export interface TestSummary {
|
|
10
|
+
failed: number;
|
|
11
|
+
passed: number;
|
|
12
|
+
skipped: number;
|
|
13
|
+
todo: number;
|
|
14
|
+
failureOutput?: string;
|
|
15
|
+
}
|
|
5
16
|
//# sourceMappingURL=test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/types/test.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;CAAG;AAIzC,MAAM,WAAW,iBAAiB;CAAG"}
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../src/types/test.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;CAAG;AAIzC,MAAM,WAAW,iBAAiB;CAAG;AAErC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -28,4 +28,20 @@ export type Return<T> = T extends (...args: any[]) => infer Ret ? Ret : never;
|
|
|
28
28
|
export type RequireField<T, K extends keyof T> = T & {
|
|
29
29
|
[P in K]-?: T[P];
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* A result that can either have a value or an error.
|
|
33
|
+
*/
|
|
34
|
+
export type Result<ValueT, ErrorT> = {
|
|
35
|
+
readonly success: true;
|
|
36
|
+
readonly value: ValueT;
|
|
37
|
+
} | {
|
|
38
|
+
readonly success: false;
|
|
39
|
+
readonly error: ErrorT;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Returns the keys of T tht don't map to never.
|
|
43
|
+
*/
|
|
44
|
+
export type NonNeverKeys<T> = {
|
|
45
|
+
[K in keyof T]: T[K] extends never ? never : K;
|
|
46
|
+
}[keyof T];
|
|
31
47
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/types/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,CAC/C,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,KACvB,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,SAAS,CAC9C,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,KACvB,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,4BAA4B,CAAC,CAAC,IAAI,CAAC,SAAS,CACtD,GAAG,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,GAAG,CAAC,KAC5B,GAAG,GACJ,CAAC,GACD,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,CACvC,GAAG,IAAI,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE,MAAM,IAAI,CAAC,KAC/B,GAAG,GACJ,IAAI,GACJ,KAAK,CAAC;AAEV;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;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K,MAAM,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAClD,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,IAC7B;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,GAAG,KAAK,GAAG,CAAC;CAC/C,CAAC,MAAM,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Result } from "../types/utils.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a successful Result with the given value.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to include in the result.
|
|
6
|
+
* @returns A Result with success: true and the given value.
|
|
7
|
+
*/
|
|
8
|
+
export declare function successfulResult<ValueT = undefined>(...args: ValueT extends undefined | void ? [] : [value: ValueT]): {
|
|
9
|
+
success: true;
|
|
10
|
+
value: ValueT;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Creates a failed Result with the given error.
|
|
14
|
+
*
|
|
15
|
+
* @param error The error to include in the result.
|
|
16
|
+
* @returns A Result with success: false and the given error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function errorResult<ErrorT = undefined>(...args: ErrorT extends undefined | void ? [] : [error: ErrorT]): {
|
|
19
|
+
success: false;
|
|
20
|
+
error: ErrorT;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* A type guard that checks if a value is a Result.
|
|
24
|
+
*
|
|
25
|
+
* Optionally validates the value and error fields using type guard functions.
|
|
26
|
+
*
|
|
27
|
+
* @param value The value to check.
|
|
28
|
+
* @param isValue Optional type guard for the value field.
|
|
29
|
+
* @param isError Optional type guard for the error field.
|
|
30
|
+
* @returns true if the value is a Result.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isResult<ValueT = unknown, ErrorT = unknown>(value: unknown, isValue?: (v: unknown) => v is ValueT, isError?: (e: unknown) => e is ErrorT): value is Result<ValueT, ErrorT>;
|
|
33
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../../src/utils/result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAG,SAAS,EACjD,GAAG,IAAI,EAAE,MAAM,SAAS,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9D;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAIlC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,GAAG,SAAS,EAC5C,GAAG,IAAI,EAAE,MAAM,SAAS,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9D;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAInC;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,GAAG,OAAO,EACzD,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,EACrC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,GACpC,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUjC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { isObject } from "@nomicfoundation/hardhat-utils/lang";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a successful Result with the given value.
|
|
4
|
+
*
|
|
5
|
+
* @param value The value to include in the result.
|
|
6
|
+
* @returns A Result with success: true and the given value.
|
|
7
|
+
*/
|
|
8
|
+
export function successfulResult(...args) {
|
|
9
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
10
|
+
-- Cast needed because TS loses the conditional rest parameter context */
|
|
11
|
+
return { success: true, value: args[0] };
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Creates a failed Result with the given error.
|
|
15
|
+
*
|
|
16
|
+
* @param error The error to include in the result.
|
|
17
|
+
* @returns A Result with success: false and the given error.
|
|
18
|
+
*/
|
|
19
|
+
export function errorResult(...args) {
|
|
20
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
21
|
+
-- Cast needed because TS loses the conditional rest parameter context */
|
|
22
|
+
return { success: false, error: args[0] };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A type guard that checks if a value is a Result.
|
|
26
|
+
*
|
|
27
|
+
* Optionally validates the value and error fields using type guard functions.
|
|
28
|
+
*
|
|
29
|
+
* @param value The value to check.
|
|
30
|
+
* @param isValue Optional type guard for the value field.
|
|
31
|
+
* @param isError Optional type guard for the error field.
|
|
32
|
+
* @returns true if the value is a Result.
|
|
33
|
+
*/
|
|
34
|
+
export function isResult(value, isValue, isError) {
|
|
35
|
+
if (!isObject(value) || typeof value.success !== "boolean") {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (value.success === true) {
|
|
39
|
+
return "value" in value && (isValue === undefined || isValue(value.value));
|
|
40
|
+
}
|
|
41
|
+
return "error" in value && (isError === undefined || isError(value.error));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/utils/result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,GAAG,IAA4D;IAE/D;6EACyE;IACzE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAW,EAAE,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CACzB,GAAG,IAA4D;IAE/D;6EACyE;IACzE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAW,EAAE,CAAC;AACtD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CACtB,KAAc,EACd,OAAqC,EACrC,OAAqC;IAErC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAC3D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;QAC3B,OAAO,OAAO,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,OAAO,IAAI,KAAK,IAAI,CAAC,OAAO,KAAK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hardhat",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"description": "Hardhat is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.",
|
|
5
5
|
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/hardhat",
|
|
6
6
|
"repository": {
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"./hre": "./dist/src/hre.js",
|
|
22
22
|
"./plugins": "./dist/src/plugins.js",
|
|
23
23
|
"./internal/lsp-helpers": "./dist/src/lsp-helpers.js",
|
|
24
|
+
"./types": "./dist/src/types/index.js",
|
|
24
25
|
"./types/arguments": "./dist/src/types/arguments.js",
|
|
25
26
|
"./types/artifacts": "./dist/src/types/artifacts.js",
|
|
26
27
|
"./types/config": "./dist/src/types/config.js",
|
|
@@ -38,7 +39,11 @@
|
|
|
38
39
|
"./console.sol": "./console.sol",
|
|
39
40
|
"./internal/coverage": "./dist/src/internal/builtin-plugins/coverage/exports.js",
|
|
40
41
|
"./internal/gas-analytics": "./dist/src/internal/builtin-plugins/gas-analytics/exports.js",
|
|
41
|
-
"./utils/contract-names": "./dist/src/utils/contract-names.js"
|
|
42
|
+
"./utils/contract-names": "./dist/src/utils/contract-names.js",
|
|
43
|
+
"./utils/result": "./dist/src/utils/result.js",
|
|
44
|
+
"./types/runtime": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js",
|
|
45
|
+
"./builtin-tasks/task-names": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js",
|
|
46
|
+
"./internal/artifacts": "./dist/src/internal/deprecated-module-imported-from-hardhat2-plugin.js"
|
|
42
47
|
},
|
|
43
48
|
"keywords": [
|
|
44
49
|
"ethereum",
|
|
@@ -68,14 +73,14 @@
|
|
|
68
73
|
"prettier": "3.2.5",
|
|
69
74
|
"rimraf": "^5.0.5",
|
|
70
75
|
"typescript": "~5.8.0",
|
|
71
|
-
"@nomicfoundation/hardhat-test-utils": "^2.0.
|
|
76
|
+
"@nomicfoundation/hardhat-test-utils": "^2.0.2"
|
|
72
77
|
},
|
|
73
78
|
"dependencies": {
|
|
74
|
-
"@nomicfoundation/edr": "0.12.0-next.
|
|
75
|
-
"@nomicfoundation/hardhat-errors": "^3.0.
|
|
76
|
-
"@nomicfoundation/hardhat-utils": "^
|
|
79
|
+
"@nomicfoundation/edr": "0.12.0-next.27",
|
|
80
|
+
"@nomicfoundation/hardhat-errors": "^3.0.7",
|
|
81
|
+
"@nomicfoundation/hardhat-utils": "^4.0.0",
|
|
77
82
|
"@nomicfoundation/hardhat-vendored": "^3.0.1",
|
|
78
|
-
"@nomicfoundation/hardhat-zod-utils": "^3.0.
|
|
83
|
+
"@nomicfoundation/hardhat-zod-utils": "^3.0.3",
|
|
79
84
|
"@nomicfoundation/solidity-analyzer": "^0.1.1",
|
|
80
85
|
"@sentry/core": "^9.4.0",
|
|
81
86
|
"adm-zip": "^0.4.16",
|
package/src/config.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type { HardhatUserConfig } from "./types/config.js";
|
|
|
8
8
|
import "./internal/builtin-plugins/index.js";
|
|
9
9
|
import type { HardhatUserConfig } from "./types/config.js";
|
|
10
10
|
|
|
11
|
+
import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js";
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* Defines a Hardhat user config.
|
|
13
15
|
*
|
|
@@ -38,3 +40,38 @@ export function defineConfig(config: HardhatUserConfig): HardhatUserConfig {
|
|
|
38
40
|
// use it and have a better user experience.
|
|
39
41
|
return config;
|
|
40
42
|
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
46
|
+
*/
|
|
47
|
+
export function extendConfig(..._args: any): any {
|
|
48
|
+
throwUsingHardhat2PluginError();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
53
|
+
*/
|
|
54
|
+
export function extendEnvironment(..._args: any): any {
|
|
55
|
+
throwUsingHardhat2PluginError();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
60
|
+
*/
|
|
61
|
+
export function extendProvider(..._args: any): any {
|
|
62
|
+
throwUsingHardhat2PluginError();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
67
|
+
*/
|
|
68
|
+
export function scope(..._args: any): any {
|
|
69
|
+
throwUsingHardhat2PluginError();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
74
|
+
*/
|
|
75
|
+
export function subtask(..._args: any): any {
|
|
76
|
+
throwUsingHardhat2PluginError();
|
|
77
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ArtifactManager,
|
|
3
3
|
GetArtifactByName,
|
|
4
|
+
StringWithArtifactContractNamesAutocompletion,
|
|
4
5
|
} from "../../../types/artifacts.js";
|
|
5
6
|
|
|
6
7
|
import { EOL } from "node:os";
|
|
@@ -47,7 +48,9 @@ export class ArtifactManagerImplementation implements ArtifactManager {
|
|
|
47
48
|
this.#readFsData = readFsData ?? (() => this.#readFsDataFromFileSystem());
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
public async readArtifact<
|
|
51
|
+
public async readArtifact<
|
|
52
|
+
ContractNameT extends StringWithArtifactContractNamesAutocompletion,
|
|
53
|
+
>(
|
|
51
54
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
52
55
|
): Promise<GetArtifactByName<ContractNameT>> {
|
|
53
56
|
const artifactPath = await this.getArtifactPath(
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ArtifactManager,
|
|
3
3
|
GetArtifactByName,
|
|
4
|
+
StringWithArtifactContractNamesAutocompletion,
|
|
4
5
|
} from "../../../../types/artifacts.js";
|
|
5
6
|
import type { HardhatRuntimeEnvironmentHooks } from "../../../../types/hooks.js";
|
|
6
7
|
|
|
@@ -13,7 +14,9 @@ class LazyArtifactManager implements ArtifactManager {
|
|
|
13
14
|
this.#artifactsPath = artifactsPath;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
|
-
public async readArtifact<
|
|
17
|
+
public async readArtifact<
|
|
18
|
+
ContractNameT extends StringWithArtifactContractNamesAutocompletion,
|
|
19
|
+
>(
|
|
17
20
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
18
21
|
): Promise<GetArtifactByName<ContractNameT>> {
|
|
19
22
|
const artifactManager = await this.#getArtifactManager();
|