audiences 1.5.3 → 1.5.4.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2128c153d299dd4a2fa4f94d5830dcf883cbf0b1b9300ca0905d0b5816fcc53
4
- data.tar.gz: feb6f90c5e3cf41e4331fce62cca0b8fb42cb94f1570283f4b760beec23a1a36
3
+ metadata.gz: d2cfcb960281d8ff412da34805fe15e7ef755224584258f72474c419d814bc30
4
+ data.tar.gz: 1427f62f82a43b0325dcf3a13346f25cfa8d24b03736048c1972f5c56bafe412
5
5
  SHA512:
6
- metadata.gz: 7831f938d1841653b4829f8726bcdd491888a048e633fc98fe45a7978e9fb5cb789f5d420ace6b18d66d75782c6a87da4437b046c5a54a0c772b153f2f718eaf
7
- data.tar.gz: 258c57d51a40fa73560ac5c2a01dedbc567923956fa5f237de8bd714c97f8cdeac95b9aab13fdf7bfb4c60a5b21d23e2fa681072318565c127ab93a9ee36a409
6
+ metadata.gz: 8b316dd4832e8e410f6e131d33cd58256950f9810e40fd5ad46ee452e39cc3c95a4344a2014ece5c207bb9c742afb27de31dc064fc61a4a92e5da5651613f4f9
7
+ data.tar.gz: e9d72bfc24b7b7a8bf3cfc04bc8aaa23e4ef1f9becd7e532c6f0c56b2ec4dc4313c6057c7b7d42fa9405f5ae8c1cb4dbd4daf15682ee4cfd06ae0583f07a522c
data/Rakefile CHANGED
@@ -15,4 +15,23 @@ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
15
15
  load "rails/tasks/engine.rake"
16
16
  load "rails/tasks/statistics.rake"
17
17
 
18
- task default: %i[rubocop spec]
18
+ desc "Build audiences-react and copy JS to Rails assets"
19
+ task build_frontend: :environment do
20
+ puts "Building audiences-react..."
21
+ system("cd ../audiences-react && yarn install && yarn build --mode ujs") || raise("Failed to build audiences-react")
22
+
23
+ source_path = Pathname.pwd.join("../audiences-react/dist/audiences-ujs.js")
24
+ destination_dir = Pathname.pwd.join("app/assets/builds")
25
+ destination_path = destination_dir.join("audiences-ujs.js")
26
+
27
+ destination_dir.mkpath
28
+ raise "Build file not found: #{source_path}" unless source_path.exist?
29
+
30
+ puts "Copying #{source_path} to #{destination_path}..."
31
+ FileUtils.cp(source_path.to_s, destination_path.to_s)
32
+ puts "Successfully copied!"
33
+ end
34
+
35
+ Rake::Task["build"].enhance(["build_frontend"])
36
+
37
+ task default: %i[rubocop spec build_frontend]