Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading