Content pfp
Content
@
0 reply
0 recast
0 reaction

frolic pfp
frolic
@frolic
$500 USDC bounty to publish Foundry binaries to npm The npm package should be automated and track upstream versions (e.g. nightly) Ultimately I want to be able to run `forge build` in my Vercel app’s “build command” setting and use the resulting output files in my app (ABI, bytecode, etc.) @bountybot
2 replies
0 recast
5 reactions

Soptq pfp
Soptq
@soptq
Just made one 🫡 : ```bash npm install -g foundry-up ``` and you can `forge build` with latest nightly foundry without problems. Source code: https://github.com/Soptq/foundry-up
1 reply
0 recast
1 reaction

frolic pfp
frolic
@frolic
Does it work in Vercel?
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
Yes it is! Here is the `forge -V` running on Vercel Node.js 20.x. (the last line)
2 replies
0 recast
1 reaction

frolic pfp
frolic
@frolic
Is there a way to specify a particular foundry version? Can the npm publish pipeline track it rather than installing latest?
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
For now there isn't, as Foundry still has no versioned releases (see https://github.com/foundry-rs/foundry/issues/3895 for more details). However, this functionality is not hard to implement once the Foundry has versioned releases. Will add this feat when its ready.
1 reply
0 recast
0 reaction

frolic pfp
frolic
@frolic
There may be no versioned releases, but foundryup lets you specify commits, which has let us pin to specific points in time if there are temporary bugs and we need to roll back while we wait for upstream fixes. How would you go about that in the npm package?
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
Yes, indeed. I have made an update to foundry-up to version 0.1.3 to allow specifying a release tag. For example, if I want to stick to `nightly-2cf84d9f3ba7b6f4a9296299e7036ecc24cfa1da`, I can now: ```bash npm install -g foundry-up --foundry_version=nightly-2cf84d9f3ba7b6f4a9296299e7036ecc24cfa1da ```
1 reply
0 recast
1 reaction

frolic pfp
frolic
@frolic
Awesome, getting closer! It would be great if this was reflected in the npm version and lockfile. So that it can be included as a dev dependency rather than installed globally.
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
Great! I just updated to 1.2.0. Now you can specify the foundry version in the `package.json` by adding the following: "config": { "foundry_version": "nightly" } and then `npm install` will install the given foundry version. After installing locally, you need to call forge by npx. Refer to README for details ;)
1 reply
0 recast
0 reaction

frolic pfp
frolic
@frolic
This will work for now, but what I really want (and the intent of the original bounty) is that the package would get published per nightly where the npm version corresponds to the nightly sha like you have here. “devDependencies”: { “foundry-up”: “nightly-2cf84d…” } Is that doable?
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
Unfortunately for now I don't think it is doable, as the version of any npm package needs to be semantic (https://docs.npmjs.com/about-semantic-versioning). Namely, if the package has a version of "nightly-2cf84d…", it cannot be published to npmjs.
1 reply
0 recast
0 reaction

frolic pfp
frolic
@frolic
Not exactly true. You can still tag npm versions with arbitrary data. See https://www.npmjs.com/package/@latticexyz/store?activeTab=versions where we publish a version per commit to main.
1 reply
0 recast
0 reaction

Soptq pfp
Soptq
@soptq
Thanks for letting me know! 🫡 I have made another package to achieve that: ``` npm install foundry-js@nightly-87bc53fc6c874bd4c92d97ed180b949e3a36d78c ``` will install the corresponding version of foundry. This package will be updated daily automatically.
1 reply
0 recast
1 reaction