@devaloop/devalang 0.0.1-beta.2 → 0.1.1
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.
- package/README.md +177 -146
- package/out-tsc/api.d.ts +180 -0
- package/out-tsc/api.d.ts.map +1 -0
- package/out-tsc/api.js +286 -0
- package/out-tsc/api.js.map +1 -0
- package/out-tsc/bin/index.d.ts +12 -0
- package/out-tsc/bin/index.d.ts.map +1 -0
- package/out-tsc/bin/index.js +20 -54
- package/out-tsc/bin/index.js.map +1 -0
- package/out-tsc/examples/basic-usage.d.ts +8 -0
- package/out-tsc/examples/basic-usage.d.ts.map +1 -0
- package/out-tsc/examples/basic-usage.js +113 -0
- package/out-tsc/examples/basic-usage.js.map +1 -0
- package/out-tsc/index.d.ts +19 -5
- package/out-tsc/index.d.ts.map +1 -0
- package/out-tsc/index.js +24 -6
- package/out-tsc/index.js.map +1 -0
- package/out-tsc/scripts/copy-wasm-dts.d.ts +7 -0
- package/out-tsc/scripts/copy-wasm-dts.d.ts.map +1 -0
- package/out-tsc/scripts/copy-wasm-dts.js +36 -32
- package/out-tsc/scripts/copy-wasm-dts.js.map +1 -0
- package/out-tsc/scripts/postinstall.d.ts +1 -0
- package/out-tsc/scripts/postinstall.d.ts.map +1 -0
- package/out-tsc/scripts/postinstall.js +4 -1
- package/out-tsc/scripts/postinstall.js.map +1 -0
- package/out-tsc/scripts/version/bump.d.ts +5 -1
- package/out-tsc/scripts/version/bump.d.ts.map +1 -0
- package/out-tsc/scripts/version/bump.js +114 -44
- package/out-tsc/scripts/version/bump.js.map +1 -0
- package/out-tsc/scripts/version/fetch.d.ts +12 -1
- package/out-tsc/scripts/version/fetch.d.ts.map +1 -0
- package/out-tsc/scripts/version/fetch.js +68 -24
- package/out-tsc/scripts/version/fetch.js.map +1 -0
- package/out-tsc/scripts/version/index.d.ts +6 -0
- package/out-tsc/scripts/version/index.d.ts.map +1 -0
- package/out-tsc/scripts/version/index.js +44 -22
- package/out-tsc/scripts/version/index.js.map +1 -0
- package/out-tsc/scripts/version/sync.d.ts +5 -1
- package/out-tsc/scripts/version/sync.d.ts.map +1 -0
- package/out-tsc/scripts/version/sync.js +78 -29
- package/out-tsc/scripts/version/sync.js.map +1 -0
- package/out-tsc/types.d.ts +68 -0
- package/out-tsc/types.d.ts.map +1 -0
- package/out-tsc/{core/types/value.js → types.js} +4 -0
- package/out-tsc/types.js.map +1 -0
- package/out-tsc/wasm.d.ts +8 -0
- package/out-tsc/wasm.d.ts.map +1 -0
- package/out-tsc/{core/index.js → wasm.js} +9 -6
- package/out-tsc/wasm.js.map +1 -0
- package/package.json +50 -37
- package/.cargo/config.toml +0 -2
- package/.devalang +0 -9
- package/.github/workflows/ci.yml +0 -103
- package/Cargo.toml +0 -81
- package/docs/CHANGELOG.md +0 -581
- package/docs/CONTRIBUTING.md +0 -101
- package/docs/ROADMAP.md +0 -38
- package/docs/TODO.md +0 -71
- package/examples/automation.deva +0 -42
- package/examples/bank.deva +0 -7
- package/examples/bus.deva +0 -10
- package/examples/condition.deva +0 -20
- package/examples/duration.deva +0 -9
- package/examples/effect.deva +0 -2
- package/examples/events.deva +0 -12
- package/examples/filter.deva +0 -11
- package/examples/function.deva +0 -15
- package/examples/group.deva +0 -12
- package/examples/index.deva +0 -63
- package/examples/lfo.deva +0 -9
- package/examples/loop.deva +0 -10
- package/examples/pattern.deva +0 -8
- package/examples/plugin.deva +0 -16
- package/examples/samples/hat-808.wav +0 -0
- package/examples/samples/kick-808.wav +0 -0
- package/examples/synth.deva +0 -24
- package/examples/synth_types.deva +0 -17
- package/examples/variables.deva +0 -9
- package/out-tsc/core/functions/index.d.ts +0 -42
- package/out-tsc/core/functions/index.js +0 -87
- package/out-tsc/core/index.d.ts +0 -6
- package/out-tsc/core/types/index.d.ts +0 -4
- package/out-tsc/core/types/index.js +0 -20
- package/out-tsc/core/types/plugin.d.ts +0 -18
- package/out-tsc/core/types/plugin.js +0 -2
- package/out-tsc/core/types/result.d.ts +0 -27
- package/out-tsc/core/types/result.js +0 -2
- package/out-tsc/core/types/statement.d.ts +0 -106
- package/out-tsc/core/types/statement.js +0 -2
- package/out-tsc/core/types/value.d.ts +0 -43
- package/out-tsc/pkg/devalang_core.d.ts +0 -15
- package/out-tsc/pkg/devalang_core.js +0 -65
- package/out-tsc/pkg/devalang_core_bg.wasm.d.ts +0 -34
- package/project-version.json +0 -6
- package/rust/cli/bank/api.rs +0 -122
- package/rust/cli/bank/commands.rs +0 -306
- package/rust/cli/bank/mod.rs +0 -29
- package/rust/cli/build/commands.rs +0 -153
- package/rust/cli/build/mod.rs +0 -2
- package/rust/cli/build/process.rs +0 -165
- package/rust/cli/check/mod.rs +0 -208
- package/rust/cli/discover/commands.rs +0 -253
- package/rust/cli/discover/config.rs +0 -111
- package/rust/cli/discover/fs.rs +0 -19
- package/rust/cli/discover/install.rs +0 -103
- package/rust/cli/discover/metadata.rs +0 -48
- package/rust/cli/discover/mod.rs +0 -5
- package/rust/cli/init/commands.rs +0 -88
- package/rust/cli/init/mod.rs +0 -1
- package/rust/cli/install/addon.rs +0 -118
- package/rust/cli/install/bank.rs +0 -72
- package/rust/cli/install/commands.rs +0 -35
- package/rust/cli/install/mod.rs +0 -4
- package/rust/cli/install/plugin.rs +0 -80
- package/rust/cli/login/commands.rs +0 -124
- package/rust/cli/login/mod.rs +0 -1
- package/rust/cli/mod.rs +0 -12
- package/rust/cli/parser.rs +0 -359
- package/rust/cli/play/commands.rs +0 -375
- package/rust/cli/play/io.rs +0 -17
- package/rust/cli/play/mod.rs +0 -5
- package/rust/cli/play/process.rs +0 -159
- package/rust/cli/play/realtime.rs +0 -91
- package/rust/cli/play/utils.rs +0 -23
- package/rust/cli/telemetry/commands.rs +0 -22
- package/rust/cli/telemetry/event_creator.rs +0 -80
- package/rust/cli/telemetry/mod.rs +0 -3
- package/rust/cli/telemetry/send.rs +0 -51
- package/rust/cli/template/commands.rs +0 -69
- package/rust/cli/template/mod.rs +0 -1
- package/rust/cli/update/commands.rs +0 -6
- package/rust/cli/update/mod.rs +0 -1
- package/rust/config/driver.rs +0 -112
- package/rust/config/mod.rs +0 -3
- package/rust/config/ops.rs +0 -26
- package/rust/config/settings.rs +0 -101
- package/rust/core/audio/engine/driver.rs +0 -220
- package/rust/core/audio/engine/export.rs +0 -169
- package/rust/core/audio/engine/helpers.rs +0 -178
- package/rust/core/audio/engine/mod.rs +0 -56
- package/rust/core/audio/engine/notes/dsp.rs +0 -85
- package/rust/core/audio/engine/notes/mod.rs +0 -44
- package/rust/core/audio/engine/notes/params.rs +0 -294
- package/rust/core/audio/engine/sample/insert.rs +0 -199
- package/rust/core/audio/engine/sample/mod.rs +0 -40
- package/rust/core/audio/engine/sample/padding.rs +0 -170
- package/rust/core/audio/evaluator/condition.rs +0 -61
- package/rust/core/audio/evaluator/mod.rs +0 -9
- package/rust/core/audio/evaluator/numeric.rs +0 -152
- package/rust/core/audio/evaluator/rhs.rs +0 -16
- package/rust/core/audio/evaluator/string_expr.rs +0 -94
- package/rust/core/audio/interpreter/driver.rs +0 -574
- package/rust/core/audio/interpreter/mod.rs +0 -2
- package/rust/core/audio/interpreter/statements/arrow_call/interprete.rs +0 -175
- package/rust/core/audio/interpreter/statements/arrow_call/methods/chord.rs +0 -384
- package/rust/core/audio/interpreter/statements/arrow_call/methods/mod.rs +0 -2
- package/rust/core/audio/interpreter/statements/arrow_call/methods/note.rs +0 -316
- package/rust/core/audio/interpreter/statements/arrow_call/mod.rs +0 -3
- package/rust/core/audio/interpreter/statements/arrow_call/types/arp.rs +0 -192
- package/rust/core/audio/interpreter/statements/arrow_call/types/mod.rs +0 -24
- package/rust/core/audio/interpreter/statements/arrow_call/types/pad.rs +0 -116
- package/rust/core/audio/interpreter/statements/arrow_call/types/pluck.rs +0 -97
- package/rust/core/audio/interpreter/statements/arrow_call/types/sub.rs +0 -100
- package/rust/core/audio/interpreter/statements/automate.rs +0 -16
- package/rust/core/audio/interpreter/statements/call.rs +0 -295
- package/rust/core/audio/interpreter/statements/condition.rs +0 -72
- package/rust/core/audio/interpreter/statements/function.rs +0 -24
- package/rust/core/audio/interpreter/statements/let_.rs +0 -36
- package/rust/core/audio/interpreter/statements/load.rs +0 -17
- package/rust/core/audio/interpreter/statements/loop_.rs +0 -115
- package/rust/core/audio/interpreter/statements/mod.rs +0 -12
- package/rust/core/audio/interpreter/statements/sleep.rs +0 -28
- package/rust/core/audio/interpreter/statements/spawn.rs +0 -253
- package/rust/core/audio/interpreter/statements/tempo.rs +0 -40
- package/rust/core/audio/interpreter/statements/trigger.rs +0 -239
- package/rust/core/audio/loader/mod.rs +0 -1
- package/rust/core/audio/loader/trigger.rs +0 -98
- package/rust/core/audio/mod.rs +0 -6
- package/rust/core/audio/player.rs +0 -70
- package/rust/core/audio/special/easing.rs +0 -189
- package/rust/core/audio/special/env.rs +0 -45
- package/rust/core/audio/special/math.rs +0 -134
- package/rust/core/audio/special/mod.rs +0 -9
- package/rust/core/audio/special/modulator.rs +0 -143
- package/rust/core/builder/mod.rs +0 -129
- package/rust/core/debugger/lexer.rs +0 -27
- package/rust/core/debugger/logs.rs +0 -52
- package/rust/core/debugger/mod.rs +0 -30
- package/rust/core/debugger/preprocessor.rs +0 -27
- package/rust/core/debugger/store.rs +0 -38
- package/rust/core/error/mod.rs +0 -269
- package/rust/core/lexer/driver.rs +0 -59
- package/rust/core/lexer/handler/arrow.rs +0 -82
- package/rust/core/lexer/handler/at.rs +0 -21
- package/rust/core/lexer/handler/brace.rs +0 -41
- package/rust/core/lexer/handler/colon.rs +0 -21
- package/rust/core/lexer/handler/comment.rs +0 -30
- package/rust/core/lexer/handler/dot.rs +0 -21
- package/rust/core/lexer/handler/driver.rs +0 -337
- package/rust/core/lexer/handler/identifier.rs +0 -47
- package/rust/core/lexer/handler/indent.rs +0 -66
- package/rust/core/lexer/handler/mod.rs +0 -15
- package/rust/core/lexer/handler/newline.rs +0 -23
- package/rust/core/lexer/handler/number.rs +0 -31
- package/rust/core/lexer/handler/operator.rs +0 -46
- package/rust/core/lexer/handler/parenthesis.rs +0 -41
- package/rust/core/lexer/handler/slash.rs +0 -21
- package/rust/core/lexer/handler/string.rs +0 -63
- package/rust/core/lexer/mod.rs +0 -3
- package/rust/core/lexer/token.rs +0 -91
- package/rust/core/mod.rs +0 -9
- package/rust/core/parser/driver/block.rs +0 -111
- package/rust/core/parser/driver/cursor.rs +0 -82
- package/rust/core/parser/driver/driver_impl.rs +0 -139
- package/rust/core/parser/driver/mod.rs +0 -6
- package/rust/core/parser/driver/parse_array.rs +0 -120
- package/rust/core/parser/driver/parse_map.rs +0 -223
- package/rust/core/parser/driver/parser.rs +0 -160
- package/rust/core/parser/handler/arrow_call.rs +0 -277
- package/rust/core/parser/handler/at.rs +0 -279
- package/rust/core/parser/handler/bank.rs +0 -104
- package/rust/core/parser/handler/condition.rs +0 -83
- package/rust/core/parser/handler/dot.rs +0 -148
- package/rust/core/parser/handler/identifier/automate.rs +0 -254
- package/rust/core/parser/handler/identifier/call.rs +0 -91
- package/rust/core/parser/handler/identifier/emit.rs +0 -70
- package/rust/core/parser/handler/identifier/function.rs +0 -113
- package/rust/core/parser/handler/identifier/group.rs +0 -89
- package/rust/core/parser/handler/identifier/let_.rs +0 -173
- package/rust/core/parser/handler/identifier/mod.rs +0 -55
- package/rust/core/parser/handler/identifier/on.rs +0 -107
- package/rust/core/parser/handler/identifier/print.rs +0 -49
- package/rust/core/parser/handler/identifier/sleep.rs +0 -96
- package/rust/core/parser/handler/identifier/spawn.rs +0 -91
- package/rust/core/parser/handler/identifier/synth.rs +0 -135
- package/rust/core/parser/handler/loop_.rs +0 -194
- package/rust/core/parser/handler/mod.rs +0 -9
- package/rust/core/parser/handler/pattern.rs +0 -74
- package/rust/core/parser/handler/tempo.rs +0 -105
- package/rust/core/parser/mod.rs +0 -3
- package/rust/core/parser/statement.rs +0 -10
- package/rust/core/plugin/loader.rs +0 -137
- package/rust/core/plugin/mod.rs +0 -2
- package/rust/core/plugin/runner/mod.rs +0 -11
- package/rust/core/plugin/runner/non_wasm.rs +0 -297
- package/rust/core/plugin/runner/wasm32.rs +0 -43
- package/rust/core/preprocessor/loader/inject.rs +0 -278
- package/rust/core/preprocessor/loader/loader_helpers.rs +0 -110
- package/rust/core/preprocessor/loader/mod.rs +0 -235
- package/rust/core/preprocessor/mod.rs +0 -4
- package/rust/core/preprocessor/module.rs +0 -55
- package/rust/core/preprocessor/processor/handlers.rs +0 -107
- package/rust/core/preprocessor/processor/mod.rs +0 -1
- package/rust/core/preprocessor/resolver/bank.rs +0 -49
- package/rust/core/preprocessor/resolver/call.rs +0 -124
- package/rust/core/preprocessor/resolver/condition.rs +0 -95
- package/rust/core/preprocessor/resolver/driver.rs +0 -324
- package/rust/core/preprocessor/resolver/function.rs +0 -69
- package/rust/core/preprocessor/resolver/group.rs +0 -122
- package/rust/core/preprocessor/resolver/let_.rs +0 -32
- package/rust/core/preprocessor/resolver/loop_.rs +0 -318
- package/rust/core/preprocessor/resolver/mod.rs +0 -16
- package/rust/core/preprocessor/resolver/pattern.rs +0 -83
- package/rust/core/preprocessor/resolver/spawn.rs +0 -99
- package/rust/core/preprocessor/resolver/synth.rs +0 -54
- package/rust/core/preprocessor/resolver/tempo.rs +0 -48
- package/rust/core/preprocessor/resolver/trigger.rs +0 -116
- package/rust/core/preprocessor/resolver/value.rs +0 -176
- package/rust/core/store/global.rs +0 -57
- package/rust/core/store/mod.rs +0 -1
- package/rust/lib.rs +0 -323
- package/rust/main.rs +0 -388
- package/rust/types/Cargo.toml +0 -11
- package/rust/types/src/addons.rs +0 -55
- package/rust/types/src/ast.rs +0 -202
- package/rust/types/src/config.rs +0 -84
- package/rust/types/src/lib.rs +0 -15
- package/rust/types/src/plugin.rs +0 -20
- package/rust/types/src/store.rs +0 -139
- package/rust/types/src/telemetry.rs +0 -85
- package/rust/utils/Cargo.toml +0 -26
- package/rust/utils/src/error.rs +0 -186
- package/rust/utils/src/file.rs +0 -94
- package/rust/utils/src/first_usage.rs +0 -97
- package/rust/utils/src/lib.rs +0 -9
- package/rust/utils/src/logger.rs +0 -200
- package/rust/utils/src/path.rs +0 -129
- package/rust/utils/src/signature.rs +0 -41
- package/rust/utils/src/spinner.rs +0 -20
- package/rust/utils/src/version.rs +0 -27
- package/rust/utils/src/watcher.rs +0 -46
- package/rust/web/api.rs +0 -5
- package/rust/web/cdn.rs +0 -34
- package/rust/web/mod.rs +0 -3
- package/rust/web/sso.rs +0 -5
- package/templates/minimal/.devalang +0 -5
- package/templates/minimal/README.md +0 -218
- package/templates/minimal/src/index.deva +0 -2
- package/templates/welcome/.devalang +0 -5
- package/templates/welcome/README.md +0 -218
- package/templates/welcome/samples/kick-808.wav +0 -0
- package/templates/welcome/src/index.deva +0 -61
- package/templates/welcome/src/variables.deva +0 -3
- package/tests/integration.rs +0 -21
- package/tests/rust/cli_check_build.rs +0 -21
- package/tests/rust/cli_help.rs +0 -12
- package/tests/rust/cli_template_list.rs +0 -10
- package/tests/rust/cli_version.rs +0 -11
- package/tests/typescript/index.spec.ts +0 -136
- package/tests/typescript/playhead.spec.ts +0 -36
- package/tests/typescript/render_e2e.spec.ts +0 -77
- package/tsconfig.json +0 -115
- package/typescript/bin/index.ts +0 -28
- package/typescript/core/functions/index.ts +0 -94
- package/typescript/core/index.ts +0 -6
- package/typescript/core/types/index.ts +0 -4
- package/typescript/core/types/plugin.ts +0 -19
- package/typescript/core/types/result.ts +0 -29
- package/typescript/core/types/statement.ts +0 -47
- package/typescript/core/types/value.ts +0 -29
- package/typescript/index.ts +0 -8
- package/typescript/pkg/devalang_core.d.ts +0 -4
- package/typescript/pkg/devalang_core.ts +0 -65
- package/typescript/scripts/copy-wasm-dts.ts +0 -41
- package/typescript/scripts/postinstall.ts +0 -85
- package/typescript/scripts/version/bump.ts +0 -44
- package/typescript/scripts/version/fetch.ts +0 -18
- package/typescript/scripts/version/index.ts +0 -25
- package/typescript/scripts/version/sync.ts +0 -24
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { Value, Duration } from "./value";
|
|
2
|
-
/**
|
|
3
|
-
* Represents a statement kind in the code.
|
|
4
|
-
*/
|
|
5
|
-
export type StatementKind = {
|
|
6
|
-
kind: "Tempo";
|
|
7
|
-
} | {
|
|
8
|
-
kind: "Bank";
|
|
9
|
-
alias?: string;
|
|
10
|
-
} | {
|
|
11
|
-
kind: "Print";
|
|
12
|
-
} | {
|
|
13
|
-
kind: "Load";
|
|
14
|
-
source: string;
|
|
15
|
-
alias: string;
|
|
16
|
-
} | {
|
|
17
|
-
kind: "Use";
|
|
18
|
-
name: string;
|
|
19
|
-
alias?: string;
|
|
20
|
-
} | {
|
|
21
|
-
kind: "Let";
|
|
22
|
-
name: string;
|
|
23
|
-
} | {
|
|
24
|
-
kind: "Automate";
|
|
25
|
-
target: string;
|
|
26
|
-
} | {
|
|
27
|
-
kind: "ArrowCall";
|
|
28
|
-
target: string;
|
|
29
|
-
method: string;
|
|
30
|
-
args: Value[];
|
|
31
|
-
} | {
|
|
32
|
-
kind: "Function";
|
|
33
|
-
name: string;
|
|
34
|
-
parameters: string[];
|
|
35
|
-
body: Statement[];
|
|
36
|
-
} | {
|
|
37
|
-
kind: "Synth";
|
|
38
|
-
} | {
|
|
39
|
-
kind: "Trigger";
|
|
40
|
-
entity: string;
|
|
41
|
-
duration: Duration;
|
|
42
|
-
effects?: Value;
|
|
43
|
-
} | {
|
|
44
|
-
kind: "Sleep";
|
|
45
|
-
} | {
|
|
46
|
-
kind: "Call";
|
|
47
|
-
name: string;
|
|
48
|
-
args: Value[];
|
|
49
|
-
} | {
|
|
50
|
-
kind: "Spawn";
|
|
51
|
-
name: string;
|
|
52
|
-
args: Value[];
|
|
53
|
-
} | {
|
|
54
|
-
kind: "Loop";
|
|
55
|
-
} | {
|
|
56
|
-
kind: "Group";
|
|
57
|
-
} | {
|
|
58
|
-
kind: "Include";
|
|
59
|
-
path: string;
|
|
60
|
-
} | {
|
|
61
|
-
kind: "Export";
|
|
62
|
-
names: string[];
|
|
63
|
-
source: string;
|
|
64
|
-
} | {
|
|
65
|
-
kind: "Import";
|
|
66
|
-
names: string[];
|
|
67
|
-
source: string;
|
|
68
|
-
} | {
|
|
69
|
-
kind: "If";
|
|
70
|
-
} | {
|
|
71
|
-
kind: "Else";
|
|
72
|
-
} | {
|
|
73
|
-
kind: "ElseIf";
|
|
74
|
-
} | {
|
|
75
|
-
kind: "Comment";
|
|
76
|
-
} | {
|
|
77
|
-
kind: "Indent";
|
|
78
|
-
} | {
|
|
79
|
-
kind: "Dedent";
|
|
80
|
-
} | {
|
|
81
|
-
kind: "NewLine";
|
|
82
|
-
} | {
|
|
83
|
-
kind: "On";
|
|
84
|
-
event: string;
|
|
85
|
-
args?: Value[];
|
|
86
|
-
body: Statement[];
|
|
87
|
-
} | {
|
|
88
|
-
kind: "Emit";
|
|
89
|
-
event: string;
|
|
90
|
-
payload?: Value;
|
|
91
|
-
} | {
|
|
92
|
-
kind: "Unknown";
|
|
93
|
-
} | {
|
|
94
|
-
kind: "Error";
|
|
95
|
-
message: string;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Represents a statement in the code.
|
|
99
|
-
*/
|
|
100
|
-
export interface Statement {
|
|
101
|
-
kind: StatementKind;
|
|
102
|
-
value: Value;
|
|
103
|
-
indent: number;
|
|
104
|
-
line: number;
|
|
105
|
-
column: number;
|
|
106
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Statement } from "./statement";
|
|
2
|
-
/**
|
|
3
|
-
* Represents a duration in the code.
|
|
4
|
-
*/
|
|
5
|
-
export type Duration = {
|
|
6
|
-
Number: number;
|
|
7
|
-
} | {
|
|
8
|
-
Identifier: string;
|
|
9
|
-
} | {
|
|
10
|
-
Beat: string;
|
|
11
|
-
} | {
|
|
12
|
-
Auto: null;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Represents a value in the code.
|
|
16
|
-
*/
|
|
17
|
-
export type Value = {
|
|
18
|
-
Boolean: boolean;
|
|
19
|
-
} | {
|
|
20
|
-
Number: number;
|
|
21
|
-
} | {
|
|
22
|
-
Duration: Duration;
|
|
23
|
-
} | {
|
|
24
|
-
Identifier: string;
|
|
25
|
-
} | {
|
|
26
|
-
String: string;
|
|
27
|
-
} | {
|
|
28
|
-
Array: Value[];
|
|
29
|
-
} | {
|
|
30
|
-
Map: Record<string, Value>;
|
|
31
|
-
} | {
|
|
32
|
-
Block: Statement[];
|
|
33
|
-
} | {
|
|
34
|
-
Sample: string;
|
|
35
|
-
} | {
|
|
36
|
-
Beat: string;
|
|
37
|
-
} | {
|
|
38
|
-
Statement: Statement;
|
|
39
|
-
} | {
|
|
40
|
-
StatementKind: any;
|
|
41
|
-
} | {
|
|
42
|
-
Unknown: null;
|
|
43
|
-
} | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare function parse(...args: any[]): any;
|
|
2
|
-
export declare function debug_render(...args: any[]): any;
|
|
3
|
-
export declare function render_audio(...args: any[]): any;
|
|
4
|
-
export declare function register_playhead_callback(cb?: any): any;
|
|
5
|
-
export declare function collect_playhead_events(): any;
|
|
6
|
-
export declare function unregister_playhead_callback(): any;
|
|
7
|
-
declare const pkg: {
|
|
8
|
-
parse: typeof parse;
|
|
9
|
-
debug_render: typeof debug_render;
|
|
10
|
-
render_audio: typeof render_audio;
|
|
11
|
-
register_playhead_callback: typeof register_playhead_callback;
|
|
12
|
-
collect_playhead_events: typeof collect_playhead_events;
|
|
13
|
-
unregister_playhead_callback: typeof unregister_playhead_callback;
|
|
14
|
-
};
|
|
15
|
-
export default pkg;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.parse = parse;
|
|
4
|
-
exports.debug_render = debug_render;
|
|
5
|
-
exports.render_audio = render_audio;
|
|
6
|
-
exports.register_playhead_callback = register_playhead_callback;
|
|
7
|
-
exports.collect_playhead_events = collect_playhead_events;
|
|
8
|
-
exports.unregister_playhead_callback = unregister_playhead_callback;
|
|
9
|
-
/**
|
|
10
|
-
* Shim TypeScript source that re-exports the runtime wasm-pack package when
|
|
11
|
-
* available, or provides safe stubs when not present. Compiles to
|
|
12
|
-
* out-tsc/pkg/devalang_core.js so compiled code can require("./pkg/devalang_core").
|
|
13
|
-
*/
|
|
14
|
-
let runtimePkg;
|
|
15
|
-
try {
|
|
16
|
-
// prefer runtime pkg generated by wasm-pack when available
|
|
17
|
-
// require at runtime so the package can be used even if wasm hasn't been built
|
|
18
|
-
// (this keeps tests and consumers robust).
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
|
-
runtimePkg = require("../../pkg/devalang_core");
|
|
21
|
-
}
|
|
22
|
-
catch (e) {
|
|
23
|
-
runtimePkg = undefined;
|
|
24
|
-
}
|
|
25
|
-
function parse(...args) {
|
|
26
|
-
if (runtimePkg && typeof runtimePkg.parse === "function")
|
|
27
|
-
return runtimePkg.parse(...args);
|
|
28
|
-
throw new Error("WASM package not built: pkg/devalang_core not found");
|
|
29
|
-
}
|
|
30
|
-
function debug_render(...args) {
|
|
31
|
-
if (runtimePkg && typeof runtimePkg.debug_render === "function")
|
|
32
|
-
return runtimePkg.debug_render(...args);
|
|
33
|
-
throw new Error("WASM package not built: pkg/devalang_core not found");
|
|
34
|
-
}
|
|
35
|
-
function render_audio(...args) {
|
|
36
|
-
if (runtimePkg && typeof runtimePkg.render_audio === "function")
|
|
37
|
-
return runtimePkg.render_audio(...args);
|
|
38
|
-
return new Float32Array(0);
|
|
39
|
-
}
|
|
40
|
-
function register_playhead_callback(cb) {
|
|
41
|
-
if (runtimePkg && typeof runtimePkg.register_playhead_callback === "function")
|
|
42
|
-
return runtimePkg.register_playhead_callback(cb);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
function collect_playhead_events() {
|
|
46
|
-
if (runtimePkg && typeof runtimePkg.collect_playhead_events === "function") {
|
|
47
|
-
return runtimePkg.collect_playhead_events();
|
|
48
|
-
}
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
function unregister_playhead_callback() {
|
|
52
|
-
if (runtimePkg &&
|
|
53
|
-
typeof runtimePkg.unregister_playhead_callback === "function")
|
|
54
|
-
return runtimePkg.unregister_playhead_callback();
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
const pkg = {
|
|
58
|
-
parse,
|
|
59
|
-
debug_render,
|
|
60
|
-
render_audio,
|
|
61
|
-
register_playhead_callback,
|
|
62
|
-
collect_playhead_events,
|
|
63
|
-
unregister_playhead_callback,
|
|
64
|
-
};
|
|
65
|
-
exports.default = pkg;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const parse: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
5
|
-
export const debug_render: (a: number, b: number) => [number, number, number];
|
|
6
|
-
export const render_audio: (a: number, b: number) => [number, number, number];
|
|
7
|
-
export const register_playhead_callback: (a: any) => void;
|
|
8
|
-
export const collect_playhead_events: () => [number, number, number];
|
|
9
|
-
export const unregister_playhead_callback: () => void;
|
|
10
|
-
export const rust_lzma_wasm_shim_malloc: (a: number) => number;
|
|
11
|
-
export const rust_lzma_wasm_shim_calloc: (a: number, b: number) => number;
|
|
12
|
-
export const rust_lzma_wasm_shim_free: (a: number) => void;
|
|
13
|
-
export const rust_lzma_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
14
|
-
export const rust_lzma_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
15
|
-
export const rust_lzma_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
16
|
-
export const rust_lzma_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const rust_lzma_wasm_shim_strlen: (a: number) => number;
|
|
18
|
-
export const rust_lzma_wasm_shim_memchr: (a: number, b: number, c: number) => number;
|
|
19
|
-
export const rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
20
|
-
export const rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
21
|
-
export const rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
22
|
-
export const rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
23
|
-
export const rust_zstd_wasm_shim_free: (a: number) => void;
|
|
24
|
-
export const rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
25
|
-
export const rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
26
|
-
export const rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
27
|
-
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
28
|
-
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
29
|
-
export const __wbindgen_exn_store: (a: number) => void;
|
|
30
|
-
export const __externref_table_alloc: () => number;
|
|
31
|
-
export const __wbindgen_export_4: WebAssembly.Table;
|
|
32
|
-
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
33
|
-
export const __externref_table_dealloc: (a: number) => void;
|
|
34
|
-
export const __wbindgen_start: () => void;
|
package/project-version.json
DELETED
package/rust/cli/bank/api.rs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
use crate::web::cdn::get_cdn_url;
|
|
2
|
-
use devalang_types::{BankFile, BankInfo};
|
|
3
|
-
use serde::Deserialize;
|
|
4
|
-
|
|
5
|
-
#[derive(Debug, Deserialize)]
|
|
6
|
-
pub struct BankList {
|
|
7
|
-
pub bank: Vec<BankInfo>,
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
#[derive(Debug, Deserialize)]
|
|
11
|
-
pub struct BankVersion {
|
|
12
|
-
pub version: String,
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
pub async fn handle_bank_info_command(
|
|
16
|
-
name: String,
|
|
17
|
-
) -> Result<BankInfo, Box<dyn std::error::Error>> {
|
|
18
|
-
let cdn_url = get_cdn_url();
|
|
19
|
-
let url = format!("{}/bank/{}/info", cdn_url, name);
|
|
20
|
-
|
|
21
|
-
let response = reqwest::get(&url).await?;
|
|
22
|
-
|
|
23
|
-
if !response.status().is_success() {
|
|
24
|
-
return Err(format!("Failed to fetch bank info: HTTP {}", response.status()).into());
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let bytes = response.bytes().await?;
|
|
28
|
-
|
|
29
|
-
let parsed: BankInfo = serde_json::from_slice(&bytes)?;
|
|
30
|
-
|
|
31
|
-
println!("📦 Bank Info for '{}':", name);
|
|
32
|
-
println!(" - Name: {}", parsed.name);
|
|
33
|
-
println!(" - Version: {}", parsed.version);
|
|
34
|
-
println!(" - Description: {}", parsed.description);
|
|
35
|
-
println!(" - Author: {}", parsed.author);
|
|
36
|
-
|
|
37
|
-
Ok(parsed)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
pub async fn fetch_latest_version(
|
|
41
|
-
bank_name: String,
|
|
42
|
-
) -> Result<BankVersion, Box<dyn std::error::Error>> {
|
|
43
|
-
let cdn_url = get_cdn_url();
|
|
44
|
-
let url = format!("{}/bank/{}/version", cdn_url, bank_name);
|
|
45
|
-
|
|
46
|
-
let response = reqwest::get(url).await?;
|
|
47
|
-
|
|
48
|
-
if !response.status().is_success() {
|
|
49
|
-
return Err(format!("❌ Failed to fetch version: HTTP {}", response.status()).into());
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
let bytes = response.bytes().await?;
|
|
53
|
-
|
|
54
|
-
let version: BankVersion = serde_json::from_slice(&bytes)?;
|
|
55
|
-
|
|
56
|
-
Ok(version)
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
pub async fn list_external_banks() -> Result<Vec<BankInfo>, Box<dyn std::error::Error>> {
|
|
60
|
-
let cdn_url = get_cdn_url();
|
|
61
|
-
let url = format!("{}/bank/list", cdn_url);
|
|
62
|
-
|
|
63
|
-
let response = reqwest::get(url).await?;
|
|
64
|
-
|
|
65
|
-
if !response.status().is_success() {
|
|
66
|
-
return Err(format!("❌ Failed to fetch bank list: HTTP {}", response.status()).into());
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
let bytes = response.bytes().await?;
|
|
70
|
-
|
|
71
|
-
let parsed: BankList = serde_json::from_slice(&bytes)?;
|
|
72
|
-
|
|
73
|
-
Ok(parsed.bank)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
pub async fn list_installed_banks() -> Result<Vec<BankFile>, String> {
|
|
77
|
-
let deva_dir = devalang_utils::path::ensure_deva_dir()?;
|
|
78
|
-
let bank_dir = deva_dir.join("banks");
|
|
79
|
-
|
|
80
|
-
let mut banks = Vec::new();
|
|
81
|
-
|
|
82
|
-
if !bank_dir.exists() {
|
|
83
|
-
return Ok(banks); // No banks installed
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let config_path = devalang_utils::path::get_devalang_config_path()?;
|
|
87
|
-
let config = crate::config::ops::load_config(Some(&config_path))
|
|
88
|
-
.ok_or_else(|| format!("Failed to load config from '{}'", config_path.display()))?;
|
|
89
|
-
|
|
90
|
-
let config_banks = config.banks.clone();
|
|
91
|
-
|
|
92
|
-
if let Some(banks_in_toml) = config_banks {
|
|
93
|
-
for bank in banks_in_toml {
|
|
94
|
-
let bank_name = bank
|
|
95
|
-
.path
|
|
96
|
-
.strip_prefix("devalang://bank/")
|
|
97
|
-
.unwrap_or(&bank.path)
|
|
98
|
-
.to_string();
|
|
99
|
-
|
|
100
|
-
let bank_path = bank_dir.join(&bank_name);
|
|
101
|
-
if bank_path.exists() {
|
|
102
|
-
let bank_info_path = bank_path.join("bank.toml");
|
|
103
|
-
|
|
104
|
-
if bank_info_path.exists() {
|
|
105
|
-
let content = std::fs::read_to_string(&bank_info_path)
|
|
106
|
-
.map_err(|e| format!("Failed to read bank info: {}", e))?;
|
|
107
|
-
|
|
108
|
-
match toml::from_str::<BankFile>(&content) {
|
|
109
|
-
Ok(bank_info) => banks.push(bank_info),
|
|
110
|
-
Err(_err) => {
|
|
111
|
-
eprintln!("❌ Error parsing bank info for '{}'", bank_name);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
} else {
|
|
115
|
-
eprintln!("❌ Bank info file not found for '{}'", bank_name);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
Ok(banks)
|
|
122
|
-
}
|