Coder Social home page Coder Social logo

Publish `fuelup` to NPM about fuelup HOT 5 OPEN

fuellabs avatar fuellabs commented on September 26, 2024 1
Publish `fuelup` to NPM

from fuelup.

Comments (5)

AlicanC avatar AlicanC commented on September 26, 2024 2

@mitchmindtree "packaging each of these tools individually" was my thought when I opened https://github.com/FuelLabs/pm/issues/19.

@adlerjohn suggested we do this instead here: https://github.com/FuelLabs/pm/issues/19#issuecomment-1157069847

I'm ok with both and can't really decide.

(I've also set P: Low. This isn't a blocker or anything.)

from fuelup.

bingcicle avatar bingcicle commented on September 26, 2024

To understand this issue a bit better, what would be the usage like after publishing fuelup to npm? As far as I understood from reading the linked PRs above (and your last comment here, there are 2 needs to fulfill:

  1. JS projects need to be able to use forc and fuel-core and update them if necessary
  2. the CI needs to be able to use forc

In the case of 2, would https://github.com/FuelLabs/action-fuel-toolchain be useful here?

from fuelup.

AlicanC avatar AlicanC commented on September 26, 2024

This is what I imagine:

  • We go to a TS repo
  • We do npm add fuelup-bin which will install a specific version of fuelup locked by package-lock.json.
  • Now we can do npm exec fuelup, npm exec forc and npm exec fuel-core because these are all binaries of fuelup-bin.
  • At this point npm exec forc and npm exec fuel-core fails because we don't have them installed.
  • We create a version file like .forc-version that will lock the version of forc (which will also depend on a specific version of fuel-core so its version will be locked too).
  • Now we run npm exec fuelup install which sees our .forc-version and installs the correct versions to the correct places so npm exec forc and npm exec fuel-core works.
  • Lastly we add fuelup install to our postinstall script so when a new dev (or the CI) clones the repo and does an npm install everything required will be automatically installed.

from fuelup.

AlicanC avatar AlicanC commented on September 26, 2024

Emphasis on the "installs [to the] correct places" by the way. The meaning is that these should be local installs scoped to the project and not global installs. People shouldn't clone a fuelup-bin project and get their global installation messed up.

from fuelup.

mitchmindtree avatar mitchmindtree commented on September 26, 2024

@AlicanC I think there's a chance you might not actually want the fuelup bin itself here.

fuelup itself has a very narrow scope, which is providing an easy way to get going with the necessary set of tools required for fuel dev, including fuel-core, forc and a curated set of forc-plugins. fuelup can be thought of as a very minimal package manager that purely ships fuellabs tools and installs them at $HOME/.fuelup/bin, with some convenience commands for switching between different version sets. This is quite useful as it means there's always a way for users to get started with Fuel dev, even if a user's OS or language package manager doesn't provide any of the fuel packages yet.

If other package managers (e.g nix, brew, npm, basel, whatever) plan to ship or integrate fuel-core and forc, they are very likely better off packaging each of these tools individually in their own way, as doing so will likely involve placing packages in certain standard paths, fetching them during some standard fetching stage, locking them, etc - all of which fuelup does in its own way.

One thing other package managers might find useful is the version compatibility index that fuelup's CI will eventually manage at this repo (not yet implemented). E.g. other package managers might benefit from using this to select compatible fuel tool version sets, but will likely want to fetch/build/lock/cache those themselves rather than doing so indirectly via fuelup.

That said I've not much experience with npm itself - let me know if I'm missing the point here!

from fuelup.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.