{"id":20780675,"url":"https://github.com/aroemers/mount-lite","last_synced_at":"2025-05-16T04:00:15.371Z","repository":{"id":53621212,"uuid":"50057402","full_name":"aroemers/mount-lite","owner":"aroemers","description":"mount, but different and light","archived":false,"fork":false,"pushed_at":"2025-01-16T20:42:39.000Z","size":369,"stargazers_count":102,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"2.x","last_synced_at":"2025-04-08T14:05:41.709Z","etag":null,"topics":["clojure","defstate","mount"],"latest_commit_sha":null,"homepage":"https://cljdoc.org/d/functionalbytes/mount-lite/","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aroemers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-20T20:16:21.000Z","updated_at":"2025-01-16T20:42:32.000Z","dependencies_parsed_at":"2025-02-24T10:13:50.515Z","dependency_job_id":"ee71de7f-d1c6-4b97-9192-923dc7175c75","html_url":"https://github.com/aroemers/mount-lite","commit_stats":{"total_commits":219,"total_committers":10,"mean_commits":21.9,"dds":0.2100456621004566,"last_synced_commit":"0a01c03a96aa8fbbf8a9b69e99ace8521b9a27af"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aroemers%2Fmount-lite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aroemers%2Fmount-lite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aroemers%2Fmount-lite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aroemers%2Fmount-lite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aroemers","download_url":"https://codeload.github.com/aroemers/mount-lite/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464890,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clojure","defstate","mount"],"created_at":"2024-11-17T13:38:49.501Z","updated_at":"2025-05-16T04:00:15.065Z","avatar_url":"https://github.com/aroemers.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](doc/logo.png)\n\nA library resembling [mount](https://github.com/tolitius/mount), but different on some key things:\n\n* **Clojure only**, dereferencing states only.\n* **Minimal API**, based on usage in several larger projects. Less turned out to be more.\n* **Supports multiple system instances simultaneously**, enabling parallel testing for instance.\n* **Easily extensible**, without touching the core. Several extensions are provided, such as [tools.namespace](https://github.com/clojure/tools.namespace#reloading-code-usage) integration and inferred dependency graphs.\n\n## Getting started\n\nAdd `[functionalbytes/mount-lite \"2.3.2\"]` or `functionalbytes/mount-lite {:mvn/version \"2.3.2\"}` to your dependencies and make sure Clojars is one of your repositories.\n\nYou can find all the documentation about mount-lite, what makes it unique, and the API by clicking on the link below:\n\n\u0026gt;\u003e\u003e [**FULL DOCUMENTATION**](https://cljdoc.org/d/functionalbytes/mount-lite/) \u003c\u003c\u003c\n\n## A primer\n\nRequire the `mount.lite` namespace, and other namespaces you depend on.\n\n```clj\n(ns your.app\n  (:require [mount.lite :refer (defstate) :as mount]\n            [your.app.config :as config] ;; \u003c-- Also has a defstate.\n            [some.db.lib :as db]))\n```\n\nDefine a defstate var, including the `:start` and `:stop` lifecycle expressions.\n\n```clj\n(defstate db\n  :start (db/start (get-in @config/config [:db :url]))\n  :stop  (db/stop @db))\n;=\u003e #'your.app/db\n```\n\nThen start all defstates, use `(start)`.\nA sequence of started state vars is returned.\nThe order in which the states are started is determined by their load order by the Clojure compiler.\nCalling `(stop)` stops all the states in reverse order.\n\n```clj\n(mount/start)\n;=\u003e (#'your.app.config/config #'your.app/db)\n\n@db\n;=\u003e object[some.db.Object 0x12345678]\n\n(mount/stop)\n;=\u003e (#'your.app/db #'your.app.config/config)\n\n@db\n;=\u003e ExceptionInfo: state db is not started\n```\n\n*That's it, enjoy!*\n\n## Core development features\n\nNext to above basic usage, the core provides three more concepts:\n\n- **[Substitutes](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/doc/substitutions)**: replace default defstate implementations with substitutes, for testing or REPL sessions.\n\n- **[Start/stop \"up-to\"](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/doc/start-up-to-stop-down-to)**: only start (or stop) the defstates sequence to a certain defstate.\n\n- **[Multiple systems](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/doc/multiple-systems-of-states)**: start multiple instances of defstate systems concurrently.\n\n## Extensions\n\nThe core provides an easy [extension point](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/doc/extension-point).\nThe following extensions are currently provided:\n\n- **[Basic](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.basic)**: start only certain states, or all states except certain states.\n\n- **[Data-driven](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.data-driven)**: start the states according to an EDN specification.\n\n- **[Refresh](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.refresh)**: use mount-lite in combination with the \"refresh\" functionality of the [tools.namespace](https://github.com/clojure/tools.namespace#reloading-code-usage) library.\n\n- **[Inferred dependencies](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.namespace-deps)**: only start (or stop) states based on an inferred dependency graph using the tools.namespace library.\n\n- **[Explicit dependencies](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.explicit-deps)**: only start (or stop) states based on an explicitly declared dependency graph.\n\n- **[Autostart](https://cljdoc.org/d/functionalbytes/mount-lite/CURRENT/api/mount.extensions.autostart)**: automatically start states (and its dependencies) on first use.\n\n## Version 2.x\n\nVersion 2.x is breaking with the 0.9.x versions.\nVersion 2.0 introduced the ability to run multiple systems of states simultaneously.\nThis was an opportunity to get rid of the excess, based on experience in several larger projects.\nIt has become really \"lite\", especially the core, while providing an easy to understand extension point for more advanced features.\n[This blog post](https://www.functionalbytes.nl/clojure/mount/mount-lite/2016/12/10/mount-lite-2.html) explains what has changed in version 2.0 in detail, and why.\n\nVersion 0.9.x will still be maintained, and can be found under the [1.x branch](https://github.com/aroemers/mount-lite/tree/1.x).\n\n## License\n\nCopyright © 2017-2024 Functional Bytes\n\nDistributed under the Eclipse Public License either version 1.0 or (at\nyour option) any later version.\n\n\u003e 2.x branch: [![Circle CI](https://circleci.com/gh/aroemers/mount-lite/tree/2.x.svg?style=svg)](https://circleci.com/gh/aroemers/mount-lite/tree/2.x)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faroemers%2Fmount-lite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faroemers%2Fmount-lite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faroemers%2Fmount-lite/lists"}