rustywind 0.23.1 → 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/lib/constants.js CHANGED
@@ -3,5 +3,5 @@
3
3
 
4
4
  module.exports = {
5
5
  REPO: "avencera/rustywind",
6
- VERSION: "v0.23.1",
6
+ VERSION: "v0.24.0",
7
7
  };
@@ -9,46 +9,46 @@ const get = require("./get");
9
9
  * @param {string} tag
10
10
  */
11
11
  function getApiUrl(repo, tag) {
12
- return `https://api.github.com/repos/${repo}/releases/tags/${tag}`;
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
- 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;
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
- if (!opts.version) {
50
- return Promise.reject(new Error("Missing version"));
51
- }
49
+ if (!opts.version) {
50
+ return Promise.reject(new Error("Missing version"));
51
+ }
52
52
 
53
- return getReleaseFromGitHubApi(opts);
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
- var HttpsProxyAgent = require("https-proxy-agent");
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
- response.pipe(outFile);
125
- outFile.on("finish", () => {
126
- resolve();
127
- });
128
- })
129
- .on("error", async (err) => {
130
- await fsUnlink(dest);
131
- reject(err);
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
  }
@@ -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 = process.env.npm_config_arch || os.arch();
35
+ const arch = os.arch();
36
+ const platform = os.platform();
28
37
 
29
- switch (os.platform()) {
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
- ? "arm-unknown-linux-gnueabihf"
39
- : arch === "arm64"
40
- ? "aarch64-unknown-linux-gnu"
41
- : arch === "ppc64"
42
- ? "powerpc64le-unknown-linux-gnu"
43
- : "i686-unknown-linux-musl";
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.23.1",
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/181344937",
3
- "assets_url": "https://api.github.com/repos/avencera/rustywind/releases/181344937/assets",
4
- "upload_url": "https://uploads.github.com/repos/avencera/rustywind/releases/181344937/assets{?name,label}",
5
- "html_url": "https://github.com/avencera/rustywind/releases/tag/v0.23.1",
6
- "id": 181344937,
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,
@@ -25,20 +25,20 @@
25
25
  "user_view_type": "public",
26
26
  "site_admin": false
27
27
  },
28
- "node_id": "RE_kwDODVEYLM4Kzxqp",
29
- "tag_name": "v0.23.1",
28
+ "node_id": "RE_kwDODVEYLM4MF7_F",
29
+ "tag_name": "v0.24.0",
30
30
  "target_commitish": "master",
31
- "name": "v0.23.1",
31
+ "name": "v0.24.0",
32
32
  "draft": false,
33
33
  "prerelease": false,
34
- "created_at": "2024-10-23T02:00:55Z",
35
- "published_at": "2024-10-23T02:02:52Z",
34
+ "created_at": "2025-02-27T19:39:42Z",
35
+ "published_at": "2025-02-27T19:41:53Z",
36
36
  "assets": [
37
37
  {
38
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201066691",
39
- "id": 201066691,
40
- "node_id": "RA_kwDODVEYLM4L_AjD",
41
- "name": "rustywind-v0.23.1-aarch64-apple-darwin.tar.gz",
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",
42
42
  "label": "",
43
43
  "uploader": {
44
44
  "login": "github-actions[bot]",
@@ -63,16 +63,16 @@
63
63
  },
64
64
  "content_type": "application/gzip",
65
65
  "state": "uploaded",
66
- "size": 2049314,
67
- "created_at": "2024-10-23T02:02:52Z",
68
- "updated_at": "2024-10-23T02:02:53Z",
69
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-aarch64-apple-darwin.tar.gz"
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"
70
70
  },
71
71
  {
72
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201066829",
73
- "id": 201066829,
74
- "node_id": "RA_kwDODVEYLM4L_AlN",
75
- "name": "rustywind-v0.23.1-aarch64-unknown-linux-gnu.tar.gz",
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",
76
76
  "label": "",
77
77
  "uploader": {
78
78
  "login": "github-actions[bot]",
@@ -97,16 +97,16 @@
97
97
  },
98
98
  "content_type": "application/gzip",
99
99
  "state": "uploaded",
100
- "size": 2134004,
101
- "created_at": "2024-10-23T02:03:51Z",
102
- "updated_at": "2024-10-23T02:03:51Z",
103
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-aarch64-unknown-linux-gnu.tar.gz"
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"
104
104
  },
105
105
  {
106
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067018",
107
- "id": 201067018,
108
- "node_id": "RA_kwDODVEYLM4L_AoK",
109
- "name": "rustywind-v0.23.1-aarch64-unknown-linux-musl.tar.gz",
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",
110
110
  "label": "",
111
111
  "uploader": {
112
112
  "login": "github-actions[bot]",
@@ -131,16 +131,16 @@
131
131
  },
132
132
  "content_type": "application/gzip",
133
133
  "state": "uploaded",
134
- "size": 2181383,
135
- "created_at": "2024-10-23T02:04:38Z",
136
- "updated_at": "2024-10-23T02:04:38Z",
137
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-aarch64-unknown-linux-musl.tar.gz"
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"
138
138
  },
139
139
  {
140
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067019",
141
- "id": 201067019,
142
- "node_id": "RA_kwDODVEYLM4L_AoL",
143
- "name": "rustywind-v0.23.1-arm-unknown-linux-gnueabi.tar.gz",
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",
144
144
  "label": "",
145
145
  "uploader": {
146
146
  "login": "github-actions[bot]",
@@ -165,16 +165,16 @@
165
165
  },
166
166
  "content_type": "application/gzip",
167
167
  "state": "uploaded",
168
- "size": 2115539,
169
- "created_at": "2024-10-23T02:04:38Z",
170
- "updated_at": "2024-10-23T02:04:39Z",
171
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-arm-unknown-linux-gnueabi.tar.gz"
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"
172
172
  },
173
173
  {
174
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201066935",
175
- "id": 201066935,
176
- "node_id": "RA_kwDODVEYLM4L_Am3",
177
- "name": "rustywind-v0.23.1-arm-unknown-linux-gnueabihf.tar.gz",
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",
178
178
  "label": "",
179
179
  "uploader": {
180
180
  "login": "github-actions[bot]",
@@ -199,16 +199,16 @@
199
199
  },
200
200
  "content_type": "application/gzip",
201
201
  "state": "uploaded",
202
- "size": 2108303,
203
- "created_at": "2024-10-23T02:04:27Z",
204
- "updated_at": "2024-10-23T02:04:27Z",
205
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-arm-unknown-linux-gnueabihf.tar.gz"
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"
206
206
  },
207
207
  {
208
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067024",
209
- "id": 201067024,
210
- "node_id": "RA_kwDODVEYLM4L_AoQ",
211
- "name": "rustywind-v0.23.1-armv7-unknown-linux-gnueabihf.tar.gz",
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",
212
212
  "label": "",
213
213
  "uploader": {
214
214
  "login": "github-actions[bot]",
@@ -233,16 +233,16 @@
233
233
  },
234
234
  "content_type": "application/gzip",
235
235
  "state": "uploaded",
236
- "size": 2074021,
237
- "created_at": "2024-10-23T02:04:39Z",
238
- "updated_at": "2024-10-23T02:04:40Z",
239
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-armv7-unknown-linux-gnueabihf.tar.gz"
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
240
  },
241
241
  {
242
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067331",
243
- "id": 201067331,
244
- "node_id": "RA_kwDODVEYLM4L_AtD",
245
- "name": "rustywind-v0.23.1-i686-pc-windows-msvc.zip",
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
246
  "label": "",
247
247
  "uploader": {
248
248
  "login": "github-actions[bot]",
@@ -267,16 +267,16 @@
267
267
  },
268
268
  "content_type": "application/zip",
269
269
  "state": "uploaded",
270
- "size": 1761897,
271
- "created_at": "2024-10-23T02:06:39Z",
272
- "updated_at": "2024-10-23T02:06:39Z",
273
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-i686-pc-windows-msvc.zip"
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"
274
274
  },
275
275
  {
276
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067055",
277
- "id": 201067055,
278
- "node_id": "RA_kwDODVEYLM4L_Aov",
279
- "name": "rustywind-v0.23.1-i686-unknown-linux-musl.tar.gz",
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",
280
280
  "label": "",
281
281
  "uploader": {
282
282
  "login": "github-actions[bot]",
@@ -301,16 +301,16 @@
301
301
  },
302
302
  "content_type": "application/gzip",
303
303
  "state": "uploaded",
304
- "size": 2124948,
305
- "created_at": "2024-10-23T02:05:00Z",
306
- "updated_at": "2024-10-23T02:05:00Z",
307
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-i686-unknown-linux-musl.tar.gz"
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"
308
308
  },
309
309
  {
310
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201066717",
311
- "id": 201066717,
312
- "node_id": "RA_kwDODVEYLM4L_Ajd",
313
- "name": "rustywind-v0.23.1-x86_64-apple-darwin.tar.gz",
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",
314
314
  "label": "",
315
315
  "uploader": {
316
316
  "login": "github-actions[bot]",
@@ -335,16 +335,16 @@
335
335
  },
336
336
  "content_type": "application/gzip",
337
337
  "state": "uploaded",
338
- "size": 2169143,
339
- "created_at": "2024-10-23T02:03:01Z",
340
- "updated_at": "2024-10-23T02:03:01Z",
341
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-x86_64-apple-darwin.tar.gz"
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"
342
342
  },
343
343
  {
344
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067149",
345
- "id": 201067149,
346
- "node_id": "RA_kwDODVEYLM4L_AqN",
347
- "name": "rustywind-v0.23.1-x86_64-pc-windows-msvc.zip",
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",
348
348
  "label": "",
349
349
  "uploader": {
350
350
  "login": "github-actions[bot]",
@@ -369,16 +369,16 @@
369
369
  },
370
370
  "content_type": "application/zip",
371
371
  "state": "uploaded",
372
- "size": 2078986,
373
- "created_at": "2024-10-23T02:05:39Z",
374
- "updated_at": "2024-10-23T02:05:40Z",
375
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-x86_64-pc-windows-msvc.zip"
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"
376
376
  },
377
377
  {
378
- "url": "https://api.github.com/repos/avencera/rustywind/releases/assets/201067035",
379
- "id": 201067035,
380
- "node_id": "RA_kwDODVEYLM4L_Aob",
381
- "name": "rustywind-v0.23.1-x86_64-unknown-linux-musl.tar.gz",
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",
382
382
  "label": "",
383
383
  "uploader": {
384
384
  "login": "github-actions[bot]",
@@ -403,13 +403,14 @@
403
403
  },
404
404
  "content_type": "application/gzip",
405
405
  "state": "uploaded",
406
- "size": 2373565,
407
- "created_at": "2024-10-23T02:04:46Z",
408
- "updated_at": "2024-10-23T02:04:47Z",
409
- "browser_download_url": "https://github.com/avencera/rustywind/releases/download/v0.23.1/rustywind-v0.23.1-x86_64-unknown-linux-musl.tar.gz"
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"
410
410
  }
411
411
  ],
412
- "tarball_url": "https://api.github.com/repos/avencera/rustywind/tarball/v0.23.1",
413
- "zipball_url": "https://api.github.com/repos/avencera/rustywind/zipball/v0.23.1",
414
- "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
415
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();