Skip to content

Instantly share code, notes, and snippets.

@madis
Last active June 14, 2022 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madis/fc730ac6eb09c2b739b7b8f788a8bd91 to your computer and use it in GitHub Desktop.
Save madis/fc730ac6eb09c2b739b7b8f788a8bd91 to your computer and use it in GitHub Desktop.
Moving CLJS libraries form leiningen to shadow-cljs (deps.edn, transitive NPM deps)

To resume the changes required to move a CLJS library from leiningen to shadow-cljs:

  1. Create shadow-cljs.edn in the project root
  1. Create deps.edn in the project root and translate the Clojars dependencies from project.clj to there
  1. If there are direct NPM dependencies for that library / project, define these in src/deps.cljs
  • NB! note the extension, it's .cljs not .edn, this is important
  • after this you can remove package.json (and its respective lock-file)
  • hint: if you want to force subsequent dependency updates to use Yarn, you can do yarn add shadow-cljs@2.19.3 which will generate package.json and yarn.lock, after which shadow-cljs will automatically use yarn for future dependency pulls yarn, otherwise it'll default to npm)
  1. To build and publish JAR (normally CI publishes it)

More example build, test & release commands are documented in https://github.com/district0x/cljs-web3-next/blob/master/README.md#new-build-test-and-release-commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment