项目作者: burkaydurdu

项目描述 :
Code Night (CEC)
高级语言: Clojure
项目地址: git://github.com/burkaydurdu/looney.git
创建时间: 2021-05-02T22:24:13Z
项目社区:https://github.com/burkaydurdu/looney

开源协议:

下载


looney

Netlify Status

Install Leiningen

Install NPM, Node

Package Manager

Create Project

Re-frame template

  1. lein new re-frame fro-cix +10x +test +kondo +cider +routes

Development

Running the App

Start a temporary local web server, build the app with the dev profile, and serve the app,
browser test runner and karma test runner with hot reload:

  1. npm install
  2. npx shadow-cljs watch app

Please be patient; it may take over 20 seconds to see any output, and over 40 seconds to complete.

When [:app] Build completed appears in the output, browse to
http://localhost:8280/.

shadow-cljs will automatically push ClojureScript code
changes to your browser on save. To prevent a few common issues, see
Hot Reload in ClojureScript: Things to avoid.

Opening the app in your browser starts a
ClojureScript browser REPL,
to which you may now connect.

Connecting to the browser REPL from VS Code with Calva

See the re-frame-template README for Calva instuctions. See also https://calva.io for Calva documentation.

Connecting to the browser REPL from other editors

See
Shadow CLJS User’s Guide: Editor Integration.
Note that npm run watch runs npx shadow-cljs watch for you, and that this project’s running build ids is
app, browser-test, karma-test, or the keywords :app, :browser-test, :karma-test in a Clojure context.

Alternatively, search the web for info on connecting to a shadow-cljs ClojureScript browser REPL
from your editor and configuration.

Connecting to the browser REPL from a terminal

  1. Connect to the shadow-cljs nREPL:

    1. lein repl :connect localhost:8777

    The REPL prompt, shadow.user=>, indicates that is a Clojure REPL, not ClojureScript.

  2. In the REPL, switch the session to this project’s running build id, :app:

    1. (shadow.cljs.devtools.api/nrepl-select :app)

    The REPL prompt changes to cljs.user=>, indicating that this is now a ClojureScript REPL.

  3. See user.cljs for symbols that are immediately accessible in the REPL
    without needing to require.

Running Tests

Build the app with the prod profile, start a temporary local web server, launch headless
Chrome/Chromium, run tests, and stop the web server:

  1. npm install
  2. npm run ci

Please be patient; it may take over 15 seconds to see any output, and over 25 seconds to complete.

Or, for auto-reload:

  1. npm install
  2. npm run watch

Then in another terminal:

  1. karma start

Running shadow-cljs Actions

See a list of shadow-cljs CLI
actions:

  1. npx shadow-cljs --help

Please be patient; it may take over 10 seconds to see any output. Also note that some actions shown
may not actually be supported, outputting “Unknown action.” when run.

Run a shadow-cljs action on this project’s build id (without the colon, just app):

  1. npx shadow-cljs <action> app

Debug Logging

The debug? variable in config.cljs defaults to true in
dev builds, and false in prod builds.

Use debug? for logging or other tasks that should run only on dev builds:

  1. (ns fro-cix.example
  2. (:require [fro-cix.config :as config])
  3. (when config/debug?
  4. (println "This message will appear in the browser console only on dev builds."))

Production

Build the app with the prod profile:

  1. npm install
  2. npm run release

Please be patient; it may take over 15 seconds to see any output, and over 30 seconds to complete.

The resources/public/js/compiled directory is created, containing the compiled app.js and
manifest.edn files.