-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
85 lines (80 loc) · 1.83 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# frozen_string_literal: true
require "decidim/dev/common_rake"
require "fileutils"
# fix: https://github.com/decidim/decidim/blob/f2360320143222a53858f9d7a8bbddc9cad218aa/babel.config.json
def fix_babel_configs(path)
Dir.chdir(path) do
puts "Fixing JS dependencies in 'babel.config.json'..."
File.write("babel.config.json", "
{
'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 }]
]
}")
puts "Successfully modified !
You must now run to finish installing development_app:
cd development_app && yarn install && bundle exec bin/webpack
"
end
end
desc "Generates a dummy app for testing"
task :test_app do
generate_decidim_app(
"spec/decidim_dummy_app",
"--app_name",
"#{base_app_name}_test_app",
"--path",
"../..",
"--recreate_db",
"--skip_gemfile",
"--skip_spring",
"--skip_webpack_install",
"--demo",
"--force_ssl",
"false",
"--locales",
"en,ca,es"
)
fix_babel_configs("spec/decidim_dummy_app")
end
desc "Generates a development app."
task :development_app do
Bundler.with_original_env do
generate_decidim_app(
"development_app",
"--app_name",
"#{base_app_name}_development_app",
"--path",
"..",
"--recreate_db",
"--seed_db",
"--demo",
"--skip_webpack_install",
"--profiling",
"--locales",
"en,ca,es",
"--dev_ssl"
)
end
fix_babel_configs("development_app")
end