GithubHelp home page GithubHelp logo

dfinity / vessel-package-set Goto Github PK

View Code? Open in Web Editor NEW
17.0 10.0 17.0 178 KB

The official community package-set for vessel

Home Page: https://dfinity.github.io/vessel-package-set/

License: Apache License 2.0

Dhall 60.97% Makefile 2.72% JavaScript 4.70% Handlebars 31.62%

vessel-package-set's Introduction

Vessel Package Set ยท GitHub license CI PRs Welcome

The official community package-set for Motoko libraries to use with vessel.

What is a package set?

A package set is a collection of packages in which there is only one specified version for each package in the set.

This means that when you want to install a package:

  • it must be in the package set
  • its dependencies and all the transitive dependencies must be in the package set

Add your package

This repository aims to be a good collection of packages you can depend on. In general we welcome all packages, provided that they follow some guidelines defined in the contributing guide.

The linked document also contains instructions on how to add new packages to the set, and information on versioning and related policies.

How do I use this with vessel?

You should point the package-set.dhall file in your project at a tagged release of this repository. For example:

let upstream =
  https://github.com/dfinity/vessel-package-set/releases/download/mo-0.7.5-20230118/package-set.dhall
in upstream

Attribution

Much of this machinery and documentation is adapted from https://github.com/purescript/package-sets.

vessel-package-set's People

Contributors

chenyan2002 avatar crusso avatar dependabot[bot] avatar feliciss avatar flyq avatar jzxchiang1 avatar kritzcreek avatar matthewhammer avatar neokree avatar nomeata avatar rvanasa avatar

Stargazers

 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  avatar  avatar

vessel-package-set's Issues

Field Types does not exist in type

When I use vessel to build a project, something error:

$ sudo dfx build
Building canisters...
The build step failed for canister 'rwlgt-iiaaa-aaaaa-aaaaa-cai' with an embedded error: The command '"/Users/flyq/.cache/dfinity/versions/0.7.2/moc" "/Users/flyq/workspace/github/q/ic-course/tool/src/tool/main.mo" "-o" "/Users/flyq/workspace/github/q/ic-course/tool/.dfx/local/canisters/tool/tool.did" "--idl" "--actor-idl" "/Users/flyq/workspace/github/q/ic-course/tool/.dfx/local/canisters/idl/" "--actor-alias" "tool" "rwlgt-iiaaa-aaaaa-aaaaa-cai" "--package" "base" ".vessel/base/927119e172964f4038ebc7018f9cc1b688544bfa/src" "--package" "matchers" ".vessel/matchers/v1.1.0/src" "--package" "sha224" ".vessel/sha224/v0.1.0/src"' failed with exit status 'exit code: 1'.
Stdout:

Stderr:
.vessel/base/927119e172964f4038ebc7018f9cc1b688544bfa/src/Char.mo:6.27-6.32: type error [M0028], field Types does not exist in type
  module {
    type ErrorCode =
      {
        #canister_error;
        #canister_reject;
        #destination_invalid;
        #future : Nat32;
        #system_fatal;
        #system_transient
      };
    Array_init : <T>(Nat, T) -> [var T];
    Array_tabulate : <T>(Nat, Nat -> T) -> [T];
    abs : Int -> Nat;
    arccos : Float -> Float;
    arcsin : Float -> Float;
    arctan : Float -> Float;
    arctan2 : (Float, Float) -> Float;
    arrayMutToBlob : [var Nat8] -> Blob;
    arrayToBlob : [Nat8] -> Blob;
    blobOfPrincipal : Principal -> Blob;
    blobToArray : Blob -> [Nat8];
    blobToArrayMut : Blob -> [var Nat8];
    btstInt16 : (Int16, Int16) -> Bool;
    btstInt32 : (Int32, Int32) -> Bool;
    btstInt64 : (Int64, Int64) -> Bool;
    btstInt8 : (Int8, Int8) -> Bool;
    btstNat16 : (Nat16, Nat16) -> Bool;
    btstNat32 : (Nat32, Nat32) -> Bool;
    btstNat64 : (Nat64, Nat64) -> Bool;
    btstNat8 : (Nat8, Nat8) -> Bool;
    charIsAlphabetic : Char -> Bool;
    charIsLowercase : Char -> Bool;
    charIsUppercase : Char -> Bool;
    charIsWhitespace : Char -> Bool;
    charToLower : Char -> Char;
    charToNat32 : Char -> Nat32;
    charToText : Char -> Text;
    charToUpper : Char -> Char;
    clzInt16 : Int16 -> Int16;
    clzInt32 : Int32 -> Int32;
    clzInt64 : Int64 -> Int64;
    clzInt8 : Int8 -> Int8;
    clzNat16 : Nat16 -> Nat16;
    clzNat32 : Nat32 -> Nat32;
    clzNat64 : Nat64 -> Nat64;
    clzNat8 : Nat8 -> Nat8;
    cos : Float -> Float;
    createActor : (Blob, Blob) -> async Principal;
    ctzInt16 : Int16 -> Int16;
    ctzInt32 : Int32 -> Int32;
    ctzInt64 : Int64 -> Int64;
    ctzInt8 : Int8 -> Int8;
    ctzNat16 : Nat16 -> Nat16;
    ctzNat32 : Nat32 -> Nat32;
    ctzNat64 : Nat64 -> Nat64;
    ctzNat8 : Nat8 -> Nat8;
    cyclesAccept : Nat64 -> Nat64;
    cyclesAdd : Nat64 -> ();
    cyclesAvailable : () -> Nat64;
    cyclesBalance : () -> Nat64;
    cyclesRefunded : () -> Nat64;
    debugPrint : Text -> ();
    debugPrintChar : Char -> ();
    debugPrintInt : Int -> ();
    debugPrintNat : Nat -> ();
    decodeUtf8 : Blob -> ?Text;
    encodeUtf8 : Text -> Blob;
    error : Text -> Error;
    errorCode : Error -> ErrorCode;
    errorMessage : Error -> Text;
    exp : Float -> Float;
    floatAbs : Float -> Float;
    floatCeil : Float -> Float;
    floatCopySign : (Float, Float) -> Float;
    floatFloor : Float -> Float;
    floatMax : (Float, Float) -> Float;
    floatMin : (Float, Float) -> Float;
    floatNearest : Float -> Float;
    floatSqrt : Float -> Float;
    floatToFormattedText : (Float, Nat8, Nat8) -> Text;
    floatToInt64 : Float -> Int64;
    floatToText : Float -> Text;
    floatTrunc : Float -> Float;
    getCertificate : () -> ?Blob;
    hashBlob : Blob -> Nat32;
    idlHash : Text -> Nat32;
    int16ToInt : Int16 -> Int;
    int16ToNat16 : Int16 -> Nat16;
    int32ToInt : Int32 -> Int;
    int32ToNat32 : Int32 -> Nat32;
    int64ToFloat : Int64 -> Float;
    int64ToInt : Int64 -> Int;
    int64ToNat64 : Int64 -> Nat64;
    int8ToInt : Int8 -> Int;
    int8ToNat8 : Int8 -> Nat8;
    intToInt16 : Int -> Int16;
    intToInt16Wrap : Int -> Int16;
    intToInt32 : Int -> Int32;
    intToInt32Wrap : Int -> Int32;
    intToInt64 : Int -> Int64;
    intToInt64Wrap : Int -> Int64;
    intToInt8 : Int -> Int8;
    intToInt8Wrap : Int -> Int8;
    intToNat16Wrap : Int -> Nat16;
    intToNat32Wrap : Int -> Nat32;
    intToNat64Wrap : Int -> Nat64;
    intToNat8Wrap : Int -> Nat8;
    log : Float -> Float;
    nat16ToInt16 : Nat16 -> Int16;
    nat16ToNat : Nat16 -> Nat;
    nat32ToChar : Nat32 -> Char;
    nat32ToInt32 : Nat32 -> Int32;
    nat32ToNat : Nat32 -> Nat;
    nat64ToInt64 : Nat64 -> Int64;
    nat64ToNat : Nat64 -> Nat;
    nat8ToInt8 : Nat8 -> Int8;
    nat8ToNat : Nat8 -> Nat;
    natToNat16 : Nat -> Nat16;
    natToNat32 : Nat -> Nat32;
    natToNat64 : Nat -> Nat64;
    natToNat8 : Nat -> Nat8;
    popcntInt16 : Int16 -> Int16;
    popcntInt32 : Int32 -> Int32;
    popcntInt64 : Int64 -> Int64;
    popcntInt8 : Int8 -> Int8;
    popcntNat16 : Nat16 -> Nat16;
    popcntNat32 : Nat32 -> Nat32;
    popcntNat64 : Nat64 -> Nat64;
    popcntNat8 : Nat8 -> Nat8;
    principalOfActor : (actor {}) -> Principal;
    rts_callback_table_count : () -> Nat;
    rts_callback_table_size : () -> Nat;
    rts_heap_size : () -> Nat;
    rts_max_live_size : () -> Nat;
    rts_memory_size : () -> Nat;
    rts_reclaimed : () -> Nat;
    rts_total_allocation : () -> Nat;
    rts_version : () -> Text;
    setCertifiedData : Blob -> ();
    sin : Float -> Float;
    tan : Float -> Float;
    time : () -> Nat64
  }

