Coder Social home page Coder Social logo

practicalli / clojure-cli-config Goto Github PK

View Code? Open in Web Editor NEW
495.0 495.0 495.0 557 KB

User aliases and Clojure CLI configuration for deps.edn based projects

Home Page: https://practical.li/clojure/

License: Creative Commons Attribution Share Alike 4.0 International

Makefile 100.00%
clojure clojure-cli deps-edn

clojure-cli-config's People

Contributors

abogoyavlensky avatar allentiak avatar blak3mill3r avatar camsaul avatar cch1 avatar deas avatar donthorp avatar eval avatar gwena avatar holyjak avatar imrekoszo avatar jcrum avatar joshrotenberg avatar keram avatar kjoshi avatar mathisto avatar mvarela avatar practicalli-johnny avatar samusz avatar terop avatar tugh avatar vemv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clojure-cli-config's Issues

Configure Super Linter for Clojure

Practicalli has used SuperLinter to lint markdown content for books. Add this to practicalli/clojure-deps-edn project to verify the markdown in the readme.md file, describing the project in detail.

Installation instructions don't mention CLJ_CONFIG or XDG_CONFIG_HOME

After following the installation instructions, calling any of the provided aliases failed with the error message "No function found on command line or in :exec-fn". Due to the help of Alex Miller and Sean Corfield on the Clojurians Slack channel, it became clear that the issue is that after installing the Clojure CLI tools, my config-user is not pointing to $HOME/.clojure but to $HOME/.config/clojure. I.e., see the output of clojure -Sdescribe:

[host->~]clojure -Sdescribe
{:version "1.10.1.727"
 :config-files ["/usr/local/lib/clojure/deps.edn" "/home/schauer/.config/clojure/deps.edn" ]
 :config-user "/home/schaueho/.config/clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/lib/clojure"
 :config-dir "/home/schaueho/.config/clojure"
 :cache-dir "/home/schaueho/.config/clojure/.cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

According to Alex, the reason is in my case that the environment variable $XDG_CONFIG_HOME points to /home/schaueho/. Apparently, setting $CLJ_CONFIG could lead to similar effects, as described in deps and cli documentation.

My proposal would be to change the documentation so that instead of just assuming ~/.clojure/ to specifically mention the value of :config-user from the output above.

Error when using :search/outdated

Latest clojure, latest clojure-deps-edn.

$ clojure -T:search/outdated
No function found on command line or in :exec-fn
$ clojure -version
Clojure CLI version 1.11.1.1149
$ cd ~/.clojure
[collider@grabber .clojure]$ git status 
On branch live
Your branch is up to date with 'origin/live'.

nothing to commit, working tree clean

clj-kondo improvements

Hey there!

Thanks for your project. I'm experimenting with using it as my source of truth for all sorts of CI checks i.e. not just for personal productivity.

I noticed a couple possible issues with the clj-kondo setup:

  • :main-opts ["-m" "clj-kondo.main" "--lint" "src"]} does not specify "test". This seems a dangerous absence to have by default. It would seem sensible to either drop src or to also include test.
  • For best results, clj-kondo shouldn't be run as a one-liner, see e.g. https://github.com/clj-kondo/clj-kondo#project-setup. So it seems to me that there should be an additional alias?
    • The usage I would foresee is clojure -M:lint/clj-kondo.analyse && clojure -M:lint/clj-kondo src test

wdyt?

Cheers - V

Broken link (updating)

Currently, Updating practicalli/clojure-deps-edn links to https://github.com/practicalli/clojure-deps-edn/blob/live/updating-practicalli/clojure-deps-edn which does not exist.

It looks like it should link to updating-practicalliclojure-deps-edn (without the /).

Project License?

Hi, @practicalli-john -

Thanks for making all these useful aliases available to the Clojure community. I think it might be helpful for myself and others if you clarified what license you're making this project available under, as there currently doesn't seem to be a license as far as I can tell.

Windows and Clojure CLI - escape character issues

Currently the readme.md says to execute: clojure -X:deps mvn-install project.jar

The result I get is:
Key is missing value: project.jar

When I execute clojure -X:deps mvn-install :jar project.jar I get

my-library $ clojure -X:deps mvn-install :jar "project.jar"
Installing project.jar
Execution error (IllegalArgumentException) at clojure.tools.cli.api/read-pom-in-jar (api.clj:310).
No implementation of method: :as-file of protocol: #'clojure.java.io/Coercions found for class: clojure.lang.Symbol

Reveal has disappeared?

I had a setup for debugging some hairy recursive code using Reveal (no reveal specific code required in my app).

Now I return a month or so later and it's gone? diff here.

How do you evaluate that something is 'unused'? Can you keep metrics on clojure-deps-edn alias downloads?

With Portal I seem to have to launch an inspector from within the app. Extra steps for me given it's HumbleUI and can crash if I am doing crazy things.

