Skip to content

Commit 8308390

Browse files
committed
Load type extensions of builitin plugins
1 parent 70dd291 commit 8308390

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

Diff for: v-next/hardhat/src/config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
// Note: We export the builtin plugins' types here, so that any type extension
2+
// they may have gets loaded.
3+
export type * from "./internal/builtin-plugins/index.js";
4+
15
export type * from "@nomicfoundation/hardhat-core/config";
26
export * from "@nomicfoundation/hardhat-core/config";

Diff for: v-next/hardhat/src/internal/builtin-plugins/hardhat-foo/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { HardhatPlugin } from "@nomicfoundation/hardhat-core/types/plugins";
22

33
import { globalFlag, task } from "@nomicfoundation/hardhat-core/config";
4-
import "./type-extensions.js";
4+
export type * from "./type-extensions.js";
55

66
export default {
77
id: "hardhat-foo",

Diff for: v-next/hardhat/src/internal/builtin-plugins/hardhat-foo/type-extensions.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import "@nomicfoundation/hardhat-core/types/config";
2+
13
declare module "@nomicfoundation/hardhat-core/types/config" {
24
interface FooUserConfig {
35
bar?: number | number[];

Diff for: v-next/hardhat/src/internal/builtin-plugins/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { HardhatPlugin } from "@nomicfoundation/hardhat-core/types/plugins";
22

3+
// Note: When importing a plugin, you have to export its types, so that its
4+
// type extensions, if any, also get loaded.
5+
export type * from "./hardhat-foo/index.js";
36
import hardhatFoo from "./hardhat-foo/index.js";
47

58
export const builtinPlugins: HardhatPlugin[] = [hardhatFoo];

0 commit comments

Comments
 (0)