rustywind 0.22.0 → 0.24.0
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/bin/rustywind +0 -0
- package/lib/constants.js +1 -1
- package/lib/download-release.js +29 -29
- package/lib/download.js +47 -36
- package/lib/postinstall.js +22 -8
- package/package.json +3 -2
- package/release.json +139 -93
- package/lib/install.js +0 -107
package/bin/rustywind
CHANGED
|
Binary file
|
package/lib/constants.js
CHANGED
package/lib/download-release.js
CHANGED
|
@@ -9,46 +9,46 @@ const get = require("./get");
|
|
|
9
9
|
* @param {string} tag
|
|
10
10
|
*/
|
|
11
11
|
function getApiUrl(repo, tag) {
|
|
12
|
-
|
|
12
|
+
return `https://api.github.com/repos/${repo}/releases/tags/${tag}`;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {{ token?: string; version: string; }} opts
|
|
17
17
|
*/
|
|
18
18
|
async function getReleaseFromGitHubApi(opts) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
const downloadOpts = {
|
|
20
|
+
headers: {
|
|
21
|
+
"user-agent": "rustywind",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (opts.token) {
|
|
26
|
+
downloadOpts.headers.authorization = `token ${opts.token}`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(`Finding rustywind ${opts.version} release`);
|
|
30
|
+
const release = await get(getApiUrl(REPO, opts.version), downloadOpts);
|
|
31
|
+
let jsonRelease;
|
|
32
|
+
try {
|
|
33
|
+
jsonRelease = JSON.parse(release);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
throw new Error("Malformed API response: " + e.stack);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!jsonRelease.assets) {
|
|
39
|
+
throw new Error("Bad API response: " + JSON.stringify(release));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return jsonRelease;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* @param {{ token?: string; version: string; }} opts
|
|
47
47
|
*/
|
|
48
48
|
module.exports = async (opts) => {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
if (!opts.version) {
|
|
50
|
+
return Promise.reject(new Error("Missing version"));
|
|
51
|
+
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
return getReleaseFromGitHubApi(opts);
|
|
54
54
|
};
|
package/lib/download.js
CHANGED
|
@@ -11,8 +11,6 @@ const URL = url.URL;
|
|
|
11
11
|
const child_process = require("child_process");
|
|
12
12
|
const proxy_from_env = require("proxy-from-env");
|
|
13
13
|
|
|
14
|
-
const get = require("./get");
|
|
15
|
-
|
|
16
14
|
const packageVersion = require("../package.json").version;
|
|
17
15
|
const tmpDir = path.join(os.tmpdir(), `rustywind-cache-${packageVersion}`);
|
|
18
16
|
|
|
@@ -79,10 +77,11 @@ function downloadWin(url, dest, opts) {
|
|
|
79
77
|
});
|
|
80
78
|
}
|
|
81
79
|
|
|
82
|
-
function download(_url, dest, opts) {
|
|
80
|
+
async function download(_url, dest, opts) {
|
|
81
|
+
// Handle proxy setup
|
|
83
82
|
const proxy = proxy_from_env.getProxyForUrl(url.parse(_url));
|
|
84
|
-
if (proxy
|
|
85
|
-
|
|
83
|
+
if (proxy) {
|
|
84
|
+
const HttpsProxyAgent = require("https-proxy-agent");
|
|
86
85
|
opts = {
|
|
87
86
|
...opts,
|
|
88
87
|
agent: new HttpsProxyAgent(proxy),
|
|
@@ -90,46 +89,56 @@ function download(_url, dest, opts) {
|
|
|
90
89
|
};
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
// Windows-specific handling
|
|
93
93
|
if (isWindows) {
|
|
94
|
-
// This alternative strategy shouldn't be necessary but sometimes on Windows the file does not get closed,
|
|
95
|
-
// so unzipping it fails, and I don't know why.
|
|
96
94
|
return downloadWin(_url, dest, opts);
|
|
97
95
|
}
|
|
98
96
|
|
|
97
|
+
// Remove auth headers for non-GitHub URLs
|
|
99
98
|
if (opts.headers.authorization && !isGithubUrl(_url)) {
|
|
100
99
|
delete opts.headers.authorization;
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
return new Promise((resolve, reject) => {
|
|
104
|
-
console.log(`Download options: ${JSON.stringify(opts)}`);
|
|
105
103
|
const outFile = fs.createWriteStream(dest);
|
|
106
|
-
const mergedOpts = {
|
|
107
|
-
...url.parse(_url),
|
|
108
|
-
...opts,
|
|
109
|
-
};
|
|
110
|
-
https
|
|
111
|
-
.get(mergedOpts, (response) => {
|
|
112
|
-
console.log("statusCode: " + response.statusCode);
|
|
113
|
-
if (response.statusCode === 302) {
|
|
114
|
-
console.log("Following redirect to: " + response.headers.location);
|
|
115
|
-
return download(response.headers.location, dest, opts).then(
|
|
116
|
-
resolve,
|
|
117
|
-
reject
|
|
118
|
-
);
|
|
119
|
-
} else if (response.statusCode !== 200) {
|
|
120
|
-
reject(new Error("Download failed with " + response.statusCode));
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
104
|
+
const mergedOpts = { ...url.parse(_url), ...opts };
|
|
123
105
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
106
|
+
const request = https.get(mergedOpts, (response) => {
|
|
107
|
+
// Handle redirects
|
|
108
|
+
if (response.statusCode === 302) {
|
|
109
|
+
outFile.destroy();
|
|
110
|
+
return download(response.headers.location, dest, opts).then(resolve, reject);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Handle error status codes
|
|
114
|
+
if (response.statusCode !== 200) {
|
|
115
|
+
outFile.destroy();
|
|
116
|
+
reject(new Error(`Download failed with ${response.statusCode}`));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Pipe the response to file
|
|
121
|
+
response.pipe(outFile);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
// Handle write stream errors
|
|
125
|
+
outFile.on('error', async (err) => {
|
|
126
|
+
outFile.destroy();
|
|
127
|
+
await fsUnlink(dest).catch(() => { });
|
|
128
|
+
reject(err);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Handle successful completion
|
|
132
|
+
outFile.on('finish', () => {
|
|
133
|
+
outFile.close(() => resolve(null));
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// Handle request errors
|
|
137
|
+
request.on('error', async (err) => {
|
|
138
|
+
outFile.destroy();
|
|
139
|
+
await fsUnlink(dest).catch(() => { });
|
|
140
|
+
reject(err);
|
|
141
|
+
});
|
|
133
142
|
});
|
|
134
143
|
}
|
|
135
144
|
|
|
@@ -229,6 +238,8 @@ function untar(zipPath, destinationDir) {
|
|
|
229
238
|
if (code !== 0) {
|
|
230
239
|
reject(new Error(`tar xvf exited with ${code}`));
|
|
231
240
|
return;
|
|
241
|
+
} else {
|
|
242
|
+
process.exit(0);
|
|
232
243
|
}
|
|
233
244
|
|
|
234
245
|
resolve();
|
|
@@ -281,7 +292,7 @@ module.exports = async (opts) => {
|
|
|
281
292
|
console.log("Deleting invalid download cache");
|
|
282
293
|
try {
|
|
283
294
|
await fsUnlink(assetDownloadPath);
|
|
284
|
-
} catch (e) {}
|
|
295
|
+
} catch (e) { }
|
|
285
296
|
|
|
286
297
|
throw e;
|
|
287
298
|
}
|
|
@@ -300,7 +311,7 @@ module.exports = async (opts) => {
|
|
|
300
311
|
|
|
301
312
|
try {
|
|
302
313
|
await fsUnlink(assetDownloadPath);
|
|
303
|
-
} catch (e) {}
|
|
314
|
+
} catch (e) { }
|
|
304
315
|
|
|
305
316
|
throw e;
|
|
306
317
|
}
|
package/lib/postinstall.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
// Imports
|
|
4
5
|
const os = require("os");
|
|
5
6
|
const fs = require("fs");
|
|
6
7
|
const path = require("path");
|
|
@@ -19,14 +20,26 @@ if (forceInstall) {
|
|
|
19
20
|
const { VERSION } = require("./constants");
|
|
20
21
|
const BIN_PATH = path.join(__dirname, "../bin");
|
|
21
22
|
|
|
23
|
+
|
|
24
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
25
|
+
const APP_NAME = "rustywind";
|
|
26
|
+
const REPO = "avencera/rustywind";
|
|
27
|
+
const GITHUB_REPO = `https://github.com/${REPO}`;
|
|
28
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
29
|
+
|
|
22
30
|
process.on("unhandledRejection", (reason, promise) => {
|
|
23
31
|
console.log("Unhandled rejection: ", promise, "reason:", reason);
|
|
24
32
|
});
|
|
25
33
|
|
|
26
34
|
function getTarget() {
|
|
27
|
-
const arch =
|
|
35
|
+
const arch = os.arch();
|
|
36
|
+
const platform = os.platform();
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
console.log(`Downloading: ${APP_NAME}`);
|
|
39
|
+
console.log(` from: ${GITHUB_REPO}`);
|
|
40
|
+
console.log(` for platform: ${arch}-${platform}\n`);
|
|
41
|
+
|
|
42
|
+
switch (platform) {
|
|
30
43
|
case "darwin":
|
|
31
44
|
return arch == "x64" ? "x86_64-apple-darwin" : "aarch64-apple-darwin";
|
|
32
45
|
case "win32":
|
|
@@ -35,12 +48,12 @@ function getTarget() {
|
|
|
35
48
|
return arch === "x64"
|
|
36
49
|
? "x86_64-unknown-linux-musl"
|
|
37
50
|
: arch === "arm"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
? "arm-unknown-linux-gnueabihf"
|
|
52
|
+
: arch === "arm64"
|
|
53
|
+
? "aarch64-unknown-linux-gnu"
|
|
54
|
+
: arch === "ppc64"
|
|
55
|
+
? "powerpc64le-unknown-linux-gnu"
|
|
56
|
+
: "i686-unknown-linux-musl";
|
|
44
57
|
default:
|
|
45
58
|
throw new Error("Unknown platform: " + os.platform());
|
|
46
59
|
}
|
|
@@ -59,6 +72,7 @@ async function main() {
|
|
|
59
72
|
destDir: BIN_PATH,
|
|
60
73
|
force: forceInstall,
|
|
61
74
|
};
|
|
75
|
+
|
|
62
76
|
try {
|
|
63
77
|
await download(opts);
|
|
64
78
|
} catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rustywind",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
4
4
|
"description": "CLI for organizing Tailwind CSS classes",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"homepage": "https://github.com/avencera/rustywind#readme",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"https-proxy-agent": "^4.0.0",
|
|
37
|
-
"proxy-from-env": "^1.1.0"
|
|
37
|
+
"proxy-from-env": "^1.1.0",
|
|
38
|
+
"user": "^0.0.0"
|
|
38
39
|
}
|
|
39
40
|
}
|
package/release.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/
|
|
3
|
-
"assets_url": "https://api.github.com/repos/avencera/rustywind/releases/
|
|
4
|
-
"upload_url": "https://uploads.github.com/repos/avencera/rustywind/releases/
|
|
5
|
-
"html_url": "https://github.com/avencera/rustywind/releases/tag/v0.
|
|
6
|
-
"id":
|
|
2
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/202883013",
|
|
3
|
+
"assets_url": "https://api.github.com/repos/avencera/rustywind/releases/202883013/assets",
|
|
4
|
+
"upload_url": "https://uploads.github.com/repos/avencera/rustywind/releases/202883013/assets{?name,label}",
|
|
5
|
+
"html_url": "https://github.com/avencera/rustywind/releases/tag/v0.24.0",
|
|
6
|
+
"id": 202883013,
|
|
7
7
|
"author": {
|
|
8
8
|
"login": "github-actions[bot]",
|
|
9
9
|
"id": 41898282,
|
|
@@ -22,22 +22,23 @@
|
|
|
22
22
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
23
23
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
24
24
|
"type": "Bot",
|
|
25
|
+
"user_view_type": "public",
|
|
25
26
|
"site_admin": false
|
|
26
27
|
},
|
|
27
|
-
"node_id": "
|
|
28
|
-
"tag_name": "v0.
|
|
28
|
+
"node_id": "RE_kwDODVEYLM4MF7_F",
|
|
29
|
+
"tag_name": "v0.24.0",
|
|
29
30
|
"target_commitish": "master",
|
|
30
|
-
"name": "v0.
|
|
31
|
+
"name": "v0.24.0",
|
|
31
32
|
"draft": false,
|
|
32
33
|
"prerelease": false,
|
|
33
|
-
"created_at": "
|
|
34
|
-
"published_at": "
|
|
34
|
+
"created_at": "2025-02-27T19:39:42Z",
|
|
35
|
+
"published_at": "2025-02-27T19:41:53Z",
|
|
35
36
|
"assets": [
|
|
36
37
|
{
|
|
37
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
38
|
-
"id":
|
|
39
|
-
"node_id": "
|
|
40
|
-
"name": "rustywind-v0.
|
|
38
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153796",
|
|
39
|
+
"id": 233153796,
|
|
40
|
+
"node_id": "RA_kwDODVEYLM4N5aUE",
|
|
41
|
+
"name": "rustywind-v0.24.0-aarch64-apple-darwin.tar.gz",
|
|
41
42
|
"label": "",
|
|
42
43
|
"uploader": {
|
|
43
44
|
"login": "github-actions[bot]",
|
|
@@ -57,20 +58,21 @@
|
|
|
57
58
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
58
59
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
59
60
|
"type": "Bot",
|
|
61
|
+
"user_view_type": "public",
|
|
60
62
|
"site_admin": false
|
|
61
63
|
},
|
|
62
64
|
"content_type": "application/gzip",
|
|
63
65
|
"state": "uploaded",
|
|
64
|
-
"size":
|
|
65
|
-
"created_at": "
|
|
66
|
-
"updated_at": "
|
|
67
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
66
|
+
"size": 1998093,
|
|
67
|
+
"created_at": "2025-02-27T19:41:54Z",
|
|
68
|
+
"updated_at": "2025-02-27T19:41:54Z",
|
|
69
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-aarch64-apple-darwin.tar.gz"
|
|
68
70
|
},
|
|
69
71
|
{
|
|
70
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
71
|
-
"id":
|
|
72
|
-
"node_id": "
|
|
73
|
-
"name": "rustywind-v0.
|
|
72
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153931",
|
|
73
|
+
"id": 233153931,
|
|
74
|
+
"node_id": "RA_kwDODVEYLM4N5aWL",
|
|
75
|
+
"name": "rustywind-v0.24.0-aarch64-unknown-linux-gnu.tar.gz",
|
|
74
76
|
"label": "",
|
|
75
77
|
"uploader": {
|
|
76
78
|
"login": "github-actions[bot]",
|
|
@@ -90,20 +92,21 @@
|
|
|
90
92
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
91
93
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
92
94
|
"type": "Bot",
|
|
95
|
+
"user_view_type": "public",
|
|
93
96
|
"site_admin": false
|
|
94
97
|
},
|
|
95
98
|
"content_type": "application/gzip",
|
|
96
99
|
"state": "uploaded",
|
|
97
|
-
"size":
|
|
98
|
-
"created_at": "
|
|
99
|
-
"updated_at": "
|
|
100
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
100
|
+
"size": 2087775,
|
|
101
|
+
"created_at": "2025-02-27T19:42:14Z",
|
|
102
|
+
"updated_at": "2025-02-27T19:42:14Z",
|
|
103
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-aarch64-unknown-linux-gnu.tar.gz"
|
|
101
104
|
},
|
|
102
105
|
{
|
|
103
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
104
|
-
"id":
|
|
105
|
-
"node_id": "
|
|
106
|
-
"name": "rustywind-v0.
|
|
106
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153939",
|
|
107
|
+
"id": 233153939,
|
|
108
|
+
"node_id": "RA_kwDODVEYLM4N5aWT",
|
|
109
|
+
"name": "rustywind-v0.24.0-aarch64-unknown-linux-musl.tar.gz",
|
|
107
110
|
"label": "",
|
|
108
111
|
"uploader": {
|
|
109
112
|
"login": "github-actions[bot]",
|
|
@@ -123,20 +126,21 @@
|
|
|
123
126
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
124
127
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
125
128
|
"type": "Bot",
|
|
129
|
+
"user_view_type": "public",
|
|
126
130
|
"site_admin": false
|
|
127
131
|
},
|
|
128
132
|
"content_type": "application/gzip",
|
|
129
133
|
"state": "uploaded",
|
|
130
|
-
"size":
|
|
131
|
-
"created_at": "
|
|
132
|
-
"updated_at": "
|
|
133
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
134
|
+
"size": 2128032,
|
|
135
|
+
"created_at": "2025-02-27T19:42:17Z",
|
|
136
|
+
"updated_at": "2025-02-27T19:42:18Z",
|
|
137
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-aarch64-unknown-linux-musl.tar.gz"
|
|
134
138
|
},
|
|
135
139
|
{
|
|
136
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
137
|
-
"id":
|
|
138
|
-
"node_id": "
|
|
139
|
-
"name": "rustywind-v0.
|
|
140
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153985",
|
|
141
|
+
"id": 233153985,
|
|
142
|
+
"node_id": "RA_kwDODVEYLM4N5aXB",
|
|
143
|
+
"name": "rustywind-v0.24.0-arm-unknown-linux-gnueabi.tar.gz",
|
|
140
144
|
"label": "",
|
|
141
145
|
"uploader": {
|
|
142
146
|
"login": "github-actions[bot]",
|
|
@@ -156,20 +160,21 @@
|
|
|
156
160
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
157
161
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
158
162
|
"type": "Bot",
|
|
163
|
+
"user_view_type": "public",
|
|
159
164
|
"site_admin": false
|
|
160
165
|
},
|
|
161
166
|
"content_type": "application/gzip",
|
|
162
167
|
"state": "uploaded",
|
|
163
|
-
"size":
|
|
164
|
-
"created_at": "
|
|
165
|
-
"updated_at": "
|
|
166
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
168
|
+
"size": 2045615,
|
|
169
|
+
"created_at": "2025-02-27T19:42:34Z",
|
|
170
|
+
"updated_at": "2025-02-27T19:42:35Z",
|
|
171
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-arm-unknown-linux-gnueabi.tar.gz"
|
|
167
172
|
},
|
|
168
173
|
{
|
|
169
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
170
|
-
"id":
|
|
171
|
-
"node_id": "
|
|
172
|
-
"name": "rustywind-v0.
|
|
174
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153960",
|
|
175
|
+
"id": 233153960,
|
|
176
|
+
"node_id": "RA_kwDODVEYLM4N5aWo",
|
|
177
|
+
"name": "rustywind-v0.24.0-arm-unknown-linux-gnueabihf.tar.gz",
|
|
173
178
|
"label": "",
|
|
174
179
|
"uploader": {
|
|
175
180
|
"login": "github-actions[bot]",
|
|
@@ -189,20 +194,21 @@
|
|
|
189
194
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
190
195
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
191
196
|
"type": "Bot",
|
|
197
|
+
"user_view_type": "public",
|
|
192
198
|
"site_admin": false
|
|
193
199
|
},
|
|
194
200
|
"content_type": "application/gzip",
|
|
195
201
|
"state": "uploaded",
|
|
196
|
-
"size":
|
|
197
|
-
"created_at": "
|
|
198
|
-
"updated_at": "
|
|
199
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
202
|
+
"size": 2038337,
|
|
203
|
+
"created_at": "2025-02-27T19:42:24Z",
|
|
204
|
+
"updated_at": "2025-02-27T19:42:24Z",
|
|
205
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-arm-unknown-linux-gnueabihf.tar.gz"
|
|
200
206
|
},
|
|
201
207
|
{
|
|
202
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
203
|
-
"id":
|
|
204
|
-
"node_id": "
|
|
205
|
-
"name": "rustywind-v0.
|
|
208
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233154076",
|
|
209
|
+
"id": 233154076,
|
|
210
|
+
"node_id": "RA_kwDODVEYLM4N5aYc",
|
|
211
|
+
"name": "rustywind-v0.24.0-armv7-unknown-linux-gnueabihf.tar.gz",
|
|
206
212
|
"label": "",
|
|
207
213
|
"uploader": {
|
|
208
214
|
"login": "github-actions[bot]",
|
|
@@ -222,20 +228,55 @@
|
|
|
222
228
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
223
229
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
224
230
|
"type": "Bot",
|
|
231
|
+
"user_view_type": "public",
|
|
232
|
+
"site_admin": false
|
|
233
|
+
},
|
|
234
|
+
"content_type": "application/gzip",
|
|
235
|
+
"state": "uploaded",
|
|
236
|
+
"size": 2017558,
|
|
237
|
+
"created_at": "2025-02-27T19:42:51Z",
|
|
238
|
+
"updated_at": "2025-02-27T19:42:52Z",
|
|
239
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-armv7-unknown-linux-gnueabihf.tar.gz"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233154616",
|
|
243
|
+
"id": 233154616,
|
|
244
|
+
"node_id": "RA_kwDODVEYLM4N5ag4",
|
|
245
|
+
"name": "rustywind-v0.24.0-i686-pc-windows-msvc.zip",
|
|
246
|
+
"label": "",
|
|
247
|
+
"uploader": {
|
|
248
|
+
"login": "github-actions[bot]",
|
|
249
|
+
"id": 41898282,
|
|
250
|
+
"node_id": "MDM6Qm90NDE4OTgyODI=",
|
|
251
|
+
"avatar_url": "https://avatars.githubusercontent.com/in/15368?v=4",
|
|
252
|
+
"gravatar_id": "",
|
|
253
|
+
"url": "https://api.github.com/users/github-actions%5Bbot%5D",
|
|
254
|
+
"html_url": "https://github.com/apps/github-actions",
|
|
255
|
+
"followers_url": "https://api.github.com/users/github-actions%5Bbot%5D/followers",
|
|
256
|
+
"following_url": "https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}",
|
|
257
|
+
"gists_url": "https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}",
|
|
258
|
+
"starred_url": "https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}",
|
|
259
|
+
"subscriptions_url": "https://api.github.com/users/github-actions%5Bbot%5D/subscriptions",
|
|
260
|
+
"organizations_url": "https://api.github.com/users/github-actions%5Bbot%5D/orgs",
|
|
261
|
+
"repos_url": "https://api.github.com/users/github-actions%5Bbot%5D/repos",
|
|
262
|
+
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
263
|
+
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
264
|
+
"type": "Bot",
|
|
265
|
+
"user_view_type": "public",
|
|
225
266
|
"site_admin": false
|
|
226
267
|
},
|
|
227
268
|
"content_type": "application/zip",
|
|
228
269
|
"state": "uploaded",
|
|
229
|
-
"size":
|
|
230
|
-
"created_at": "
|
|
231
|
-
"updated_at": "
|
|
232
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
270
|
+
"size": 1703739,
|
|
271
|
+
"created_at": "2025-02-27T19:44:59Z",
|
|
272
|
+
"updated_at": "2025-02-27T19:45:00Z",
|
|
273
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-i686-pc-windows-msvc.zip"
|
|
233
274
|
},
|
|
234
275
|
{
|
|
235
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
236
|
-
"id":
|
|
237
|
-
"node_id": "
|
|
238
|
-
"name": "rustywind-v0.
|
|
276
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233154151",
|
|
277
|
+
"id": 233154151,
|
|
278
|
+
"node_id": "RA_kwDODVEYLM4N5aZn",
|
|
279
|
+
"name": "rustywind-v0.24.0-i686-unknown-linux-musl.tar.gz",
|
|
239
280
|
"label": "",
|
|
240
281
|
"uploader": {
|
|
241
282
|
"login": "github-actions[bot]",
|
|
@@ -255,20 +296,21 @@
|
|
|
255
296
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
256
297
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
257
298
|
"type": "Bot",
|
|
299
|
+
"user_view_type": "public",
|
|
258
300
|
"site_admin": false
|
|
259
301
|
},
|
|
260
302
|
"content_type": "application/gzip",
|
|
261
303
|
"state": "uploaded",
|
|
262
|
-
"size":
|
|
263
|
-
"created_at": "
|
|
264
|
-
"updated_at": "
|
|
265
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
304
|
+
"size": 2076068,
|
|
305
|
+
"created_at": "2025-02-27T19:43:18Z",
|
|
306
|
+
"updated_at": "2025-02-27T19:43:18Z",
|
|
307
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-i686-unknown-linux-musl.tar.gz"
|
|
266
308
|
},
|
|
267
309
|
{
|
|
268
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
269
|
-
"id":
|
|
270
|
-
"node_id": "
|
|
271
|
-
"name": "rustywind-v0.
|
|
310
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233153809",
|
|
311
|
+
"id": 233153809,
|
|
312
|
+
"node_id": "RA_kwDODVEYLM4N5aUR",
|
|
313
|
+
"name": "rustywind-v0.24.0-x86_64-apple-darwin.tar.gz",
|
|
272
314
|
"label": "",
|
|
273
315
|
"uploader": {
|
|
274
316
|
"login": "github-actions[bot]",
|
|
@@ -288,20 +330,21 @@
|
|
|
288
330
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
289
331
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
290
332
|
"type": "Bot",
|
|
333
|
+
"user_view_type": "public",
|
|
291
334
|
"site_admin": false
|
|
292
335
|
},
|
|
293
336
|
"content_type": "application/gzip",
|
|
294
337
|
"state": "uploaded",
|
|
295
|
-
"size":
|
|
296
|
-
"created_at": "
|
|
297
|
-
"updated_at": "
|
|
298
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
338
|
+
"size": 2114675,
|
|
339
|
+
"created_at": "2025-02-27T19:41:55Z",
|
|
340
|
+
"updated_at": "2025-02-27T19:41:55Z",
|
|
341
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-x86_64-apple-darwin.tar.gz"
|
|
299
342
|
},
|
|
300
343
|
{
|
|
301
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
302
|
-
"id":
|
|
303
|
-
"node_id": "
|
|
304
|
-
"name": "rustywind-v0.
|
|
344
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233154657",
|
|
345
|
+
"id": 233154657,
|
|
346
|
+
"node_id": "RA_kwDODVEYLM4N5ahh",
|
|
347
|
+
"name": "rustywind-v0.24.0-x86_64-pc-windows-msvc.zip",
|
|
305
348
|
"label": "",
|
|
306
349
|
"uploader": {
|
|
307
350
|
"login": "github-actions[bot]",
|
|
@@ -321,20 +364,21 @@
|
|
|
321
364
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
322
365
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
323
366
|
"type": "Bot",
|
|
367
|
+
"user_view_type": "public",
|
|
324
368
|
"site_admin": false
|
|
325
369
|
},
|
|
326
370
|
"content_type": "application/zip",
|
|
327
371
|
"state": "uploaded",
|
|
328
|
-
"size":
|
|
329
|
-
"created_at": "
|
|
330
|
-
"updated_at": "
|
|
331
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
372
|
+
"size": 2031170,
|
|
373
|
+
"created_at": "2025-02-27T19:45:26Z",
|
|
374
|
+
"updated_at": "2025-02-27T19:45:26Z",
|
|
375
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-x86_64-pc-windows-msvc.zip"
|
|
332
376
|
},
|
|
333
377
|
{
|
|
334
|
-
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/
|
|
335
|
-
"id":
|
|
336
|
-
"node_id": "
|
|
337
|
-
"name": "rustywind-v0.
|
|
378
|
+
"url": "https://api.github.com/repos/avencera/rustywind/releases/assets/233154169",
|
|
379
|
+
"id": 233154169,
|
|
380
|
+
"node_id": "RA_kwDODVEYLM4N5aZ5",
|
|
381
|
+
"name": "rustywind-v0.24.0-x86_64-unknown-linux-musl.tar.gz",
|
|
338
382
|
"label": "",
|
|
339
383
|
"uploader": {
|
|
340
384
|
"login": "github-actions[bot]",
|
|
@@ -354,17 +398,19 @@
|
|
|
354
398
|
"events_url": "https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}",
|
|
355
399
|
"received_events_url": "https://api.github.com/users/github-actions%5Bbot%5D/received_events",
|
|
356
400
|
"type": "Bot",
|
|
401
|
+
"user_view_type": "public",
|
|
357
402
|
"site_admin": false
|
|
358
403
|
},
|
|
359
404
|
"content_type": "application/gzip",
|
|
360
405
|
"state": "uploaded",
|
|
361
|
-
"size":
|
|
362
|
-
"created_at": "
|
|
363
|
-
"updated_at": "
|
|
364
|
-
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.
|
|
406
|
+
"size": 2332160,
|
|
407
|
+
"created_at": "2025-02-27T19:43:22Z",
|
|
408
|
+
"updated_at": "2025-02-27T19:43:22Z",
|
|
409
|
+
"browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.24.0/rustywind-v0.24.0-x86_64-unknown-linux-musl.tar.gz"
|
|
365
410
|
}
|
|
366
411
|
],
|
|
367
|
-
"tarball_url": "https://api.github.com/repos/avencera/rustywind/tarball/v0.
|
|
368
|
-
"zipball_url": "https://api.github.com/repos/avencera/rustywind/zipball/v0.
|
|
369
|
-
"body": ""
|
|
412
|
+
"tarball_url": "https://api.github.com/repos/avencera/rustywind/tarball/v0.24.0",
|
|
413
|
+
"zipball_url": "https://api.github.com/repos/avencera/rustywind/zipball/v0.24.0",
|
|
414
|
+
"body": "## What's Changed\r\n* Big performance increase for MacOS systems with high CPU counts (4x improvement on M4 Pro Mac Mini)\r\n * By limiting threads to 4\r\n* Refactor into `RustyWind` struct by @praveenperera in https://github.com/avencera/rustywind/pull/116\r\n\r\n**Full Changelog**: https://github.com/avencera/rustywind/compare/v0.23.1...v0.24.0",
|
|
415
|
+
"mentions_count": 1
|
|
370
416
|
}
|
package/lib/install.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const os = require("os");
|
|
3
|
-
const request = require("request");
|
|
4
|
-
const rp = require("request-promise");
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const rimraf = require("rimraf");
|
|
7
|
-
const decompress = require("decompress");
|
|
8
|
-
const decompressTargz = require("decompress-targz");
|
|
9
|
-
|
|
10
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
11
|
-
const APP_NAME = "rustywind";
|
|
12
|
-
const REPO = "avencera/rustywind";
|
|
13
|
-
const GITHUB_REPO = `https://github.com/${REPO}`;
|
|
14
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
15
|
-
|
|
16
|
-
const INSTALL_LOCATION = process.cwd();
|
|
17
|
-
|
|
18
|
-
const randomString = () => {
|
|
19
|
-
return Math.random()
|
|
20
|
-
.toString(36)
|
|
21
|
-
.substring(10);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const getPlatform = () => {
|
|
25
|
-
switch (os.platform()) {
|
|
26
|
-
case "darwin": {
|
|
27
|
-
return "apple-darwin";
|
|
28
|
-
}
|
|
29
|
-
case "linux": {
|
|
30
|
-
return "unknown-linux-musl";
|
|
31
|
-
}
|
|
32
|
-
case "win32": {
|
|
33
|
-
return "pc-windows-gnu";
|
|
34
|
-
}
|
|
35
|
-
default:
|
|
36
|
-
throw `we don't current support your os (${os.platform()}) please make an issue on github`;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const getArch = () => {
|
|
41
|
-
switch (os.arch()) {
|
|
42
|
-
case "x64":
|
|
43
|
-
return "x86_64";
|
|
44
|
-
default:
|
|
45
|
-
throw `we don't current support your cpu arch (${os.arch()}) please make an issue on github`;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
async function getTag(repo) {
|
|
50
|
-
const url = `https://api.github.com/repos/${REPO}/releases/latest`;
|
|
51
|
-
const response = await rp(url, {
|
|
52
|
-
json: true,
|
|
53
|
-
headers: { "user-agent": "node.js" }
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
return response.tag_name;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
async function download() {
|
|
60
|
-
const tag = await getTag(REPO);
|
|
61
|
-
const url = `${GITHUB_REPO}/releases/download/${tag}/${APP_NAME}-${tag}-${getArch()}-${getPlatform()}.tar.gz`;
|
|
62
|
-
|
|
63
|
-
const tmpdir = os.tmpdir();
|
|
64
|
-
|
|
65
|
-
const release = `${tmpdir}/${APP_NAME}-${tag}-${getArch()}-${getPlatform()}-${randomString()}.tar.gz`;
|
|
66
|
-
|
|
67
|
-
console.log(`Downloading: ${APP_NAME}`);
|
|
68
|
-
console.log(`from: ${GITHUB_REPO}`);
|
|
69
|
-
console.log(`version: ${tag}`);
|
|
70
|
-
console.log(`platform: ${getArch()}-${getPlatform()}\n`);
|
|
71
|
-
|
|
72
|
-
/* Create an empty file where we can save data */
|
|
73
|
-
let file = fs.createWriteStream(release);
|
|
74
|
-
/* Using Promises so that we can use the ASYNC AWAIT syntax */
|
|
75
|
-
|
|
76
|
-
await new Promise((resolve, reject) => {
|
|
77
|
-
let stream = request({
|
|
78
|
-
uri: url
|
|
79
|
-
})
|
|
80
|
-
.pipe(file)
|
|
81
|
-
.on("finish", () => {
|
|
82
|
-
console.log("Download complete");
|
|
83
|
-
resolve();
|
|
84
|
-
})
|
|
85
|
-
.on("error", error => {
|
|
86
|
-
reject(error);
|
|
87
|
-
});
|
|
88
|
-
}).catch(error => {
|
|
89
|
-
console.log(`\n ------------- Something happened: ${error} --------- \n`);
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
await rimraf.sync(`${INSTALL_LOCATION}/rustywind`);
|
|
93
|
-
|
|
94
|
-
console.log(`Installing to: ${INSTALL_LOCATION}`);
|
|
95
|
-
await decompress(release, INSTALL_LOCATION, {
|
|
96
|
-
plugins: [decompressTargz()]
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
console.log("Installation complete\n");
|
|
100
|
-
|
|
101
|
-
console.log("Cleaning up");
|
|
102
|
-
await rimraf(`${INSTALL_LOCATION}/node_modules`, _ =>
|
|
103
|
-
console.log(`Clean up complete\n`)
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
download();
|