Git Product home page Git Product logo

mops's People

Contributors

peterpeterparker avatar rvanasa avatar tomijaga avatar zenvoich 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

Watchers

 avatar  avatar

mops's Issues

Add documentation for using GitHub and Vessel packages

I've recently been directing Vessel users towards MOPS, and it appears that a lot of people are under the impression that MOPS only supports the on-chain registry (and not GitHub / Vessel packages).

A quick example of installing a GitHub package in the setup instructions on mops.one would probably make a big difference, especially for all the new developers who are currently in Motoko Bootcamp.

Thanks again for your work on this package manager!

Context: dfinity/vessel#66 (comment)

Error

I created a project for the tests. Mistake
"Installing: No such file or directory"
I,m using vesssel-dhall. There are no problems in it
Are there any plans to send the fuzz library to vessel-dhall?

[Bug] Missing 'stream' package

After installing via npm i -g ic-mops, all mops commands fail due to:

    internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'stream' imported from /usr/local/lib/node_modules/ic-mops/vessel.js
    at new NodeError (internal/errors.js:322:7)
    at packageResolve (internal/modules/esm/resolve.js:732:9)
    at moduleResolve (internal/modules/esm/resolve.js:773:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:887:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:76:40)
    at link (internal/modules/esm/module_job.js:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node version: 14.20
NPM version: 9.2.0
Mops version: 0.2.1

Github lib support and vessel support

Hey @ZenVoich,

I've started working on integration for GitHub and vessel.

I want to use this issue to discuss the design of this new feature and track my progress.

Additions:

  • Import a GitHub library and save its info in the mops.toml file
  • Parses the vessel.dhall and package-set.dhall files in GitHub dependencies
  • Installs nested GitHub dependencies
  • Init - Create mops.toml from vessel.dhall if it exists in the root dir
  • Add all GitHub dependencies paths to the mops sources command
  • Modify the backend to store a GitHub dependency's repo info
  • Uninstall Github dependency
  • Updates the console with the progress bar for each installation

Design Choices:

Saving Github dependency info

Packages installed from GitHub by the mops cli are stored like this:

    [name] = "[url]#[version or branch]"
    Itertools = "https://github.com/NatLabs/Itertools.mo#v0.1.0"`
    Itertools = "https://github.com/NatLabs/Itertools.mo#main"

If no branch/version is specified, the branch defaults to master

Installing GitHub dependencies

I've updated the install command to install a dependency from GitHub if it starts with https://github.com or contains a forward slash, for instance, NatLabs/Itertools.mo

The user might also want to specify the branch/version of the lib.
What do you think about adding a new parameter that accepts the lib's version?

    mops import NatLabs/Itertools.mo v0.1.0
    mops import https://github.com/NatLabs/Itertools.mo main

Or would it be better to concatenate the version with the repo's URL?

    mops import NatLabs/Itertools.mo#v0.1.0
    mops import https://github.com/NatLabs/Itertools.mo#main

Internal representation of Github Dependencies

The current Motoko representation is

    public type Dependency = {
        name: PackageName; // max 50
        version: Text; // max 20
    };

I want to change it to

    public type Dependency = {
        name: PackageName; // max 50
        repo: Text; // max unknown
        version: Text; // max 20
    };

Store File Blobs in Stable Memory

Hi @ZenVoich,

I noticed that the uploaded files are currently being stored as an array of blobs in heap memory. I would like to propose a change that would store these files in stable memory once they have finished uploading, in order to take advantage of the extra 32 GB of space in stable memory.

The proposed design is as follows:

  • After the file chunks are successfully uploaded to the canister, we would take the chunks from activeUploadsChunks and store them contiguously in stable memory using the ExperimentalStableMemory module.
  • The location of the stored data would then be stored as a File type in a new TrieMap<FileId, File> called files.
type File = {
    offset: Nat64;
    size: Nat:
}

I believe that this change would help us make better use of the available stable memory and improve the overall performance of the system. Let me know what you think!

[Question] Long term plans/goals

I am a IC dev and am looking to help get Motoko to get to maturity faster
One of those factors is not only building the Motoko libraries but the accessibility/discovery of them

What's the general long term strategy of the MOPS project?
Currently I see vessel and mops but vessel seems to be the 'default' but is essentially just a wrapper around github projects and hard coded project ids.
I am curious if you have thought about vessel as a competitor or rather a different client that can share repositories and work together?

Do you have any plans on developer adoption or is this just in the building phases right now.

I personally have only used vessel so im not sure what the MOPS experience is like right now

Alternate base seems to break something

I tried to add an alternate base as @di-wu does in https://github.com/aviate-labs/json.mo and I get an odd error on mops install

[dependencies]
base = "https://github.com/dfinity/motoko-base#494824a2787aee24ab4a5888aa519deb05ecfd60"
xtendedNumbers = "https://github.com/edjcase/motoko_numbers#v1.0.0"
base-0.7.3 = "https://github.com/dfinity/motoko-base#3a20693fc597b96a8c7cf8645fda7a3534d13e5fbda28c00d01f0b7641efe494"

[package]
name = "candid"
version = "0.1.0"
description = "A Candid library for encoding and decoding candid bytes"
repository = "https://github.com/edjcase/motoko_candid"
mops install
file:///opt/homebrew/lib/node_modules/ic-mops/mops.js:130
                if (data.startsWith('https://github.com/')){
                         ^

TypeError: data.startsWith is not a function
    at file:///opt/homebrew/lib/node_modules/ic-mops/mops.js:130:12
    at Array.forEach (<anonymous>)
    at readConfig (file:///opt/homebrew/lib/node_modules/ic-mops/mops.js:129:23)
    at Command.<anonymous> (file:///opt/homebrew/lib/node_modules/ic-mops/cli.js:43:13)
    at Command.listener [as _actionHandler] (/opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:482:17)
    at /opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:1264:65
    at Command._chainOrCall (/opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:1158:12)
    at Command._parseCommand (/opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:1264:27)
    at /opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:1062:27
    at Command._chainOrCall (/opt/homebrew/lib/node_modules/ic-mops/node_modules/commander/lib/command.js:1158:12)

MOPS test library dependent on dfx?

Just wondering if DFX is actually needed for running MOPS tests. Im trying to use it in my github actions and I get this error. Its fine if it is needed, just wanted to make sure

Run make test
mops test
Test files:
• test/Parser.test.mo
• test/Tokenizer.test.mo
--------------------------------------------------
/bin/sh: 1: dfx: not found
node:internal/errors:857
  const err = new Error(message);
              ^

Error: Command failed: dfx cache show
/bin/sh: 1: dfx: not found

    at checkExecSyncError (node:child_process:861:11)
    at execSync (node:child_process:932:15)
    at runAll (file:///opt/hostedtoolcache/node/16.19.1/x6[4](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:5)/lib/node_modules/ic-mops/commands/test.js:82:14)
    at async test (file:///opt/hostedtoolcache/node/16.19.1/x64/lib/node_modules/ic-mops/commands/test.js:4[5](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:6):1[6](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:7))
    at async Command.<anonymous> (file:///opt/hostedtoolcache/node/16.19.1/x64/lib/node_modules/ic-mops/cli.js:162:3) {
  status: 12[7](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:8),
  signal: null,
  output: [
    null,
    Buffer(0) [Uint[8](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:9)Array] [],
    Buffer(27) [Uint8Array] [
       47,  [9](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:10)8, [10](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:11)5, [11](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:12)0,  47, 115, 104,
       58,  32,  49,  58,  32, 100, 102,
      [12](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:13)0,  58,  32, 110, 111, 116,  32,
      102, 111, 117, 110, 100,  10
    ]
  ],
  pid: 1754,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(27) [Uint8Array] [
     47,  98, 105, 110,  47, 1[15](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:16), 104,
     58,  32,  49,  58,  32, 100, 102,
    120,  58,  32, 110, 111, 1[16](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:17),  32,
    102, 111, 1[17](https://github.com/edjCase/motoko_xml/actions/runs/4311036418/jobs/7520039853#step:6:18), 110, 100,  10
  ]
}
make: *** [Makefile:6: test] Error 1
Error: Process completed with exit code 2.

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.