@skopiklabs/platform 0.0.0-stage → 0.3.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/README.md CHANGED
@@ -1,3 +1,18 @@
1
- # Temporary Holding Version
1
+ # skopik
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
+ The command line tool of [Skopik Platform](https://platform.skopik.com).
4
+
5
+ ```sh
6
+ npm install -g @skopiklabs/platform
7
+ skopik login
8
+ skopik deploy --dir . --runtime node
9
+ ```
10
+
11
+ Or without installing: `npx @skopiklabs/platform deploy`.
12
+
13
+ `skopik tools` lists every operation of the control API, each a subcommand,
14
+ and `skopik <command> --help` shows its arguments. `SKOPIK_API_KEY` and
15
+ `SKOPIK_API_URL` override the key and URL `skopik login` stored.
16
+
17
+ The package runs a native build for Linux (x64, arm64), macOS (x64, arm64)
18
+ or Windows (x64), which npm installs as an optional dependency.
@@ -0,0 +1,7 @@
1
+ {
2
+ "linux-x64": "@skopiklabs/platform-linux-x64",
3
+ "linux-arm64": "@skopiklabs/platform-linux-arm64",
4
+ "darwin-x64": "@skopiklabs/platform-darwin-x64",
5
+ "darwin-arm64": "@skopiklabs/platform-darwin-arm64",
6
+ "win32-x64": "@skopiklabs/platform-win32-x64"
7
+ }
package/bin/skopik.js ADDED
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ // Runs the build of `skopik` for this machine, which npm installed as one
3
+ // of this package's optional dependencies (the one whose `os` and `cpu`
4
+ // match), with this process's arguments, standard streams and exit code.
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("node:child_process");
8
+ const platforms = require("./platforms.json");
9
+
10
+ const key = `${process.platform}-${process.arch}`;
11
+ const pkg = platforms[key];
12
+ if (!pkg) {
13
+ console.error(
14
+ `skopik: there is no build for ${key}; the builds are for ${Object.keys(platforms).join(", ")}`,
15
+ );
16
+ process.exit(1);
17
+ }
18
+ const exe = process.platform === "win32" ? "skopik.exe" : "skopik";
19
+
20
+ let bin;
21
+ try {
22
+ bin = require.resolve(`${pkg}/bin/${exe}`);
23
+ } catch {
24
+ console.error(
25
+ `skopik: the package ${pkg}, this machine's build, is not installed. ` +
26
+ "Install again without --no-optional or --omit=optional.",
27
+ );
28
+ process.exit(1);
29
+ }
30
+
31
+ const run = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
32
+ if (run.error) {
33
+ console.error(`skopik: could not run ${bin}: ${run.error.message}`);
34
+ process.exit(1);
35
+ }
36
+ if (run.signal) {
37
+ process.kill(process.pid, run.signal);
38
+ }
39
+ process.exit(run.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@skopiklabs/platform",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "skopik, Skopik Platform's command line tool",
4
+ "version": "0.3.0",
5
+ "license": "UNLICENSED",
6
+ "homepage": "https://platform.skopik.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/skalerlabs/monkeyhub.git",
10
+ "directory": "crates/mh"
11
+ },
12
+ "bin": {
13
+ "skopik": "bin/skopik.js"
14
+ },
15
+ "files": [
16
+ "bin"
17
+ ],
18
+ "engines": {
19
+ "node": ">=18"
20
+ },
21
+ "optionalDependencies": {
22
+ "@skopiklabs/platform-linux-x64": "0.3.0",
23
+ "@skopiklabs/platform-linux-arm64": "0.3.0",
24
+ "@skopiklabs/platform-darwin-x64": "0.3.0",
25
+ "@skopiklabs/platform-darwin-arm64": "0.3.0",
26
+ "@skopiklabs/platform-win32-x64": "0.3.0"
27
+ }
28
+ }