-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspin
106 lines (83 loc) · 2.67 KB
/
spin
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
(name dream)
(description "Dream web application")
(config project_name
(input (prompt "Project name:")))
(config project_slug
(input (prompt "Project slug:"))
(default (slugify :project_name))
(rules
("The project slug must be lowercase and contain ASCII characters and '-' only."
(eq :project_slug (slugify :project_slug)))))
(config project_snake
(default (snake_case :project_slug)))
(config create_switch
(default true))
(config project_description
(input (prompt "Description:"))
(default "A short, but powerful statement about your project")
(rules
("The last character of the description cannot be a \".\" to comply with opam"
(neq . (last_char :project_description)))))
(config author_name
(input (prompt "Name of the author:")))
(config include_docker
(confirm (prompt "Include Docker setup?"))
(default false))
(config include_tailwind
(confirm (prompt "Include TailwindCSS?"))
(default false))
(config include_embedded_js
(confirm (prompt "Include embedded JavaScript application?"))
(default false))
(config include_turbolink
(confirm (prompt "Include Turbolink?"))
(default false))
(config ci_cd
(select
(prompt "Which CI/CD do you use?")
(values GitHub None))
(default GitHub))
(ignore
(files Dockerfile docker-compose.yml .dockerignore)
(enabled_if (eq :include_docker false)))
(ignore
(files asset/helpers.js asset/vendor/*)
(enabled_if (eq :include_turbolink false)))
(ignore
(files asset/main.css)
(enabled_if (eq :include_tailwind true)))
(ignore
(files tailwind.config.js package.json)
(enabled_if (eq :include_tailwind false)))
(ignore
(files bin/app.ml bin/app.mli lib/*/templates/app_template.eml lib/*_app/*)
(enabled_if (eq :include_embedded_js false)))
(ignore
(files github/*)
(enabled_if (neq :ci_cd GitHub)))
; We need to do this because Dune won't copy .github during build
(post_gen
(actions
(run mv github .github))
(enabled_if (eq :ci_cd GitHub)))
(post_gen
(actions
(run make create_switch)
(run make deps)
(run make build)
(run chmod +x script/watch.sh))
(message "🎁 Installing packages in a switch. This might take a couple minutes.")
(enabled_if (eq :create_switch true)))
(post_gen
(actions
(run make deps)
(run make build)
(run chmod +x script/watch.sh))
(message "🎁 Installing packages globally. This might take a couple minutes.")
(enabled_if (eq :create_switch false)))
(example_commands
(commands
("make watch" "Run the server in watch mode.")
("make build" "Build the dependencies and the project.")
("make deps" "Download runtime and development dependencies.")
("make test" "Starts the test runner.")))