env

dfx 0.7.2
vessel 0.6.2
moc is used under ~/.cache/dfinity/versions/0.7.2/

when I build without vessle, (delete the vessel source in dfx.json), everything is ok.
the problems is that there is no public type Blob = Prim.Types.Blob; the base library in ~/.cache/dfinity/versions/0.7.2/ . but the base library in .vessel//base/src/ has.

Identify most valuable packages for Vessel

Maybe:

  • Text Parsing
  • String Interpolation / Templating
  • Regex
  • SHA256
  • HTTP Requests / Responses
  • Base64, Hex, Principals Encoding/Decoding
  • Date/Time, esp. local time (everything is UTC)
  • Randomness
  • Iterators/Sequences (currently very wasteful)
  • Testing frameworks
  • Merkelization / Certified Variables
  • Wallet: Math comparisons, string formatting, BTrees, sorting

problem on WSl2

when I use dfx build --check
it happens

Building canisters to check they build ok. Canister IDs might be hard coded.
Building canisters...
The build step failed for canister 'cs7ap-qc5fi-rjs6g-k5hmq' with an embedded error: The command '"vessel" "sources"' failed with exit status 'exit status: 101'.
Stdout:

Stderr:
thread 'main' panicked at 'called Result::unwrap() on an Err value: reqwest::Error { kind: Request, url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("github.com")), port: None, path: "/dfinity/vessel-package-set/releases/download/mo-0.6.18-20220107/package-set.dhall", query: None, fragment: None }, source: TimedOut }', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/dhall-0.10.1/src/semantics/resolve/resolve.rs:295:36
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Force packages to use git commit hash as versions instead of tag/release versions

For such a widely used package-set such as this, since 3rd-party packages are accepted into this package-set repo it's more consistent and safe for the package versions to be based off of commit hashes instead of versions.

For example, instead of using a tag for the version like done here - https://github.com/dfinity/vessel-package-set/blob/6860864543ce275650eed1f58f3b836cc56dbab2/index/easy-random.dhall

Use a commit hash for the version, like done here - https://github.com/dfinity/vessel-package-set/blob/6860864543ce275650eed1f58f3b836cc56dbab2/index/base.dhall

If the version is based off of a tag or a branch - the 3rd party developer can very easily change the underlying code and re-tag the new commit. Maybe the underlying code was changed in a backwards incompatible manner, or maybe it will have some unintended/malicious side effect?

Plans to release a new vessel-package-set?

There have been some great additions/improvements/fixes to base and other libraries since the last release (Feb 2022).

It would be great if this package set (that many projects use by default) could be tagged and released in tandem with moc 0.6.xx updates, or at least on a more regular basis ๐Ÿ™‚ .

@crusso @chenyan-dfinity

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.