scittlets

0.9.0 • Public • Published

Catalog cli

[!NOTE] This project is in β. Features and APIs are subject to change.

Scittle brings the Small Clojure Interpreter to the browser, allowing you to run ClojureScript using simple <script> tags.

Scittlets (short for Scittle applets) is a catalog of ready-made components and starter templates for building Scittle apps, covering charting, editing, UI, and developer tools.

Overview

A scittlet is a ready to use ClojureScript component designed for adding functionality to Scittle apps, with its JavaScript dependencies that can be loaded in any Scittle HTML file.

Each component includes examples and instructions for loading from CDN into your Scittle apps.

A CLI tool helps add and manage components, create projects from templates, and pack apps.

This repository offers the scaffolding needed to develop, test, showcase, and publish scittlets, served via jsDelivr from this GitHub repository.

👉 Visit the Scittlets website to browse components with live demos, copy installation commands, and explore starter templates.

Getting Started

New to Scittle? Create a starter app from a template with the CLI:

npx scittlets new

Add components to your Scittle app:

  1. Using the CLI: Manage components automatically with the Scittlets CLI (see below)
  2. Manual setup: Browse components on the Scittlets Catalog and copy script tags into your HTML file

Each component includes live demos and copy-paste code examples.

CLI: scittlets

The scittlets CLI helps you create, manage, and pack Scittle apps and components.

Install globally with npm (requires Node.js and npm): npm install -g scittlets

Run commands with:

npx scittlets <command> [options]

Commands

  • new [template] [output-dir]

    Create a new app from the specified TEMPLATE to OUTPUT-DIR. If no template is provided, lists available templates.

  • add <html> [scittlets..] [--list-scittlets]

    Add SCITTLETS dependencies to the target HTML file, or list them if none are provided.

    Use --list-scittlets (or -l) to list available scittlets from the catalog.

  • update <html> [scittlets..]

    Update all scittlet dependencies in the HTML file at PATH using the latest catalog, or only those SCITTLETS if specified.

  • pack <html> [target]

    Pack the HTML file by inlining <script src=""> elements directly into the file.

    Saves the output to target (default: packed.html).

  • catalog [--release version]

    List all scittlets and templates in the catalog for the specified catalog release VERSION (default: latest).

  • releases

    List all published release versions of the scittlets catalog.

Example usage

List available templates:

npx scittlets new

Create a new app with a specific template:

npx scittlets new reagent/codemirror

Add scittlet dependencies to HTML file:

npx scittlets add ./index.html scittlets.reagent.codemirror

List catalog release versions:

npx scittlets releases

List scittlets and templates for the latest release version:

npx scittlets catalog

Update all scittlets dependencies in an HTML file to their latest versions:

npx scittlets update ./index.html

Pack an HTML file and specify output filename:

npx scittlets pack ./index.html output.html

Contributing & Development

First, clone the repository:

git clone https://github.com/ikappaki/scittlets.git
cd scittlets

Install dev dependencies:

$ npm install

Run the excellent cljs-josh live-reloading Scittle server:

$ npx josh
Serving ./ on port 8000:
- http://192.168.1.100:8000
- http://127.0.0.1:8000
SSE connection established

Scittlets are listed in catalog.json, the metadata registry.

Example Scittlet: scittlet.reagent.mermaid

Use this scittlet as a starting point for development:

License

Licensed under the Eclipse Public License 1.0, same as Scittle. See LICENSE for details.

Readme

Keywords

Package Sidebar

Install

npm i scittlets

Weekly Downloads

30

Version

0.9.0

License

EPL-1.0

Unpacked Size

128 kB

Total Files

5

Last publish

Collaborators

  • ikappaki