{"id":21804886,"url":"https://github.com/pez/shadow-portal","last_synced_at":"2025-04-13T19:33:08.210Z","repository":{"id":64791439,"uuid":"577957284","full_name":"PEZ/shadow-portal","owner":"PEZ","description":"A template project for using shadow-cljs and Portal together","archived":false,"fork":false,"pushed_at":"2022-12-14T16:00:15.000Z","size":719,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T10:12:09.227Z","etag":null,"topics":["calva","clojure","clojurescript","portal","shadow-cljs","vscode"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PEZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["PEZ"]}},"created_at":"2022-12-13T23:14:32.000Z","updated_at":"2023-01-26T02:16:44.000Z","dependencies_parsed_at":"2022-12-16T02:51:59.819Z","dependency_job_id":null,"html_url":"https://github.com/PEZ/shadow-portal","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PEZ%2Fshadow-portal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PEZ%2Fshadow-portal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PEZ%2Fshadow-portal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PEZ%2Fshadow-portal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PEZ","download_url":"https://codeload.github.com/PEZ/shadow-portal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248768163,"owners_count":21158589,"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":["calva","clojure","clojurescript","portal","shadow-cljs","vscode"],"created_at":"2024-11-27T11:57:18.029Z","updated_at":"2025-04-13T19:33:08.178Z","avatar_url":"https://github.com/PEZ.png","language":"Clojure","funding_links":["https://github.com/sponsors/PEZ"],"categories":[],"sub_categories":[],"readme":"# Template project for Portal with shadow-cljs\n\nThis project contains a [Clojure](https://clojure.org) ”server” ([src/main/server.clj](src/main/server.clj)) and a [ClojureScript](https://clojurescript.org) frontend, managed by [shadow-cljs](https://shadow-cljs.github.io/). The project is also configured to automatically give you [Portal](https://github.com/djblue/portal) help with navigating data.\n\n![Portal shadow-cljs Calva](shadow-portal-screenshot.png)\n\nAs of this writing, [Calva](https://calva.io) is assumed. Let's hope we can see config added for other Clojure development environments too. PRs welcome!\n\n## How to use\n\n0. `npm i`\n\nWith Calva and the Portal VS Code extension installed:\n\n1. Open the project in VS Code\n2. Run: **Calva: Start Project REPL and Connect (aka Jack-in)**\n    1. Select the project type: **shadow-portal**\n\nThe REPL should start and the Portal webview should appear.\n\n## Works\n\nThere are taps in [test/main/server_test.clj](test/main/server_test.clj) and [test/main/core_test.cljs](test/main/core_test.cljs). Run the tests in the REPL and see the taps in Portal.\n\nThe project is configured to use [Portal nREPL middleware](https://cljdoc.org/d/djblue/portal/0.35.0/doc/guides/nrepl). Which makes all evaluation results go to Portal. With the benefits mentioned at the Portal docs page just linked. This is configured in [shadow-cljs.edn](shadow-cljs.edn).\n\nThe project is configured to use dependencies from [deps.edn](deps.edn). There's a commented config in [shadow-cljs.edn](shadow-cljs.edn) that lets you use the also provided [Leiningen](https://leiningen.org/) project file, [project.clj](project.clj).\n\n**NB**: The nREPL middleware will not send `stdout` to Portal. This is probably by designed so not listed in [Doesn't work](#doesnt-work) below.\n\n## Doesn't work\n\nThe taps for [test/main/core_test.cljs](test/main/core_test.cljs) doesn't happen for the `:test` shadow-cljs build, which runs the tests every time shadow reloads code. @djblue and I are looking at this. We intend to make it work.\n\n## Portal setup code\n\nThe code for starting Portal and open the webview is in [env/dev/portal/setup.clj](env/dev/portal/setup.clj), this is started as part of the REPL connection from [.vscode/settings.json](.vscode/settings.json)\n\nThe code for adding the ClojureScript tap is in [env/dev/portal/setup.cljs](env/dev/portal/setup.cljs). It is loaded by shadow-cljs from [shadow-cljs.edn](shadow-cljs.edn). (Where it is configured both for the `:app` and the `:test` builds.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpez%2Fshadow-portal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpez%2Fshadow-portal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpez%2Fshadow-portal/lists"}