@devaloop/devalang 0.1.7 → 0.1.9
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
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|

|
|
21
21
|

|
|
22
22
|
|
|
23
|
-
# 🦊 Devalang — Write music
|
|
23
|
+
# 🦊 Devalang — Write music, like you write code.
|
|
24
24
|
|
|
25
25
|
Devalang is a compact **domain-specific language** (DSL) for **music makers**, **sound designers**, and **creative coders**.
|
|
26
26
|
Compose loops, control samples, synthesize audio, and render your ideas — all in clean, **readable text**.
|
|
@@ -5,29 +5,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
const
|
|
8
|
+
const https_1 = require("https");
|
|
9
9
|
const fs_2 = __importDefault(require("fs"));
|
|
10
10
|
const path_2 = __importDefault(require("path"));
|
|
11
|
-
// From out-tsc/scripts/ we need to go up 2 levels to reach
|
|
12
|
-
const
|
|
11
|
+
// From out-tsc/scripts/ we need to go up 2 levels to reach the published package root.
|
|
12
|
+
const packageJsonPath = path_2.default.join(__dirname, "../../package.json");
|
|
13
13
|
let versionString = "";
|
|
14
14
|
try {
|
|
15
|
-
if (!fs_2.default.existsSync(
|
|
16
|
-
console.warn(`⚠️
|
|
15
|
+
if (!fs_2.default.existsSync(packageJsonPath)) {
|
|
16
|
+
console.warn(`⚠️ package.json not found at ${packageJsonPath}. Skipping postinstall binary download.`);
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
|
-
const
|
|
19
|
+
const packageJson = fs_2.default.readFileSync(packageJsonPath, "utf-8").trim();
|
|
20
20
|
try {
|
|
21
|
-
versionString = JSON.parse(
|
|
21
|
+
versionString = JSON.parse(packageJson).version;
|
|
22
22
|
}
|
|
23
23
|
catch (e) {
|
|
24
|
-
console.warn(`⚠️ Failed to parse
|
|
24
|
+
console.warn(`⚠️ Failed to parse package.json: ${e.message}. Skipping binary download.`);
|
|
25
25
|
versionString = "";
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
catch (e) {
|
|
30
|
-
console.warn(`⚠️ Could not read
|
|
30
|
+
console.warn(`⚠️ Could not read package.json: ${e.message}. Skipping binary download.`);
|
|
31
31
|
versionString = "";
|
|
32
32
|
}
|
|
33
33
|
const platform = process.platform;
|
|
@@ -50,35 +50,51 @@ if (binaryName !== "" && versionString) {
|
|
|
50
50
|
const url = `https://github.com/devaloop-labs/devalang/releases/download/v${versionString}/${binaryName}`;
|
|
51
51
|
(0, fs_1.mkdirSync)(destDir, { recursive: true });
|
|
52
52
|
console.log(`⬇️ Downloading ${binaryName} from ${url}`);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
53
|
+
const download = (downloadUrl, redirectsLeft = 5) => {
|
|
54
|
+
const req = (0, https_1.get)(downloadUrl, (res) => {
|
|
55
|
+
if (res.statusCode >= 300 &&
|
|
56
|
+
res.statusCode < 400 &&
|
|
57
|
+
res.headers.location &&
|
|
58
|
+
redirectsLeft > 0) {
|
|
59
|
+
res.resume();
|
|
60
|
+
download(new URL(res.headers.location, downloadUrl).toString(), redirectsLeft - 1);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (res.statusCode >= 300 && res.statusCode < 400) {
|
|
64
|
+
console.warn(`⚠️ Too many redirects. Skipping binary download.`);
|
|
65
|
+
res.resume();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (res.statusCode === 404) {
|
|
69
|
+
console.warn(`⚠️ Asset not found (HTTP 404). Skipping binary download.`);
|
|
70
|
+
res.resume();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (res.statusCode !== 200) {
|
|
74
|
+
console.warn(`⚠️ Failed (HTTP ${res.statusCode}). Skipping binary download.`);
|
|
75
|
+
res.resume();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const file = (0, fs_1.createWriteStream)(dest, { mode: 0o755 });
|
|
79
|
+
res.pipe(file);
|
|
80
|
+
file.on("finish", () => {
|
|
81
|
+
file.close();
|
|
82
|
+
console.log(`✅ Downloaded ${binaryName} to ${dest}`);
|
|
83
|
+
});
|
|
69
84
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
85
|
+
req.setTimeout(30000, () => {
|
|
86
|
+
console.warn(`⚠️ Download timed out after 30s. Skipping binary download for ${binaryName}.`);
|
|
87
|
+
try {
|
|
88
|
+
req.destroy();
|
|
89
|
+
}
|
|
90
|
+
catch (e) { }
|
|
91
|
+
});
|
|
92
|
+
req.on("error", (err) => {
|
|
93
|
+
// Network or other errors should not fail CI; log and continue.
|
|
94
|
+
console.warn(`⚠️ Error downloading binary: ${err.message}. Skipping binary download.`);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
download(url);
|
|
82
98
|
}
|
|
83
99
|
else {
|
|
84
100
|
console.warn(`⚠️ Unsupported platform: ${platform}. Skipping binary download.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/typescript/scripts/postinstall.ts"],"names":[],"mappings":";;;;;AAAA,2BAAkD;AAClD,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../../src/typescript/scripts/postinstall.ts"],"names":[],"mappings":";;;;;AAAA,2BAAkD;AAClD,+BAA4B;AAC5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2
|
"name": "@devaloop/devalang",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.9",
|
|
5
5
|
"description": "Write music with code. Devalang is a domain-specific language (DSL) for sound designers and music hackers. Compose, automate, and control sound — in plain text.",
|
|
6
6
|
"main": "out-tsc/index.js",
|
|
7
7
|
"types": "./out-tsc/index.d.ts",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"test:examples": "cargo run --features cli -- check --entry examples/",
|
|
33
33
|
"clean": "cargo clean && npm run ts:clean",
|
|
34
34
|
"prepare": "npm run ts:build",
|
|
35
|
-
"postinstall": "node -e \"try { require('./out-tsc/scripts/postinstall.js') } catch (e) { console.
|
|
35
|
+
"postinstall": "node -e \"try { require('./out-tsc/scripts/postinstall.js') } catch (e) { console.warn('⚠️ Skipping postinstall:', e.message) }\""
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://devalang.com",
|
|
38
38
|
"keywords": [
|
|
@@ -58,9 +58,7 @@
|
|
|
58
58
|
"url": "https://github.com/devaloop-labs/devalang.git"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@types/follow-redirects": "^1.14.4",
|
|
62
61
|
"@types/node": "^20.19.19",
|
|
63
|
-
"follow-redirects": "^1.15.9",
|
|
64
62
|
"rimraf": "^5.0.10",
|
|
65
63
|
"tsx": "^4.20.6",
|
|
66
64
|
"typescript": "^5.9.3"
|
|
@@ -71,6 +69,7 @@
|
|
|
71
69
|
"files": [
|
|
72
70
|
"out-tsc/**/*",
|
|
73
71
|
"pkg/**/*",
|
|
72
|
+
"project-version.json",
|
|
74
73
|
"README.md",
|
|
75
74
|
"LICENSE"
|
|
76
75
|
]
|