Skip to content

Commit

Permalink
fix: Add missing js dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentinchampenois committed Oct 17, 2024
1 parent 0873896 commit 0a0ca23
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@

require "decidim/dev/common_rake"

def js_configuration(path)
babel_file_path = File.join(Dir.pwd, "babel.config.json")

Dir.chdir(path) do
FileUtils.cp(babel_file_path, "babel.config.json")
system("yarn add @babel/plugin-proposal-private-methods")
system("yarn add @babel/plugin-proposal-private-property-in-object")
end
end

desc "Generates a dummy app for testing"
task test_app: "decidim:generate_external_test_app"
task test_app: "decidim:generate_external_test_app" do
ENV["RAILS_ENV"] = "test"
js_configuration("spec/decidim_dummy_app")
end

desc "Generates a development app."
task development_app: "decidim:generate_external_development_app"
task development_app: "decidim:generate_external_development_app" do
js_configuration("development_app")
end
28 changes: 28 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"presets": [
[
"@babel/preset-env", {
"forceAllTransforms": true,
"useBuiltIns": "entry",
"corejs": 3,
"modules": false
}
],
["@babel/preset-react"]
],
"plugins": [
"@babel/plugin-transform-classes",
[
"@babel/plugin-transform-runtime",
{
"helpers": false,
"regenerator": true,
"corejs": false
}
],
[ "@babel/plugin-transform-regenerator", { "async": false }],
[ "@babel/plugin-proposal-private-property-in-object", { "loose": true }],
["@babel/plugin-proposal-private-methods", { "loose": true }],
["@babel/plugin-proposal-class-properties", { "loose": true }]
]
}
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


0 comments on commit 0a0ca23

Please sign in to comment.