simplecloud 0.0.1-beta.9 → 0.0.1-beta.92

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.
@@ -0,0 +1,85 @@
1
+ #!/bin/sh
2
+
3
+ set -eu
4
+
5
+ resolve_script_path() {
6
+ link_path="$1"
7
+
8
+ while [ -L "$link_path" ]; do
9
+ link_dir=$(CDPATH= cd -P -- "$(dirname -- "$link_path")" && pwd)
10
+ link_target=$(readlink "$link_path")
11
+ case "$link_target" in
12
+ /*) link_path="$link_target" ;;
13
+ *) link_path="$link_dir/$link_target" ;;
14
+ esac
15
+ done
16
+
17
+ CDPATH= cd -P -- "$(dirname -- "$link_path")" && printf '%s/%s\n' "$PWD" "$(basename -- "$link_path")"
18
+ }
19
+
20
+ detect_target() {
21
+ os_name=$(uname -s)
22
+ arch_name=$(uname -m)
23
+
24
+ case "$os_name" in
25
+ Darwin) platform="darwin" ;;
26
+ Linux) platform="linux" ;;
27
+ *)
28
+ echo "SimpleCloud does not support operating system: $os_name" >&2
29
+ exit 1
30
+ ;;
31
+ esac
32
+
33
+ case "$arch_name" in
34
+ x86_64|amd64) architecture="x64" ;;
35
+ aarch64|arm64) architecture="arm64" ;;
36
+ *)
37
+ echo "SimpleCloud does not support CPU architecture: $arch_name" >&2
38
+ exit 1
39
+ ;;
40
+ esac
41
+
42
+ if [ "$platform" = "darwin" ]; then
43
+ printf '%s-%s\n' "$platform" "$architecture"
44
+ return
45
+ fi
46
+
47
+ libc="gnu"
48
+ if command -v getconf >/dev/null 2>&1 && getconf GNU_LIBC_VERSION >/dev/null 2>&1; then
49
+ libc="gnu"
50
+ elif ldd --version 2>&1 | grep -qi musl; then
51
+ libc="musl"
52
+ elif find /lib -maxdepth 1 -name 'ld-musl-*.so.1' -print -quit 2>/dev/null | grep -q .; then
53
+ libc="musl"
54
+ fi
55
+
56
+ printf '%s-%s-%s\n' "$platform" "$architecture" "$libc"
57
+ }
58
+
59
+ script_path=$(resolve_script_path "$0")
60
+ package_root=$(CDPATH= cd -P -- "$(dirname -- "$script_path")/.." && pwd)
61
+ target=$(detect_target)
62
+ package_name="@simplecloud/cli-$target"
63
+
64
+ case "$package_root" in
65
+ *"/install/global/node_modules/simplecloud")
66
+ package_manager="bun"
67
+ reinstall_command="bun install --global simplecloud"
68
+ ;;
69
+ *)
70
+ package_manager="npm"
71
+ reinstall_command="npm install --global simplecloud"
72
+ ;;
73
+ esac
74
+
75
+ for dependency_root in "$package_root/node_modules" "$package_root/.."; do
76
+ binary="$dependency_root/$package_name/bin/simplecloud"
77
+ if [ -x "$binary" ]; then
78
+ export SIMPLECLOUD_PACKAGE_MANAGER="$package_manager"
79
+ exec "$binary" "$@"
80
+ fi
81
+ done
82
+
83
+ echo "The native SimpleCloud package for $target was not installed." >&2
84
+ echo "Reinstall without omitting optional dependencies: $reinstall_command" >&2
85
+ exit 1
package/package.json CHANGED
@@ -1,56 +1,39 @@
1
1
  {
2
2
  "name": "simplecloud",
3
- "version": "0.0.1-beta.9",
4
- "description": "simplecloud.app cli",
5
- "type": "module",
3
+ "version": "0.0.1-beta.92",
4
+ "description": "SimpleCloud command-line interface",
6
5
  "keywords": [
7
6
  "cli",
8
7
  "cloud",
9
- "tool"
8
+ "minecraft"
10
9
  ],
11
10
  "author": "simplecloud.app",
12
11
  "license": "MIT",
13
- "publishConfig": {
14
- "access": "public"
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/simplecloudapp/cli.git"
15
15
  },
16
- "main": "dist/index.js",
17
16
  "bin": {
18
- "simplecloud": "dist/cli.js",
19
- "sc": "dist/cli.js"
17
+ "simplecloud": "bin/simplecloud",
18
+ "sc": "bin/simplecloud"
20
19
  },
21
20
  "files": [
22
- "dist"
21
+ "bin",
22
+ "platforms.json"
23
23
  ],
24
- "scripts": {
25
- "dev": "bun run build && bun scripts/build-dev.ts",
26
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --format esm --minify --target bun --packages=bundle && bun build src/cli.ts --outdir dist --format esm --minify --target bun --packages=bundle && echo '#!/usr/bin/env bun' | cat - dist/cli.js > dist/cli.tmp && mv dist/cli.tmp dist/cli.js",
27
- "prepublishOnly": "bun run build",
28
- "test:cli": "bun run build && bun dist/cli.js --help",
29
- "local:setup": "bun run build && echo 'alias scl=\"bun '$(pwd)'/dist/cli.js\"' >> ~/.zshrc && echo 'Local alias added! Run: source ~/.zshrc'",
30
- "local:link": "bun run build && npm link",
31
- "local:unlink": "npm unlink -g",
32
- "local:pack": "bun run build && mkdir -p temp && npm pack --pack-destination=./temp && mv ./temp/simplecloud-*.tgz ./temp/simplecloud.tgz",
33
- "lint": "biome check .",
34
- "lint:fix": "biome check . --write",
35
- "generate:api": "swagger-typescript-api generate -p https://controller.platform.simplecloud.app/swagger/doc.json -o src/lib/generated -n simplecloud-api.ts --sort-types --single-http-client --clean-output"
36
- },
37
- "devDependencies": {
38
- "@biomejs/biome": "2.3.8",
39
- "@effect/platform-bun": "^0.86.0",
40
- "@types/bun": "latest",
41
- "swagger-typescript-api": "^13.2.16"
42
- },
43
- "peerDependencies": {
44
- "typescript": "^5"
24
+ "os": [
25
+ "darwin",
26
+ "linux"
27
+ ],
28
+ "optionalDependencies": {
29
+ "@simplecloud/cli-darwin-arm64": "0.0.1-beta.92",
30
+ "@simplecloud/cli-darwin-x64": "0.0.1-beta.92",
31
+ "@simplecloud/cli-linux-arm64-gnu": "0.0.1-beta.92",
32
+ "@simplecloud/cli-linux-x64-gnu": "0.0.1-beta.92",
33
+ "@simplecloud/cli-linux-arm64-musl": "0.0.1-beta.92",
34
+ "@simplecloud/cli-linux-x64-musl": "0.0.1-beta.92"
45
35
  },
46
- "dependencies": {
47
- "@clack/prompts": "^1.0.0-alpha.6",
48
- "@effect/cli": "^0.72.1",
49
- "@opentui/solid": "^0.1.60",
50
- "better-auth": "^1.4.6",
51
- "chalk": "^5.6.2",
52
- "effect": "^3.19.12",
53
- "solid-js": "^1.9.10",
54
- "table": "^6.9.0"
36
+ "publishConfig": {
37
+ "access": "public"
55
38
  }
56
39
  }
package/platforms.json ADDED
@@ -0,0 +1,48 @@
1
+ [
2
+ {
3
+ "id": "darwin-arm64",
4
+ "packageName": "@simplecloud/cli-darwin-arm64",
5
+ "os": "darwin",
6
+ "cpu": "arm64",
7
+ "bunTarget": "bun-darwin-arm64"
8
+ },
9
+ {
10
+ "id": "darwin-x64",
11
+ "packageName": "@simplecloud/cli-darwin-x64",
12
+ "os": "darwin",
13
+ "cpu": "x64",
14
+ "bunTarget": "bun-darwin-x64-baseline"
15
+ },
16
+ {
17
+ "id": "linux-arm64-gnu",
18
+ "packageName": "@simplecloud/cli-linux-arm64-gnu",
19
+ "os": "linux",
20
+ "cpu": "arm64",
21
+ "libc": "glibc",
22
+ "bunTarget": "bun-linux-arm64"
23
+ },
24
+ {
25
+ "id": "linux-x64-gnu",
26
+ "packageName": "@simplecloud/cli-linux-x64-gnu",
27
+ "os": "linux",
28
+ "cpu": "x64",
29
+ "libc": "glibc",
30
+ "bunTarget": "bun-linux-x64-baseline"
31
+ },
32
+ {
33
+ "id": "linux-arm64-musl",
34
+ "packageName": "@simplecloud/cli-linux-arm64-musl",
35
+ "os": "linux",
36
+ "cpu": "arm64",
37
+ "libc": "musl",
38
+ "bunTarget": "bun-linux-arm64-musl"
39
+ },
40
+ {
41
+ "id": "linux-x64-musl",
42
+ "packageName": "@simplecloud/cli-linux-x64-musl",
43
+ "os": "linux",
44
+ "cpu": "x64",
45
+ "libc": "musl",
46
+ "bunTarget": "bun-linux-x64-baseline-musl"
47
+ }
48
+ ]
package/README.md DELETED
@@ -1,123 +0,0 @@
1
- # SimpleCloud CLI
2
-
3
- A command-line interface tool for SimpleCloud.
4
-
5
- ## Development
6
-
7
- ### Prerequisites
8
-
9
- - Node.js >= 18.0.0
10
- - Bun (for development)
11
-
12
- ### Setup
13
-
14
- Install dependencies:
15
-
16
- ```bash
17
- bun install
18
- ```
19
-
20
- ### Development
21
-
22
- **Development Watcher (Recommended)**
23
-
24
- Run with automatic rebuilding on file changes:
25
-
26
- ```bash
27
- bun run dev
28
- ```
29
-
30
- This will:
31
- - 🔧 Start a file watcher
32
- - 📁 Watch all `.ts` files in `src/`
33
- - 🔄 Automatically rebuild `dist/` on changes
34
- - ⚡ Debounced builds (300ms delay)
35
- - 🛑 Stop with `Ctrl+C`
36
-
37
- **Local Package Testing**
38
-
39
- Create a local package file for testing:
40
-
41
- ```bash
42
- bun run local:pack # Creates temp/simplecloud.tgz (no version in filename)
43
- ```
44
-
45
- ### Building
46
-
47
- Build the CLI for distribution:
48
-
49
- ```bash
50
- bun run build
51
- ```
52
-
53
- This creates optimized, minified bundles in the `dist/` folder that include all dependencies.
54
-
55
- ### Testing
56
-
57
- Test the built CLI:
58
-
59
- ```bash
60
- bun run test:cli
61
- ```
62
-
63
- Test specific commands:
64
-
65
- ```bash
66
- node dist/cli.js --help
67
- node dist/cli.js start group test
68
- ```
69
-
70
- ### Local Development
71
-
72
- **Option 1: Shell Alias (Recommended - No Conflicts)**
73
-
74
- Create a local `scl` alias that points to your development build:
75
-
76
- ```bash
77
- bun run local:setup # Creates 'scl' alias in ~/.zshrc
78
- source ~/.zshrc # Reload shell config
79
- ```
80
-
81
- Now you can use `scl` for local testing without conflicting with published versions:
82
-
83
- ```bash
84
- scl --help # Local development
85
- scl start group mygroup
86
- ```
87
-
88
- **Pro Tip**: Run `bun run dev` in one terminal and use `scl` commands in another terminal for seamless development with auto-rebuilding!
89
-
90
- **Option 2: npm link (Development Symlink)**
91
-
92
- Creates symlinks to global npm location (uses same command names):
93
-
94
- ```bash
95
- bun run local:link # Link for development
96
- bun run local:unlink # Unlink when done
97
- ```
98
-
99
- **Option 3: Direct Execution**
100
-
101
- Run the built CLI directly:
102
-
103
- ```bash
104
- bun run build
105
- node dist/cli.js --help
106
- node dist/cli.js start group mygroup
107
- ```
108
-
109
- ## Generating API
110
-
111
- ```bash
112
- bunx swagger-typescript-api generate -p swagger.yaml -o src/lib/generated -n simplecloud-api.ts --sort-types --single-http-client --clean-output
113
- ```
114
-
115
-
116
- ## Publishing to npm
117
-
118
- 1. Update the version in `package.json`
119
- 2. Update author, repository, and other metadata fields
120
- 3. Ensure you're logged into npm: `npm login`
121
- 4. Publish: `npm publish`
122
-
123
- The `prepublishOnly` script will automatically build the project before publishing.