@leclabs/fleet 0.0.0-stage → 0.0.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/install.sh ADDED
@@ -0,0 +1,69 @@
1
+ #!/bin/sh
2
+ # Installs fleet on this host: mise if it is absent, fleet through mise, then
3
+ # `fleet init`.
4
+ #
5
+ # curl -fsSL <url>/install.sh | sh -s -- [fleet init flags]
6
+ #
7
+ # Everything after `--` goes to `fleet init` (--icon, --wallpaper, --layers).
8
+ # FLEET_VERSION pins a version; fleet follows `latest` otherwise.
9
+ # FLEET_SOURCE=<path to a packed tarball> installs that tarball instead of the
10
+ # package from npm, to test a build before it is published.
11
+ set -eu
12
+
13
+ die() {
14
+ echo "install.sh: $*" >&2
15
+ exit 1
16
+ }
17
+
18
+ command -v curl >/dev/null 2>&1 || die "curl is required"
19
+
20
+ bin="$HOME/.local/bin"
21
+ if command -v mise >/dev/null 2>&1; then
22
+ mise="$(command -v mise)"
23
+ elif [ -x "$bin/mise" ]; then
24
+ mise="$bin/mise"
25
+ else
26
+ curl -fsSL https://mise.run | sh
27
+ mise="$bin/mise"
28
+ fi
29
+ [ -x "$mise" ] || die "mise did not install"
30
+ # mise's own hooks (npm's reshim) call `mise` by name.
31
+ PATH="$(dirname "$mise"):$PATH"
32
+ export PATH
33
+
34
+ if [ -n "${FLEET_SOURCE:-}" ]; then
35
+ [ -f "$FLEET_SOURCE" ] || die "FLEET_SOURCE is not a file: $FLEET_SOURCE"
36
+ case "$FLEET_SOURCE" in
37
+ /*) ;;
38
+ *) FLEET_SOURCE="$PWD/$FLEET_SOURCE" ;;
39
+ esac
40
+ prefix="$HOME/.local/share/fleet/source"
41
+ "$mise" install node@lts
42
+ "$mise" exec node@lts -- npm install --global --prefix "$prefix" "$FLEET_SOURCE"
43
+ mkdir -p "$bin"
44
+ cat >"$bin/fleet" <<EOF
45
+ #!/bin/sh
46
+ exec "$mise" exec node@lts -- "$prefix/bin/fleet" "\$@"
47
+ EOF
48
+ chmod +x "$bin/fleet"
49
+ run_fleet() { "$bin/fleet" "$@"; }
50
+ else
51
+ "$mise" use --global "npm:@leclabs/fleet@${FLEET_VERSION:-latest}"
52
+ run_fleet() { "$mise" exec -- fleet "$@"; }
53
+ fi
54
+
55
+ # Piped from curl, stdin is this script: ask the questions on the terminal.
56
+ if [ ! -t 0 ] && ( exec </dev/tty ) 2>/dev/null; then
57
+ run_fleet init "$@" </dev/tty
58
+ else
59
+ run_fleet init "$@"
60
+ fi
61
+
62
+ cat <<EOF
63
+
64
+ fleet is installed. Next:
65
+ fleet apply the user layer (no root)
66
+ fleet apply --machine the machine layer (packages, system files); it asks sudo
67
+ If your shell does not find fleet yet, add mise's shims to its PATH:
68
+ export PATH="\$HOME/.local/share/mise/shims:\$HOME/.local/bin:\$PATH"
69
+ EOF
package/package.json CHANGED
@@ -1,6 +1,53 @@
1
1
  {
2
2
  "name": "@leclabs/fleet",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.0",
4
+ "description": "Applies one opinionated baseline to the host it runs on, with mise bootstrap as its engine.",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">=22"
8
+ },
9
+ "type": "module",
10
+ "bin": {
11
+ "fleet": "./dist/fleet.js"
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "assets",
16
+ "install.sh"
17
+ ],
18
+ "dependencies": {
19
+ "commander": "^14.0.3",
20
+ "smol-toml": "^1.4.0",
21
+ "zod": "^3.23.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^22.0.0",
25
+ "tsup": "^8.3.0",
26
+ "typescript": "^5.7.0",
27
+ "vitest": "^2.1.0"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "keywords": [
33
+ "fleet",
34
+ "mise",
35
+ "bootstrap",
36
+ "dotfiles",
37
+ "cli"
38
+ ],
39
+ "author": "Lance Caraccioli <lance.caraccioli@gmail.com>",
40
+ "repository": {
41
+ "type": "git",
42
+ "url": "git+https://github.com/leclabs/homelab.git",
43
+ "directory": "packages/fleet"
44
+ },
45
+ "scripts": {
46
+ "build": "tsup",
47
+ "typecheck": "tsc --noEmit",
48
+ "typecheck:test": "tsc -p tsconfig.test.json",
49
+ "test": "vitest run",
50
+ "clean": "rm -rf dist",
51
+ "dev": "tsup --watch"
52
+ }
6
53
  }