Giter Site home page Giter Site logo

runtools / run Goto Github PK

View Code? Open in Web Editor NEW
91.0 8.0 0.0 281.33 MB

⚡The resource runtime

Home Page: https://run.tools

License: MIT License

JavaScript 96.75% HTML 0.96% Shell 2.30%
tool-manager api cli terminal developer-tools command-line shell object-oriented rpc

run's Introduction

Run

Caution: This project has been abandoned and is no longer maintained.


This is Run's monorepo.

What is Run?

When we work on a project, we usually use several tools such as (in the case of a modern web project), a dependency manager, a transpiler, a bundler, etc. So we need a way to install, configure and compose all these tools. Unfortunately, our good old command line is not very good at this. The interface of the executables is not quite user-friendly, and since typical shells cannot handle several versions of the same tool, managing our development environment is painful when we have to deal with many projects.

Run solves these problems by introducing the concept of resource. A resource adds an object-oriented interface to the tools, making them easier to use both from the command line and, programmatically, from other tools. Using inheritance and composition, it is possible to define projects composed of several tools in an elegant way. Also, since Run installs tools automatically, we get development environments that are easily transportable and shareable.

Installation

To install (or update) Run on macOS or Linux (Windows support will come later), invoke the following command in the terminal:

curl https://install.run.tools | bash

Then, open a new terminal session to make the run command available.

Hello, World!

Let's get started by writing a simple "Hello, World!" resource. First, create a file named @resource.json with the following content:

{
  "hello": {
    "@type": "method",
    "@run": "@console print 'Hello, World!'"
  }
}

Then, invoke Run:

run .

You should see a description of the resource you just created. When you invoke Run without any commands, you get a handy help showing what the current resource is capable of. In the present case, there is only one thing exposed: the hello method. Let's invoke it:

run . hello

Voila! You wrote your first resource. 🎉

Documentation

The full documentation can be found here:

https://run.tools/docs

Contributing

Contributions are more than welcome. Before contributing please read the code of conduct & search the issue tracker; your issue may have already been discussed or fixed in master. To contribute, fork Run, commit your changes, & send a pull request.

License

MIT

run's People

Contributors

mvila 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

run's Issues

Bash resource for method implementations

This is fork 1 of 2 from #2. The goal is to provide a resource so that bash commands can be used to implement methods, such as this implementation for a compress method powered by gzip, implemented by calling out through the command line.

{
  "compress": {
    "@type": "method",
    "@input": {
      "source": {
        "@type": "string",
        "@position": 0
      },
      "destination": {
        "@type": "string",
        "@position": 1
      }
    },
    "@run": "(@import shell/bash) run 'gzip -c ${source} > ${destination}'"
  },
  "uncompress": {
  }
}

Plan of attack is that I will create a resource named robertfischer/bash for @mvila to be review, and we will move that into script/bash once it looks good.

Feature Request: Stack Resource and Haskell Runtime

I do most of my development in Haskell, which is a nontrivial environment to manage. I'm excited about the possibility of using Run resources to manage them, since the dominant alternative (the Nix package manager) gives me a sad.

There are two pieces that I think we would need for this: first, a resource for supporting stack builds; and second, a runtime resource that would execute a Haskell *.hs file (via stack runghc).

Two questions.

  1. Are you interested in this?
  2. Any tips on how to build this, what to name the resources, etc., etc.?

EXDEV: cross-device link not permitted (on Linux)

Hiya, just gave run a go, ran (no pun intended) into an issue on Linux:

❯ run @registry
{ Error: EXDEV: cross-device link not permitted, rename '/tmp/8d44d3f1dc023f4de9ac635acc6eeb55' -> '/home/markus/.run/resdir-registry/resource-cache/resdir/registry-client/versions/0.1.27'
    at Error (native)
    at fs.renameSync (fs.js:811:18)
    at /Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:222:7
    at next (native)
    at step (/usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:221)
    at _next (/usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:409)
    at /usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:477
    at /usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:97
    at ResourceFetcher._saveCachedResourceVersion (/Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:213:89)
    at /Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:90:23
  errno: -18,
  code: 'EXDEV',
  syscall: 'rename',
  path: '/tmp/8d44d3f1dc023f4de9ac635acc6eeb55',
  dest: '/home/markus/.run/resdir-registry/resource-cache/resdir/registry-client/versions/0.1.27',
  contextStack: 
   [ Resource {
       '$defaultAutoBoxing': false,
       '$defaultAutoUnboxing': false,
       '_$bases': [],
       '_$children': [],
       '_$currentDirectory': '/home/markus',
       '_$isInitializing': false,
       '_$listeners': {},
       '_$hasBeenInitialized': true } ] }

I don't really know much node, so maybe this is a known issue and my partition setup is at fault. But figured it can't hurt to log it...

Bash Runtime Resource

This is fork 2 of 2 from #2.

Quoting @mvila. The goal is to create...

a "resource runtime" allowing to implement resource methods in Bash.

For example:

{
  "@runtime": "bash",
  "@implementation": "./main.sh",
  "compress": {
    "@type": "method",
    "@input": {
      "source": {
        "@type": "string",
        "@position": 0
      },
      "destination": {
        "@type": "string",
        "@position": 1
      }
    }
  },
  "uncompress": {
  }
}

Then, the implementation would be a bash script:

#!/bin/bash

compress ()
{
  gzip -c $1 > $2
}

uncompress ()
{
  # ...
}

A runtime for resources implemented in Bash is complicated,
and I am not sure that Bash can handle the whole resource specs.

Feature request: bash runtime

I like the idea of machine readable interoperability, but for legacy reasons I think there should be a bash runtime so that, for instance, a 'bzip' resource could be created to wrap the bzip command line. If you feel like a challenge, try building a 'javac' or 'gcc' resource.

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.