@devaloop/devalang 0.0.1-alpha.14 → 0.0.1-alpha.16

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.
Files changed (177) hide show
  1. package/.devalang +10 -8
  2. package/.github/workflows/ci.yml +92 -0
  3. package/Cargo.toml +60 -58
  4. package/README.md +32 -15
  5. package/docs/CHANGELOG.md +93 -1
  6. package/docs/CONTRIBUTING.md +101 -1
  7. package/docs/ROADMAP.md +2 -2
  8. package/docs/TODO.md +1 -1
  9. package/examples/automation.deva +42 -0
  10. package/examples/bank.deva +4 -4
  11. package/examples/events.deva +12 -0
  12. package/examples/function.deva +4 -4
  13. package/examples/index.deva +39 -25
  14. package/examples/loop.deva +5 -11
  15. package/examples/pattern.deva +8 -0
  16. package/examples/plugin.deva +16 -0
  17. package/examples/variables.deva +1 -1
  18. package/out-tsc/bin/index.js +51 -7
  19. package/out-tsc/index.js +3 -1
  20. package/out-tsc/scripts/postbuild.js +9 -10
  21. package/out-tsc/scripts/postinstall.js +49 -0
  22. package/package.json +12 -4
  23. package/project-version.json +3 -3
  24. package/rust/cli/bank.rs +462 -456
  25. package/rust/cli/build.rs +252 -199
  26. package/rust/cli/check.rs +221 -180
  27. package/rust/cli/driver.rs +297 -292
  28. package/rust/cli/generator.rs +1 -0
  29. package/rust/cli/init.rs +87 -79
  30. package/rust/cli/install.rs +35 -32
  31. package/rust/cli/login.rs +127 -134
  32. package/rust/cli/mod.rs +13 -11
  33. package/rust/cli/play.rs +1123 -218
  34. package/rust/cli/telemetry.rs +19 -0
  35. package/rust/cli/template.rs +69 -57
  36. package/rust/cli/update.rs +6 -4
  37. package/rust/common/api.rs +5 -8
  38. package/rust/common/cdn.rs +3 -6
  39. package/rust/common/mod.rs +3 -3
  40. package/rust/common/sso.rs +3 -6
  41. package/rust/config/driver.rs +118 -94
  42. package/rust/config/loader.rs +165 -156
  43. package/rust/config/mod.rs +4 -2
  44. package/rust/config/settings.rs +91 -0
  45. package/rust/config/stats.rs +257 -0
  46. package/rust/core/audio/engine.rs +696 -518
  47. package/rust/core/audio/evaluator.rs +263 -31
  48. package/rust/core/audio/interpreter/arrow_call.rs +198 -161
  49. package/rust/core/audio/interpreter/automate.rs +18 -0
  50. package/rust/core/audio/interpreter/call.rs +98 -95
  51. package/rust/core/audio/interpreter/condition.rs +70 -71
  52. package/rust/core/audio/interpreter/driver.rs +487 -198
  53. package/rust/core/audio/interpreter/function.rs +26 -21
  54. package/rust/core/audio/interpreter/let_.rs +38 -19
  55. package/rust/core/audio/interpreter/load.rs +18 -18
  56. package/rust/core/audio/interpreter/loop_.rs +113 -73
  57. package/rust/core/audio/interpreter/mod.rs +14 -13
  58. package/rust/core/audio/interpreter/sleep.rs +27 -30
  59. package/rust/core/audio/interpreter/spawn.rs +105 -102
  60. package/rust/core/audio/interpreter/tempo.rs +19 -16
  61. package/rust/core/audio/interpreter/trigger.rs +239 -210
  62. package/rust/core/audio/loader/mod.rs +1 -1
  63. package/rust/core/audio/loader/trigger.rs +100 -97
  64. package/rust/core/audio/mod.rs +7 -6
  65. package/rust/core/audio/player.rs +64 -64
  66. package/rust/core/audio/renderer.rs +56 -53
  67. package/rust/core/audio/special/easing.rs +189 -0
  68. package/rust/core/audio/special/env.rs +43 -0
  69. package/rust/core/audio/special/math.rs +102 -0
  70. package/rust/core/audio/special/mod.rs +9 -0
  71. package/rust/core/audio/special/modulator.rs +143 -0
  72. package/rust/core/builder/mod.rs +80 -85
  73. package/rust/core/debugger/lexer.rs +27 -27
  74. package/rust/core/debugger/mod.rs +24 -23
  75. package/rust/core/debugger/module.rs +55 -47
  76. package/rust/core/debugger/preprocessor.rs +27 -27
  77. package/rust/core/debugger/store.rs +40 -39
  78. package/rust/core/error/mod.rs +80 -66
  79. package/rust/core/lexer/handler/arrow.rs +82 -31
  80. package/rust/core/lexer/handler/at.rs +21 -21
  81. package/rust/core/lexer/handler/brace.rs +41 -41
  82. package/rust/core/lexer/handler/colon.rs +21 -21
  83. package/rust/core/lexer/handler/comment.rs +30 -30
  84. package/rust/core/lexer/handler/dot.rs +21 -21
  85. package/rust/core/lexer/handler/driver.rs +337 -263
  86. package/rust/core/lexer/handler/identifier.rs +46 -42
  87. package/rust/core/lexer/handler/indent.rs +66 -66
  88. package/rust/core/lexer/handler/mod.rs +16 -16
  89. package/rust/core/lexer/handler/newline.rs +23 -23
  90. package/rust/core/lexer/handler/number.rs +31 -31
  91. package/rust/core/lexer/handler/operator.rs +46 -44
  92. package/rust/core/lexer/handler/parenthesis.rs +41 -41
  93. package/rust/core/lexer/handler/slash.rs +21 -21
  94. package/rust/core/lexer/handler/string.rs +63 -63
  95. package/rust/core/lexer/mod.rs +54 -51
  96. package/rust/core/lexer/token.rs +97 -91
  97. package/rust/core/mod.rs +11 -11
  98. package/rust/core/parser/driver.rs +513 -408
  99. package/rust/core/parser/handler/arrow_call.rs +233 -211
  100. package/rust/core/parser/handler/at.rs +245 -162
  101. package/rust/core/parser/handler/bank.rs +94 -69
  102. package/rust/core/parser/handler/condition.rs +80 -74
  103. package/rust/core/parser/handler/dot.rs +143 -135
  104. package/rust/core/parser/handler/identifier/automate.rs +257 -0
  105. package/rust/core/parser/handler/identifier/call.rs +91 -88
  106. package/rust/core/parser/handler/identifier/emit.rs +66 -0
  107. package/rust/core/parser/handler/identifier/function.rs +100 -92
  108. package/rust/core/parser/handler/identifier/group.rs +85 -75
  109. package/rust/core/parser/handler/identifier/let_.rs +158 -127
  110. package/rust/core/parser/handler/identifier/mod.rs +54 -52
  111. package/rust/core/parser/handler/identifier/on.rs +98 -0
  112. package/rust/core/parser/handler/identifier/print.rs +52 -0
  113. package/rust/core/parser/handler/identifier/sleep.rs +36 -33
  114. package/rust/core/parser/handler/identifier/spawn.rs +91 -88
  115. package/rust/core/parser/handler/identifier/synth.rs +65 -65
  116. package/rust/core/parser/handler/loop_.rs +170 -72
  117. package/rust/core/parser/handler/mod.rs +8 -8
  118. package/rust/core/parser/handler/tempo.rs +53 -47
  119. package/rust/core/parser/mod.rs +4 -4
  120. package/rust/core/parser/statement.rs +142 -108
  121. package/rust/core/plugin/loader.rs +123 -48
  122. package/rust/core/plugin/mod.rs +2 -1
  123. package/rust/core/plugin/runner.rs +296 -0
  124. package/rust/core/preprocessor/loader.rs +515 -326
  125. package/rust/core/preprocessor/mod.rs +4 -4
  126. package/rust/core/preprocessor/module.rs +60 -58
  127. package/rust/core/preprocessor/processor.rs +99 -101
  128. package/rust/core/preprocessor/resolver/bank.rs +51 -49
  129. package/rust/core/preprocessor/resolver/call.rs +100 -100
  130. package/rust/core/preprocessor/resolver/condition.rs +97 -97
  131. package/rust/core/preprocessor/resolver/driver.rs +310 -278
  132. package/rust/core/preprocessor/resolver/function.rs +69 -78
  133. package/rust/core/preprocessor/resolver/group.rs +96 -91
  134. package/rust/core/preprocessor/resolver/let_.rs +32 -28
  135. package/rust/core/preprocessor/resolver/loop_.rs +320 -91
  136. package/rust/core/preprocessor/resolver/mod.rs +15 -15
  137. package/rust/core/preprocessor/resolver/spawn.rs +76 -92
  138. package/rust/core/preprocessor/resolver/synth.rs +56 -50
  139. package/rust/core/preprocessor/resolver/tempo.rs +50 -49
  140. package/rust/core/preprocessor/resolver/trigger.rs +113 -116
  141. package/rust/core/preprocessor/resolver/value.rs +81 -87
  142. package/rust/core/shared/bank.rs +1 -1
  143. package/rust/core/shared/duration.rs +9 -9
  144. package/rust/core/shared/mod.rs +3 -3
  145. package/rust/core/shared/value.rs +35 -32
  146. package/rust/core/store/function.rs +34 -34
  147. package/rust/core/store/global.rs +55 -38
  148. package/rust/core/store/mod.rs +5 -5
  149. package/rust/core/store/variable.rs +37 -34
  150. package/rust/core/utils/mod.rs +2 -2
  151. package/rust/core/utils/path.rs +37 -31
  152. package/rust/core/utils/validation.rs +35 -37
  153. package/rust/installer/addon.rs +84 -80
  154. package/rust/installer/bank.rs +62 -65
  155. package/rust/installer/mod.rs +5 -5
  156. package/rust/installer/plugin.rs +54 -55
  157. package/rust/installer/utils.rs +56 -56
  158. package/rust/lib.rs +156 -164
  159. package/rust/main.rs +250 -145
  160. package/rust/utils/error.rs +200 -0
  161. package/rust/utils/file.rs +38 -35
  162. package/rust/utils/first_usage.rs +76 -0
  163. package/rust/utils/logger.rs +195 -139
  164. package/rust/utils/mod.rs +9 -50
  165. package/rust/utils/signature.rs +19 -17
  166. package/rust/utils/spinner.rs +22 -19
  167. package/rust/utils/telemetry.rs +292 -0
  168. package/rust/utils/watcher.rs +34 -33
  169. package/templates/minimal/README.md +97 -121
  170. package/templates/welcome/README.md +97 -121
  171. package/typescript/bin/index.ts +19 -5
  172. package/typescript/index.ts +3 -1
  173. package/typescript/scripts/postbuild.ts +10 -6
  174. package/typescript/scripts/postinstall.ts +56 -0
  175. package/typescript/scripts/version/bump.ts +0 -1
  176. package/typescript/scripts/version/index.ts +0 -1
  177. package/out-tsc/bin/devalang.exe +0 -0
