@devaloop/devalang 0.0.1-beta.3 → 0.1.2

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 (346) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +251 -221
  3. package/out-tsc/api.d.ts +180 -0
  4. package/out-tsc/api.d.ts.map +1 -0
  5. package/out-tsc/api.js +286 -0
  6. package/out-tsc/api.js.map +1 -0
  7. package/out-tsc/bin/index.d.ts +12 -0
  8. package/out-tsc/bin/index.d.ts.map +1 -0
  9. package/out-tsc/bin/index.js +20 -54
  10. package/out-tsc/bin/index.js.map +1 -0
  11. package/out-tsc/examples/basic-usage.d.ts +8 -0
  12. package/out-tsc/examples/basic-usage.d.ts.map +1 -0
  13. package/out-tsc/examples/basic-usage.js +113 -0
  14. package/out-tsc/examples/basic-usage.js.map +1 -0
  15. package/out-tsc/index.d.ts +19 -5
  16. package/out-tsc/index.d.ts.map +1 -0
  17. package/out-tsc/index.js +24 -6
  18. package/out-tsc/index.js.map +1 -0
  19. package/out-tsc/scripts/copy-wasm-dts.d.ts +7 -0
  20. package/out-tsc/scripts/copy-wasm-dts.d.ts.map +1 -0
  21. package/out-tsc/scripts/copy-wasm-dts.js +36 -32
  22. package/out-tsc/scripts/copy-wasm-dts.js.map +1 -0
  23. package/out-tsc/scripts/postinstall.d.ts +1 -0
  24. package/out-tsc/scripts/postinstall.d.ts.map +1 -0
  25. package/out-tsc/scripts/postinstall.js +4 -1
  26. package/out-tsc/scripts/postinstall.js.map +1 -0
  27. package/out-tsc/scripts/version/bump.d.ts +5 -1
  28. package/out-tsc/scripts/version/bump.d.ts.map +1 -0
  29. package/out-tsc/scripts/version/bump.js +122 -44
  30. package/out-tsc/scripts/version/bump.js.map +1 -0
  31. package/out-tsc/scripts/version/fetch.d.ts +12 -1
  32. package/out-tsc/scripts/version/fetch.d.ts.map +1 -0
  33. package/out-tsc/scripts/version/fetch.js +68 -24
  34. package/out-tsc/scripts/version/fetch.js.map +1 -0
  35. package/out-tsc/scripts/version/index.d.ts +6 -0
  36. package/out-tsc/scripts/version/index.d.ts.map +1 -0
  37. package/out-tsc/scripts/version/index.js +44 -22
  38. package/out-tsc/scripts/version/index.js.map +1 -0
  39. package/out-tsc/scripts/version/sync.d.ts +5 -1
  40. package/out-tsc/scripts/version/sync.d.ts.map +1 -0
  41. package/out-tsc/scripts/version/sync.js +95 -29
  42. package/out-tsc/scripts/version/sync.js.map +1 -0
  43. package/out-tsc/types.d.ts +68 -0
  44. package/out-tsc/types.d.ts.map +1 -0
  45. package/out-tsc/{core/types/value.js → types.js} +4 -0
  46. package/out-tsc/types.js.map +1 -0
  47. package/out-tsc/wasm.d.ts +8 -0
  48. package/out-tsc/wasm.d.ts.map +1 -0
  49. package/out-tsc/{core/index.js → wasm.js} +9 -6
  50. package/out-tsc/wasm.js.map +1 -0
  51. package/package.json +42 -42
  52. package/.cargo/config.toml +0 -2
  53. package/.devalang +0 -9
  54. package/.github/workflows/ci.yml +0 -103
  55. package/Cargo.toml +0 -84
  56. package/docs/CHANGELOG.md +0 -622
  57. package/docs/CONTRIBUTING.md +0 -101
  58. package/docs/ROADMAP.md +0 -38
  59. package/docs/TODO.md +0 -71
  60. package/examples/automation.deva +0 -42
  61. package/examples/bank.deva +0 -7
  62. package/examples/bus.deva +0 -10
  63. package/examples/chain.deva +0 -19
  64. package/examples/condition.deva +0 -20
  65. package/examples/duration.deva +0 -9
  66. package/examples/effect.deva +0 -2
  67. package/examples/events.deva +0 -12
  68. package/examples/filter.deva +0 -11
  69. package/examples/function.deva +0 -15
  70. package/examples/group.deva +0 -12
  71. package/examples/index.deva +0 -63
  72. package/examples/lfo.deva +0 -9
  73. package/examples/loop.deva +0 -10
  74. package/examples/pattern.deva +0 -8
  75. package/examples/plugin.deva +0 -16
  76. package/examples/routing.deva +0 -23
  77. package/examples/samples/hat-808.wav +0 -0
  78. package/examples/samples/kick-808.wav +0 -0
  79. package/examples/synth.deva +0 -24
  80. package/examples/synth_types.deva +0 -17
  81. package/examples/variables.deva +0 -9
  82. package/out-tsc/bin/project-version.json +0 -6
  83. package/out-tsc/core/functions/index.d.ts +0 -42
  84. package/out-tsc/core/functions/index.js +0 -87
  85. package/out-tsc/core/index.d.ts +0 -6
  86. package/out-tsc/core/types/index.d.ts +0 -4
  87. package/out-tsc/core/types/index.js +0 -20
  88. package/out-tsc/core/types/plugin.d.ts +0 -18
  89. package/out-tsc/core/types/plugin.js +0 -2
  90. package/out-tsc/core/types/result.d.ts +0 -27
  91. package/out-tsc/core/types/result.js +0 -2
  92. package/out-tsc/core/types/statement.d.ts +0 -106
  93. package/out-tsc/core/types/statement.js +0 -2
  94. package/out-tsc/core/types/value.d.ts +0 -43
  95. package/out-tsc/pkg/devalang_core.d.ts +0 -15
  96. package/out-tsc/pkg/devalang_core.js +0 -65
  97. package/out-tsc/pkg/devalang_core_bg.wasm.d.ts +0 -34
  98. package/out-tsc/scripts/version/copy-to-binary.d.ts +0 -1
  99. package/out-tsc/scripts/version/copy-to-binary.js +0 -79
  100. package/project-version.json +0 -6
  101. package/rust/bindings/Cargo.toml +0 -9
  102. package/rust/bindings/src/lib.rs +0 -86
  103. package/rust/cli/addon/commands.rs +0 -35
  104. package/rust/cli/addon/download.rs +0 -234
  105. package/rust/cli/addon/install.rs +0 -33
  106. package/rust/cli/addon/list.rs +0 -224
  107. package/rust/cli/addon/metadata.rs +0 -124
  108. package/rust/cli/addon/mod.rs +0 -8
  109. package/rust/cli/addon/remove.rs +0 -271
  110. package/rust/cli/addon/update.rs +0 -305
  111. package/rust/cli/addon/utils.rs +0 -109
  112. package/rust/cli/build/commands.rs +0 -153
  113. package/rust/cli/build/mod.rs +0 -2
  114. package/rust/cli/build/process.rs +0 -165
  115. package/rust/cli/check/mod.rs +0 -208
  116. package/rust/cli/discover/commands.rs +0 -275
  117. package/rust/cli/discover/config.rs +0 -109
  118. package/rust/cli/discover/fs.rs +0 -19
  119. package/rust/cli/discover/install.rs +0 -214
  120. package/rust/cli/discover/metadata.rs +0 -48
  121. package/rust/cli/discover/mod.rs +0 -5
  122. package/rust/cli/init/commands.rs +0 -88
  123. package/rust/cli/init/mod.rs +0 -1
  124. package/rust/cli/login/commands.rs +0 -124
  125. package/rust/cli/login/mod.rs +0 -1
  126. package/rust/cli/me/commands.rs +0 -52
  127. package/rust/cli/me/mod.rs +0 -1
  128. package/rust/cli/mod.rs +0 -12
  129. package/rust/cli/parser.rs +0 -320
  130. package/rust/cli/play/commands.rs +0 -375
  131. package/rust/cli/play/io.rs +0 -17
  132. package/rust/cli/play/mod.rs +0 -5
  133. package/rust/cli/play/process.rs +0 -159
  134. package/rust/cli/play/realtime.rs +0 -91
  135. package/rust/cli/play/utils.rs +0 -23
  136. package/rust/cli/telemetry/commands.rs +0 -22
  137. package/rust/cli/telemetry/event_creator.rs +0 -80
  138. package/rust/cli/telemetry/mod.rs +0 -3
  139. package/rust/cli/telemetry/send.rs +0 -51
  140. package/rust/cli/template/commands.rs +0 -69
  141. package/rust/cli/template/mod.rs +0 -1
  142. package/rust/cli/update/commands.rs +0 -6
  143. package/rust/cli/update/mod.rs +0 -1
  144. package/rust/config/driver.rs +0 -112
  145. package/rust/config/mod.rs +0 -3
  146. package/rust/config/ops.rs +0 -26
  147. package/rust/config/settings.rs +0 -101
  148. package/rust/core/audio/engine/driver.rs +0 -237
  149. package/rust/core/audio/engine/export.rs +0 -169
  150. package/rust/core/audio/engine/helpers.rs +0 -178
  151. package/rust/core/audio/engine/mod.rs +0 -56
  152. package/rust/core/audio/engine/notes/dsp.rs +0 -88
  153. package/rust/core/audio/engine/notes/mod.rs +0 -53
  154. package/rust/core/audio/engine/notes/params.rs +0 -294
  155. package/rust/core/audio/engine/sample/insert.rs +0 -300
  156. package/rust/core/audio/engine/sample/mod.rs +0 -40
  157. package/rust/core/audio/engine/sample/padding.rs +0 -170
  158. package/rust/core/audio/evaluator/condition.rs +0 -61
  159. package/rust/core/audio/evaluator/mod.rs +0 -9
  160. package/rust/core/audio/evaluator/numeric.rs +0 -152
  161. package/rust/core/audio/evaluator/rhs.rs +0 -16
  162. package/rust/core/audio/evaluator/string_expr.rs +0 -94
  163. package/rust/core/audio/interpreter/driver.rs +0 -574
  164. package/rust/core/audio/interpreter/mod.rs +0 -2
  165. package/rust/core/audio/interpreter/statements/arrow_call/interprete.rs +0 -179
  166. package/rust/core/audio/interpreter/statements/arrow_call/methods/chord.rs +0 -398
  167. package/rust/core/audio/interpreter/statements/arrow_call/methods/effects.rs +0 -323
  168. package/rust/core/audio/interpreter/statements/arrow_call/methods/mod.rs +0 -3
  169. package/rust/core/audio/interpreter/statements/arrow_call/methods/note.rs +0 -371
  170. package/rust/core/audio/interpreter/statements/arrow_call/mod.rs +0 -3
  171. package/rust/core/audio/interpreter/statements/arrow_call/types/arp.rs +0 -192
  172. package/rust/core/audio/interpreter/statements/arrow_call/types/mod.rs +0 -24
  173. package/rust/core/audio/interpreter/statements/arrow_call/types/pad.rs +0 -116
  174. package/rust/core/audio/interpreter/statements/arrow_call/types/pluck.rs +0 -97
  175. package/rust/core/audio/interpreter/statements/arrow_call/types/sub.rs +0 -100
  176. package/rust/core/audio/interpreter/statements/automate.rs +0 -16
  177. package/rust/core/audio/interpreter/statements/call.rs +0 -325
  178. package/rust/core/audio/interpreter/statements/condition.rs +0 -72
  179. package/rust/core/audio/interpreter/statements/function.rs +0 -24
  180. package/rust/core/audio/interpreter/statements/let_.rs +0 -36
  181. package/rust/core/audio/interpreter/statements/load.rs +0 -17
  182. package/rust/core/audio/interpreter/statements/loop_.rs +0 -115
  183. package/rust/core/audio/interpreter/statements/mod.rs +0 -12
  184. package/rust/core/audio/interpreter/statements/sleep.rs +0 -28
  185. package/rust/core/audio/interpreter/statements/spawn.rs +0 -302
  186. package/rust/core/audio/interpreter/statements/tempo.rs +0 -40
  187. package/rust/core/audio/interpreter/statements/trigger.rs +0 -242
  188. package/rust/core/audio/loader/mod.rs +0 -1
  189. package/rust/core/audio/loader/trigger.rs +0 -98
  190. package/rust/core/audio/mod.rs +0 -6
  191. package/rust/core/audio/player.rs +0 -70
  192. package/rust/core/audio/special/easing.rs +0 -189
  193. package/rust/core/audio/special/env.rs +0 -45
  194. package/rust/core/audio/special/math.rs +0 -134
  195. package/rust/core/audio/special/mod.rs +0 -9
  196. package/rust/core/audio/special/modulator.rs +0 -143
  197. package/rust/core/builder/mod.rs +0 -129
  198. package/rust/core/debugger/lexer.rs +0 -27
  199. package/rust/core/debugger/logs.rs +0 -52
  200. package/rust/core/debugger/mod.rs +0 -30
  201. package/rust/core/debugger/preprocessor.rs +0 -27
  202. package/rust/core/debugger/store.rs +0 -38
  203. package/rust/core/error/mod.rs +0 -269
  204. package/rust/core/lexer/driver.rs +0 -59
  205. package/rust/core/lexer/handler/arrow.rs +0 -82
  206. package/rust/core/lexer/handler/at.rs +0 -21
  207. package/rust/core/lexer/handler/brace.rs +0 -41
  208. package/rust/core/lexer/handler/colon.rs +0 -21
  209. package/rust/core/lexer/handler/comment.rs +0 -30
  210. package/rust/core/lexer/handler/dot.rs +0 -21
  211. package/rust/core/lexer/handler/driver.rs +0 -337
  212. package/rust/core/lexer/handler/identifier.rs +0 -47
  213. package/rust/core/lexer/handler/indent.rs +0 -66
  214. package/rust/core/lexer/handler/mod.rs +0 -15
  215. package/rust/core/lexer/handler/newline.rs +0 -23
  216. package/rust/core/lexer/handler/number.rs +0 -31
  217. package/rust/core/lexer/handler/operator.rs +0 -46
  218. package/rust/core/lexer/handler/parenthesis.rs +0 -41
  219. package/rust/core/lexer/handler/slash.rs +0 -21
  220. package/rust/core/lexer/handler/string.rs +0 -63
  221. package/rust/core/lexer/mod.rs +0 -3
  222. package/rust/core/lexer/token.rs +0 -91
  223. package/rust/core/mod.rs +0 -9
  224. package/rust/core/parser/driver/block.rs +0 -111
  225. package/rust/core/parser/driver/cursor.rs +0 -82
  226. package/rust/core/parser/driver/driver_impl.rs +0 -159
  227. package/rust/core/parser/driver/mod.rs +0 -6
  228. package/rust/core/parser/driver/parse_array.rs +0 -120
  229. package/rust/core/parser/driver/parse_map.rs +0 -247
  230. package/rust/core/parser/driver/parser.rs +0 -160
  231. package/rust/core/parser/handler/arrow_call.rs +0 -328
  232. package/rust/core/parser/handler/at.rs +0 -279
  233. package/rust/core/parser/handler/bank.rs +0 -104
  234. package/rust/core/parser/handler/condition.rs +0 -83
  235. package/rust/core/parser/handler/dot.rs +0 -148
  236. package/rust/core/parser/handler/identifier/automate.rs +0 -254
  237. package/rust/core/parser/handler/identifier/call.rs +0 -91
  238. package/rust/core/parser/handler/identifier/emit.rs +0 -70
  239. package/rust/core/parser/handler/identifier/function.rs +0 -113
  240. package/rust/core/parser/handler/identifier/group.rs +0 -89
  241. package/rust/core/parser/handler/identifier/let_.rs +0 -173
  242. package/rust/core/parser/handler/identifier/mod.rs +0 -55
  243. package/rust/core/parser/handler/identifier/on.rs +0 -107
  244. package/rust/core/parser/handler/identifier/print.rs +0 -49
  245. package/rust/core/parser/handler/identifier/sleep.rs +0 -96
  246. package/rust/core/parser/handler/identifier/spawn.rs +0 -91
  247. package/rust/core/parser/handler/identifier/synth.rs +0 -171
  248. package/rust/core/parser/handler/loop_.rs +0 -194
  249. package/rust/core/parser/handler/mod.rs +0 -9
  250. package/rust/core/parser/handler/pattern.rs +0 -97
  251. package/rust/core/parser/handler/tempo.rs +0 -105
  252. package/rust/core/parser/mod.rs +0 -3
  253. package/rust/core/parser/statement.rs +0 -10
  254. package/rust/core/plugin/loader.rs +0 -137
  255. package/rust/core/plugin/mod.rs +0 -2
  256. package/rust/core/plugin/runner/mod.rs +0 -11
  257. package/rust/core/plugin/runner/non_wasm.rs +0 -481
  258. package/rust/core/plugin/runner/wasm32.rs +0 -44
  259. package/rust/core/preprocessor/loader/inject.rs +0 -313
  260. package/rust/core/preprocessor/loader/loader_helpers.rs +0 -110
  261. package/rust/core/preprocessor/loader/mod.rs +0 -235
  262. package/rust/core/preprocessor/mod.rs +0 -4
  263. package/rust/core/preprocessor/module.rs +0 -55
  264. package/rust/core/preprocessor/processor/handlers.rs +0 -107
  265. package/rust/core/preprocessor/processor/mod.rs +0 -1
  266. package/rust/core/preprocessor/resolver/bank.rs +0 -49
  267. package/rust/core/preprocessor/resolver/call.rs +0 -124
  268. package/rust/core/preprocessor/resolver/condition.rs +0 -95
  269. package/rust/core/preprocessor/resolver/driver.rs +0 -324
  270. package/rust/core/preprocessor/resolver/function.rs +0 -69
  271. package/rust/core/preprocessor/resolver/group.rs +0 -122
  272. package/rust/core/preprocessor/resolver/let_.rs +0 -32
  273. package/rust/core/preprocessor/resolver/loop_.rs +0 -318
  274. package/rust/core/preprocessor/resolver/mod.rs +0 -16
  275. package/rust/core/preprocessor/resolver/pattern.rs +0 -95
  276. package/rust/core/preprocessor/resolver/spawn.rs +0 -99
  277. package/rust/core/preprocessor/resolver/synth.rs +0 -54
  278. package/rust/core/preprocessor/resolver/tempo.rs +0 -48
  279. package/rust/core/preprocessor/resolver/trigger.rs +0 -116
  280. package/rust/core/preprocessor/resolver/value.rs +0 -176
  281. package/rust/core/store/global.rs +0 -57
  282. package/rust/core/store/mod.rs +0 -1
  283. package/rust/lib.rs +0 -323
  284. package/rust/macros/Cargo.toml +0 -14
  285. package/rust/macros/src/lib.rs +0 -52
  286. package/rust/main.rs +0 -557
  287. package/rust/types/Cargo.toml +0 -11
  288. package/rust/types/src/addons.rs +0 -57
  289. package/rust/types/src/ast.rs +0 -202
  290. package/rust/types/src/config.rs +0 -82
  291. package/rust/types/src/lib.rs +0 -15
  292. package/rust/types/src/plugin.rs +0 -20
  293. package/rust/types/src/store.rs +0 -139
  294. package/rust/types/src/telemetry.rs +0 -85
  295. package/rust/utils/Cargo.toml +0 -29
  296. package/rust/utils/src/error.rs +0 -186
  297. package/rust/utils/src/file.rs +0 -477
  298. package/rust/utils/src/first_usage.rs +0 -97
  299. package/rust/utils/src/lib.rs +0 -9
  300. package/rust/utils/src/logger.rs +0 -200
  301. package/rust/utils/src/path.rs +0 -158
  302. package/rust/utils/src/signature.rs +0 -41
  303. package/rust/utils/src/spinner.rs +0 -20
  304. package/rust/utils/src/version.rs +0 -58
  305. package/rust/utils/src/watcher.rs +0 -46
  306. package/rust/web/api.rs +0 -5
  307. package/rust/web/auth.rs +0 -5
  308. package/rust/web/cdn.rs +0 -34
  309. package/rust/web/forge.rs +0 -5
  310. package/rust/web/mod.rs +0 -5
  311. package/rust/web/sso.rs +0 -5
  312. package/templates/minimal/.devalang +0 -5
  313. package/templates/minimal/README.md +0 -218
  314. package/templates/minimal/src/index.deva +0 -2
  315. package/templates/welcome/.devalang +0 -5
  316. package/templates/welcome/README.md +0 -218
  317. package/templates/welcome/samples/kick-808.wav +0 -0
  318. package/templates/welcome/src/index.deva +0 -61
  319. package/templates/welcome/src/variables.deva +0 -3
  320. package/tests/integration.rs +0 -21
  321. package/tests/rust/cli_check_build.rs +0 -21
  322. package/tests/rust/cli_help.rs +0 -12
  323. package/tests/rust/cli_template_list.rs +0 -10
  324. package/tests/rust/cli_version.rs +0 -11
  325. package/tests/typescript/index.spec.ts +0 -136
  326. package/tests/typescript/playhead.spec.ts +0 -36
  327. package/tests/typescript/render_e2e.spec.ts +0 -77
  328. package/tsconfig.json +0 -115
  329. package/typescript/bin/index.ts +0 -28
  330. package/typescript/core/functions/index.ts +0 -94
  331. package/typescript/core/index.ts +0 -6
  332. package/typescript/core/types/index.ts +0 -4
  333. package/typescript/core/types/plugin.ts +0 -19
  334. package/typescript/core/types/result.ts +0 -29
  335. package/typescript/core/types/statement.ts +0 -47
  336. package/typescript/core/types/value.ts +0 -29
  337. package/typescript/index.ts +0 -8
  338. package/typescript/pkg/devalang_core.d.ts +0 -4
  339. package/typescript/pkg/devalang_core.ts +0 -65
  340. package/typescript/scripts/copy-wasm-dts.ts +0 -41
  341. package/typescript/scripts/postinstall.ts +0 -85
  342. package/typescript/scripts/version/bump.ts +0 -44
  343. package/typescript/scripts/version/copy-to-binary.ts +0 -82
  344. package/typescript/scripts/version/fetch.ts +0 -18
  345. package/typescript/scripts/version/index.ts +0 -25
  346. package/typescript/scripts/version/sync.ts +0 -24
