From f2fdbead759b713a2cac10ec5a2510853bcc93cd Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:45:58 -0700 Subject: [PATCH 1/2] Use go.mod ignore directive instead of postinstall --- Herebyfile.mjs | 10 ---------- go.mod | 9 +++++++++ package.json | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Herebyfile.mjs b/Herebyfile.mjs index ce1d0664aa..b9f3460a12 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -477,16 +477,6 @@ export const checkFormat = task({ }, }); -export const postinstall = task({ - name: "postinstall", - hiddenFromTaskList: true, - run: () => { - // Ensure the go command doesn't waste time looking into node_modules. - // Remove once https://github.com/golang/go/issues/42965 is fixed. - fs.writeFileSync(path.join(__dirname, "node_modules", "go.mod"), `module example.org/ignoreme\n`); - }, -}); - /** * @param {string} localBaseline Path to the local copy of the baselines * @param {string} refBaseline Path to the reference copy of the baselines diff --git a/go.mod b/go.mod index 7fa976e131..000d2efd68 100644 --- a/go.mod +++ b/go.mod @@ -28,3 +28,12 @@ tool ( golang.org/x/tools/cmd/stringer mvdan.cc/gofumpt ) + +ignore ( + node_modules + ./_extension + ./_packages + ./_submodules + ./built + ./coverage +) diff --git a/package.json b/package.json index ac9436c984..a6b739464f 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "which": "^5.0.0" }, "scripts": { - "postinstall": "hereby postinstall", "build": "hereby build", "build:watch": "hereby build:watch", "build:watch:debug": "hereby build:watch --debug", From 3451398bcf21c7c266a7b4f11e2572ae22e8ada8 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Thu, 14 Aug 2025 13:48:36 -0700 Subject: [PATCH 2/2] tiy --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 000d2efd68..3112ad9137 100644 --- a/go.mod +++ b/go.mod @@ -30,10 +30,10 @@ tool ( ) ignore ( - node_modules ./_extension ./_packages ./_submodules ./built ./coverage + node_modules )