npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-cljs-plugin

v0.2.2

Published

A Serverless plugin for deploying Clojurescript functions

Downloads

141

Readme

serverless-cljs-plugin

npm version

A Serverless plugin which uses lein/cljs-lambda (or, optionally Lumo) to package services written in Clojurescript.

JVM Template

$ lein new serverless-cljs example
example$ lein deps

Will generate an example directory containing a minimal serverless.yml and project.clj demonstrating this plugin's functionality.

Guide to using the plugin on the JVM.

Usage

functions:
  echo:
    cljs: example.core/echo

plugins:
 - serverless-cljs-plugin

With the above serverless.yml, serverless deploy will create a zip file containing your functions. Doing this is similar to setting the Serverless packaging.artifact option - cljs-lambda is responsible for the zip contents, and Serverless includes/excludes will be skipped (cljs-lambda offers equivalent functionality).

In the example above, there needn't be a corresponding entry for echo in project.clj.

Lumo

Alternatively you can use the Lumo compiler.

In order to enable it, pass the --lumo switch to either deploy or package:

$ serverless deploy --lumo

Or add the following to your serverless.yml:

custom:
  cljsCompiler: lumo
  • Compiler options

    The source paths and compiler options will be read from the optional file serverless-lumo.edn. Below are the defaults:

    {:source-paths ["src"]
     :compiler     {:output-to     "out/lambda.js"
                    :output-dir    "out"
                    :source-map    false ;; because of a bug in lumo <= 1.8.0
                    :target        :nodejs
                    :optimizations :none}}
  • Lumo Configuration

    As an alternative to cljsCompiler: lumo, cljsCompiler.lumo may be specified as a map of options. These options are passed directly to the lumo process. Currently supported:

    custom:
      cljsCompiler:
        lumo:
          dependencies:
            - andare:0.7.0
          classpath:
            - /tmp/
          localRepo: /xyz
          cache: /cache | none
          index: true | false
          exitOnWarning: true | false

    Note: caching is always on unless you specify "none" in the config.

  • The index.js file

    The index option will materialize a custom index.js in :output-dir's parent folder. This file should be thought as managed by serverless-cljs-plugin and it is necessary for some plugin (e.g.: serverless-offline) to work properly.

    Note: with the default compiler options, index.js will be saved in the project root, overwriting without warning.

  • Exit on compilation warnings

    Lumo generates warnings such as WARNING: Use of undeclared Var to signal failures. You can tune the ones you want to see by using the :warnings compiler option in serverless-lumo.edn, but by default the lumo process emits the warnings, does not throw and returns 0. This means that serverless will keep going in presence of warnings.

License

serverless-cljs-plugin is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying LICENSE file.