@@ -1,30 +1,74 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
14
35
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.fetchVersion = void 0;
16
- const fs_1 = __importDefault(require("fs"));
36
+ exports.fetchVersion = fetchVersion;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
17
39
  const child_process_1 = require("child_process");
18
- const fetchVersion = (projectVersionPath) => __awaiter(void 0, void 0, void 0, function* () {
19
- const data = JSON.parse(fs_1.default.readFileSync(projectVersionPath, "utf-8"));
20
- data.build = (data.build || 0) + 1;
40
+ /**
41
+ * Fetches current version information and increments build number
42
+ */
43
+ async function fetchVersion() {
44
+ const rootPath = path.resolve(__dirname, '../../../..');
45
+ const projectVersionPath = path.join(rootPath, 'project-version.json');
46
+ let projectVersion;
47
+ if (fs.existsSync(projectVersionPath)) {
48
+ projectVersion = JSON.parse(fs.readFileSync(projectVersionPath, 'utf-8'));
49
+ }
50
+ else {
51
+ // Fallback to package.json
52
+ const packageJsonPath = path.join(rootPath, 'package.json');
53
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
54
+ projectVersion = {
55
+ version: packageJson.version,
56
+ channel: 'stable',
57
+ build: 1
58
+ };
59
+ }
60
+ // Get git commit hash
21
61
  try {
22
- const commit = (0, child_process_1.execSync)("git rev-parse HEAD").toString().trim();
23
- data.lastCommit = commit;
62
+ const commit = (0, child_process_1.execSync)('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim();
63
+ projectVersion.commit = commit;
24
64
  }
25
- catch (err) {
26
- console.warn("⚠️ Unable to fetch git commit hash. Ensure you are in a git repository.");
65
+ catch (error) {
66
+ console.warn('⚠️ Could not get git commit hash');
27
67
  }
28
- fs_1.default.writeFileSync(projectVersionPath, JSON.stringify(data, null, 2));
29
- });
30
- exports.fetchVersion = fetchVersion;
68
+ // Increment build number
69
+ projectVersion.build++;
70
+ // Save updated version
71
+ fs.writeFileSync(projectVersionPath, JSON.stringify(projectVersion, null, 2) + '\n');
72
+ return projectVersion;
73
+ }
74
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../src/typescript/scripts/version/fetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,oCAmCC;AAjDD,uCAAyB;AACzB,2CAA6B;AAC7B,iDAAyC;AASzC;;GAEG;AACI,KAAK,UAAU,YAAY;IAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;IAEvE,IAAI,cAA8B,CAAC;IAEnC,IAAI,EAAE,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QACtC,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC;IAC5E,CAAC;SAAM,CAAC;QACN,2BAA2B;QAC3B,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;QAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;QAE1E,cAAc,GAAG;YACf,OAAO,EAAE,WAAW,CAAC,OAAO;YAC5B,OAAO,EAAE,QAAQ;YACjB,KAAK,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;IAED,sBAAsB;IACtB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QACpF,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;IACpD,CAAC;IAED,yBAAyB;IACzB,cAAc,CAAC,KAAK,EAAE,CAAC;IAEvB,uBAAuB;IACvB,EAAE,CAAC,aAAa,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAErF,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -1 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Version management CLI
4
+ * Bumps version across package.json, Cargo.toml, and project-version.json
5
+ */
1
6
  export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/typescript/scripts/version/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}
@@ -1,32 +1,54 @@
1
+ #!/usr/bin/env node
1
2
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
3
+ /**
4
+ * Version management CLI
5
+ * Bumps version across package.json, Cargo.toml, and project-version.json
6
+ */
14
7
  Object.defineProperty(exports, "__esModule", { value: true });
15
- const path_1 = __importDefault(require("path"));
16
8
  const bump_1 = require("./bump");
17
9
  const sync_1 = require("./sync");
18
10
  const fetch_1 = require("./fetch");
19
- const bumpType = process.argv[2] || "patch";
20
- (() => __awaiter(void 0, void 0, void 0, function* () {
21
- const projectVersionPath = path_1.default.join(__dirname, "../../../project-version.json");
11
+ const args = process.argv.slice(2);
12
+ const command = args[0];
13
+ const options = args.slice(1);
14
+ async function main() {
22
15
  try {
23
- const newVersion = yield (0, bump_1.bumpVersion)(bumpType, projectVersionPath);
24
- yield (0, fetch_1.fetchVersion)(projectVersionPath);
25
- yield (0, sync_1.syncVersion)(projectVersionPath);
26
- console.log(`✅ Project version updated to : ${newVersion}`);
16
+ switch (command) {
17
+ case 'bump': {
18
+ const type = options[0];
19
+ if (!['major', 'minor', 'patch', 'pre'].includes(type)) {
20
+ console.error('❌ Usage: npm run version:bump <major|minor|patch|pre>');
21
+ process.exit(1);
22
+ }
23
+ const preTag = options[1] || 'beta';
24
+ await (0, bump_1.bumpVersion)(type, preTag);
25
+ console.log(`✅ Version bumped to ${type}`);
26
+ break;
27
+ }
28
+ case 'sync': {
29
+ await (0, sync_1.syncVersion)();
30
+ console.log('✅ Version synchronized across all files');
31
+ break;
32
+ }
33
+ case 'fetch': {
34
+ const version = await (0, fetch_1.fetchVersion)();
35
+ console.log(`📦 Current version: ${version.version}`);
36
+ console.log(`📍 Channel: ${version.channel}`);
37
+ console.log(`🏗️ Build: ${version.build}`);
38
+ console.log(`🔖 Commit: ${version.commit || 'unknown'}`);
39
+ break;
40
+ }
41
+ default:
42
+ console.error('❌ Usage: npm run version:bump <major|minor|patch|pre> [pre-tag]');
43
+ console.error(' npm run version:sync');
44
+ console.error(' npm run version:fetch');
45
+ process.exit(1);
46
+ }
27
47
  }
28
48
  catch (error) {
29
- console.error(`❌ Error updating project version: ${error}`);
49
+ console.error('❌ Error:', error);
30
50
  process.exit(1);
31
51
  }
32
- }))();
52
+ }
53
+ main();
54
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/typescript/scripts/version/index.ts"],"names":[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AAe,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC9C,OAAO,CAAC,GAAG,CAAC,eAAe,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;gBAC5C,OAAO,CAAC,GAAG,CAAC,cAAc,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC,CAAC;gBACzD,MAAM;YACR,CAAC;YAED;gBACE,OAAO,CAAC,KAAK,CAAC,iEAAiE,CAAC,CAAC;gBACjF,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;gBAC7C,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;gBAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACjC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -1 +1,5 @@
1
- export declare const syncVersion: (projectVersionPath: string) => Promise<void>;
1
+ /**
2
+ * Synchronizes version from package.json to all other version files
3
+ */
4
+ export declare function syncVersion(): Promise<void>;
5
+ //# sourceMappingURL=sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/typescript/scripts/version/sync.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAoEjD"}
@@ -1,32 +1,98 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.syncVersion = void 0;
16
- const fs_1 = __importDefault(require("fs"));
17
- const path_1 = __importDefault(require("path"));
18
- const syncVersion = (projectVersionPath) => __awaiter(void 0, void 0, void 0, function* () {
19
- const version = fs_1.default.readFileSync(projectVersionPath, "utf-8").trim();
20
- const versionString = JSON.parse(version).version;
21
- // Package.json
22
- const pkgPath = path_1.default.join(__dirname, "..", "..", "..", "package.json");
23
- const pkgJson = JSON.parse(fs_1.default.readFileSync(pkgPath, "utf-8"));
24
- pkgJson.version = versionString;
25
- fs_1.default.writeFileSync(pkgPath, JSON.stringify(pkgJson, null, 2));
26
- // Cargo.toml
27
- const cargoPath = path_1.default.join(__dirname, "..", "..", "..", "Cargo.toml");
28
- const cargoToml = fs_1.default.readFileSync(cargoPath, "utf-8");
29
- const updatedCargo = cargoToml.replace(/(version\s*=\s*")[^"]*(")/, `$1${versionString}$2`);
30
- fs_1.default.writeFileSync(cargoPath, updatedCargo);
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
31
17
  });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
32
36
  exports.syncVersion = syncVersion;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ /**
40
+ * Synchronizes version from package.json to all other version files
41
+ */
42
+ async function syncVersion() {
43
+ const rootPath = path.resolve(__dirname, '../../../..');
44
+ // Read package.json as source of truth
45
+ const packageJsonPath = path.join(rootPath, 'package.json');
46
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
47
+ const version = packageJson.version;
48
+ if (!version) {
49
+ throw new Error('No version found in package.json');
50
+ }
51
+ // Determine channel from version
52
+ const isPreRelease = version.includes('-');
53
+ let channel = 'stable';
54
+ if (isPreRelease) {
55
+ if (version.includes('alpha'))
56
+ channel = 'alpha';
57
+ else if (version.includes('beta'))
58
+ channel = 'beta';
59
+ else
60
+ channel = 'preview';
61
+ }
62
+ // Update Cargo.toml
63
+ const cargoTomlPath = path.join(rootPath, 'Cargo.toml');
64
+ let cargoToml = fs.readFileSync(cargoTomlPath, 'utf-8');
65
+ cargoToml = cargoToml.replace(/version = "[\d\.]+-?[a-z\.]*\d*"/, `version = "${version}"`);
66
+ fs.writeFileSync(cargoTomlPath, cargoToml);
67
+ console.log(`✅ Synchronized Cargo.toml to ${version}`);
68
+ // Update project-version.json
69
+ const projectVersionPath = path.join(rootPath, 'project-version.json');
70
+ let projectVersion = { version, channel, build: 1 };
71
+ if (fs.existsSync(projectVersionPath)) {
72
+ const existing = JSON.parse(fs.readFileSync(projectVersionPath, 'utf-8'));
73
+ projectVersion.build = existing.build || 1;
74
+ projectVersion.commit = existing.commit;
75
+ }
76
+ projectVersion.version = version;
77
+ projectVersion.channel = channel;
78
+ fs.writeFileSync(projectVersionPath, JSON.stringify(projectVersion, null, 2) + '\n');
79
+ console.log(`✅ Synchronized project-version.json to ${version}`);
80
+ // Update installer/windows/devalang.wxs (WiX installer)
81
+ const wixFilePath = path.join(rootPath, 'installer', 'windows', 'devalang.wxs');
82
+ if (fs.existsSync(wixFilePath)) {
83
+ try {
84
+ let wixContent = fs.readFileSync(wixFilePath, 'utf-8');
85
+ // Update ProductVersion in the <?define ?> section
86
+ wixContent = wixContent.replace(/<\?define ProductVersion="[\d\.]+\-?[a-z\.]*\d*" \?>/, `<` + `?define ProductVersion="${version}" ?` + `>`);
87
+ fs.writeFileSync(wixFilePath, wixContent);
88
+ console.log(`✅ Synchronized installer/windows/devalang.wxs to ${version}`);
89
+ }
90
+ catch (error) {
91
+ console.warn('⚠️ Could not update installer/windows/devalang.wxs:', error);
92
+ }
93
+ }
94
+ else {
95
+ console.warn('⚠️ installer/windows/devalang.wxs not found, skipping');
96
+ }
97
+ }
98
+ //# sourceMappingURL=sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/typescript/scripts/version/sync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,kCAoEC;AA1ED,uCAAyB;AACzB,2CAA6B;AAE7B;;GAEG;AACI,KAAK,UAAU,WAAW;IAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAExD,uCAAuC;IACvC,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC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AC,wDAAwD,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Type definitions for Devalang V2
3
+ */
4
+ /**
5
+ * Options for rendering audio
6
+ */
7
+ export interface RenderOptions {
8
+ sampleRate?: number;
9
+ bpm?: number;
10
+ }
11
+ /**
12
+ * Options for MIDI export
13
+ */
14
+ export interface MidiOptions extends RenderOptions {
15
+ timeSignatureNum?: number;
16
+ timeSignatureDen?: number;
17
+ }
18
+ /**
19
+ * Parse result from Devalang parser
20
+ */
21
+ export interface ParseResult {
22
+ success: boolean;
23
+ statements: StatementInfo[];
24
+ errors: string[];
25
+ }
26
+ /**
27
+ * Statement information
28
+ */
29
+ export interface StatementInfo {
30
+ kind: string;
31
+ line: number;
32
+ }
33
+ /**
34
+ * Debug render result with metadata
35
+ */
36
+ export interface DebugRenderResult {
37
+ audio: Float32Array;
38
+ sampleRate: number;
39
+ duration: number;
40
+ eventCount: number;
41
+ bpm: number;
42
+ }
43
+ /**
44
+ * Metadata about code without rendering
45
+ */
46
+ export interface CodeMetadata {
47
+ statementCount: number;
48
+ bpm: number;
49
+ sampleRate: number;
50
+ }
51
+ /**
52
+ * Registered bank information
53
+ */
54
+ export interface RegisteredBank {
55
+ fullName: string;
56
+ alias: string;
57
+ triggers: Record<string, string>;
58
+ }
59
+ /**
60
+ * Debug state information
61
+ */
62
+ export interface DebugState {
63
+ sampleLoadCount: number;
64
+ playbackDebugCount: number;
65
+ errorCount: number;
66
+ debugErrorsEnabled: boolean;
67
+ }
68
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/typescript/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,kBAAkB,EAAE,OAAO,CAAC;CAC7B"}
@@ -1,2 +1,6 @@
1
1
  "use strict";
2
+ /**
3
+ * Type definitions for Devalang V2
4
+ */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/typescript/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * WASM bindings re-export
3
+ *
4
+ * This module re-exports the generated WASM bindings.
5
+ * It will be available after running: npm run rust:wasm:all
6
+ */
7
+ export * from '../../pkg/node/devalang_wasm';
8
+ //# sourceMappingURL=wasm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm.d.ts","sourceRoot":"","sources":["../src/typescript/wasm.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,8BAA8B,CAAC"}
@@ -1,4 +1,10 @@
1
1
  "use strict";
2
+ /**
3
+ * WASM bindings re-export
4
+ *
5
+ * This module re-exports the generated WASM bindings.
6
+ * It will be available after running: npm run rust:wasm:all
7
+ */
2
8
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
9
  if (k2 === undefined) k2 = k;
4
10
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -14,9 +20,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
21
  };
16
22
  Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * Core functionality for the Devalang language.
19
- * This module exports all the core types and functions used in the language.
20
- */
21
- __exportStar(require("./types/index"), exports);
22
- __exportStar(require("./functions/index"), exports);
23
+ // These will be available after WASM build
24
+ __exportStar(require("../../pkg/node/devalang_wasm"), exports);
25
+ //# sourceMappingURL=wasm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm.js","sourceRoot":"","sources":["../src/typescript/wasm.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAA2C;AAC3C,+DAA6C"}
package/package.json CHANGED
@@ -1,34 +1,39 @@
1
1
  {
2
2
  "name": "@devaloop/devalang",
3
3
  "private": false,
4
- "version": "0.0.1-beta.3",
4
+ "version": "0.1.2",
5
5
  "description": "Write music like code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound — in plain text.",
6
- "longDescription": "Devalang is a compact, performant DSL and toolchain for composing, automating and rendering sound. It provides a CLI, WASM bindings, a TypeScript API, and plugins for editors. Ideal for live-coding, sample-based production, algorithmic composition, and fast prototyping.",
7
6
  "main": "out-tsc/index.js",
7
+ "types": "./out-tsc/index.d.ts",
8
8
  "bin": {
9
9
  "devalang": "./out-tsc/bin/index.js"
10
10
  },
11
- "types": "./out-tsc/index.d.ts",
12
11
  "scripts": {
13
12
  "rust:fmt": "cargo fmt",
14
- "rust:dev:build": "cargo run build --entry examples --output output --debug",
15
- "rust:dev:check": "cargo run check --entry examples --output output --debug",
16
- "rust:dev:play": "cargo run play --entry examples --output output --repeat --debug",
17
- "rust:wasm:web": "wasm-pack build --target=web --no-default-features",
18
- "rust:wasm:node": "wasm-pack build --target=nodejs --no-default-features",
19
- "rust:prepack": "cargo build --release",
20
- "scripts:postbuild": "tsc && node out-tsc/scripts/postbuild.js",
21
- "scripts:version:bump": "tsc && node out-tsc/scripts/version/index.js",
22
- "scripts:copy-version": "tsc && node out-tsc/scripts/version/copy-to-binary.js --out-dir ./out-tsc/bin",
23
- "scripts:build": "tsc",
13
+ "rust:check": "cargo check --lib",
14
+ "rust:build": "cargo build --lib --release",
15
+ "rust:build:cli": "cargo build --features cli --release",
16
+ "rust:test": "cargo test",
17
+ "rust:wasm:web": "wasm-pack build --target web --out-dir pkg/web --no-default-features --features wasm",
18
+ "rust:wasm:node": "wasm-pack build --target nodejs --out-dir pkg/node --no-default-features --features wasm",
19
+ "rust:wasm:all": "npm run rust:wasm:web && npm run rust:wasm:node",
20
+ "ts:build": "tsc",
21
+ "ts:watch": "tsc --watch",
22
+ "ts:clean": "rimraf out-tsc",
24
23
  "types:build": "tsc --emitDeclarationOnly",
25
- "types:wasm": "tsc && node out-tsc/scripts/copy-wasm-dts.js",
26
- "types:all": "npm run rust:wasm:node && npm run types:wasm && npm run types:build",
27
- "test:rust": "cargo test",
28
- "test:ts": "mocha -r ts-node/register tests/typescript/**/*.spec.ts --exit",
29
- "test": "npm run test:ts",
30
- "postinstall": "node out-tsc/scripts/postinstall.js",
31
- "beforepublish": "npm run types:all && npm run scripts:copy-version"
24
+ "types:wasm": "npm run rust:wasm:node && node out-tsc/scripts/copy-wasm-dts.js",
25
+ "version:bump": "tsx src/typescript/scripts/version/index.ts bump",
26
+ "version:sync": "tsx src/typescript/scripts/version/index.ts sync",
27
+ "version:fetch": "tsx src/typescript/scripts/version/index.ts fetch",
28
+ "build": "npm run ts:build && npm run rust:build",
29
+ "build:all": "npm run rust:wasm:all && npm run ts:build",
30
+ "build:release": "npm run build:all && npm run rust:build:cli",
31
+ "test": "npm run rust:test",
32
+ "test:examples": "cargo run --features cli -- check --entry examples/",
33
+ "clean": "cargo clean && npm run ts:clean",
34
+ "prepare": "npm run ts:build",
35
+ "prepublishOnly": "npm run build:all",
36
+ "postinstall": "node -e \"try { require('./out-tsc/scripts/postinstall.js') } catch (e) { console.log('⚠️ Skipping postinstall (build first)') }\""
32
37
  },
33
38
  "homepage": "https://devalang.com",
34
39
  "keywords": [
@@ -36,43 +41,38 @@
36
41
  "music",
37
42
  "sound",
38
43
  "dsl",
39
- "domain-specific-language",
40
44
  "audio",
41
- "music-programming",
42
45
  "synthesis",
43
46
  "midi",
44
47
  "wasm",
45
- "vscode",
46
48
  "live-coding",
47
- "sound-design",
48
- "samples",
49
- "cli"
49
+ "sound-design"
50
50
  ],
51
51
  "author": {
52
52
  "name": "Devaloop",
53
53
  "email": "contact@devaloop.com",
54
54
  "url": "https://devaloop.com"
55
55
  },
56
- "bugs": {
57
- "url": "https://github.com/devaloop-labs/devalang/issues",
58
- "email": "contact@devaloop.com"
59
- },
60
56
  "license": "MIT",
61
57
  "repository": {
62
58
  "type": "git",
63
59
  "url": "https://github.com/devaloop-labs/devalang.git"
64
60
  },
65
- "dependencies": {
61
+ "devDependencies": {
66
62
  "@types/follow-redirects": "^1.14.4",
67
- "@types/node": "^24.0.3",
68
- "follow-redirects": "^1.15.11"
63
+ "@types/node": "^20.19.19",
64
+ "follow-redirects": "^1.15.9",
65
+ "rimraf": "^5.0.10",
66
+ "tsx": "^4.20.6",
67
+ "typescript": "^5.9.3"
69
68
  },
70
- "devDependencies": {
71
- "typescript": "^5.9.2",
72
- "mocha": "^10.2.0",
73
- "chai": "^4.3.8",
74
- "ts-node": "^10.9.1",
75
- "@types/mocha": "^10.0.1",
76
- "@types/chai": "^4.3.4"
77
- }
78
- }
69
+ "engines": {
70
+ "node": ">=16.0.0"
71
+ },
72
+ "files": [
73
+ "out-tsc/**/*",
74
+ "pkg/**/*",
75
+ "README.md",
76
+ "LICENSE"
77
+ ]
78
+ }
@@ -1,2 +0,0 @@
1
- [target.wasm32-unknown-unknown]
2
- rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
package/.devalang DELETED
@@ -1,9 +0,0 @@
1
- [defaults]
2
- entry = "./examples"
3
- output = "./output"
4
- watch = false
5
- debug = true
6
- compress = true
7
- audio_format = "wav16"
8
- sample_rate = 44100
9
- output_format = ["wav", "mid"]