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

@calcit/editor

Package Overview
Dependencies
Maintainers
0
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@calcit/editor

Structural Editor for Calcit Language

  • 0.9.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
90
increased by36.36%
Maintainers
0
Weekly downloads
 
Created
Source

Calcit Editor

Intuitive S-expressions editing for Calcit.

  • Auto Layout: expressions in blocks and inline-blocks, styled with CSS
  • Structural Editing: intuitive way of structural editing as nested expressions
  • Call Stack Navigation: more fine-grained functions navigation
  • Collaboration: changes real-time synced among multiple clients via WebSockets

One function/definition in a screen, Command d to open called function at next tab, Command j Command k Command i to switch. Screenshots from Chrome App:

Expression editor

Based on DOM/CSS, easy for another theme:

Styling

Command p to search and jump inspired by Sublime Text :

Search panel

Browse definitions in a dependency tree:

Definitions browser

Usages

npm CLI of @calcit/editor

Install CLI and start a local WebSocket server, it uses calcit.cirru as a snapshot file:

npm i -g @calcit/editor
ct

UI of the editor is a webapp on http://editor.calcit-lang.org/?port=6001

You may try with my project templates:

or even clone current repo for trying out.

Don't forget to check out keyboard shortcuts. My old introduction videos can be found on YouTube.

Options

CLI variables for compiling code directly from calcit.cirru:

op=compile ct

The web UI takes several query options:

http://editor.calcit-lang.org/?host=localhost&port=6001
  • port, defaults to 6001
  • host, defaults to localhost, connects via WebSocket

Code is emitted in compact.cirru by pressing Command s. Two extra files will be emitted:

  • compact.cirru contains a compact version of data tree of the program.
  • .compact-inc.cirru contains diff information from latest modification of per definition.

It would be used in calcit-runner.

When server is stopped with Control c, calcit.cirru is also updated.

There are also several options in :configs field in calcit.cirru:

  • port, defaults to 6001

Editor UI is decoupled with WebSocket server, so it's okay to connect remote server from multiple pages with all expressions synced in real-time.

file-transform operation

Special mode file-transform added for transforming compact.cirru back to calcit.cirru.

op=file-transform ct

Workflow

Previously it's https://github.com/Cirru/calcit-editor which is for ClojureScript. And this repo is for Calcit-js only.

License

MIT

FAQs

Package last updated on 07 Jan 2025

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