@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.
- package/LICENSE +20 -20
- package/README.md +251 -221
- 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 +122 -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 +95 -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 +42 -42
- package/.cargo/config.toml +0 -2
- package/.devalang +0 -9
- package/.github/workflows/ci.yml +0 -103
- package/Cargo.toml +0 -84
- package/docs/CHANGELOG.md +0 -622
- 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/chain.deva +0 -19
- 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/routing.deva +0 -23
- 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/bin/project-version.json +0 -6
- 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/out-tsc/scripts/version/copy-to-binary.d.ts +0 -1
- package/out-tsc/scripts/version/copy-to-binary.js +0 -79
- package/project-version.json +0 -6
- package/rust/bindings/Cargo.toml +0 -9
- package/rust/bindings/src/lib.rs +0 -86
- package/rust/cli/addon/commands.rs +0 -35
- package/rust/cli/addon/download.rs +0 -234
- package/rust/cli/addon/install.rs +0 -33
- package/rust/cli/addon/list.rs +0 -224
- package/rust/cli/addon/metadata.rs +0 -124
- package/rust/cli/addon/mod.rs +0 -8
- package/rust/cli/addon/remove.rs +0 -271
- package/rust/cli/addon/update.rs +0 -305
- package/rust/cli/addon/utils.rs +0 -109
- 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 -275
- package/rust/cli/discover/config.rs +0 -109
- package/rust/cli/discover/fs.rs +0 -19
- package/rust/cli/discover/install.rs +0 -214
- 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/login/commands.rs +0 -124
- package/rust/cli/login/mod.rs +0 -1
- package/rust/cli/me/commands.rs +0 -52
- package/rust/cli/me/mod.rs +0 -1
- package/rust/cli/mod.rs +0 -12
- package/rust/cli/parser.rs +0 -320
- 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 -237
- 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 -88
- package/rust/core/audio/engine/notes/mod.rs +0 -53
- package/rust/core/audio/engine/notes/params.rs +0 -294
- package/rust/core/audio/engine/sample/insert.rs +0 -300
- 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 -179
- package/rust/core/audio/interpreter/statements/arrow_call/methods/chord.rs +0 -398
- package/rust/core/audio/interpreter/statements/arrow_call/methods/effects.rs +0 -323
- package/rust/core/audio/interpreter/statements/arrow_call/methods/mod.rs +0 -3
- package/rust/core/audio/interpreter/statements/arrow_call/methods/note.rs +0 -371
- 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 -325
- 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 -302
- package/rust/core/audio/interpreter/statements/tempo.rs +0 -40
- package/rust/core/audio/interpreter/statements/trigger.rs +0 -242
- 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 -159
- 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 -247
- package/rust/core/parser/driver/parser.rs +0 -160
- package/rust/core/parser/handler/arrow_call.rs +0 -328
- 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 -171
- 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 -97
- 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 -481
- package/rust/core/plugin/runner/wasm32.rs +0 -44
- package/rust/core/preprocessor/loader/inject.rs +0 -313
- 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 -95
- 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/macros/Cargo.toml +0 -14
- package/rust/macros/src/lib.rs +0 -52
- package/rust/main.rs +0 -557
- package/rust/types/Cargo.toml +0 -11
- package/rust/types/src/addons.rs +0 -57
- package/rust/types/src/ast.rs +0 -202
- package/rust/types/src/config.rs +0 -82
- 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 -29
- package/rust/utils/src/error.rs +0 -186
- package/rust/utils/src/file.rs +0 -477
- 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 -158
- package/rust/utils/src/signature.rs +0 -41
- package/rust/utils/src/spinner.rs +0 -20
- package/rust/utils/src/version.rs +0 -58
- package/rust/utils/src/watcher.rs +0 -46
- package/rust/web/api.rs +0 -5
- package/rust/web/auth.rs +0 -5
- package/rust/web/cdn.rs +0 -34
- package/rust/web/forge.rs +0 -5
- package/rust/web/mod.rs +0 -5
- 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/copy-to-binary.ts +0 -82
- 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,30 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 =
|
|
16
|
-
const
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)(
|
|
23
|
-
|
|
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 (
|
|
26
|
-
console.warn(
|
|
65
|
+
catch (error) {
|
|
66
|
+
console.warn('⚠️ Could not get git commit hash');
|
|
27
67
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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"}
|
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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(
|
|
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":[],"mappings":";;AAEA;;;GAGG;;AAEH,iCAAqC;AACrC,iCAAqC;AACrC,mCAAuC;AAEvC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAE9B,KAAK,UAAU,IAAI;IACjB,IAAI,CAAC;QACH,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAwC,CAAC;gBAC/D,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;oBACvD,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAC;oBACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAClB,CAAC;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,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ot":"","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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(
|
|
15
|
-
|
|
16
|
-
|
|
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;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;IAEpC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,iCAAiC;IACjC,MAAM,YAAY,GAAG,OAAO,C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
|
+
* 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
|
+
{"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|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/typescript/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
|
|
@@ -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
|
-
|
|
19
|
-
|
|
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.
|
|
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:
|
|
15
|
-
"rust:
|
|
16
|
-
"rust:
|
|
17
|
-
"rust:
|
|
18
|
-
"rust:wasm:
|
|
19
|
-
"rust:
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
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": "
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
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
|
-
"
|
|
61
|
+
"devDependencies": {
|
|
66
62
|
"@types/follow-redirects": "^1.14.4",
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"follow-redirects": "^1.15.
|
|
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
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
"engines": {
|
|
70
|
+
"node": ">=16.0.0"
|
|
71
|
+
},
|
|
72
|
+
"files": [
|
|
73
|
+
"out-tsc/**/*",
|
|
74
|
+
"pkg/**/*",
|
|
75
|
+
"README.md",
|
|
76
|
+
"LICENSE"
|
|
77
|
+
]
|
|
78
|
+
}
|
package/.cargo/config.toml
DELETED