GithubHelp home page GithubHelp logo

software-mansion / scarb Goto Github PK

View Code? Open in Web Editor NEW
168.0 8.0 43.0 3.92 MB

The Cairo package manager

Home Page: http://docs.swmansion.com/scarb/

License: MIT License

Rust 96.38% Shell 0.99% CSS 0.24% JavaScript 0.97% Vue 1.42%
package-manager starknet scarb cairo

scarb's Introduction

Scarb

Scarb is the project management tool for the Cairo language. Scarb manages your dependencies, compiles your projects and works as an extensible platform assisting in development.

Documentation

All information about Scarb is available on project's website.

Changelog

All notable changes to this project are documented on the GitHub releases page.

Roadmap

Scarb is under active development! Expect a lot of new features to appear soon! ๐Ÿ”ฅ

  • Building Cairo packages
  • Pulling dependencies from local filesystem
  • Pulling dependencies from Git
  • Machine-readable workspace metadata generation
  • Built-in Cairo compiler plugins as packages (the starknet package)
  • Feature parity with Cairo compiler CLIs
  • Scarb installer
  • ASDF plugin
  • GitHub action
  • Workspaces
  • Nightlies
  • Scarb.lock
  • scarb update
  • scarb check
  • Standardized test target ๐Ÿ—๏ธ
  • Package registry ๐Ÿ—๏ธ
  • PubGrub implementation for version resolution
  • Dynamic loading of custom Cairo compiler plugins as Scarb packages ๐Ÿ—๏ธ
  • Dynamic loading of custom targets aka code generators
  • Dependency overrides
  • Signing & notarization of Windows & macOS binaries
  • scarb doc

Credits

This product includes modified portions of code of Cargo, developed by the Rust project contributors.

This product includes modified portions of code of hex_solver, developed by Six Colors AB.

scarb's People

Contributors

0xkubitus avatar 4rgorok avatar abulenok avatar ametel01 avatar arcticae avatar cptartur avatar dependabot[bot] avatar draggu avatar drknzz avatar eikix avatar fmkra avatar fracek avatar gianfrancobazzani avatar glihm avatar kariy avatar maciektr avatar martriay avatar mkaput avatar mrdenkov avatar neotheprogramist avatar piotmag769 avatar shramee avatar szymmis avatar tarrencev avatar tkumor3 avatar tomek0123456789 avatar tserg avatar utilitycoder avatar war-in avatar xiaolou86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scarb's Issues

Canonicalize Git URLs in scarb add

We have a logic for canonicalization of Git URLs, primarily for GitHub. It's done by CanonicalUrl struct.

scarb add currently pastes Git URL to the manifest verbatim. In order to encourage consistent style of everything, I think it'd be nice to canonicalize these URLs that users are passing.

Support silencing Ui with clap verbosity quiet

Problem

The main cli arguments

let args: Args = Args::parse();
accept verbosity flag
pub verbose: clap_verbosity_flag::Verbosity,
as defined by clap-verbosity-flag package. The flag is currently used for filtering tracing info.
I suggest silencing the Ui interface
impl Ui {
when the verbosity flag is set to silence (is_silent).

Proposed Solution

No response

Notes

No response

Targets source isolation

Currently, if a package has multiple targets, all of them are in parallel compiled over the same source root. This is different from what Cargo does, and it comes from the difference in models of compilation units between Rust (each crate into separate unit and then linked) and Cairo (all crates creating a target go into single unit) worlds.

There are several disadvantages with this model though, and we might want to mimic Cargo's behaviour:

  1. It's basically impossible to mix target kinds, because often they employ dedicated compiler plugins, specific modules and so. For example, it is not possible to write a [lib] which also has a [[target.starknet-contract]].
  2. It may be impossible to isolate target-specific modules from general purpose library-ones. Leading to enforcing bad practices.

There are problems though:

  1. Isolating targets would require creating distinct project configs, which is unknown how it will behave.
  2. How should the directory layout look like? Rust-style (see how [[bin]] targets are laid out) have ambiguity with declaring submodules via mod x syntax.

Allow providing custom `core` version

  1. Stabilize no-core field in the manifest, i.e. document it properly.
  2. If the main package of a compilation unit has no-core = true, then make sure the compilation unit has no implicit core package in its components, and instead require the main package to provide custom core dependency.

Targets mechanism

Provide a pluggable mechanism for specifying package targets:

Builtin:

  • lib with a flag to allow outputting sierra and/or casm

Plug-in (but may be temporarily built-in as a hack):

  • starknet-contract
  • test

This should be similar to Cargo's targets, but some deviations are expected down the line.

Initialize Git repository in scarb new/init

Problem

scarb new and scarb init currently create .gitignore file, but it would be also nice to let it automatically call git init for the user.

Proposed Solution

Add new function init_vcs in new ops file and run it just before write_vcs_ignore. This should be on-by-default behaviour, with opt out via --no-vcs CLI flag.

Notes

We do not want to bother yet with non-Git VCS systems, like Cargo for example is. Nobody uses anything else than Git in Cairo ecosystem as far as I am aware.

User interface

  1. Implement user interface abstraction.
  2. Use it for communicating downloads and builds etc.
  3. Use console and indicatif libraries

Verify releases in CI

  1. Build artifacts and upload to release from single job.
  2. Add a set of jobs which run scarb --version on as most diverse platforms as possible.

Implement proper support for workspaces

Allow virtual manifest files which have a [workspace] table. Allow Workspace structure to really contain multiple members. Functionally this should work similar to Cargo, but implementation-wise I think this can be done in a more clean way by perhaps defining separate struct for virtual manifest.

Scarb deps don't work when using Cairo test runner

Problem

Cairo test runner doesn't know how to pull in Scarb dependencies (building does work)

Steps

  1. Repo reproduction is here: auditless/cairo-template#9.
  2. Just need to uncomment the commented bits in Scarb config/code/tests if you want to run it).

Possible Solution(s)

Wait for Protostar?

Notes

No response

Version

scarb 0.1.0-alpha.2 (d5553ded6 2023-02-22)
cairo: 1.0.0-alpha.3

Implement `fmt` command

Take a look for cargo fmt for CLI interface.

Keep mind to use exactly same version spec for formatter crate as we use for the compiler one! Rust happily compiles multiple versions of a single library into a single target.

Plugin dependencies fundamentals

Allow packages to depend on Cairo compiler plugins, and use this to allow [lib] packages use Starknet plugin. Only Scarb-crate-level APIs to register custom plugins as for now.

Add scarb rm command

Like cargo rm for Scarb.

  • Add RemoveDependency Op, just like Add one is done in manifest_editor
  • Add rm command
  • Try to preserve Cargo's behaviour as much as possible

Support namespaced package names

[dependencies]
"org/package" = "1.0.0"

On both cases, only package word as package name should be fed to the compiler. The org part is purely for registry purposes and the resolver will reject the following manifest with duplicated package conflict error:

[dependencies]
"argent/account" = "1.0.0"
"openzeppelin/account" = "6.0.0"

Reason: Support publishing forks to the registry. Suppose package company/X has a critical bug, but the maintainer is not responsive. Community can create a fix, push it to a fork and publish this it as community/X. Users will only have to change their manifests, instead of having to also rename all references to X in their codebases.

Note: I would rather avoid Javaesque/Apple domain-styled organization names (i.e. prefer starkware instead of co.starkware etc.) and in order to enforce this I plan to ban names like x.y.z

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.