Also it feels very un-Clojure like that these aliases are mutable and removed (thinking of Rich Hickey's talk and the blessings of Maven immutability).

My code tap>s out reams of info, which was very smooth scrolling through in Reveal (order is important for analysis). Perhaps I can get Portal to the same place.. but will require investigative work and so is jarring.

Thanks for the project and looking forward to your thoughts on this issue.

:mvn/local-repo appears to be broken as it is relative

The :mvn/local-repo was changed to ".cache/maven/repository" which is relative ( this probably should be absolute path in $HOME/ )
It appears to break the existing usage.
I commented it out for now - to default back to ~/.m2

User-level deps.edn is in a different place on XDG systems

I've just updated some of my repos to note that the user-level deps.edn file is in ~/.config/clojure/ on some systems (the deps/CLI reference notes them as "Freedesktop conventions"). This seems to be where the XDG_CONFIG environment variable points on such systems (and that takes precedence over the HOME variable in clojure shell script, if CLJ_CONFIG is not set).

Just in case you want to add a note in your repo.

Change of user-config to config-user

'user-config' is now 'config-user'

`samusz@CESP-176-39 polylithExample % clojure -Sdescribe

{:version "1.10.3.833"
:config-files ["/usr/local/Cellar/clojure/1.10.3.833/deps.edn" "/Users/samusz/.clojure/deps.edn" "deps.edn" ]
:config-user "/Users/samusz/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/usr/local/Cellar/clojure/1.10.3.833"
:config-dir "/Users/samusz/.clojure"
:cache-dir ".cpcache"
:force false
:repro false
:main-aliases ""
:repl-aliases ""}`

:test/eftest runner hangs when finished

After running a test suite and reporting the failures it just hangs until you kill the process. eftest.runner/run-tests is intended for REPL usage and returns a map with a summary and doesn't initiate shutdown. If you look at the source for lein-eftest it checks the number of failures/errors returned by run-tests and exits with nonzero if they are nonzero -- see https://github.com/weavejester/eftest/blob/master/lein-eftest/src/leiningen/eftest.clj#L83-L116

support Clerk as inspector ?

An alias like below starts CIDER-nREPL and opens Clerk and starts its "tap inspector", which is conceptually the same as portal and reveal, just powered by Clerk.
After this any "tapped" value is rendered in Browser.

I noticed an "issue", by "tap>" not giving the control back to the repl...
This does not happen, if you connect Emacs or an other nRepl client.

Not sure, what the root cause of this is

:inspect/clerk
  {:extra-deps {io.github.nextjournal/clerk {:mvn/version "0.15.957"}
                nrepl/nrepl                   {:mvn/version "1.0.0"}
                cider/cider-nrepl             {:mvn/version "0.28.7"}
                refactor-nrepl/refactor-nrepl {:mvn/version "3.6.0"}}
   :main-opts ["-e" "(require '[nextjournal.clerk])(nextjournal.clerk/show! 'nextjournal.clerk.tap)(nextjournal.clerk/serve! {:browse? true})"
               "-m" "nrepl.cmdline"
               "--interactive"
               "--middleware" "[refactor-nrepl.middleware/wrap-refactor,cider.nrepl/cider-middleware]"]}

Migrate :project/jar and :project/uberjar aliases to tools.build

Add a workable approach to using tools.build from Practicalli Clojure deps.edn, ideally without having to add any other files to a project (external dependency to using the alias)

Putting this on hold as tools.build seems more applicable to a project deps.edn than user config

References

Background

:project/jar and :project/uberjar aliases depend on depstar which was deprecated (and archived) for six months.

tools.build should be the preferred approach

deps-new Invalid Tag

When creating a new service from the template I get an error for io.github.seancorfield/deps-new stating that the tag (0.6.0) is invalid.
Screenshot 2024-01-03 at 22 39 42

Changing the tag for io.github.seancorfield/deps-new in deps.edn to 'v0.6.0' fixes the issue.

I will submit a pull request.

No function found on command line or in :exec-fn on new project

I run the new project template and it flunks.

user$ clojure -X:project/new :template app :name practicalli/testapp
No function found on command line or in :exec-fn

Here's the output of clojure -Sdescribe

{:version "1.10.1.763"
 :config-files ["/usr/share/clojure/deps.edn" "/home/billy/.clojure/deps.edn" ]
 :config-user "/home/billy/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/share/clojure"
 :config-dir "/home/billy/.clojure"
 :cache-dir "/home/billy/.clojure/.cpcache"
 :force false
 :repro false
 :main-aliases ""
 :repl-aliases ""}

Update repo name and branch

The repository has evolved to be more than just a deps.edn file and is specifically referred to as a Clojure CLI configuration.

use the consistent branch name main as the default branch

  • rename the repository to clojure-cli-config (github will redirect the old name)
  • rename the live branch to main
  • update description in readme.md file

[clojure-deps-edn] Create Pull Request template to guide contributions

Please raise an issue before raising a pull request in order to avoid working on something that would not be accepted.

Sweeping changes to this repository (or any open source project) are less likely to be accepted and take longer to review and test by the maintainers.

For example, updating a number of different libraries all at once will require a lot of manual testing to ensure each alias still works, especially with some of the recent changes in the ClojureScript library.

Pull requests that change deprecated aliases will be rejected. Those aliases are to be removed, so no further testing will be done. Updating deprecated aliases does not demonstrate an understanding of the project concerns.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.