From 00429dfe6f10da7d069949c7a0b6a4e50e1ece6f Mon Sep 17 00:00:00 2001 From: David Meister Date: Sun, 16 Aug 2026 18:44:21 +0000 Subject: [PATCH] Publish CodeGennable so the shipped example compiles from the package `script/Build.sol` publishes and `.soldeerignore` excludes `/test`, so the package's only worked example imported a file no consumer receives. Move `CodeGennable` under `src/concrete/`, alongside the `src/generated/CodeGennable.sol` it produces, and point every import at it. Co-Authored-By: Claude Opus 5 (1M context) --- script/Build.sol | 2 +- {test => src}/concrete/CodeGennable.sol | 0 test/lib/LibCodeGen.bytecodeHashConstantString.t.sol | 2 +- test/lib/LibFs.buildFileForContract.t.sol | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename {test => src}/concrete/CodeGennable.sol (100%) diff --git a/script/Build.sol b/script/Build.sol index b2735f2..dae9f01 100644 --- a/script/Build.sol +++ b/script/Build.sol @@ -5,7 +5,7 @@ pragma solidity =0.8.25; import {Script} from "forge-std-1.16.1/src/Script.sol"; import {LibFs} from "../src/lib/LibFs.sol"; import {LibCodeGen} from "../src/lib/LibCodeGen.sol"; -import {CodeGennable} from "../test/concrete/CodeGennable.sol"; +import {CodeGennable} from "../src/concrete/CodeGennable.sol"; /// @title Build /// @notice Script to build the generated file for the CodeGennable contract. diff --git a/test/concrete/CodeGennable.sol b/src/concrete/CodeGennable.sol similarity index 100% rename from test/concrete/CodeGennable.sol rename to src/concrete/CodeGennable.sol diff --git a/test/lib/LibCodeGen.bytecodeHashConstantString.t.sol b/test/lib/LibCodeGen.bytecodeHashConstantString.t.sol index 705ea48..0e9ec0f 100644 --- a/test/lib/LibCodeGen.bytecodeHashConstantString.t.sol +++ b/test/lib/LibCodeGen.bytecodeHashConstantString.t.sol @@ -5,7 +5,7 @@ pragma solidity =0.8.25; import {Test} from "forge-std-1.16.1/src/Test.sol"; import {LibCodeGen, MAX_LINE_LENGTH, CodelessInstance} from "src/lib/LibCodeGen.sol"; import {LibCodeGenSlow} from "./LibCodeGenSlow.sol"; -import {CodeGennable} from "../concrete/CodeGennable.sol"; +import {CodeGennable} from "src/concrete/CodeGennable.sol"; /// @title LibCodeGenBytecodeHashConstantStringTest /// @notice `bytecodeHashConstantString` emits the one constant that every diff --git a/test/lib/LibFs.buildFileForContract.t.sol b/test/lib/LibFs.buildFileForContract.t.sol index a5ed2af..f24dbc2 100644 --- a/test/lib/LibFs.buildFileForContract.t.sol +++ b/test/lib/LibFs.buildFileForContract.t.sol @@ -5,7 +5,7 @@ pragma solidity =0.8.25; import {Test} from "forge-std-1.16.1/src/Test.sol"; import {LibFs} from "src/lib/LibFs.sol"; import {LibCodeGen, InvalidContractName} from "src/lib/LibCodeGen.sol"; -import {CodeGennable} from "test/concrete/CodeGennable.sol"; +import {CodeGennable} from "src/concrete/CodeGennable.sol"; import {LibFsExternal} from "test/concrete/LibFsExternal.sol"; import {LibCodeGenSlow} from "test/lib/LibCodeGenSlow.sol";