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
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
|
|
3
|
+
import { CustomError } from "@nomicfoundation/hardhat-utils/error";
|
|
4
|
+
import { shortenPath } from "@nomicfoundation/hardhat-utils/path";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
|
|
7
|
+
export class UsingHardhat2PluginError extends CustomError {
|
|
8
|
+
public readonly callerRelativePath: string | undefined;
|
|
9
|
+
constructor() {
|
|
10
|
+
const callerPath = getCallerRelativePath();
|
|
11
|
+
|
|
12
|
+
let message: string;
|
|
13
|
+
if (callerPath !== undefined) {
|
|
14
|
+
message = `You are trying to use a Hardhat 2 plugin in a Hardhat 3 project.
|
|
15
|
+
|
|
16
|
+
This file is part of a Hardhat 2 plugin calling an API that was removed in Hardhat 3: ${chalk.bold(callerPath)}
|
|
17
|
+
|
|
18
|
+
Please read https://hardhat.org/migrate-from-hardhat2 to learn how to migrate your project to Hardhat 3.
|
|
19
|
+
`;
|
|
20
|
+
} else {
|
|
21
|
+
message = `You are trying to use a Hardhat 2 plugin in a Hardhat 3 project.
|
|
22
|
+
|
|
23
|
+
Check the stack trace below to identify which plugin is causing this.
|
|
24
|
+
|
|
25
|
+
Please read https://hardhat.org/migrate-from-hardhat2 to learn how to migrate your project to Hardhat 3.
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
super(message);
|
|
30
|
+
this.callerRelativePath = callerPath;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Returns the relative path of the file that called a deprecated Hardhat
|
|
36
|
+
* plugin API, based on the stack trace. This helps identify which plugin
|
|
37
|
+
* file is triggering usage of Hardhat 2 APIs in a Hardhat 3 project.
|
|
38
|
+
*
|
|
39
|
+
* @param {number} [depth=5] The stack trace depth to locate the caller's
|
|
40
|
+
* source file. By default, depth 5 is used because:
|
|
41
|
+
* 0 = message
|
|
42
|
+
* 1 = getCallerRelativePath
|
|
43
|
+
* 2 = UsingHardhat2PluginError constructor
|
|
44
|
+
* 3 = throwUsingHardhat2PluginError
|
|
45
|
+
* 4 = deprecated function
|
|
46
|
+
* 5 = actual caller (the plugin file)
|
|
47
|
+
*
|
|
48
|
+
* @returns {string|undefined} The shortened relative path of the caller file,
|
|
49
|
+
* or undefined if not found.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* If the stack trace is:
|
|
53
|
+
* // Error
|
|
54
|
+
* // at getCallerRelativePath (src/internal/using-hardhat2-plugin-errors.ts:34:15)
|
|
55
|
+
* // at UsingHardhat2PluginError.constructor (src/internal/using-hardhat2-plugin-errors.ts:7:3)
|
|
56
|
+
* // at throwUsingHardhat2PluginError (src/internal/using-hardhat2-plugin-errors.ts:90:3)
|
|
57
|
+
* // at deprecatedFunction (plugins/example-plugin/deprecated.js:50:10)
|
|
58
|
+
* // at main (plugins/example-plugin/index.js:100:5)
|
|
59
|
+
* Calling getCallerRelativePath() returns 'plugins/example-plugin/index.js'
|
|
60
|
+
*/
|
|
61
|
+
export function getCallerRelativePath(depth: number = 5): string | undefined {
|
|
62
|
+
try {
|
|
63
|
+
const stack = new Error().stack;
|
|
64
|
+
if (stack === undefined) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const lines = stack.split("\n");
|
|
69
|
+
const callerLine = lines[depth];
|
|
70
|
+
if (callerLine === undefined) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Matches a single stack trace line:
|
|
76
|
+
*
|
|
77
|
+
* at FunctionName (path/to/file.ts:10:5)
|
|
78
|
+
* at path/to/file.ts:10:5
|
|
79
|
+
*
|
|
80
|
+
* Captures:
|
|
81
|
+
* - group 1: file location (without line/column)
|
|
82
|
+
*/
|
|
83
|
+
const STACK_TRACE_LINE_REGEX =
|
|
84
|
+
/^at (?:.+? \()?([^\(].*?)(?::\d+)?(?::\d+)?\)?$/;
|
|
85
|
+
|
|
86
|
+
const match = callerLine.trim().match(STACK_TRACE_LINE_REGEX);
|
|
87
|
+
if (match === null || match[1] === undefined) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let filePath = match[1];
|
|
92
|
+
|
|
93
|
+
// Handle file:// URLs from ESM stack traces
|
|
94
|
+
if (filePath.startsWith("file://")) {
|
|
95
|
+
filePath = fileURLToPath(filePath);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return shortenPath(filePath);
|
|
99
|
+
} catch {
|
|
100
|
+
return undefined;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function throwUsingHardhat2PluginError(): never {
|
|
105
|
+
/* eslint-disable-next-line no-restricted-syntax -- Intentionally throwing a
|
|
106
|
+
custom error here so that we always print the stack trace */
|
|
107
|
+
throw new UsingHardhat2PluginError();
|
|
108
|
+
}
|
package/src/plugins.ts
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
1
|
export { HardhatPluginError } from "@nomicfoundation/hardhat-errors";
|
|
2
|
+
|
|
3
|
+
import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
7
|
+
*/
|
|
8
|
+
export function lazyFunction(..._args: any): any {
|
|
9
|
+
throwUsingHardhat2PluginError();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
14
|
+
*/
|
|
15
|
+
export function lazyObject(..._args: any): any {
|
|
16
|
+
throwUsingHardhat2PluginError();
|
|
17
|
+
}
|
package/src/types/artifacts.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SolidityBuildInfo } from "./solidity/solidity-artifacts.js";
|
|
2
|
+
import type { NonNeverKeys } from "./utils.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* A map of bare contract names and fully qualified contract names to their
|
|
@@ -17,6 +18,37 @@ export type GetArtifactByName<ContractNameT extends string> =
|
|
|
17
18
|
? ArtifactMap[ContractNameT]
|
|
18
19
|
: Artifact;
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* A type that represents the contract names (bare and fully qualified) of all
|
|
23
|
+
* the artifacts that have been built in a project. This enables the
|
|
24
|
+
* autocomplete of the TS Language Server to list the actual contracts, without
|
|
25
|
+
* leading to a compilation error for general strings, so it doesn't fail
|
|
26
|
+
* before `hardhat build` is run.
|
|
27
|
+
*
|
|
28
|
+
* This is meant to be used in functions like this:
|
|
29
|
+
* @example
|
|
30
|
+
* ```
|
|
31
|
+
* function doSomething<ContractNameT extends ArtifactContractNames>(
|
|
32
|
+
* contractName: ContractNameT,
|
|
33
|
+
* ...
|
|
34
|
+
* ): DoSomethingReturnType<ContractNameT> {
|
|
35
|
+
* }
|
|
36
|
+
*/
|
|
37
|
+
export type ArtifactContractNames = keyof ArtifactMap extends never
|
|
38
|
+
? string
|
|
39
|
+
: NonNeverKeys<ArtifactMap>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A type that represents a string that should match an artifact contract name,
|
|
43
|
+
* but it doesn't fail if the string is not a contract name. It's mostly used
|
|
44
|
+
* to offer autocompletion.
|
|
45
|
+
*
|
|
46
|
+
* @see {@link ArtifactContractNames}
|
|
47
|
+
*/
|
|
48
|
+
export type StringWithArtifactContractNamesAutocompletion =
|
|
49
|
+
| ArtifactContractNames
|
|
50
|
+
| (string & {});
|
|
51
|
+
|
|
20
52
|
/**
|
|
21
53
|
* The ArtifactManager is responsible for reading and writing artifacts from
|
|
22
54
|
* the Hardhat build system.
|
|
@@ -28,13 +60,18 @@ export interface ArtifactManager {
|
|
|
28
60
|
* @param contractNameOrFullyQualifiedName The name of the contract.
|
|
29
61
|
* It can be a contract bare contract name (e.g. "Token") if it's
|
|
30
62
|
* unique in your project, or a fully qualified contract name
|
|
31
|
-
* (e.g. "contract/token.sol:Token") otherwise.
|
|
63
|
+
* (e.g. "contract/token.sol:Token") otherwise. TypeScript's language server
|
|
64
|
+
* autocompletes the names of the contracts that have already been built. If
|
|
65
|
+
* your contract name isn't in the list, you can still use it, and/or run
|
|
66
|
+
* `hardhat build` to get it in the list.
|
|
32
67
|
*
|
|
33
68
|
* @throws Throws an error if a non-unique contract name is used,
|
|
34
69
|
* indicating which fully qualified names can be used instead.
|
|
35
70
|
* @throws Throws an error if the artifact doesn't exist.
|
|
36
71
|
*/
|
|
37
|
-
readArtifact<
|
|
72
|
+
readArtifact<
|
|
73
|
+
ContractNameT extends StringWithArtifactContractNamesAutocompletion,
|
|
74
|
+
>(
|
|
38
75
|
contractNameOrFullyQualifiedName: ContractNameT,
|
|
39
76
|
): Promise<GetArtifactByName<ContractNameT>>;
|
|
40
77
|
|
|
@@ -239,7 +276,7 @@ export interface LinkReferences {
|
|
|
239
276
|
* is the id of the AST node that represents the variable.
|
|
240
277
|
*/
|
|
241
278
|
export interface ImmutableReferences {
|
|
242
|
-
[
|
|
279
|
+
[immutableId: string]: Array<{ start: number; length: number }>;
|
|
243
280
|
}
|
|
244
281
|
|
|
245
282
|
/**
|
package/src/types/hre.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface HardhatRuntimeEnvironment {
|
|
|
15
15
|
readonly hardhat: string;
|
|
16
16
|
readonly edr: string;
|
|
17
17
|
};
|
|
18
|
-
// These fields are defined using module
|
|
18
|
+
// These fields are defined using module augmentation despite being part of
|
|
19
19
|
// Hardhat's core:
|
|
20
20
|
// readonly hooks: HookManager;
|
|
21
21
|
// readonly tasks: TaskManager;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./arguments.js";
|
|
2
|
+
export * from "./artifacts.js";
|
|
3
|
+
export * from "./config.js";
|
|
4
|
+
export * from "./global-options.js";
|
|
5
|
+
export * from "./hooks.js";
|
|
6
|
+
export * from "./hre.js";
|
|
7
|
+
export * from "./network.js";
|
|
8
|
+
export * from "./plugins.js";
|
|
9
|
+
export * from "./providers.js";
|
|
10
|
+
export * from "./solidity.js";
|
|
11
|
+
export * from "./tasks.js";
|
|
12
|
+
export * from "./test.js";
|
|
13
|
+
export * from "./user-interruptions.js";
|
|
14
|
+
export * from "./utils.js";
|
package/src/types/network.ts
CHANGED
package/src/types/plugins.ts
CHANGED
|
@@ -65,8 +65,8 @@ export interface HardhatPlugin {
|
|
|
65
65
|
* returning an object with a handler for the `extendUserConfig` hook.
|
|
66
66
|
*
|
|
67
67
|
* You can define each factory in two ways:
|
|
68
|
-
*
|
|
69
|
-
*
|
|
68
|
+
* - As an inline function.
|
|
69
|
+
* - As a string with the path to a file that exports the factory as `default`.
|
|
70
70
|
*
|
|
71
71
|
* The first option should only be used for development. You MUST use the second
|
|
72
72
|
* option for production.
|
|
@@ -72,7 +72,7 @@ export type RunCompilationJobOptions = Pick<
|
|
|
72
72
|
*/
|
|
73
73
|
export interface CompileBuildInfoOptions {
|
|
74
74
|
/**
|
|
75
|
-
* If `true`, this option
|
|
75
|
+
* If `true`, this option forces the build system to recompile the build info,
|
|
76
76
|
* even if its output is cached.
|
|
77
77
|
*/
|
|
78
78
|
force?: boolean;
|
|
@@ -84,26 +84,70 @@ export interface CompileBuildInfoOptions {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export enum CompilationJobCreationErrorReason {
|
|
87
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The root file's own pragmas are incompatible with all configured compilers.
|
|
89
|
+
*/
|
|
88
90
|
NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT = "NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT",
|
|
89
|
-
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* A dependency's own pragmas are incompatible with all configured compilers.
|
|
94
|
+
*/
|
|
95
|
+
NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY = "NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY",
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Root and a transitive import path have contradictory pragmas (invalid range / empty intersection).
|
|
99
|
+
*/
|
|
90
100
|
IMPORT_OF_INCOMPATIBLE_FILE = "IMPORT_OF_INCOMPATIBLE_FILE",
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Root and a transitive import path have a valid range but no configured compiler satisfies it.
|
|
104
|
+
*/
|
|
105
|
+
NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH = "NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH",
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* The override version doesn't satisfy the root file's own pragmas.
|
|
109
|
+
*/
|
|
110
|
+
INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION = "INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION",
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* A dependency's pragmas are incompatible with the override version.
|
|
114
|
+
*/
|
|
115
|
+
OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY = "OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY",
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Generic fallback — no single compiler works for root + all dependencies.
|
|
119
|
+
*/
|
|
120
|
+
NO_COMPATIBLE_SOLC_VERSION_FOUND = "NO_COMPATIBLE_SOLC_VERSION_FOUND",
|
|
91
121
|
}
|
|
92
122
|
|
|
93
123
|
export interface BaseCompilationJobCreationError {
|
|
124
|
+
success: false;
|
|
94
125
|
buildProfile: string;
|
|
95
126
|
rootFilePath: string;
|
|
96
127
|
formattedReason: string;
|
|
97
128
|
}
|
|
98
129
|
|
|
99
|
-
export interface
|
|
130
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot
|
|
100
131
|
extends BaseCompilationJobCreationError {
|
|
101
132
|
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_ROOT;
|
|
102
133
|
}
|
|
103
134
|
|
|
104
|
-
export interface
|
|
135
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency
|
|
105
136
|
extends BaseCompilationJobCreationError {
|
|
106
|
-
reason: CompilationJobCreationErrorReason.
|
|
137
|
+
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_WITH_DEPENDENCY;
|
|
138
|
+
incompatibleImportPath: string[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface CompilationJobCreationErrorImportOfIncompatibleFile
|
|
142
|
+
extends BaseCompilationJobCreationError {
|
|
143
|
+
reason: CompilationJobCreationErrorReason.IMPORT_OF_INCOMPATIBLE_FILE;
|
|
144
|
+
incompatibleImportPath: string[];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath
|
|
148
|
+
extends BaseCompilationJobCreationError {
|
|
149
|
+
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOR_TRANSITIVE_IMPORT_PATH;
|
|
150
|
+
incompatibleImportPath: string[];
|
|
107
151
|
}
|
|
108
152
|
|
|
109
153
|
export interface CompilationJobCreationErrorIncompatibleOverriddenSolcVersion
|
|
@@ -111,24 +155,25 @@ export interface CompilationJobCreationErrorIncompatibleOverriddenSolcVersion
|
|
|
111
155
|
reason: CompilationJobCreationErrorReason.INCOMPATIBLE_OVERRIDDEN_SOLC_VERSION;
|
|
112
156
|
}
|
|
113
157
|
|
|
114
|
-
export interface
|
|
158
|
+
export interface CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency
|
|
115
159
|
extends BaseCompilationJobCreationError {
|
|
116
|
-
reason: CompilationJobCreationErrorReason.
|
|
117
|
-
// The path of absolute files imported, starting from the root, that take you
|
|
118
|
-
// to the first file with an incompatible version pragma.
|
|
160
|
+
reason: CompilationJobCreationErrorReason.OVERRIDDEN_SOLC_VERSION_INCOMPATIBLE_WITH_DEPENDENCY;
|
|
119
161
|
incompatibleImportPath: string[];
|
|
120
162
|
}
|
|
121
163
|
|
|
122
|
-
export interface
|
|
164
|
+
export interface CompilationJobCreationErrorNoCompatibleSolcVersionFound
|
|
123
165
|
extends BaseCompilationJobCreationError {
|
|
124
166
|
reason: CompilationJobCreationErrorReason.NO_COMPATIBLE_SOLC_VERSION_FOUND;
|
|
125
167
|
}
|
|
126
168
|
|
|
127
169
|
export type CompilationJobCreationError =
|
|
128
|
-
|
|
|
129
|
-
|
|
|
170
|
+
| CompilationJobCreationErrorNoCompatibleSolcVersionWithRoot
|
|
171
|
+
| CompilationJobCreationErrorNoCompatibleSolcVersionWithDependency
|
|
172
|
+
| CompilationJobCreationErrorImportOfIncompatibleFile
|
|
173
|
+
| CompilationJobCreationErrorNoCompatibleSolcVersionForTransitiveImportPath
|
|
130
174
|
| CompilationJobCreationErrorIncompatibleOverriddenSolcVersion
|
|
131
|
-
|
|
|
175
|
+
| CompilationJobCreationErrorOverriddenSolcVersionIncompatibleWithDependency
|
|
176
|
+
| CompilationJobCreationErrorNoCompatibleSolcVersionFound;
|
|
132
177
|
|
|
133
178
|
/**
|
|
134
179
|
* The restult of building a file.
|
|
@@ -174,6 +219,11 @@ export interface CacheHitInfo {
|
|
|
174
219
|
* The keys in the maps of this interface are Root File Paths, which means either absolute paths or `npm:<package>/<file>` URIs.
|
|
175
220
|
*/
|
|
176
221
|
export interface GetCompilationJobsResult {
|
|
222
|
+
/**
|
|
223
|
+
* A flag to distinguish between a successful and a failed result.
|
|
224
|
+
*/
|
|
225
|
+
success: true;
|
|
226
|
+
|
|
177
227
|
/**
|
|
178
228
|
* Map from root file path to compilation job for files that need compilation.
|
|
179
229
|
*/
|
|
@@ -239,12 +289,23 @@ export interface SolidityBuildSystem {
|
|
|
239
289
|
* @param options The options to use when building the files.
|
|
240
290
|
* @returns An `Map` of the files to their build results, or an error if
|
|
241
291
|
* there was a problem when trying to create the necessary compilation jobs.
|
|
292
|
+
* @see `isSuccessfulBuildResult` to check if the build result is successful.
|
|
242
293
|
*/
|
|
243
294
|
build(
|
|
244
295
|
rootFilePaths: string[],
|
|
245
296
|
options?: BuildOptions,
|
|
246
297
|
): Promise<CompilationJobCreationError | Map<string, FileBuildResult>>;
|
|
247
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Returns true if the given build result is successful.
|
|
301
|
+
*
|
|
302
|
+
* @param buildResult Result of the `build` method.
|
|
303
|
+
* @returns True if the build result is successful.
|
|
304
|
+
*/
|
|
305
|
+
isSuccessfulBuildResult(
|
|
306
|
+
buildResult: CompilationJobCreationError | Map<string, FileBuildResult>,
|
|
307
|
+
): buildResult is Map<string, FileBuildResult>;
|
|
308
|
+
|
|
248
309
|
/**
|
|
249
310
|
* Returns the CompilationJobs that would be used to build the provided files.
|
|
250
311
|
*
|
|
@@ -91,6 +91,11 @@ export interface NpmRootFileOfUninstalledPackageError {
|
|
|
91
91
|
type: RootResolutionErrorType.NPM_ROOT_FILE_OF_UNINSTALLED_PACKAGE;
|
|
92
92
|
npmModule: string;
|
|
93
93
|
installationName: string;
|
|
94
|
+
/**
|
|
95
|
+
* A boolean indicating if the Hardhat project has a foundry.toml file in its
|
|
96
|
+
* root.
|
|
97
|
+
*/
|
|
98
|
+
projectHasFoundryToml?: boolean;
|
|
94
99
|
}
|
|
95
100
|
|
|
96
101
|
export interface NpmRootResolutionWithRemappingErrors {
|
|
@@ -109,6 +114,10 @@ export interface NpmRootFileWithIncorrectCasingError
|
|
|
109
114
|
extends ResolvedFileReference {
|
|
110
115
|
type: RootResolutionErrorType.NPM_ROOT_FILE_WITH_INCORRECT_CASING;
|
|
111
116
|
npmModule: string;
|
|
117
|
+
/**
|
|
118
|
+
* The correct casing of the file, expressed as the relative fs path from the
|
|
119
|
+
* package's root, using forward slashes, and without a leading "./".
|
|
120
|
+
*/
|
|
112
121
|
correctCasing: string;
|
|
113
122
|
}
|
|
114
123
|
|
|
@@ -216,6 +225,10 @@ export interface ImportInvalidCasingError extends ResolvedFileReference {
|
|
|
216
225
|
type: ImportResolutionErrorType.IMPORT_INVALID_CASING;
|
|
217
226
|
fromFsPath: string;
|
|
218
227
|
importPath: string;
|
|
228
|
+
/**
|
|
229
|
+
* The correct casing of the file, expressed as the relative fs path from the
|
|
230
|
+
* package's root, using forward slashes, and without a leading "./".
|
|
231
|
+
*/
|
|
219
232
|
correctCasing: string;
|
|
220
233
|
}
|
|
221
234
|
|
|
@@ -230,6 +243,11 @@ export interface ImportOfUninstalledPackageError {
|
|
|
230
243
|
fromFsPath: string;
|
|
231
244
|
importPath: string;
|
|
232
245
|
installationName: string;
|
|
246
|
+
/**
|
|
247
|
+
* A boolean indicating weather the import is from a source file whose package
|
|
248
|
+
* has a foundry.toml file in its root.
|
|
249
|
+
*/
|
|
250
|
+
importerPackageHasFoundryToml?: boolean;
|
|
233
251
|
}
|
|
234
252
|
|
|
235
253
|
export interface ImportWithRemappingErrorsError {
|
|
@@ -348,10 +366,14 @@ export interface ResolvedFileReference {
|
|
|
348
366
|
// package's input source name root, after applying the user remapping.
|
|
349
367
|
// - For an npm import, it's the npm-subpath. i.e. the module identifier
|
|
350
368
|
// without the package name.
|
|
369
|
+
//
|
|
370
|
+
// This never includes a leading "./".
|
|
351
371
|
subpath: string;
|
|
352
372
|
|
|
353
373
|
// The subpath after resolving package.exports
|
|
354
374
|
//
|
|
355
375
|
// Only present when actually using package.exports.
|
|
376
|
+
//
|
|
377
|
+
// This never includes a leading "./".
|
|
356
378
|
packageExportsResolvedSubpath?: string;
|
|
357
379
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface ResolvedNpmPackage {
|
|
5
5
|
/**
|
|
6
|
-
* The name of the package, potentially
|
|
6
|
+
* The name of the package, potentially scoped.
|
|
7
7
|
*/
|
|
8
8
|
name: string;
|
|
9
9
|
|
|
@@ -103,7 +103,7 @@ export interface NpmPackageResolvedFile {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
* The
|
|
106
|
+
* The result of resolving a file or import using a Resolver.
|
|
107
107
|
*/
|
|
108
108
|
export type ResolvedFile = ProjectResolvedFile | NpmPackageResolvedFile;
|
|
109
109
|
|