-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscaffold.yaml
166 lines (158 loc) · 4.2 KB
/
scaffold.yaml
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# yaml-language-server: $schema=https://hay-kot.github.io/scaffold/schema.json
messages:
pre: |
# Welcome to Aspect, the multi-language monorepo dev platform
Generate boilerplate code for a new Bazel project using Aspect CLI and Aspect Workflows.
post: |
# Next Steps
1. `cd {{ .ProjectSnake }}`, or open that folder in your editor.
2. Read the developer guide in `/README.bazel.md`.
3. Try out some commands, such as:
{{- if .Scaffold.lint }}
- Format: `aspect run format`
- Lint: `aspect lint //...`
{{- end }}
- Run all tests: `aspect test //...`
- Watch mode: `./tools/ibazel run //my:devserver`
4. Add source code and run `aspect configure` to create
additional `BUILD.bazel` files.
questions:
- name: langs
validate:
min: 1
prompt:
multi: true
message: Languages to be used in the project
options:
- JavaScript & TypeScript
- Python
- Go
- Java
- C & C++
- Rust
- Shell (Bash)
- name: copier
prompt:
confirm: Setup code generation?
description: "Installs https://copier.readthedocs.io/"
when: "{{ has \"Python\" .langs }}"
- name: lint
prompt:
confirm: Setup format and linting?
description: "Installs https://github.com/aspect-build/rules_lint"
- name: stamp
prompt:
confirm: Setup version stamping?
description: "Read more: https://blog.aspect.build/versioning-releases-from-a-monorepo"
- name: oci
prompt:
confirm: Setup OCI Containers?
description: "Install rules_oci; see https://github.com/bazel-contrib/rules_oci"
features:
- value: "{{ .Scaffold.copier }}"
globs:
- "*/tools/copier"
- value: "{{ .Scaffold.lint }}"
globs:
- "*/tools/format/*"
- "*/tools/lint/*"
- "*/.pre-commit-config.yaml"
- value: "{{ .Scaffold.stamp }}"
globs:
- "*/tools/workspace_status.sh"
- "**/weekly_tag.yaml"
- value: "{{ .Computed.shell }}"
globs:
- "*/.shellcheckrc"
- value: "{{ .Computed.javascript }}"
globs:
- "*/package.json"
- "*/pnpm-*.yaml"
- "*/*.config.cjs*"
- "*/*.config.mjs*"
- "*/.npmrc"
- "**/packages/**"
- "*/tools/pnpm"
- "*/.aspect/bazelrc/javascript.bazelrc"
- "*/.aspect/cli/package-json*.star"
- value: "{{ .Computed.python }}"
globs:
- "*/requirements/**"
- "*/pyproject.toml"
- "*/gazelle_python.yaml"
- "*/.aspect/cli/py*.star"
- value: "{{ .Computed.go }}"
globs:
- "*/go.mod"
- "*/tools/go"
- value: "{{ .Computed.java }}"
globs:
- "*/maven_install.json"
- "*/pmd.xml"
- "*/.aspect/bazelrc/java.bazelrc"
- value: "{{ .Computed.cpp }}"
globs:
- "*/.clang-tidy"
- value: "{{ .Scaffold.oci }}"
globs:
- "*/tools/oci/BUILD.bazel"
- value: "{{ and .Scaffold.oci .Computed.python }}"
globs:
- "*/.aspect/cli/py3_image.star"
- "*/tools/oci/py3_image.bzl"
- value: "{{ and .Scaffold.oci .Computed.go }}"
globs:
- "*/.aspect/cli/go_image.star"
- "*/tools/oci/go_image.bzl"
- value: "{{ .Computed.rust }}"
globs:
- "*/Cargo.toml"
- "*/tools/cargo"
- "*/src/main.rs"
computed:
javascript: "{{ has \"JavaScript & TypeScript\" .Scaffold.langs }}"
python: "{{ has \"Python\" .Scaffold.langs }}"
go: "{{ has \"Go\" .Scaffold.langs }}"
java: "{{ has \"Java\" .Scaffold.langs }}"
cpp: "{{ has \"C & C++\" .Scaffold.langs }}"
rust: "{{ has \"Rust\" .Scaffold.langs }}"
shell: "{{ has \"Shell (Bash)\" .Scaffold.langs }}"
presets:
kitchen-sink:
lint: true
langs:
- 'C & C++'
- 'JavaScript & TypeScript'
- 'Python'
- 'Go'
- 'Java'
- 'Rust'
- 'Shell (Bash)'
copier: true
stamp: true
oci: true
shell:
langs: ['Shell (Bash)']
lint: true
go:
langs: ['Go']
lint: true
oci: true
js:
langs: ['JavaScript & TypeScript']
lint: true
py:
langs: ['Python']
copier: true
lint: true
java:
langs: ['Java']
lint: true
cpp:
langs: ['C & C++']
lint: true
rust:
langs: ['Rust']
lint: true
minimal:
langs: []