Skip to content

Commit

Permalink
Download and install tailwindcss binary without opam (#2718)
Browse files Browse the repository at this point in the history
Co-authored-by: Cuihtlauac ALVARADO <[email protected]>
Co-authored-by: Thibaut Mattio <[email protected]>
  • Loading branch information
3 people authored Oct 10, 2024
1 parent 981db66 commit be704c0
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 24 deletions.
3 changes: 2 additions & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
(rule
(target main.css)
(deps
%{workspace_root}/tool/tailwind/tailwindcss
(:config %{workspace_root}/tailwind.config.js)
(:input %{workspace_root}/src/ocamlorg_frontend/css/styles.css)
(source_tree %{workspace_root}/src/ocamlorg_frontend))
(action
(chdir
%{workspace_root}
(run tailwindcss -m -c %{config} -i %{input} -o %{target})))))
(run %{workspace_root}/tool/tailwind/tailwindcss -m -c %{config} -i %{input} -o %{target})))))

(subdir
asset/
Expand Down
12 changes: 11 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
(>= 2.0.0))
yojson
lwt
tailwindcss
(hilite
(>= 0.4.0))
(river
Expand All @@ -75,3 +74,14 @@
(>= 1.1.0))
xmlm
uri))

(pin
(url
"git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a")
(package
(name river)))

(pin
(url "git+https://github.com/tarides/olinkcheck")
(package
(name olinkcheck)))
19 changes: 0 additions & 19 deletions dune-workspace

This file was deleted.

2 changes: 0 additions & 2 deletions ocamlorg.opam
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ depends: [
"timedesc" {>= "2.0.0"}
"yojson"
"lwt"
"tailwindcss"
"hilite" {>= "0.4.0"}
"river" {>= "0.3"}
"syndic"
Expand Down Expand Up @@ -71,6 +70,5 @@ build: [
dev-repo: "git+https://github.com/ocaml/ocaml.org.git"
pin-depends: [
["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"]
]
1 change: 0 additions & 1 deletion ocamlorg.opam.template
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pin-depends: [
["river.dev" "git+https://github.com/aantron/river#476dc945a908a69548bddd267f143a3e5d9c8a1a"]
["tailwindcss.dev" "https://github.com/tmattio/opam-tailwindcss/archive/3e60fc32bbcf82525999d83ad0f395e16107026b.tar.gz"]
["olinkcheck.~dev" "git+https://github.com/tarides/olinkcheck"]
]
79 changes: 79 additions & 0 deletions tool/tailwind/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
(rule
(target tailwindcss-linux-x64)
(action
(progn
(run
curl
-sLO
https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target})
(run chmod +x %{target}))))

(rule
(target tailwindcss-linux-arm64)
(action
(progn
(run
curl
-sLO
https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target})
(run chmod +x %{target}))))

(rule
(target tailwindcss-macos-x64)
(action
(progn
(run
curl
-sLO
https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target})
(run chmod +x %{target}))))

(rule
(target tailwindcss-macos-arm64)
(action
(progn
(run
curl
-sLO
https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target})
(run chmod +x %{target}))))

(rule
(enabled_if
(and
(= %{architecture} amd64)
(= %{system} linux)))
(target tailwindcss)
(deps tailwindcss-linux-x64)
(action
(copy %{deps} tailwindcss)))

(rule
(enabled_if
(and
(= %{architecture} arm64)
(= %{system} linux)))
(target tailwindcss)
(deps tailwindcss-linux-arm64)
(action
(copy %{deps} tailwindcss)))

(rule
(enabled_if
(and
(= %{architecture} amd64)
(= %{system} macosx)))
(target tailwindcss)
(deps tailwindcss-macos-x64)
(action
(copy %{deps} tailwindcss)))

(rule
(enabled_if
(and
(= %{architecture} arm64)
(= %{system} macosx)))
(target tailwindcss)
(deps tailwindcss-macos-arm64)
(action
(copy %{deps} tailwindcss)))

0 comments on commit be704c0

Please sign in to comment.