Skip to content

pink-gorilla/shadow-x

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shadow-x GitHub Actions status |pink-gorilla/shadow-xClojars Project

  • shadow-x creates a shadow-cljs config based on extensions. see extension extensions allow to bring new features to an application (and can be removed or replaced without adjusting the application other than including/removing a dependency). It works similar to the discovery of deps.cljs files.

  • allows to compile / run unit tests with a cli entrypoint. (see compile profiles)

features

shadow-x build

  • this feature is available for apps that use shadow-x
  • compiles/watches via shadow-cljs
  • does not require shadow-cljs.edn
  • bundle-size report at compile time

shadow-x - how to use:

To start shadow-x you have to pass it two parameter: profile and config

shadow-x Compile Profiles

shadow-x profile can be one of the following strings:

  • watch: builds and runs shadow dev server (shadow-cljs watch)
  • compile: builds bundle and output bundle stats
  • release: builds release bundle (for production) no tenx. no source-maps bundle stats
  • jetty: runs app, with bundle compiled via compile or release
  • ci: builds bundle for unit tests
  • npm-install: just installs npm dependencies (based on deps.cljs)

shadow-x config:

  • is a clojure datastructure
  • is used in backend (clj) and frontend (cljs)
  • can be passed as a string (link to a edn file or resource) - mandatory if shadow-x is used in a leiningen project
  • can be passed as a clojure datastructure - for quicker configuration in deps.edn projects.

npm dependencies

  • keep your npm dependencies only in deps.cljs
  • do NOT create a package.json file!
  • package.json will be auto generated

Add npm dependencies that you want to use into a clojure deps.cljs

{:npm-deps
 {; font awesome
  "@fortawesome/fontawesome-free" "^5.13.0"

Sometimes github repo and npm module do not match. Check this to see what goes on: https://unpkg.com/@ricokahler/oauth2-popup-flow@2.0.0-alpha.1/index.js

unit tests

  • clj bb test-clj
  • cljs: bb test-cljs

static build

  cd demo-shadow-x
  clj -X:shadow-x:compile  or clojure -X:shadow-x:release-adv
  clj -X:shadow-x:static
  cp node_modules/@icon .gorilla/static/index_files -r
 ./http-server.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors