From 0e7f223fe07ae0fba0d89b10a7458c6808e9841e Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 14 Jun 2024 23:31:39 -0300 Subject: [PATCH] Try fix CI --- Rules | 9 +++++---- nanoc/rules/index.rules | 9 +++++---- nanoc/rules/random.rules | 2 +- nanoc/rules/redirect.rules | 2 +- nanoc/rules/stream.rules | 4 ++-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Rules b/Rules index bf5aa5d..349feea 100644 --- a/Rules +++ b/Rules @@ -15,6 +15,7 @@ locales = %w[ar fa en] json_dir = File.join(Dir.getwd, "src", "json") name_by_id = Ryo.from_json(path: File.join(json_dir, "nameById.json")) tdata = Ryo.from_json(path: File.join(json_dir, "t.json")) +tidy = `which tidy || which tidy5` buildenv = ENV["buildenv"] || "development" ## @@ -60,10 +61,10 @@ passthrough "/json/durations/*.json" ## # Require rules require_rules "nanoc/rules/assets" -require_rules "nanoc/rules/redirect", {locales:} -require_rules "nanoc/rules/random", {locales:, tdata:} -require_rules "nanoc/rules/stream", {locales:, tdata:, name_by_id:} -require_rules "nanoc/rules/index", {locales:, tdata:} +require_rules "nanoc/rules/redirect", {locales:, tidy:} +require_rules "nanoc/rules/random", {locales:, tdata:, tidy:} +require_rules "nanoc/rules/stream", {locales:, tdata:, name_by_id:, tidy:} +require_rules "nanoc/rules/index", {locales:, tdata:, tidy:} ## # Catch-all diff --git a/nanoc/rules/index.rules b/nanoc/rules/index.rules index dc34cd6..1e6a996 100644 --- a/nanoc/rules/index.rules +++ b/nanoc/rules/index.rules @@ -15,16 +15,17 @@ locales.each do |locale| end compile "/js/main/surah-index.tsx" do - filter :webpack, depend_on: ["/js/components", - "/js/lib/", - "/js/hooks"] + filter :webpack, exe: tidy, + depend_on: ["/js/components", + "/js/lib/", + "/js/hooks"] write "/js/main/surah-index.js" filter :gzip write "/js/main/surah-index.js.gz" end compile "/js/loaders/SurahIndexLoader.ts" do - filter :webpack + filter :webpack, exe: tidy write "/js/loaders/surah-index-loader.js" filter :gzip write "/js/loaders/surah-index-loader.js.gz" diff --git a/nanoc/rules/random.rules b/nanoc/rules/random.rules index 19e40dc..b4b3eee 100644 --- a/nanoc/rules/random.rules +++ b/nanoc/rules/random.rules @@ -15,7 +15,7 @@ locales.each do |locale| end compile "/js/main/random.ts" do - filter(:webpack, depend_on: ["/js/lib/"]) + filter(:webpack, exe: tidy, depend_on: ["/js/lib/"]) write("/js/main/random.js") filter(:gzip) write("/js/main/random.js.gz") diff --git a/nanoc/rules/redirect.rules b/nanoc/rules/redirect.rules index 25f2b9a..c0d89b7 100644 --- a/nanoc/rules/redirect.rules +++ b/nanoc/rules/redirect.rules @@ -12,7 +12,7 @@ compile "/html/main/redirect.html.erb" do end compile "/js/main/redirect.ts" do - filter(:webpack, depend_on: ["/js/lib/"]) + filter(:webpack, exe: tidy, depend_on: ["/js/lib/"]) write("/js/main/redirect.js") filter(:gzip) write("/js/main/redirect.js.gz") diff --git a/nanoc/rules/stream.rules b/nanoc/rules/stream.rules index 1eab180..97b2102 100644 --- a/nanoc/rules/stream.rules +++ b/nanoc/rules/stream.rules @@ -42,7 +42,7 @@ Ryo.each(name_by_id) do |id, slug| end compile "/js/main/surah-stream.tsx" do - filter :webpack, + filter :webpack, exe: tidy, depend_on: ["/js/components", "/js/lib/", "/js/hooks"] write "/js/main/surah-stream.js" filter :gzip @@ -50,7 +50,7 @@ compile "/js/main/surah-stream.tsx" do end compile "/js/loaders/SurahStreamLoader.ts" do - filter :webpack + filter :webpack, exe: tidy write "/js/loaders/surah-stream-loader.js" filter :gzip write "/js/loaders/surah-stream-loader.js.gz"