diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs index 3c55cf1..228bbda 100644 --- a/.pnpmfile.cjs +++ b/.pnpmfile.cjs @@ -15,7 +15,18 @@ const Path = require("path") const Fs = require("node:fs") const linkLocalOppModelsEnv = "WIRE_LINK_LOCAL_OPP_MODELS" +const linkLocalOutpostArtifactsEnv = "WIRE_LINK_LOCAL_OUTPOST_ARTIFACTS" const localOppModelTargets = ["typescript", "solidity"] +const localOutpostArtifactPackages = [ + [ + "@wireio/outpost-ethereum-artifacts", + Path.resolve(__dirname, "..", "wire-ethereum", "sdk-artifacts") + ], + [ + "@wireio/outpost-solana-artifacts", + Path.resolve(__dirname, "..", "wire-solana", "sdk-artifacts") + ] +] /** * Checks whether a path exists and is a directory, without throwing. @@ -61,7 +72,29 @@ function appendLocalOppModelOverrides() { }) } +/** + * Links source-owned outpost packages generated by sibling chain repositories. + * Standalone and release installs keep registry resolution so their lockfile + * remains portable and exact published versions stay authoritative. + */ +function appendLocalOutpostArtifactOverrides() { + const shouldLinkLocalOutpostArtifacts = + process.env[linkLocalOutpostArtifactsEnv] === "1" || + process.env[linkLocalOutpostArtifactsEnv] === "true" + + if (!shouldLinkLocalOutpostArtifacts) { + return + } + + localOutpostArtifactPackages + .filter(([, path]) => isDirectory(path)) + .forEach(([pkgName, path]) => { + localOverrides[pkgName] = path + }) +} + appendLocalOppModelOverrides() +appendLocalOutpostArtifactOverrides() /** * `readPackage` hook, which links locally available versions of diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 22a3a29..efa1d8c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ overrides: webpack-dev-server: 6.0.0 ws: 8.21.0 -pnpmfileChecksum: sha256-VL75P024zf3lp95S21DDaE+45rqS+Duf7c72gZgr1CY= +pnpmfileChecksum: sha256-l5MT63RFu2+KTSHDSf/PtK5iN6T6YIAeV3ky+GtQlBk= importers: