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
|
@@ -38,33 +38,77 @@ export async function extendUserConfig(
|
|
|
38
38
|
const networks: Record<string, NetworkUserConfig> =
|
|
39
39
|
extendedConfig.networks ?? {};
|
|
40
40
|
|
|
41
|
-
const localhostConfig:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
};
|
|
41
|
+
const localhostConfig: NetworkUserConfig | undefined = networks.localhost;
|
|
42
|
+
const defaultConfig: NetworkUserConfig | undefined = networks.default;
|
|
43
|
+
const nodeConfig: NetworkUserConfig | undefined = networks.node;
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
let extendedLocalhostConfig: NetworkUserConfig;
|
|
46
|
+
if (
|
|
47
|
+
localhostConfig === undefined ||
|
|
48
|
+
localhostConfig.type === undefined ||
|
|
49
|
+
localhostConfig.type === "http"
|
|
50
|
+
) {
|
|
51
|
+
extendedLocalhostConfig = {
|
|
52
|
+
url: "http://localhost:8545",
|
|
53
|
+
type: "http",
|
|
54
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
55
|
+
-- We cast it here because otherwise TS complains that some fields are
|
|
56
|
+
always overwritten, which is not true for js incomplete configs. */
|
|
57
|
+
...(localhostConfig as Partial<HttpNetworkUserConfig>),
|
|
58
|
+
};
|
|
59
|
+
} else {
|
|
60
|
+
extendedLocalhostConfig = localhostConfig;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const defaultEdrNetworkConfigValues = {
|
|
64
|
+
chainId: 31337,
|
|
65
|
+
gas: "auto",
|
|
66
|
+
gasMultiplier: 1,
|
|
67
|
+
gasPrice: "auto",
|
|
68
|
+
type: "edr-simulated",
|
|
69
|
+
} as const;
|
|
70
|
+
|
|
71
|
+
let extendedDefaultConfig: NetworkUserConfig;
|
|
72
|
+
if (
|
|
73
|
+
defaultConfig === undefined ||
|
|
74
|
+
defaultConfig.type === undefined ||
|
|
75
|
+
defaultConfig.type === "edr-simulated"
|
|
76
|
+
) {
|
|
77
|
+
extendedDefaultConfig = {
|
|
78
|
+
...defaultEdrNetworkConfigValues,
|
|
79
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
80
|
+
-- We cast it here because otherwise TS complains that some fields are
|
|
81
|
+
always overwritten, which is not true for js incomplete configs. */
|
|
82
|
+
...(defaultConfig as Partial<EdrNetworkUserConfig>),
|
|
83
|
+
};
|
|
84
|
+
} else {
|
|
85
|
+
extendedDefaultConfig = defaultConfig;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let extendedNodeConfig: NetworkUserConfig;
|
|
89
|
+
if (
|
|
90
|
+
nodeConfig === undefined ||
|
|
91
|
+
nodeConfig.type === undefined ||
|
|
92
|
+
nodeConfig.type === "edr-simulated"
|
|
93
|
+
) {
|
|
94
|
+
extendedNodeConfig = {
|
|
95
|
+
...defaultEdrNetworkConfigValues,
|
|
96
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
97
|
+
-- We cast it here because otherwise TS complains that url and http will
|
|
98
|
+
be always overwritten, which is not true for js incomplete configs. */
|
|
99
|
+
...(nodeConfig as Partial<EdrNetworkUserConfig>),
|
|
100
|
+
};
|
|
101
|
+
} else {
|
|
102
|
+
extendedNodeConfig = nodeConfig;
|
|
103
|
+
}
|
|
50
104
|
|
|
51
105
|
return {
|
|
52
106
|
...extendedConfig,
|
|
53
107
|
networks: {
|
|
54
108
|
...networks,
|
|
55
|
-
localhost:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
type: "http",
|
|
59
|
-
},
|
|
60
|
-
[DEFAULT_NETWORK_NAME]: {
|
|
61
|
-
chainId: 31337,
|
|
62
|
-
gas: "auto",
|
|
63
|
-
gasMultiplier: 1,
|
|
64
|
-
gasPrice: "auto",
|
|
65
|
-
...defaultConfig,
|
|
66
|
-
type: "edr-simulated",
|
|
67
|
-
},
|
|
109
|
+
localhost: extendedLocalhostConfig,
|
|
110
|
+
[DEFAULT_NETWORK_NAME]: extendedDefaultConfig,
|
|
111
|
+
node: extendedNodeConfig,
|
|
68
112
|
},
|
|
69
113
|
};
|
|
70
114
|
}
|
|
@@ -344,6 +344,15 @@ function refineEdrNetworkUserConfig(
|
|
|
344
344
|
{ defaultChainType = GENERIC_CHAIN_TYPE, networks = {} }: HardhatUserConfig,
|
|
345
345
|
ctx: RefinementCtx,
|
|
346
346
|
): void {
|
|
347
|
+
const nodeNetwork = networks.node;
|
|
348
|
+
if (nodeNetwork !== undefined && nodeNetwork.type !== "edr-simulated") {
|
|
349
|
+
ctx.addIssue({
|
|
350
|
+
code: z.ZodIssueCode.custom,
|
|
351
|
+
path: ["networks", "node", "type"],
|
|
352
|
+
message: "The node network type must be 'edr-simulated'",
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
|
|
347
356
|
for (const [networkName, network] of Object.entries(networks)) {
|
|
348
357
|
if (network.type === "edr-simulated") {
|
|
349
358
|
const { chainType, hardfork, minGasPrice, initialBaseFeePerGas } =
|
|
@@ -12,7 +12,6 @@ import { ensureDir, exists } from "@nomicfoundation/hardhat-utils/fs";
|
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
import debug from "debug";
|
|
14
14
|
|
|
15
|
-
import { DEFAULT_NETWORK_NAME } from "../../constants.js";
|
|
16
15
|
import { isSupportedChainType } from "../../edr/chain-type.js";
|
|
17
16
|
import { BUILD_INFO_DIR_NAME } from "../artifacts/artifact-manager.js";
|
|
18
17
|
import { EdrProvider } from "../network-manager/edr/edr-provider.js";
|
|
@@ -42,7 +41,7 @@ const nodeAction: NewTaskActionFunction<NodeActionArguments> = async (
|
|
|
42
41
|
const network =
|
|
43
42
|
hre.globalOptions.network !== undefined
|
|
44
43
|
? hre.globalOptions.network
|
|
45
|
-
:
|
|
44
|
+
: "node";
|
|
46
45
|
|
|
47
46
|
if (!(network in hre.config.networks)) {
|
|
48
47
|
throw new HardhatError(HardhatError.ERRORS.CORE.NETWORK.NETWORK_NOT_FOUND, {
|
|
@@ -64,6 +63,7 @@ const nodeAction: NewTaskActionFunction<NodeActionArguments> = async (
|
|
|
64
63
|
} = {
|
|
65
64
|
network,
|
|
66
65
|
};
|
|
66
|
+
|
|
67
67
|
// NOTE: We create an empty network config override here. We add to it based
|
|
68
68
|
// on the result of arguments parsing. We can expand the list of arguments
|
|
69
69
|
// as much as needed.
|
|
@@ -2,6 +2,7 @@ import type {
|
|
|
2
2
|
CompilationJobCreationError,
|
|
3
3
|
FailedFileBuildResult,
|
|
4
4
|
FileBuildResult,
|
|
5
|
+
SolidityBuildSystem,
|
|
5
6
|
} from "../../../types/solidity.js";
|
|
6
7
|
|
|
7
8
|
import { HardhatError } from "@nomicfoundation/hardhat-errors";
|
|
@@ -22,9 +23,10 @@ type SuccessfulSolidityBuildResults = Map<
|
|
|
22
23
|
* job failed.
|
|
23
24
|
*/
|
|
24
25
|
export function throwIfSolidityBuildFailed(
|
|
26
|
+
solidity: SolidityBuildSystem,
|
|
25
27
|
results: SolidityBuildResults,
|
|
26
28
|
): asserts results is SuccessfulSolidityBuildResults {
|
|
27
|
-
if (
|
|
29
|
+
if (!solidity.isSuccessfulBuildResult(results)) {
|
|
28
30
|
throw new HardhatError(
|
|
29
31
|
HardhatError.ERRORS.CORE.SOLIDITY.COMPILATION_JOB_CREATION_ERROR,
|
|
30
32
|
{
|
|
@@ -208,6 +208,12 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
+
public isSuccessfulBuildResult(
|
|
212
|
+
buildResult: CompilationJobCreationError | Map<string, FileBuildResult>,
|
|
213
|
+
): buildResult is Map<string, FileBuildResult> {
|
|
214
|
+
return buildResult instanceof Map;
|
|
215
|
+
}
|
|
216
|
+
|
|
211
217
|
public async build(
|
|
212
218
|
rootFilePaths: string[],
|
|
213
219
|
_options?: BuildOptions,
|
|
@@ -244,7 +250,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
244
250
|
options,
|
|
245
251
|
);
|
|
246
252
|
|
|
247
|
-
if (
|
|
253
|
+
if (!compilationJobsResult.success) {
|
|
248
254
|
return compilationJobsResult;
|
|
249
255
|
}
|
|
250
256
|
|
|
@@ -418,6 +424,7 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
418
424
|
rootFilePaths.toSorted(), // We sort them to have a deterministic order
|
|
419
425
|
this.#options.projectRoot,
|
|
420
426
|
readSourceFileFactory(this.#hooks),
|
|
427
|
+
this.#hooks,
|
|
421
428
|
);
|
|
422
429
|
|
|
423
430
|
const { buildProfileName, buildProfile } = this.#getBuildProfile(
|
|
@@ -429,7 +436,6 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
429
436
|
const solcConfigSelector = new SolcConfigSelector(
|
|
430
437
|
buildProfileName,
|
|
431
438
|
buildProfile,
|
|
432
|
-
dependencyGraph,
|
|
433
439
|
);
|
|
434
440
|
|
|
435
441
|
let subgraphsWithConfig: Array<
|
|
@@ -445,11 +451,11 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
445
451
|
const configOrError =
|
|
446
452
|
solcConfigSelector.selectBestSolcConfigForSingleRootGraph(subgraph);
|
|
447
453
|
|
|
448
|
-
if (
|
|
454
|
+
if (!configOrError.success) {
|
|
449
455
|
return configOrError;
|
|
450
456
|
}
|
|
451
457
|
|
|
452
|
-
subgraphsWithConfig.push([configOrError, subgraph]);
|
|
458
|
+
subgraphsWithConfig.push([configOrError.config, subgraph]);
|
|
453
459
|
}
|
|
454
460
|
|
|
455
461
|
// get longVersion and isWasm from the compiler for each version
|
|
@@ -631,7 +637,12 @@ export class SolidityBuildSystemImplementation implements SolidityBuildSystem {
|
|
|
631
637
|
}
|
|
632
638
|
}
|
|
633
639
|
|
|
634
|
-
return {
|
|
640
|
+
return {
|
|
641
|
+
success: true,
|
|
642
|
+
compilationJobsPerFile,
|
|
643
|
+
indexedIndividualJobs,
|
|
644
|
+
cacheHits,
|
|
645
|
+
};
|
|
635
646
|
}
|
|
636
647
|
|
|
637
648
|
#getBuildProfile(buildProfileName: string = DEFAULT_BUILD_PROFILE) {
|
|
@@ -66,7 +66,7 @@ async function spawnCompile(
|
|
|
66
66
|
);
|
|
67
67
|
|
|
68
68
|
const stdoutPipeline = subprocess.stdout.pipe(stdoutWriteStream);
|
|
69
|
-
// NOTE: Compiler warnings are NOT written to
|
|
69
|
+
// NOTE: Compiler warnings are NOT written to stderr, they are returned via
|
|
70
70
|
// the `errors` field of the CompilerOutput instead
|
|
71
71
|
const stderrPipeline = subprocess.stderr.pipe(
|
|
72
72
|
createNonClosingWriter(process.stderr),
|
|
@@ -152,12 +152,8 @@ export class CompilerDownloaderImplementation implements CompilerDownloader {
|
|
|
152
152
|
readonly #platform: CompilerPlatform;
|
|
153
153
|
readonly #compilersDir: string;
|
|
154
154
|
readonly #downloadFunction: typeof download;
|
|
155
|
+
readonly #mutexCompilerList: MultiProcessMutex;
|
|
155
156
|
|
|
156
|
-
readonly #mutexCompilerList = new MultiProcessMutex("compiler-download-list");
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Use CompilerDownloader.getConcurrencySafeDownloader instead
|
|
160
|
-
*/
|
|
161
157
|
constructor(
|
|
162
158
|
platform: CompilerPlatform,
|
|
163
159
|
compilersDir: string,
|
|
@@ -165,6 +161,9 @@ export class CompilerDownloaderImplementation implements CompilerDownloader {
|
|
|
165
161
|
) {
|
|
166
162
|
this.#platform = platform;
|
|
167
163
|
this.#compilersDir = compilersDir;
|
|
164
|
+
this.#mutexCompilerList = new MultiProcessMutex(
|
|
165
|
+
path.join(compilersDir, "compiler-download-list"),
|
|
166
|
+
);
|
|
168
167
|
this.#downloadFunction = downloadFunction;
|
|
169
168
|
}
|
|
170
169
|
|
|
@@ -204,7 +203,9 @@ export class CompilerDownloaderImplementation implements CompilerDownloader {
|
|
|
204
203
|
// Without the mutex, a concurrent process might check whether a version exists, incorrectly
|
|
205
204
|
// find it missing (because another process is still downloading it), and start a redundant download.
|
|
206
205
|
|
|
207
|
-
const mutex = new MultiProcessMutex(
|
|
206
|
+
const mutex = new MultiProcessMutex(
|
|
207
|
+
path.join(this.#compilersDir, `compiler-download-${version}`),
|
|
208
|
+
);
|
|
208
209
|
|
|
209
210
|
return mutex.use(async () => {
|
|
210
211
|
const isCompilerDownloaded = await this.isCompilerDownloaded(version);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { RemappingsReaderFunction } from "./resolver/remapped-npm-packages-graph.js";
|
|
2
|
+
import type { HookManager } from "../../../../types/hooks.js";
|
|
1
3
|
import type { ResolvedFile } from "../../../../types/solidity/resolved-file.js";
|
|
2
4
|
|
|
3
5
|
import { HardhatError } from "@nomicfoundation/hardhat-errors";
|
|
@@ -17,8 +19,28 @@ export async function buildDependencyGraph(
|
|
|
17
19
|
rootFiles: string[],
|
|
18
20
|
projectRoot: string,
|
|
19
21
|
readFile: (absPath: string) => Promise<string>,
|
|
22
|
+
hookManager: HookManager,
|
|
20
23
|
): Promise<DependencyGraphImplementation> {
|
|
21
|
-
|
|
24
|
+
// Create the wrapper function that captures the hook manager
|
|
25
|
+
const remappingsReader: RemappingsReaderFunction = (
|
|
26
|
+
packageName,
|
|
27
|
+
packageVersion,
|
|
28
|
+
packagePath,
|
|
29
|
+
defaultBehavior,
|
|
30
|
+
) =>
|
|
31
|
+
hookManager.runHandlerChain(
|
|
32
|
+
"solidity",
|
|
33
|
+
"readNpmPackageRemappings",
|
|
34
|
+
[packageName, packageVersion, packagePath],
|
|
35
|
+
async (_context, name, version, path) =>
|
|
36
|
+
defaultBehavior(name, version, path),
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const resolver = await ResolverImplementation.create(
|
|
40
|
+
projectRoot,
|
|
41
|
+
readFile,
|
|
42
|
+
remappingsReader,
|
|
43
|
+
);
|
|
22
44
|
|
|
23
45
|
const dependencyGraph = new DependencyGraphImplementation();
|
|
24
46
|
|
|
@@ -25,7 +25,7 @@ export class DependencyGraphImplementation implements DependencyGraph {
|
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Adds a root file to the graph. All the roots of the dependency graph must
|
|
28
|
-
* be added before any
|
|
28
|
+
* be added before any dependency.
|
|
29
29
|
*
|
|
30
30
|
* @param userSourceName The source name used to identify the file, as it
|
|
31
31
|
* would appear in the artifacts and used by the user. This is not always the
|
|
@@ -4,7 +4,6 @@ import type {
|
|
|
4
4
|
Remapping,
|
|
5
5
|
ResolvedNpmUserRemapping,
|
|
6
6
|
ResolvedUserRemapping,
|
|
7
|
-
Result,
|
|
8
7
|
} from "./types.js";
|
|
9
8
|
import type {
|
|
10
9
|
ImportResolutionError,
|
|
@@ -20,6 +19,7 @@ import type {
|
|
|
20
19
|
ProjectResolvedFile,
|
|
21
20
|
NpmPackageResolvedFile,
|
|
22
21
|
} from "../../../../../types/solidity/resolved-file.js";
|
|
22
|
+
import type { Result } from "../../../../../types/utils.js";
|
|
23
23
|
|
|
24
24
|
import path from "node:path";
|
|
25
25
|
|
|
@@ -38,6 +38,7 @@ import { parseNpmDirectImport } from "./npm-module-parsing.js";
|
|
|
38
38
|
import {
|
|
39
39
|
isResolvedUserRemapping,
|
|
40
40
|
RemappedNpmPackagesGraphImplementation,
|
|
41
|
+
type RemappingsReaderFunction,
|
|
41
42
|
} from "./remapped-npm-packages-graph.js";
|
|
42
43
|
import { applyValidRemapping, formatRemapping } from "./remappings.js";
|
|
43
44
|
import {
|
|
@@ -86,14 +87,18 @@ export class ResolverImplementation implements Resolver {
|
|
|
86
87
|
*
|
|
87
88
|
* @param projectRoot The absolute path to the Hardhat project root.
|
|
88
89
|
* @param readUtf8File A function that reads a UTF-8 file.
|
|
90
|
+
* @param remappingsReader Optional function to read remappings from packages.
|
|
89
91
|
* @returns The resolver or the user remapping errors found.
|
|
90
92
|
*/
|
|
91
93
|
public static async create(
|
|
92
94
|
projectRoot: string,
|
|
93
95
|
readUtf8File: (absPath: string) => Promise<string>,
|
|
96
|
+
remappingsReader?: RemappingsReaderFunction,
|
|
94
97
|
): Promise<Resolver> {
|
|
95
|
-
const map =
|
|
96
|
-
|
|
98
|
+
const map = await RemappedNpmPackagesGraphImplementation.create(
|
|
99
|
+
projectRoot,
|
|
100
|
+
remappingsReader,
|
|
101
|
+
);
|
|
97
102
|
|
|
98
103
|
return new ResolverImplementation(projectRoot, map, readUtf8File);
|
|
99
104
|
}
|
|
@@ -691,6 +696,13 @@ export class ResolverImplementation implements Resolver {
|
|
|
691
696
|
);
|
|
692
697
|
|
|
693
698
|
if (dependencyResolution === undefined) {
|
|
699
|
+
// Check if the from file's package has foundry.toml
|
|
700
|
+
const foundryTomlPath = path.join(
|
|
701
|
+
from.package.rootFsPath,
|
|
702
|
+
"foundry.toml",
|
|
703
|
+
);
|
|
704
|
+
const fromHasFoundryToml = await exists(foundryTomlPath);
|
|
705
|
+
|
|
694
706
|
return {
|
|
695
707
|
success: false,
|
|
696
708
|
error: {
|
|
@@ -698,6 +710,7 @@ export class ResolverImplementation implements Resolver {
|
|
|
698
710
|
fromFsPath: from.fsPath,
|
|
699
711
|
importPath,
|
|
700
712
|
installationName: parsedDirectImport.package,
|
|
713
|
+
importerPackageHasFoundryToml: fromHasFoundryToml,
|
|
701
714
|
},
|
|
702
715
|
};
|
|
703
716
|
}
|
|
@@ -1098,6 +1111,7 @@ export class ResolverImplementation implements Resolver {
|
|
|
1098
1111
|
type: RootResolutionErrorType.NPM_ROOT_FILE_OF_UNINSTALLED_PACKAGE,
|
|
1099
1112
|
npmModule,
|
|
1100
1113
|
installationName: error.installationName,
|
|
1114
|
+
projectHasFoundryToml: error.importerPackageHasFoundryToml,
|
|
1101
1115
|
};
|
|
1102
1116
|
}
|
|
1103
1117
|
case ImportResolutionErrorType.IMPORT_WITH_REMAPPING_ERRORS: {
|
|
@@ -57,7 +57,14 @@ Note that the npm module is being remapped by ${formatRemappingReference(error.u
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
case RootResolutionErrorType.NPM_ROOT_FILE_OF_UNINSTALLED_PACKAGE: {
|
|
60
|
-
|
|
60
|
+
const baseMessage = `The package "${error.installationName}" is not installed.`;
|
|
61
|
+
if (error.projectHasFoundryToml === true) {
|
|
62
|
+
return `${baseMessage}
|
|
63
|
+
|
|
64
|
+
Your project has a foundry.toml, and you may need to install the "@nomicfoundation/hardhat-foundry" plugin.
|
|
65
|
+
Learn more about Hardhat's Foundry compatibility here: https://hardhat.org/foundry-compatibility`;
|
|
66
|
+
}
|
|
67
|
+
return baseMessage;
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
case RootResolutionErrorType.NPM_ROOT_FILE_RESOLUTION_WITH_REMAPPING_ERRORS: {
|
|
@@ -107,13 +114,13 @@ export function formatImportResolutionError(
|
|
|
107
114
|
}
|
|
108
115
|
|
|
109
116
|
case ImportResolutionErrorType.ILLEGAL_RELATIVE_IMPORT: {
|
|
110
|
-
return "The import has too many '../'
|
|
117
|
+
return "The import has too many '../' and is trying to leave its package.";
|
|
111
118
|
}
|
|
112
119
|
|
|
113
120
|
case ImportResolutionErrorType.RELATIVE_IMPORT_INTO_NODE_MODULES: {
|
|
114
121
|
return `You are trying to import a file from your node_modules directory with its file system path.
|
|
115
122
|
|
|
116
|
-
You should write your
|
|
123
|
+
You should write your imports into npm modules just as you would do in JavaScript files.`;
|
|
117
124
|
}
|
|
118
125
|
|
|
119
126
|
case ImportResolutionErrorType.IMPORT_WITH_INVALID_NPM_SYNTAX: {
|
|
@@ -121,7 +128,14 @@ You should write your the path of your imports into npm modules just as you woul
|
|
|
121
128
|
}
|
|
122
129
|
|
|
123
130
|
case ImportResolutionErrorType.IMPORT_OF_UNINSTALLED_PACKAGE: {
|
|
124
|
-
|
|
131
|
+
const baseMessage = `The package "${error.installationName}" is not installed.`;
|
|
132
|
+
if (error.importerPackageHasFoundryToml === true) {
|
|
133
|
+
return `${baseMessage}
|
|
134
|
+
|
|
135
|
+
The file importing this package is inside a Foundry project (foundry.toml detected), and you may need to install the "@nomicfoundation/hardhat-foundry" plugin.
|
|
136
|
+
Learn more about Hardhat's Foundry compatibility here: https://hardhat.org/foundry-compatibility`;
|
|
137
|
+
}
|
|
138
|
+
return baseMessage;
|
|
125
139
|
}
|
|
126
140
|
|
|
127
141
|
case ImportResolutionErrorType.IMPORT_WITH_REMAPPING_ERRORS: {
|
|
@@ -148,7 +162,7 @@ If you still want to be able to do it, try adding this remapping "${error.sugges
|
|
|
148
162
|
? "the package"
|
|
149
163
|
: "the project";
|
|
150
164
|
|
|
151
|
-
const message = `The file ${error.packageExportsResolvedSubpath ?? error.subpath} doesn't exist within ${packageOrProject}.`;
|
|
165
|
+
const message = `The file "${error.packageExportsResolvedSubpath ?? error.subpath}" doesn't exist within ${packageOrProject}.`;
|
|
152
166
|
|
|
153
167
|
return formatResolutionErrorRemappingsOrPackageExportsNotes({
|
|
154
168
|
message,
|