Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survive tailwindcss binary #2773

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ was upgraded in the process, the files `.ocamlformat` and
`.github/workflows/ci.yml` must be modified with the currently installed version
of OCamlFormat.

### Handling the Tailwind CSS

The Tailwind CSS framework. The tailwind binary pulled from its GitHub [repo](https://github.com/tailwindlabs/tailwindcss). Download is performed by Dune during the build. When working on a local switch for hacking, you don't want `dune clean` to delete this binary. Just do `dune install tailwind` to have it installed in the local switch.

## Repository Structure

The following snippet describes the repository structure:
Expand Down
11 changes: 1 addition & 10 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,13 @@
(rule
(target main.css)
(deps
%{project_root}/tool/tailwind/tailwindcss
(:config %{project_root}/tailwind.config.js)
(:input %{project_root}/src/ocamlorg_frontend/css/styles.css)
(source_tree %{project_root}/src/ocamlorg_frontend))
(action
(chdir
%{project_root}
(run
%{project_root}/tool/tailwind/tailwindcss
-m
-c
%{config}
-i
%{input}
-o
%{target})))))
(run tailwindcss -m -c %{config} -i %{input} -o %{target})))))

(subdir
asset/
Expand Down
3 changes: 3 additions & 0 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

(using mdx 0.1)

(package
(name tailwindcss) (allow_empty))

(package
(name ocamlorg)
(synopsis "Official OCaml website")
Expand Down
37 changes: 21 additions & 16 deletions tool/tailwind/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@
(target tailwindcss-linux-x64)
(action
(progn
(run
curl
-sLO
https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target})
(with-stdout-to
%{target}
(bash
"cat 2> /dev/null < $(which tailwindcss) || curl -#fSL 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})
(with-stdout-to
%{target}
(bash
"cat 2> /dev/null < $(which tailwindcss) || curl -#fSL 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})
(with-stdout-to
%{target}
(bash
"cat 2> /dev/null < $(which tailwindcss) || curl -#fSL 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})
(with-stdout-to
%{target}
(bash
"cat 2> /dev/null < $(which tailwindcss) || curl -#fSL https://github.com/tailwindlabs/tailwindcss/releases/download/v3.3.6/%{target}"))
(run chmod +x %{target}))))

(rule
Expand Down Expand Up @@ -81,3 +81,8 @@
(alias
(name default)
(deps tailwindcss))

(install
(section bin)
(package tailwindcss)
(files tailwindcss))
Loading