hardhat 3.1.9 → 3.1.10
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 +15 -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/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/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/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-system/build-system.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/build-system.js +1 -1
- 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/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/resolver/dependency-resolver.d.ts +3 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/dependency-resolver.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/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 +8 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.d.ts.map +1 -1
- package/dist/src/internal/builtin-plugins/solidity/build-system/resolver/remapped-npm-packages-graph.js +54 -20
- 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/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/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/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/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/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/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/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/plugins.d.ts +2 -2
- 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/tasks.d.ts +95 -34
- package/dist/src/types/tasks.d.ts.map +1 -1
- package/package.json +10 -6
- package/src/config.ts +37 -0
- package/src/internal/builtin-plugins/coverage/coverage-manager.ts +57 -50
- 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/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-system/build-system.ts +1 -0
- 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/resolver/dependency-resolver.ts +16 -2
- 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 +103 -29
- 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/type-extensions.ts +1 -0
- package/src/internal/cli/error-handler.ts +18 -0
- package/src/internal/cli/telemetry/sentry/reporter.ts +5 -0
- 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/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/index.ts +14 -0
- package/src/types/plugins.ts +2 -2
- package/src/types/solidity/errors.ts +22 -0
- package/src/types/tasks.ts +133 -36
- package/templates/hardhat-3/01-node-test-runner-viem/package.json +10 -10
- package/templates/hardhat-3/02-mocha-ethers/package.json +16 -16
- package/templates/hardhat-3/03-minimal/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../../../../src/internal/core/tasks/validations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../../../../src/internal/core/tasks/validations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,4BAA4B,EAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,0BAA0B,EAC3B,MAAM,yBAAyB,CAAC;AAYjC,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAMtD;AAED,wBAAgB,cAAc,CAC5B,MAAM,EACF,gBAAgB,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,GACtD,gBAAgB,CAAC,0BAA0B,CAAC,aAAa,CAAC,CAAC,GAC3D,SAAS,EACb,YAAY,EACR,qBAAqB,CAAC,aAAa,CAAC,GACpC,0BAA0B,CAAC,aAAa,CAAC,GACzC,SAAS,EACb,MAAM,EAAE,MAAM,EAAE,EAChB,QAAQ,EAAE,OAAO,GAChB,IAAI,CAqBN;AAED,wBAAgB,cAAc,CAC5B,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,gBAAgB,EACzD,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GACxB,IAAI,CA6BN;AAED,wBAAgB,0BAA0B,CACxC,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,4BAA4B,EACtE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,EACtB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,EACzB,OAAO,CAAC,EAAE,4BAA4B,GACrC,IAAI,CA0CN;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,aAAa,GAAG,aAAa,EAAE,EACtC,UAAU,EAAE,OAAO,EACnB,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GACxB,IAAI,CAuBN"}
|
|
@@ -6,6 +6,17 @@ export function validateId(id) {
|
|
|
6
6
|
throw new HardhatError(HardhatError.ERRORS.CORE.TASK_DEFINITIONS.EMPTY_TASK_ID);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
+
export function validateAction(action, inlineAction, taskId, isPlugin) {
|
|
10
|
+
if (isPlugin && inlineAction !== undefined) {
|
|
11
|
+
throw new HardhatError(HardhatError.ERRORS.CORE.TASK_DEFINITIONS.INLINE_ACTION_CANNOT_BE_USED_IN_PLUGINS, { task: formatTaskId(taskId) });
|
|
12
|
+
}
|
|
13
|
+
if (action !== undefined && inlineAction !== undefined) {
|
|
14
|
+
throw new HardhatError(HardhatError.ERRORS.CORE.TASK_DEFINITIONS.ACTION_AND_INLINE_ACTION_SET, { task: formatTaskId(taskId) });
|
|
15
|
+
}
|
|
16
|
+
if (action === undefined && inlineAction === undefined) {
|
|
17
|
+
throw new HardhatError(HardhatError.ERRORS.CORE.TASK_DEFINITIONS.NO_ACTION, { task: formatTaskId(taskId) });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
9
20
|
export function validateOption({ name, shortName, type, defaultValue }, usedNames, taskId) {
|
|
10
21
|
validateArgumentName(name);
|
|
11
22
|
if (usedNames.has(name)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../../src/internal/core/tasks/validations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../../../../src/internal/core/tasks/validations.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE1C,MAAM,UAAU,UAAU,CAAC,EAAqB;IAC9C,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,YAAY,CACpB,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CACxD,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,MAGa,EACb,YAGa,EACb,MAAgB,EAChB,QAAiB;IAEjB,IAAI,QAAQ,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC3C,MAAM,IAAI,YAAY,CACpB,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,uCAAuC,EACjF,EAAE,IAAI,EA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1B,KAAsC,EACtC,UAAmB,EACnB,MAAyB;IAEzB,IAAI,CAAC;QACH,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,YAAY,CAAC,cAAc,CACzB,KAAK,EACL,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAC1D,EACD,CAAC;YACD,MAAM,IAAI,YAAY,CACpB,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,sBAAsB,EAChE;gBACE,IAAI;gBACJ,IAAI,EAAE,YAAY;gBAClB,KAAK;gBACL,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;aAC3B,CACF,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-module-imported-from-hardhat2-plugin.d.ts","sourceRoot":"","sources":["../../../src/internal/deprecated-module-imported-from-hardhat2-plugin.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This is an empty module that is used to exported it with a subpath that's
|
|
2
|
+
// commonly used by Hardhat 2 plugins. This is to avoid the plugins breaking
|
|
3
|
+
// when the `require` it, so that they have an opportunity to run a function
|
|
4
|
+
// that throws a better error message.
|
|
5
|
+
export {};
|
|
6
|
+
// The reason this module can be empty is that Hardhat 2 plugins are CJS modules
|
|
7
|
+
// so they can destructure the require and get `undefined` values, instead of
|
|
8
|
+
// a load-time error.
|
|
9
|
+
// We could also throw from this file, but if it gets imported by an ESM module
|
|
10
|
+
// you don't get an import-stack-trace, so you loose the possibility of figuring
|
|
11
|
+
// out which plugin is triggering the error.
|
|
12
|
+
//# sourceMappingURL=deprecated-module-imported-from-hardhat2-plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-module-imported-from-hardhat2-plugin.js","sourceRoot":"","sources":["../../../src/internal/deprecated-module-imported-from-hardhat2-plugin.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAC5E,4EAA4E;AAC5E,sCAAsC;;AAEtC,gFAAgF;AAChF,6EAA6E;AAC7E,qBAAqB;AAErB,+EAA+E;AAC/E,gFAAgF;AAChF,4CAA4C"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CustomError } from "@nomicfoundation/hardhat-utils/error";
|
|
2
|
+
export declare class UsingHardhat2PluginError extends CustomError {
|
|
3
|
+
readonly callerRelativePath: string | undefined;
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns the relative path of the file that called a deprecated Hardhat
|
|
8
|
+
* plugin API, based on the stack trace. This helps identify which plugin
|
|
9
|
+
* file is triggering usage of Hardhat 2 APIs in a Hardhat 3 project.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} [depth=5] The stack trace depth to locate the caller's
|
|
12
|
+
* source file. By default, depth 5 is used because:
|
|
13
|
+
* 0 = message
|
|
14
|
+
* 1 = getCallerRelativePath
|
|
15
|
+
* 2 = UsingHardhat2PluginError constructor
|
|
16
|
+
* 3 = throwUsingHardhat2PluginError
|
|
17
|
+
* 4 = deprecated function
|
|
18
|
+
* 5 = actual caller (the plugin file)
|
|
19
|
+
*
|
|
20
|
+
* @returns {string|undefined} The shortened relative path of the caller file,
|
|
21
|
+
* or undefined if not found.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* If the stack trace is:
|
|
25
|
+
* // Error
|
|
26
|
+
* // at getCallerRelativePath (src/internal/using-hardhat2-plugin-errors.ts:34:15)
|
|
27
|
+
* // at UsingHardhat2PluginError.constructor (src/internal/using-hardhat2-plugin-errors.ts:7:3)
|
|
28
|
+
* // at throwUsingHardhat2PluginError (src/internal/using-hardhat2-plugin-errors.ts:90:3)
|
|
29
|
+
* // at deprecatedFunction (plugins/example-plugin/deprecated.js:50:10)
|
|
30
|
+
* // at main (plugins/example-plugin/index.js:100:5)
|
|
31
|
+
* Calling getCallerRelativePath() returns 'plugins/example-plugin/index.js'
|
|
32
|
+
*/
|
|
33
|
+
export declare function getCallerRelativePath(depth?: number): string | undefined;
|
|
34
|
+
export declare function throwUsingHardhat2PluginError(): never;
|
|
35
|
+
//# sourceMappingURL=using-hardhat2-plugin-errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"using-hardhat2-plugin-errors.d.ts","sourceRoot":"","sources":["../../../src/internal/using-hardhat2-plugin-errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAInE,qBAAa,wBAAyB,SAAQ,WAAW;IACvD,SAAgB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;;CAwBxD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,GAAE,MAAU,GAAG,MAAM,GAAG,SAAS,CAyC3E;AAED,wBAAgB,6BAA6B,IAAI,KAAK,CAIrD"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { CustomError } from "@nomicfoundation/hardhat-utils/error";
|
|
3
|
+
import { shortenPath } from "@nomicfoundation/hardhat-utils/path";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
export class UsingHardhat2PluginError extends CustomError {
|
|
6
|
+
callerRelativePath;
|
|
7
|
+
constructor() {
|
|
8
|
+
const callerPath = getCallerRelativePath();
|
|
9
|
+
let message;
|
|
10
|
+
if (callerPath !== undefined) {
|
|
11
|
+
message = `You are trying to use a Hardhat 2 plugin in a Hardhat 3 project.
|
|
12
|
+
|
|
13
|
+
This file is part of a Hardhat 2 plugin calling an API that was removed in Hardhat 3: ${chalk.bold(callerPath)}
|
|
14
|
+
|
|
15
|
+
Please read https://hardhat.org/migrate-from-hardhat2 to learn how to migrate your project to Hardhat 3.
|
|
16
|
+
`;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
message = `You are trying to use a Hardhat 2 plugin in a Hardhat 3 project.
|
|
20
|
+
|
|
21
|
+
Check the stack trace below to identify which plugin is causing this.
|
|
22
|
+
|
|
23
|
+
Please read https://hardhat.org/migrate-from-hardhat2 to learn how to migrate your project to Hardhat 3.
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
super(message);
|
|
27
|
+
this.callerRelativePath = callerPath;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns the relative path of the file that called a deprecated Hardhat
|
|
32
|
+
* plugin API, based on the stack trace. This helps identify which plugin
|
|
33
|
+
* file is triggering usage of Hardhat 2 APIs in a Hardhat 3 project.
|
|
34
|
+
*
|
|
35
|
+
* @param {number} [depth=5] The stack trace depth to locate the caller's
|
|
36
|
+
* source file. By default, depth 5 is used because:
|
|
37
|
+
* 0 = message
|
|
38
|
+
* 1 = getCallerRelativePath
|
|
39
|
+
* 2 = UsingHardhat2PluginError constructor
|
|
40
|
+
* 3 = throwUsingHardhat2PluginError
|
|
41
|
+
* 4 = deprecated function
|
|
42
|
+
* 5 = actual caller (the plugin file)
|
|
43
|
+
*
|
|
44
|
+
* @returns {string|undefined} The shortened relative path of the caller file,
|
|
45
|
+
* or undefined if not found.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* If the stack trace is:
|
|
49
|
+
* // Error
|
|
50
|
+
* // at getCallerRelativePath (src/internal/using-hardhat2-plugin-errors.ts:34:15)
|
|
51
|
+
* // at UsingHardhat2PluginError.constructor (src/internal/using-hardhat2-plugin-errors.ts:7:3)
|
|
52
|
+
* // at throwUsingHardhat2PluginError (src/internal/using-hardhat2-plugin-errors.ts:90:3)
|
|
53
|
+
* // at deprecatedFunction (plugins/example-plugin/deprecated.js:50:10)
|
|
54
|
+
* // at main (plugins/example-plugin/index.js:100:5)
|
|
55
|
+
* Calling getCallerRelativePath() returns 'plugins/example-plugin/index.js'
|
|
56
|
+
*/
|
|
57
|
+
export function getCallerRelativePath(depth = 5) {
|
|
58
|
+
try {
|
|
59
|
+
const stack = new Error().stack;
|
|
60
|
+
if (stack === undefined) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const lines = stack.split("\n");
|
|
64
|
+
const callerLine = lines[depth];
|
|
65
|
+
if (callerLine === undefined) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Matches a single stack trace line:
|
|
70
|
+
*
|
|
71
|
+
* at FunctionName (path/to/file.ts:10:5)
|
|
72
|
+
* at path/to/file.ts:10:5
|
|
73
|
+
*
|
|
74
|
+
* Captures:
|
|
75
|
+
* - group 1: file location (without line/column)
|
|
76
|
+
*/
|
|
77
|
+
const STACK_TRACE_LINE_REGEX = /^at (?:.+? \()?([^\(].*?)(?::\d+)?(?::\d+)?\)?$/;
|
|
78
|
+
const match = callerLine.trim().match(STACK_TRACE_LINE_REGEX);
|
|
79
|
+
if (match === null || match[1] === undefined) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
let filePath = match[1];
|
|
83
|
+
// Handle file:// URLs from ESM stack traces
|
|
84
|
+
if (filePath.startsWith("file://")) {
|
|
85
|
+
filePath = fileURLToPath(filePath);
|
|
86
|
+
}
|
|
87
|
+
return shortenPath(filePath);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
export function throwUsingHardhat2PluginError() {
|
|
94
|
+
/* eslint-disable-next-line no-restricted-syntax -- Intentionally throwing a
|
|
95
|
+
custom error here so that we always print the stack trace */
|
|
96
|
+
throw new UsingHardhat2PluginError();
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=using-hardhat2-plugin-errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"using-hardhat2-plugin-errors.js","sourceRoot":"","sources":["../../../src/internal/using-hardhat2-plugin-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,OAAO,wBAAyB,SAAQ,WAAW;IACvC,kBAAkB,CAAqB;IACvD;QACE,MAAM,UAAU,GAAG,qBAAqB,EAAE,CAAC;QAE3C,IAAI,OAAe,CAAC;QACpB,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,GAAG;;wFAEwE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;;;CAG7G,CAAC;QACE,CAAC;aAAM,CAAC;YACN,OAAO,GAAG;;;;;CAKf,CAAC;QACE,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;QAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,SAAS,CAAC;QACnB,CAAC;QAED;;;;;;;;WAQG;QACH,MAAM,sBAAsB,GAC1B,iDAAiD,CAAC;QAEpD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC9D,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;YAC7C,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAExB,4CAA4C;QAC5C,IAAI,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YACnC,QAAQ,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,6BAA6B;IAC3C;kEAC8D;IAC9D,MAAM,IAAI,wBAAwB,EAAE,CAAC;AACvC,CAAC"}
|
package/dist/src/plugins.d.ts
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { HardhatPluginError } from "@nomicfoundation/hardhat-errors";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
4
|
+
*/
|
|
5
|
+
export declare function lazyFunction(..._args: any): any;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
8
|
+
*/
|
|
9
|
+
export declare function lazyObject(..._args: any): any;
|
|
2
10
|
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAIrE;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,KAAK,EAAE,GAAG,GAAG,GAAG,CAE/C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,KAAK,EAAE,GAAG,GAAG,GAAG,CAE7C"}
|
package/dist/src/plugins.js
CHANGED
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
export { HardhatPluginError } from "@nomicfoundation/hardhat-errors";
|
|
2
|
+
import { throwUsingHardhat2PluginError } from "./internal/using-hardhat2-plugin-errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
5
|
+
*/
|
|
6
|
+
export function lazyFunction(..._args) {
|
|
7
|
+
throwUsingHardhat2PluginError();
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated This function is part of the Hardhat 2 plugin API.
|
|
11
|
+
*/
|
|
12
|
+
export function lazyObject(..._args) {
|
|
13
|
+
throwUsingHardhat2PluginError();
|
|
14
|
+
}
|
|
2
15
|
//# sourceMappingURL=plugins.js.map
|
package/dist/src/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAE3F;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAG,KAAU;IACxC,6BAA6B,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,GAAG,KAAU;IACtC,6BAA6B,EAAE,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
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";
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,yBAAyB,CAAC;AACxC,cAAc,YAAY,CAAC"}
|
|
@@ -57,8 +57,8 @@ export interface HardhatPlugin {
|
|
|
57
57
|
* returning an object with a handler for the `extendUserConfig` hook.
|
|
58
58
|
*
|
|
59
59
|
* You can define each factory in two ways:
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* - As an inline function.
|
|
61
|
+
* - As a string with the path to a file that exports the factory as `default`.
|
|
62
62
|
*
|
|
63
63
|
* The first option should only be used for development. You MUST use the second
|
|
64
64
|
* option for production.
|
|
@@ -75,6 +75,11 @@ export interface NpmRootFileOfUninstalledPackageError {
|
|
|
75
75
|
type: RootResolutionErrorType.NPM_ROOT_FILE_OF_UNINSTALLED_PACKAGE;
|
|
76
76
|
npmModule: string;
|
|
77
77
|
installationName: string;
|
|
78
|
+
/**
|
|
79
|
+
* A boolean indicating if the Hardhat project has a foundry.toml file in its
|
|
80
|
+
* root.
|
|
81
|
+
*/
|
|
82
|
+
projectHasFoundryToml?: boolean;
|
|
78
83
|
}
|
|
79
84
|
export interface NpmRootResolutionWithRemappingErrors {
|
|
80
85
|
type: RootResolutionErrorType.NPM_ROOT_FILE_RESOLUTION_WITH_REMAPPING_ERRORS;
|
|
@@ -88,6 +93,10 @@ export interface NpmRootFileDoesNotExistWithinPackageError extends ResolvedFileR
|
|
|
88
93
|
export interface NpmRootFileWithIncorrectCasingError extends ResolvedFileReference {
|
|
89
94
|
type: RootResolutionErrorType.NPM_ROOT_FILE_WITH_INCORRECT_CASING;
|
|
90
95
|
npmModule: string;
|
|
96
|
+
/**
|
|
97
|
+
* The correct casing of the file, expressed as the relative fs path from the
|
|
98
|
+
* package's root, using forward slashes, and without a leading "./".
|
|
99
|
+
*/
|
|
91
100
|
correctCasing: string;
|
|
92
101
|
}
|
|
93
102
|
export interface NpmRootFileNonExportedFileError extends ResolvedFileReference {
|
|
@@ -171,6 +180,10 @@ export interface ImportInvalidCasingError extends ResolvedFileReference {
|
|
|
171
180
|
type: ImportResolutionErrorType.IMPORT_INVALID_CASING;
|
|
172
181
|
fromFsPath: string;
|
|
173
182
|
importPath: string;
|
|
183
|
+
/**
|
|
184
|
+
* The correct casing of the file, expressed as the relative fs path from the
|
|
185
|
+
* package's root, using forward slashes, and without a leading "./".
|
|
186
|
+
*/
|
|
174
187
|
correctCasing: string;
|
|
175
188
|
}
|
|
176
189
|
export interface ImportWithInvalidNpmSyntaxError {
|
|
@@ -183,6 +196,11 @@ export interface ImportOfUninstalledPackageError {
|
|
|
183
196
|
fromFsPath: string;
|
|
184
197
|
importPath: string;
|
|
185
198
|
installationName: string;
|
|
199
|
+
/**
|
|
200
|
+
* A boolean indicating weather the import is from a source file whose package
|
|
201
|
+
* has a foundry.toml file in its root.
|
|
202
|
+
*/
|
|
203
|
+
importerPackageHasFoundryToml?: boolean;
|
|
186
204
|
}
|
|
187
205
|
export interface ImportWithRemappingErrorsError {
|
|
188
206
|
type: ImportResolutionErrorType.IMPORT_WITH_REMAPPING_ERRORS;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/types/solidity/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,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AEzC;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,UAAU,EAAE,mBAAmB,CAAC;IAKhC,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAavC,OAAO,EAAE,MAAM,CAAC;IAOhB,6BAA6B,CAAC,EAAE,MAAM,CAAC;CACxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/types/solidity/errors.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,uBA0DX;AA1DD,WAAY,uBAAuB;IACjC;;OAEG;IACH,gGAAqE,CAAA;IAErE;;OAEG;IACH,gGAAqE,CAAA;IAErE;;;OAGG;IACH,kGAAuE,CAAA;IAEvE;;;OAGG;IACH,4GAAiF,CAAA;IAEjF;;;;;OAKG;IACH,4GAAiF,CAAA;IAEjF;;OAEG;IACH,wGAA6E,CAAA;IAE7E;;OAEG;IACH,4HAAiG,CAAA;IAEjG;;;OAGG;IACH,8HAAmG,CAAA;IAEnG;;;OAGG;IACH,sGAA2E,CAAA;IAE3E;;;OAGG;IACH,8FAAmE,CAAA;AACrE,CAAC,EA1DW,uBAAuB,KAAvB,uBAAuB,QA0DlC;
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/types/solidity/errors.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,uBA0DX;AA1DD,WAAY,uBAAuB;IACjC;;OAEG;IACH,gGAAqE,CAAA;IAErE;;OAEG;IACH,gGAAqE,CAAA;IAErE;;;OAGG;IACH,kGAAuE,CAAA;IAEvE;;;OAGG;IACH,4GAAiF,CAAA;IAEjF;;;;;OAKG;IACH,4GAAiF,CAAA;IAEjF;;OAEG;IACH,wGAA6E,CAAA;IAE7E;;OAEG;IACH,4HAAiG,CAAA;IAEjG;;;OAGG;IACH,8HAAmG,CAAA;IAEnG;;;OAGG;IACH,sGAA2E,CAAA;IAE3E;;;OAGG;IACH,8FAAmE,CAAA;AACrE,CAAC,EA1DW,uBAAuB,KAAvB,uBAAuB,QA0DlC;AAsFD;;GAEG;AACH,MAAM,CAAN,IAAY,yBAgDX;AAhDD,WAAY,yBAAyB;IACnC;;OAEG;IACH,wGAA2E,CAAA;IAC3E;;OAEG;IACH,gFAAmD,CAAA;IACnD;;;OAGG;IACH,oGAAuE,CAAA;IACvE;;OAEG;IACH,4EAA+C,CAAA;IAC/C;;OAEG;IACH,4EAA+C,CAAA;IAC/C;;OAEG;IACH,8FAAiE,CAAA;IACjE;;OAEG;IACH,4FAA+D,CAAA;IAC/D;;OAEG;IACH,mFAAsD,CAAA;IACtD;;OAEG;IACH,gGAAmE,CAAA;IAEnE;;OAEG;IACH,wHAA2F,CAAA;IAE3F;;OAEG;IACH,wFAA2D,CAAA;AAC7D,CAAC,EAhDW,yBAAyB,KAAzB,yBAAyB,QAgDpC;AAgGD;;;GAGG;AACH,MAAM,CAAN,IAAY,sBAUX;AAVD,WAAY,sBAAsB;IAChC;;OAEG;IACH,yFAA+D,CAAA;IAE/D;;OAEG;IACH,+FAAqE,CAAA;AACvE,CAAC,EAVW,sBAAsB,KAAtB,sBAAsB,QAUjC"}
|
|
@@ -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.
|
|
77
90
|
*/
|
|
78
|
-
export
|
|
91
|
+
export type NewTaskDefinition = BaseTaskDefinition & TaskAction;
|
|
92
|
+
/**
|
|
93
|
+
* The base definition of an override of an existing task.
|
|
94
|
+
*/
|
|
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,33 @@ 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")`.
|
|
117
140
|
*
|
|
118
|
-
* Note that plugins
|
|
119
|
-
*
|
|
141
|
+
* Note that plugins cannot use inline actions (see {@link setInlineAction}).
|
|
142
|
+
* They must use this method with a lazy import.
|
|
143
|
+
*
|
|
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
|
+
setAction(action: LazyActionObject<NewTaskActionFunction<TaskArgumentsT>>): NewTaskDefinitionBuilder<TaskArgumentsT, "LAZY_ACTION">;
|
|
152
|
+
/**
|
|
153
|
+
* Sets the inline action of the task.
|
|
154
|
+
*
|
|
155
|
+
* It must be provided as a function.
|
|
156
|
+
*
|
|
157
|
+
* @remarks
|
|
158
|
+
* This method can only be called once per task definition. Calling it multiple
|
|
159
|
+
* times will result in a runtime error.
|
|
160
|
+
*
|
|
161
|
+
* This method cannot be used together with {@link setAction} on the same
|
|
162
|
+
* task. Use one or the other.
|
|
120
163
|
*/
|
|
121
|
-
|
|
164
|
+
setInlineAction(inlineAction: NewTaskActionFunction<TaskArgumentsT>): NewTaskDefinitionBuilder<TaskArgumentsT, "INLINE_ACTION">;
|
|
122
165
|
/**
|
|
123
166
|
* Adds an option to the task.
|
|
124
167
|
*
|
|
@@ -135,7 +178,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
135
178
|
type?: TypeT;
|
|
136
179
|
defaultValue: ArgumentTypeToValueType<TypeT>;
|
|
137
180
|
hidden?: boolean;
|
|
138
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
181
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
139
182
|
/**
|
|
140
183
|
* Adds an option of flag type and default value false.
|
|
141
184
|
*/
|
|
@@ -144,7 +187,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
144
187
|
shortName?: string;
|
|
145
188
|
description?: string;
|
|
146
189
|
hidden?: boolean;
|
|
147
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT
|
|
190
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT>, ActionTypeT>;
|
|
148
191
|
/**
|
|
149
192
|
* Adds an option of level type and default value 0.
|
|
150
193
|
*/
|
|
@@ -153,7 +196,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
153
196
|
shortName?: string;
|
|
154
197
|
description?: string;
|
|
155
198
|
defaultValue?: number;
|
|
156
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT
|
|
199
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT>, ActionTypeT>;
|
|
157
200
|
/**
|
|
158
201
|
* Adds a positional argument to the task.
|
|
159
202
|
*
|
|
@@ -175,7 +218,7 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
175
218
|
description?: string;
|
|
176
219
|
type?: TypeT;
|
|
177
220
|
defaultValue?: ArgumentTypeToValueType<TypeT>;
|
|
178
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
221
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
179
222
|
/**
|
|
180
223
|
* Adds a variadic positional argument to the task.
|
|
181
224
|
*
|
|
@@ -195,16 +238,23 @@ export interface NewTaskDefinitionBuilder<TaskArgumentsT extends TaskArguments =
|
|
|
195
238
|
description?: string;
|
|
196
239
|
type?: TypeT;
|
|
197
240
|
defaultValue?: Array<ArgumentTypeToValueType<TypeT>>;
|
|
198
|
-
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT[], TaskArgumentsT
|
|
241
|
+
}): NewTaskDefinitionBuilder<ExtendTaskArguments<NameT, TypeT[], TaskArgumentsT>, ActionTypeT>;
|
|
199
242
|
/**
|
|
200
243
|
* Builds the NewTaskDefinition.
|
|
201
244
|
*/
|
|
202
|
-
build(): NewTaskDefinition
|
|
245
|
+
build(): ActionTypeT extends "LAZY_ACTION" ? Extract<NewTaskDefinition, {
|
|
246
|
+
action: LazyActionObject<NewTaskActionFunction>;
|
|
247
|
+
}> : ActionTypeT extends "INLINE_ACTION" ? Extract<NewTaskDefinition, {
|
|
248
|
+
inlineAction: NewTaskActionFunction;
|
|
249
|
+
}> : never;
|
|
203
250
|
}
|
|
204
251
|
/**
|
|
205
|
-
* A builder for overriding existing tasks
|
|
252
|
+
* A builder for overriding existing tasks
|
|
253
|
+
*
|
|
254
|
+
* @template TaskArgumentsT The arguments of the task.
|
|
255
|
+
* @template ActionTypeT Tracks if the action is "LAZY_ACTION" (Plugin Safe) or "INLINE_ACTION".
|
|
206
256
|
*/
|
|
207
|
-
export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments> {
|
|
257
|
+
export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArguments = TaskArguments, ActionTypeT extends "LAZY_ACTION" | "INLINE_ACTION" | "MISSING_ACTION" = "MISSING_ACTION"> {
|
|
208
258
|
/**
|
|
209
259
|
* Sets a new description for the task.
|
|
210
260
|
*/
|
|
@@ -214,7 +264,13 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
214
264
|
*
|
|
215
265
|
* @see NewTaskDefinitionBuilder.setAction
|
|
216
266
|
*/
|
|
217
|
-
setAction(action: LazyActionObject<TaskOverrideActionFunction<TaskArgumentsT>>):
|
|
267
|
+
setAction(action: LazyActionObject<TaskOverrideActionFunction<TaskArgumentsT>>): TaskOverrideDefinitionBuilder<TaskArgumentsT, "LAZY_ACTION">;
|
|
268
|
+
/**
|
|
269
|
+
* Sets a new inline action for the task.
|
|
270
|
+
*
|
|
271
|
+
* @see NewTaskDefinitionBuilder.setInlineAction
|
|
272
|
+
*/
|
|
273
|
+
setInlineAction(inlineAction: TaskOverrideActionFunction<TaskArgumentsT>): TaskOverrideDefinitionBuilder<TaskArgumentsT, "INLINE_ACTION">;
|
|
218
274
|
/**
|
|
219
275
|
* Adds a new option to the task.
|
|
220
276
|
*
|
|
@@ -227,7 +283,7 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
227
283
|
type?: TypeT;
|
|
228
284
|
defaultValue: ArgumentTypeToValueType<TypeT>;
|
|
229
285
|
hidden?: boolean;
|
|
230
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT
|
|
286
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, TypeT, TaskArgumentsT>, ActionTypeT>;
|
|
231
287
|
/**
|
|
232
288
|
* Adds an option of flag type and default value false.
|
|
233
289
|
*/
|
|
@@ -236,7 +292,7 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
236
292
|
shortName?: string;
|
|
237
293
|
description?: string;
|
|
238
294
|
hidden?: boolean;
|
|
239
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT
|
|
295
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.FLAG, TaskArgumentsT>, ActionTypeT>;
|
|
240
296
|
/**
|
|
241
297
|
* Adds an option of level type and default value 0.
|
|
242
298
|
*/
|
|
@@ -245,33 +301,38 @@ export interface TaskOverrideDefinitionBuilder<TaskArgumentsT extends TaskArgume
|
|
|
245
301
|
shortName?: string;
|
|
246
302
|
description?: string;
|
|
247
303
|
defaultValue?: number;
|
|
248
|
-
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT
|
|
304
|
+
}): TaskOverrideDefinitionBuilder<ExtendTaskArguments<NameT, ArgumentType.LEVEL, TaskArgumentsT>, ActionTypeT>;
|
|
249
305
|
/**
|
|
250
306
|
* Builds the TaskOverrideDefinition.
|
|
251
307
|
*/
|
|
252
|
-
build(): TaskOverrideDefinition
|
|
308
|
+
build(): ActionTypeT extends "LAZY_ACTION" ? Extract<TaskOverrideDefinition, {
|
|
309
|
+
action: LazyActionObject<TaskOverrideActionFunction>;
|
|
310
|
+
}> : ActionTypeT extends "INLINE_ACTION" ? Extract<TaskOverrideDefinition, {
|
|
311
|
+
inlineAction: TaskOverrideActionFunction;
|
|
312
|
+
}> : never;
|
|
253
313
|
}
|
|
254
314
|
/**
|
|
255
315
|
* The actions associated to the task, in order.
|
|
256
316
|
*
|
|
257
317
|
* Each of them has the pluginId of the plugin that defined it, if any, and the
|
|
258
|
-
* action itself.
|
|
318
|
+
* action itself. The action is stored either in `action` or `inlineAction`.
|
|
319
|
+
* Note that `inlineAction` is reserved for user tasks and is not allowed for plugins.
|
|
259
320
|
*
|
|
260
|
-
* Note that the first action is a `NewTaskActionFunction
|
|
261
|
-
* `undefined
|
|
321
|
+
* Note that the first action is a `NewTaskActionFunction` or undefined.
|
|
322
|
+
* `undefined` is only used for empty tasks.
|
|
262
323
|
*
|
|
263
|
-
* The rest of the actions always have a `TaskOverrideActionFunction
|
|
264
|
-
* `string`.
|
|
324
|
+
* The rest of the actions always have a `TaskOverrideActionFunction`.
|
|
265
325
|
*/
|
|
266
326
|
export type TaskActions = [
|
|
267
327
|
{
|
|
268
328
|
pluginId?: string;
|
|
269
|
-
|
|
270
|
-
|
|
329
|
+
} & (TaskAction | {
|
|
330
|
+
action?: undefined;
|
|
331
|
+
inlineAction?: undefined;
|
|
332
|
+
}),
|
|
271
333
|
...Array<{
|
|
272
334
|
pluginId?: string;
|
|
273
|
-
|
|
274
|
-
}>
|
|
335
|
+
} & TaskOverrideAction>
|
|
275
336
|
];
|
|
276
337
|
/**
|
|
277
338
|
* A task.
|