Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
User code (fiddles) goes to src/ - address user's confusion
Browse files Browse the repository at this point in the history
Electric-fiddle's code moved to src-contrib
  • Loading branch information
ggeoffrey committed Jan 23, 2024
1 parent ec58ff0 commit 7d52a11
Show file tree
Hide file tree
Showing 60 changed files with 44 additions and 44 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ At the REPL:
```

1. Navigate to [http://localhost:8080](http://localhost:8080)
2. Corresponding source code is in `src-fiddles/hello_world`
2. Corresponding source code is in `src/hello_world`

## Load more fiddles

Expand Down Expand Up @@ -62,8 +62,8 @@ Optional:

## Roll your own

1. `mkdir src-fiddles/my_fiddle`
3. Add the following to `src-fiddles/my_fiddle/fiddles.cljc`:
1. `mkdir src/my_fiddle`
3. Add the following to `src/my_fiddle/fiddles.cljc`:
```clojure
(ns my-fiddle.fiddles
(:require [hyperfiddle.electric :as e]
Expand Down
2 changes: 1 addition & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ring-basic-authentication/ring-basic-authentication {:mvn/version "1.2.0"}
}

:paths ["src" "resources" "src-fiddles"]
:paths ["src" "resources" "src-contrib"]

:aliases
{:dev
Expand Down
2 changes: 1 addition & 1 deletion src-build/build.clj
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ so do not use `clj -T`"
:optimize optimize, :debug debug, :verbose verbose}))

(b/copy-dir {:target-dir class-dir :src-dirs ["src" "src-prod" "resources"]})
(b/copy-dir {:target-dir (str class-dir "/" (domain->dir domain)) :src-dirs [(str "src-fiddles/" (domain->dir domain))]})
(b/copy-dir {:target-dir (str class-dir "/" (domain->dir domain)) :src-dirs [(str "src/" (domain->dir domain))]})
(let [jar-name (or (some-> jar-name str) ; override for Dockerfile builds to avoid needing to reconstruct the name
(format "target/electricfiddle-%s-%s.jar" domain electric-user-version))
aliases [:prod (keyword domain)]]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
(set! (.-innerHTML dom/node) html))))

