Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ligolang/compact-ligo-ide

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ligolang/compact-ligo-ide

A React component for embedding Ligo code snippets on a page.

  • 2.0.4
  • npm
  • Socket score

Version published
Weekly downloads
15
Maintainers
1
Weekly downloads
 
Created
Source

A React component for embedding Ligo code snippets on a page.

Quick start

  1. Install package yarn add @ligolang/compact-ligo-ide
  2. Add CompactLigoIde component to a page
import { Code, CompactLigoIde, Result } from "@ligolang/compact-ligo-ide";

<CompactLigoIde language="cameligo">
  <Code>
    {`type storage = int

(* variant defining pseudo multi-entrypoint actions *)

type action =
| Increment of int
| Decrement of int

let add (a,b: int * int) : int = a + b
let sub (a,b: int * int) : int = a - b

(* real entrypoint that re-routes the flow based on the action provided *)

let main (p,s: action * storage) =
 let storage =
   match p with
   | Increment n -> add (s, n)
   | Decrement n -> sub (s, n)
 in ([] : operation list), storage
 `}
  </Code>
  <Compile>
    <Entrypoint>main</Entrypoint>
  </Compile>
  <DryRun>
    <Entrypoint>main</Entrypoint>
    <Parameter>Increment 1</Parameter>
    <Storage>0</Storage>
  </DryRun>
  <Deploy>
    <Entrypoint>main</Entrypoint>
    <Storage>0</Storage>
  </Deploy>
</CompactLigoIde>;
  1. Apply styling
<style type="text/css">
    .compactLigoIde {
        height: 600px;
        width: 600px;
    }
</style>

Available configuration elements

  • <Code>
  • <Compile>
  • <DryRun>
  • <Deploy>
  • <EvaluateFunction>
  • <EvaluateValue>
  • <Entrypoint>
  • <Parameter>
  • <Storage>

Contribute

Starting dev server

  1. Install dependencies with yarn install
  2. Run yarn start
  3. Open http://localhost:1234 in a browser

Build package

Run yarn build.

Publish package

Run npm publish --access=public.

FAQs

Package last updated on 31 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc