cloudspin 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,16 @@
1
- # Temporary Holding Version
1
+ # cloudspin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A terminal music player under a living sky: a spinning record, real weather,
4
+ and a sky that changes with the song.
5
+
6
+ This npm package is a small launcher. Cloudspin itself is a Python app, so the
7
+ launcher runs it through whichever of these it finds: an installed `cloudspin`,
8
+ [`uv`](https://docs.astral.sh/uv/), or [`pipx`](https://pipx.pypa.io/).
9
+
10
+ ```sh
11
+ npx cloudspin --demo
12
+ npm install -g cloudspin
13
+ ```
14
+
15
+ You need `mpv` for sound. Full documentation:
16
+ https://github.com/itsHarshDabas/Cloudspin
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ // Cloudspin is a Python app. This launcher finds a way to run it and hands
3
+ // over the terminal: an installed `cloudspin`, then uv, then pipx.
4
+ "use strict";
5
+
6
+ const { spawnSync } = require("node:child_process");
7
+
8
+ const args = process.argv.slice(2);
9
+ const self = require("node:fs").realpathSync(__filename);
10
+
11
+ function onPath(command) {
12
+ const probe = spawnSync(process.platform === "win32" ? "where" : "which", ["-a", command], { encoding: "utf8" });
13
+ if (probe.status !== 0) return [];
14
+ return probe.stdout.split(/\r?\n/).filter(Boolean);
15
+ }
16
+
17
+ function run(command, commandArgs) {
18
+ const result = spawnSync(command, commandArgs, { stdio: "inherit" });
19
+ if (result.error) return null;
20
+ return result.status === null ? 1 : result.status;
21
+ }
22
+
23
+ // An already installed Python cloudspin, skipping this launcher itself.
24
+ const installed = onPath("cloudspin").find((candidate) => {
25
+ try {
26
+ return require("node:fs").realpathSync(candidate) !== self;
27
+ } catch {
28
+ return false;
29
+ }
30
+ });
31
+
32
+ const attempts = [];
33
+ if (installed) attempts.push([installed, args]);
34
+ if (onPath("uvx").length) attempts.push(["uvx", ["cloudspin", ...args]]);
35
+ if (onPath("pipx").length) attempts.push(["pipx", ["run", "cloudspin", ...args]]);
36
+
37
+ for (const [command, commandArgs] of attempts) {
38
+ const status = run(command, commandArgs);
39
+ if (status !== null) process.exit(status);
40
+ }
41
+
42
+ console.error(
43
+ [
44
+ "cloudspin needs Python to run, and no way to start it was found.",
45
+ "Install one of these, then try again:",
46
+ " uv https://docs.astral.sh/uv/ (then: uvx cloudspin)",
47
+ " pipx https://pipx.pypa.io/ (then: pipx install cloudspin)",
48
+ ].join("\n")
49
+ );
50
+ process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "cloudspin",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Launcher for Cloudspin, a terminal music player under a living sky. Runs the Python app through uv or pipx.",
5
+ "bin": {
6
+ "cloudspin": "bin/cloudspin.js"
7
+ },
8
+ "files": [
9
+ "bin",
10
+ "README.md"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/itsHarshDabas/Cloudspin.git"
16
+ },
17
+ "keywords": [
18
+ "tui",
19
+ "music",
20
+ "player",
21
+ "weather",
22
+ "terminal"
23
+ ],
24
+ "engines": {
25
+ "node": ">=18"
26
+ }
27
+ }