(def essays
{'electric-y-combinator "src-fiddles/dustingetz/electric_y_combinator.md"
'hfql-intro "src-fiddles/dustingetz/hfql_intro.md"
'hfql-teeshirt-orders "src-fiddles/dustingetz/hfql_teeshirt_orders.md"
{'electric-y-combinator "src/dustingetz/electric_y_combinator.md"
'hfql-intro "src/dustingetz/hfql_intro.md"
'hfql-teeshirt-orders "src/dustingetz/hfql_teeshirt_orders.md"

'demo_two_clocks "src-fiddles/electric_tutorial/demo_two_clocks.md"})
'demo_two_clocks "src/electric_tutorial/demo_two_clocks.md"})

(defn parse-md-directive [s]
(let [[_ extension alt-text arg arg2] (re-find #"!(.*?)\[(.*?)\]\((.*?)\)(?:\((.*?)\))?" s)]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src-dev/fiddle_manager.clj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"\nPossible causes:"
"\n - this fiddle doesn’t exist"
"\n - is `" fiddle "` the right name?"
"\n - is there a corresponding file named `src-fiddles/" (munge fiddle) "/fiddles.cljc`?"
"\n - is there a corresponding file named `src/" (munge fiddle) "/fiddles.cljc`?"
)
(instance? java.io.FileNotFoundException (ex-cause error))
(str
Expand Down
20 changes: 0 additions & 20 deletions src-fiddles/hello_fiddle/fly.toml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,20 @@
(dom/text (str (title next) " >"))))))))

(def tutorials2
{`electric-tutorial.demo-two-clocks/TwoClocks "src-fiddles/electric_tutorial/demo_two_clocks.md"
`electric-tutorial.demo-toggle/Toggle "src-fiddles/electric_tutorial/demo_toggle.md"
`electric-tutorial.demo-system-properties/SystemProperties "src-fiddles/electric_tutorial/demo_system_properties.md"
`electric-tutorial.demo-chat/Chat "src-fiddles/electric_tutorial/demo_chat.md"
`electric-tutorial.tutorial-backpressure/Backpressure "src-fiddles/electric_tutorial/tutorial_backpressure.md"
`electric-tutorial.tutorial-lifecycle/Lifecycle "src-fiddles/electric_tutorial/tutorial_lifecycle.md"
`electric-tutorial.demo-chat-extended/ChatExtended "src-fiddles/electric_tutorial/demo_chat_extended.md"
`electric-tutorial.demo-webview/Webview "src-fiddles/electric_tutorial/demo_webview.md"
`electric-tutorial.demo-todos-simple/TodoList "src-fiddles/electric_tutorial/demo_todos_simple.md"
`electric-tutorial.demo-svg/SVG "src-fiddles/electric_tutorial/demo_svg.md"
`electric-tutorial.tutorial-7guis-1-counter/Counter "src-fiddles/electric_tutorial/tutorial_7guis_1_counter.md"
`electric-tutorial.tutorial-7guis-2-temperature/TemperatureConverter "src-fiddles/electric_tutorial/tutorial_7guis_2_temperature.md"
`electric-tutorial.tutorial-7guis-4-timer/Timer "src-fiddles/electric_tutorial/tutorial_7guis_4_timer.md"
`electric-tutorial.tutorial-7guis-5-crud/CRUD "src-fiddles/electric_tutorial/tutorial_7guis_5_crud.md"
{`electric-tutorial.demo-two-clocks/TwoClocks "src/electric_tutorial/demo_two_clocks.md"
`electric-tutorial.demo-toggle/Toggle "src/electric_tutorial/demo_toggle.md"
`electric-tutorial.demo-system-properties/SystemProperties "src/electric_tutorial/demo_system_properties.md"
`electric-tutorial.demo-chat/Chat "src/electric_tutorial/demo_chat.md"
`electric-tutorial.tutorial-backpressure/Backpressure "src/electric_tutorial/tutorial_backpressure.md"
`electric-tutorial.tutorial-lifecycle/Lifecycle "src/electric_tutorial/tutorial_lifecycle.md"
`electric-tutorial.demo-chat-extended/ChatExtended "src/electric_tutorial/demo_chat_extended.md"
`electric-tutorial.demo-webview/Webview "src/electric_tutorial/demo_webview.md"
`electric-tutorial.demo-todos-simple/TodoList "src/electric_tutorial/demo_todos_simple.md"
`electric-tutorial.demo-svg/SVG "src/electric_tutorial/demo_svg.md"
`electric-tutorial.tutorial-7guis-1-counter/Counter "src/electric_tutorial/tutorial_7guis_1_counter.md"
`electric-tutorial.tutorial-7guis-2-temperature/TemperatureConverter "src/electric_tutorial/tutorial_7guis_2_temperature.md"
`electric-tutorial.tutorial-7guis-4-timer/Timer "src/electric_tutorial/tutorial_7guis_4_timer.md"
`electric-tutorial.tutorial-7guis-5-crud/CRUD "src/electric_tutorial/tutorial_7guis_5_crud.md"
;`electric-tutorial.demo-reagent-interop/ReagentInterop ""
})

Expand Down
File renamed without changes.
20 changes: 20 additions & 0 deletions src/hello_fiddle/fly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
app = "hello-fiddle"
primary_region = "ewr"

[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ["app"]

[build.args]
HYPERFIDDLE_DOMAIN="hello-fiddle"


# NO_COLOR=1 fly deploy --config src/hello_fiddle/fly.toml --remote-only --build-only

# fly scale vm shared-cpu-8x --config src/hello_fiddle/fly.toml
# fly scale show --config src/hello_fiddle/fly.toml
# fly status --config src/hello_fiddle/fly.toml

0 comments on commit 7d52a11

Please sign in to comment.