@@ -1,292 +1,297 @@
1
- use clap::{ Parser, Subcommand };
2
- use crate::utils::version::get_version;
3
-
4
- #[derive(Parser)]
5
- #[command(name = "devalang")]
6
- #[command(author = "Devaloop")]
7
- #[command(version = get_version())]
8
- #[command(about = "🦊 Devalang – A programming language for music and sound.")]
9
- pub struct Cli {
10
- #[arg(long, global = true)]
11
- /// Skips loading the configuration file.
12
- pub no_config: bool,
13
-
14
- #[command(subcommand)]
15
- pub command: Commands,
16
- }
17
-
18
- #[derive(Subcommand)]
19
- pub enum InstallCommand {
20
- /// Installs a bank.
21
- Bank {
22
- name: String,
23
- },
24
- /// Installs a plugin.
25
- Plugin {
26
- name: String,
27
- },
28
- /// Installs a preset.
29
- Preset {
30
- name: String,
31
- },
32
- }
33
-
34
- #[derive(Subcommand)]
35
- pub enum TemplateCommand {
36
- /// Lists all available templates for Devalang projects.
37
- List,
38
- /// Displays information about a specific template.
39
- Info {
40
- name: String,
41
- },
42
- }
43
-
44
- #[derive(Subcommand)]
45
- pub enum BankCommand {
46
- /// Lists installed banks.
47
- List,
48
- /// Lists all available banks.
49
- Available,
50
- /// Displays information about a specific bank.
51
- Info {
52
- name: String,
53
- },
54
- /// Removes a bank.
55
- Remove {
56
- name: String,
57
- },
58
- /// Updates a specific or all banks.
59
- Update {
60
- name: Option<String>,
61
- },
62
- }
63
-
64
- #[derive(Subcommand)]
65
- pub enum Commands {
66
- /// Create a new Devalang project.
67
- ///
68
- /// ### Arguments
69
- /// - `name` - The name of the project to create.
70
- /// - `template` - The template to use for the project. Defaults to "default".
71
- ///
72
- /// ### Example
73
- /// ```bash
74
- /// devalang init --name my_project --template default
75
- ///
76
- Init {
77
- #[arg(short, long)]
78
- /// The optional name (directory) of the project to create.
79
- name: Option<String>,
80
-
81
- #[arg(short, long)]
82
- /// The template to use for the project.
83
- ///
84
- /// ### Default value
85
- /// - `default`
86
- ///
87
- template: Option<String>,
88
- },
89
-
90
- /// Manage templates for Devalang projects.
91
- ///
92
- /// ### Subcommands
93
- /// - `list` - Lists all available templates.
94
- /// - `info <name>` - Displays information about a specific template.
95
- ///
96
- /// ### Example
97
- /// ```bash
98
- /// devalang template list
99
- /// devalang template info my_template
100
- /// ```bash
101
- ///
102
- Template {
103
- #[command(subcommand)]
104
- /// The template command to execute.
105
- command: TemplateCommand,
106
- },
107
-
108
- /// Build the program and generate output files.
109
- ///
110
- /// ### Arguments
111
- /// - `entry` - The entry point of the program to build. Defaults to "./src".
112
- /// - `output` - The directory where the output files will be generated. Defaults to "./output".
113
- /// - `watch` - Whether to watch for changes and rebuild. Defaults to "true".
114
- /// - `debug` - Whether to print debug information. Defaults to "false".
115
- /// - `compress` - Whether to compress the output files. Defaults to "false".
116
- ///
117
- /// ### Example
118
- /// ```bash
119
- /// devalang build --entry ./src --output ./output --watch true --debug false --compress false
120
- /// ```
121
- ///
122
- Build {
123
- #[arg(short, long)]
124
- /// The entry point of the program to build.
125
- ///
126
- entry: Option<String>,
127
-
128
- #[arg(short, long)]
129
- /// The directory where the output files will be generated.
130
- ///
131
- output: Option<String>,
132
-
133
- #[arg(long, default_value_t = false)]
134
- /// Whether to watch for changes and rebuild.
135
- ///
136
- /// ### Default value
137
- /// - `false`
138
- ///
139
- watch: bool,
140
-
141
- #[arg(short, long, default_value_t = false)]
142
- /// Whether to print debug information.
143
- ///
144
- /// ### Default value
145
- /// - `false`
146
- ///
147
- debug: bool,
148
-
149
- #[arg(short, long, default_value_t = false)]
150
- /// Whether to compress the output files.
151
- ///
152
- /// ### Default value
153
- /// - `false`
154
- ///
155
- compress: bool,
156
- },
157
-
158
- /// Analyze the program for errors and warnings.
159
- ///
160
- /// ### Arguments
161
- /// - `entry` - The entry point of the program to analyze. Defaults to "./src".
162
- /// - `output` - The directory where the output files will be generated. Defaults to "./output".
163
- /// - `watch` - Whether to watch for changes and re-analyze. Defaults to "true".
164
- /// - `debug` - Whether to print debug information. Defaults to "false".
165
- ///
166
- /// ### Example
167
- /// ```bash
168
- /// devalang check --entry ./src --output ./output --watch true --debug false
169
- /// ```
170
- ///
171
- Check {
172
- #[arg(short, long)]
173
- /// The entry point of the program to analyze.
174
- entry: Option<String>,
175
-
176
- #[arg(short, long)]
177
- /// The directory where the output files will be generated.
178
- output: Option<String>,
179
-
180
- #[arg(long, default_value_t = false)]
181
- /// Whether to watch for changes and re-analyze.
182
- ///
183
- /// ### Default value
184
- /// - `false`
185
- ///
186
- watch: bool,
187
-
188
- #[arg(short, long, default_value_t = false)]
189
- /// Whether to print debug information.
190
- ///
191
- /// ### Default value
192
- /// - `false`
193
- ///
194
- debug: bool,
195
- },
196
-
197
- /// Play the program and generate output files.
198
- ///
199
- /// ### Arguments
200
- /// - `entry` - The entry point of the program to play. Defaults to "./src".
201
- /// - `output` - The directory where the output files will be generated. Defaults to "./output".
202
- /// - `watch` - Whether to watch for changes and re-play. Defaults to "false".
203
- /// - `repeat` - Whether to replay the program after it finishes. Defaults to "false".
204
- /// - `debug` - Whether to print debug information. Defaults to "false".
205
- ///
206
- /// Note: `--repeat` and `--watch` cannot be used together. Instead use `repeat` to watch for changes and replay the program.
207
- ///
208
- /// ### Example
209
- /// ```bash
210
- /// devalang play --entry ./src --output ./output --repeat true --debug false
211
- /// ```
212
- ///
213
- Play {
214
- #[arg(short, long)]
215
- /// The entry point of the program to play.
216
- entry: Option<String>,
217
-
218
- #[arg(short, long)]
219
- /// The directory where the output files will be generated.
220
- output: Option<String>,
221
-
222
- #[arg(long, default_value_t = false)]
223
- /// Whether to watch for changes and re-play.
224
- ///
225
- /// ### Default value
226
- /// - `false`
227
- ///
228
- watch: bool,
229
-
230
- #[arg(long, default_value_t = false)]
231
- /// Whether to replay the program after it finishes.
232
- ///
233
- /// ### Default value
234
- /// - `false`
235
- ///
236
- repeat: bool,
237
-
238
- #[arg(short, long, default_value_t = false)]
239
- /// Whether to print debug information.
240
- ///
241
- /// ### Default value
242
- /// - `false`
243
- ///
244
- debug: bool,
245
- },
246
-
247
- /// Update the Devalang CLI to the latest version.
248
- ///
249
- /// ### Arguments
250
- /// - `only` - Selects what to update (separated by commas). Defaults to updating all components.
251
- ///
252
- Update {
253
- // #[arg(long, default_value_t = false)]
254
- /// Whether to allow updates when the working directory is dirty.
255
- // allow_dirty: bool,
256
-
257
- #[arg(long, default_value = "")]
258
- /// Selects what to update (separated by commas).
259
- only: Option<String>,
260
- },
261
-
262
- /// Install templates, banks, or plugins.
263
- ///
264
- /// ### Subcommands
265
- /// - `template` - Installs a template.
266
- /// - `bank` - Installs a bank.
267
- /// - `plugin` - Installs a plugin.
268
- ///
269
- Install {
270
- #[command(subcommand)]
271
- command: InstallCommand,
272
- },
273
-
274
- /// Manage banks for Devalang projects.
275
- ///
276
- /// ### Subcommands
277
- /// - `list` - Lists all available banks.
278
- /// - `info <name>` - Displays information about a specific bank.
279
- ///
280
- Bank {
281
- #[command(subcommand)]
282
- command: BankCommand,
283
- },
284
-
285
- /// Log in to your Devaloop account.
286
- ///
287
- Login {},
288
-
289
- /// Log out of your Devaloop account.
290
- ///
291
- Logout {},
292
- }
1
+ use crate::utils::version::get_version;
2
+ use clap::{Parser, Subcommand};
3
+
4
+ #[derive(Parser)]
5
+ #[command(name = "devalang")]
6
+ #[command(author = "Devaloop")]
7
+ #[command(version = get_version())]
8
+ #[command(about = "🦊 Devalang – A programming language for music and sound.")]
9
+ pub struct Cli {
10
+ #[arg(long, global = true)]
11
+ /// Skips loading the configuration file.
12
+ pub no_config: bool,
13
+
14
+ #[command(subcommand)]
15
+ pub command: Commands,
16
+ }
17
+
18
+ #[derive(Subcommand)]
19
+ pub enum TelemetryCommand {
20
+ /// Enables telemetry data collection.
21
+ Enable {},
22
+ /// Disables telemetry data collection.
23
+ Disable {},
24
+ }
25
+
26
+ #[derive(Subcommand)]
27
+ pub enum InstallCommand {
28
+ /// Installs a bank.
29
+ Bank { name: String },
30
+ /// Installs a plugin.
31
+ Plugin { name: String },
32
+ /// Installs a preset.
33
+ Preset { name: String },
34
+ }
35
+
36
+ #[derive(Subcommand)]
37
+ pub enum TemplateCommand {
38
+ /// Lists all available templates for Devalang projects.
39
+ List,
40
+ /// Displays information about a specific template.
41
+ Info { name: String },
42
+ }
43
+
44
+ #[derive(Subcommand)]
45
+ pub enum BankCommand {
46
+ /// Lists installed banks.
47
+ List,
48
+ /// Lists all available banks.
49
+ Available,
50
+ /// Displays information about a specific bank.
51
+ Info { name: String },
52
+ /// Removes a bank.
53
+ Remove { name: String },
54
+ /// Updates a specific or all banks.
55
+ Update { name: Option<String> },
56
+ }
57
+
58
+ #[derive(Subcommand)]
59
+ pub enum Commands {
60
+ /// Create a new Devalang project.
61
+ ///
62
+ /// ### Arguments
63
+ /// - `name` - The name of the project to create.
64
+ /// - `template` - The template to use for the project. Defaults to "default".
65
+ ///
66
+ /// ### Example
67
+ /// ```bash
68
+ /// devalang init --name my_project --template default
69
+ ///
70
+ Init {
71
+ #[arg(short, long)]
72
+ /// The optional name (directory) of the project to create.
73
+ name: Option<String>,
74
+
75
+ #[arg(short, long)]
76
+ /// The template to use for the project.
77
+ ///
78
+ /// ### Default value
79
+ /// - `default`
80
+ ///
81
+ template: Option<String>,
82
+ },
83
+
84
+ /// Manage templates for Devalang projects.
85
+ ///
86
+ /// ### Subcommands
87
+ /// - `list` - Lists all available templates.
88
+ /// - `info <name>` - Displays information about a specific template.
89
+ ///
90
+ /// ### Example
91
+ /// ```bash
92
+ /// devalang template list
93
+ /// devalang template info my_template
94
+ /// ```bash
95
+ ///
96
+ Template {
97
+ #[command(subcommand)]
98
+ /// The template command to execute.
99
+ command: TemplateCommand,
100
+ },
101
+
102
+ /// Build the program and generate output files.
103
+ ///
104
+ /// ### Arguments
105
+ /// - `entry` - The entry point of the program to build. Defaults to "./src".
106
+ /// - `output` - The directory where the output files will be generated. Defaults to "./output".
107
+ /// - `watch` - Whether to watch for changes and rebuild. Defaults to "true".
108
+ /// - `debug` - Whether to print debug information. Defaults to "false".
109
+ /// - `compress` - Whether to compress the output files. Defaults to "false".
110
+ ///
111
+ /// ### Example
112
+ /// ```bash
113
+ /// devalang build --entry ./src --output ./output --watch true --debug false --compress false
114
+ /// ```
115
+ ///
116
+ Build {
117
+ #[arg(short, long)]
118
+ /// The entry point of the program to build.
119
+ ///
120
+ entry: Option<String>,
121
+
122
+ #[arg(short, long)]
123
+ /// The directory where the output files will be generated.
124
+ ///
125
+ output: Option<String>,
126
+
127
+ #[arg(long, default_value_t = false)]
128
+ /// Whether to watch for changes and rebuild.
129
+ ///
130
+ /// ### Default value
131
+ /// - `false`
132
+ ///
133
+ watch: bool,
134
+
135
+ #[arg(short, long, default_value_t = false)]
136
+ /// Whether to print debug information.
137
+ ///
138
+ /// ### Default value
139
+ /// - `false`
140
+ ///
141
+ debug: bool,
142
+
143
+ #[arg(short, long, default_value_t = false)]
144
+ /// Whether to compress the output files.
145
+ ///
146
+ /// ### Default value
147
+ /// - `false`
148
+ ///
149
+ compress: bool,
150
+ },
151
+
152
+ /// Analyze the program for errors and warnings.
153
+ ///
154
+ /// ### Arguments
155
+ /// - `entry` - The entry point of the program to analyze. Defaults to "./src".
156
+ /// - `output` - The directory where the output files will be generated. Defaults to "./output".
157
+ /// - `watch` - Whether to watch for changes and re-analyze. Defaults to "true".
158
+ /// - `debug` - Whether to print debug information. Defaults to "false".
159
+ ///
160
+ /// ### Example
161
+ /// ```bash
162
+ /// devalang check --entry ./src --output ./output --watch true --debug false
163
+ /// ```
164
+ ///
165
+ Check {
166
+ #[arg(short, long)]
167
+ /// The entry point of the program to analyze.
168
+ entry: Option<String>,
169
+
170
+ #[arg(short, long)]
171
+ /// The directory where the output files will be generated.
172
+ output: Option<String>,
173
+
174
+ #[arg(long, default_value_t = false)]
175
+ /// Whether to watch for changes and re-analyze.
176
+ ///
177
+ /// ### Default value
178
+ /// - `false`
179
+ ///
180
+ watch: bool,
181
+
182
+ #[arg(short, long, default_value_t = false)]
183
+ /// Whether to print debug information.
184
+ ///
185
+ /// ### Default value
186
+ /// - `false`
187
+ ///
188
+ debug: bool,
189
+ },
190
+
191
+ /// Play the program and generate output files.
192
+ ///
193
+ /// ### Arguments
194
+ /// - `entry` - The entry point of the program to play. Defaults to "./src".
195
+ /// - `output` - The directory where the output files will be generated. Defaults to "./output".
196
+ /// - `watch` - Whether to watch for changes and re-play. Defaults to "false".
197
+ /// - `repeat` - Whether to replay the program after it finishes. Defaults to "false".
198
+ /// - `debug` - Whether to print debug information. Defaults to "false".
199
+ ///
200
+ /// Note: `--repeat` and `--watch` cannot be used together. Instead use `repeat` to watch for changes and replay the program.
201
+ ///
202
+ /// ### Example
203
+ /// ```bash
204
+ /// devalang play --entry ./src --output ./output --repeat true --debug false
205
+ /// ```
206
+ ///
207
+ Play {
208
+ #[arg(short, long)]
209
+ /// The entry point of the program to play.
210
+ entry: Option<String>,
211
+
212
+ #[arg(short, long)]
213
+ /// The directory where the output files will be generated.
214
+ output: Option<String>,
215
+
216
+ #[arg(long, default_value_t = false)]
217
+ /// Whether to watch for changes and re-play.
218
+ ///
219
+ /// ### Default value
220
+ /// - `false`
221
+ ///
222
+ watch: bool,
223
+
224
+ #[arg(long, default_value_t = false)]
225
+ /// Whether to replay the program after it finishes.
226
+ ///
227
+ /// ### Default value
228
+ /// - `false`
229
+ ///
230
+ repeat: bool,
231
+
232
+ #[arg(short, long, default_value_t = false)]
233
+ /// Whether to print debug information.
234
+ ///
235
+ /// ### Default value
236
+ /// - `false`
237
+ ///
238
+ debug: bool,
239
+ },
240
+
241
+ /// Update the Devalang CLI to the latest version.
242
+ ///
243
+ /// ### Arguments
244
+ /// - `only` - Selects what to update (separated by commas). Defaults to updating all components.
245
+ ///
246
+ Update {
247
+ // #[arg(long, default_value_t = false)]
248
+ /// Whether to allow updates when the working directory is dirty.
249
+ // allow_dirty: bool,
250
+
251
+ #[arg(long, default_value = "")]
252
+ /// Selects what to update (separated by commas).
253
+ only: Option<String>,
254
+ },
255
+
256
+ /// Install templates, banks, or plugins.
257
+ ///
258
+ /// ### Subcommands
259
+ /// - `template` - Installs a template.
260
+ /// - `bank` - Installs a bank.
261
+ /// - `plugin` - Installs a plugin.
262
+ ///
263
+ Install {
264
+ #[command(subcommand)]
265
+ command: InstallCommand,
266
+ },
267
+
268
+ /// Manage banks for Devalang projects.
269
+ ///
270
+ /// ### Subcommands
271
+ /// - `list` - Lists all available banks.
272
+ /// - `info <name>` - Displays information about a specific bank.
273
+ ///
274
+ Bank {
275
+ #[command(subcommand)]
276
+ command: BankCommand,
277
+ },
278
+
279
+ /// Telemetry settings for Devalang.
280
+ ///
281
+ /// ### Subcommands
282
+ /// - `enable` - Enables telemetry data collection.
283
+ /// - `disable` - Disables telemetry data collection.
284
+ ///
285
+ Telemetry {
286
+ #[command(subcommand)]
287
+ command: TelemetryCommand,
288
+ },
289
+
290
+ /// Log in to your Devaloop account.
291
+ ///
292
+ Login {},
293
+
294
+ /// Log out of your Devaloop account.
295
+ ///
296
+ Logout {},
297
+ }
@@ -0,0 +1 @@
1
+ // TODO: Plugin generator