unitup 0.1.4 → 0.2.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/CHANGELOG.md +5 -0
- package/README.md +89 -8
- package/biome.json +0 -1
- package/docs/index.html +188 -234
- package/index.d.ts +336 -445
- package/package.json +9 -3
- package/src/cli.js +187 -101
- package/src/doctor.js +123 -56
- package/src/errors.js +131 -0
- package/src/index.js +132 -59
- package/src/logs.js +148 -0
- package/src/platform/base.js +211 -0
- package/src/platform/index.js +43 -0
- package/src/platform/linux.js +155 -0
- package/src/platform/macos.js +723 -0
- package/src/platform/windows-host.js +246 -0
- package/src/platform/windows.js +495 -0
- package/src/runtimes/bun.js +4 -3
- package/src/runtimes/common.js +24 -6
- package/src/runtimes/deno.js +4 -3
- package/src/runtimes/elixir.js +4 -3
- package/src/runtimes/go.js +4 -3
- package/src/runtimes/index.js +14 -11
- package/src/runtimes/native.js +4 -5
- package/src/runtimes/node.js +4 -3
- package/src/runtimes/php.js +4 -3
- package/src/runtimes/python.js +4 -3
- package/src/runtimes/ruby.js +4 -3
- package/src/runtimes/shell.js +4 -3
- package/src/schedule.js +31 -24
- package/src/service/config.js +55 -0
- package/src/service/manager.js +233 -0
- package/src/service/normalize.js +216 -0
- package/src/systemd.js +84 -38
- package/src/unit.js +12 -18
- package/src/utils.js +32 -18
- package/tsconfig.json +1 -1
- package/types-test/index.ts +158 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.5] - 2026-07-31
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- Fixed script argument resolution in all runtime adapters (`node`, `python`, `ruby`, `php`, `bun`, `deno`, `shell`, `go`, `elixir`, `native`) to resolve relative script paths against `opts.cwd` instead of `process.cwd()`.
|
|
14
|
+
|
|
10
15
|
## [0.1.4] - 2026-07-31
|
|
11
16
|
|
|
12
17
|
### Added
|
package/README.md
CHANGED
|
@@ -1,20 +1,101 @@
|
|
|
1
1
|
# unitup
|
|
2
2
|
|
|
3
|
-
> Minimal, zero-dependency
|
|
3
|
+
> Minimal, zero-dependency cross-platform background service manager for Node.js, Python, Ruby, PHP, Bun, Deno, Go, Elixir, Shell scripts, and native binaries.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## What is unitup?
|
|
6
|
+
|
|
7
|
+
`unitup` is a lightweight, zero-dependency CLI tool and programmatic library designed to run and manage background applications and services natively across:
|
|
8
|
+
* **Linux** → `systemd` (`~/.config/systemd/user/`)
|
|
9
|
+
* **macOS** → `launchd` (`~/Library/LaunchAgents/` & `/Library/LaunchDaemons/`)
|
|
10
|
+
* **Windows** → `Windows Services` (`sc.exe` + Unitup Service Host)
|
|
11
|
+
|
|
12
|
+
Unlike traditional process managers (such as PM2) that run a persistent master daemon continuously consuming system CPU and RAM, `unitup` operates **without a resident background process**. When you run `unitup install`, `unitup start`, or `unitup status`, it interacts directly with the operating system's native service manager and exits immediately.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Platform Support Table
|
|
17
|
+
|
|
18
|
+
| Feature | Linux | macOS | Windows |
|
|
19
|
+
| :--- | :--- | :--- | :--- |
|
|
20
|
+
| **Install / Uninstall** | `systemd` user/system unit | `launchd` agent/daemon plist | Windows Service (`sc.exe`) |
|
|
21
|
+
| **Start / Stop** | `systemctl start/stop` | `launchctl kickstart/kill` | `sc.exe start/stop` |
|
|
22
|
+
| **Restart** | `systemctl restart` | `launchctl kickstart -k` | SCM restart |
|
|
23
|
+
| **Auto-start on Boot** | `systemctl enable` | `RunAtLoad: true` | Automatic service startup |
|
|
24
|
+
| **Environment Variables** | `Environment=` | `EnvironmentVariables` plist dict | Environment forwarding |
|
|
25
|
+
| **Logs** | `journalctl` | File-based tail streaming | File-based tail streaming |
|
|
26
|
+
| **Crash Recovery** | `Restart=on-failure` | `KeepAlive` dictionary | Host supervisor recovery |
|
|
27
|
+
| **User Services** | `~/.config/systemd/user/` | `~/Library/LaunchAgents/` | Supported |
|
|
28
|
+
| **System Services** | `/etc/systemd/system/` | `/Library/LaunchDaemons/` | Native Windows Service |
|
|
29
|
+
| **Dry-Run Inspection** | `--dry-run` (systemd unit) | `--dry-run` (plist XML) | `--dry-run` (service config) |
|
|
30
|
+
| **Diagnostics** | `unitup doctor` | `unitup doctor` | `unitup doctor` |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
### Architecture & Workflow
|
|
35
|
+
|
|
36
|
+
```mermaid
|
|
37
|
+
flowchart TD
|
|
38
|
+
CLI["unitup CLI / API"]
|
|
39
|
+
Manager["ServiceManager"]
|
|
40
|
+
Norm["NormalizedServiceConfig"]
|
|
41
|
+
|
|
42
|
+
CLI --> Manager
|
|
43
|
+
Manager --> Norm
|
|
44
|
+
|
|
45
|
+
subgraph Adapters["Platform Adapters"]
|
|
46
|
+
LinuxAdapt["LinuxAdapter<br/>(systemd)"]
|
|
47
|
+
MacAdapt["MacOSAdapter<br/>(launchd)"]
|
|
48
|
+
WinAdapt["WindowsAdapter<br/>(SCM / Host)"]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
Norm --> LinuxAdapt
|
|
52
|
+
Norm --> MacAdapt
|
|
53
|
+
Norm --> WinAdapt
|
|
54
|
+
|
|
55
|
+
subgraph LinuxOS["Linux"]
|
|
56
|
+
ServiceFile["systemd Unit<br/>(.service & .timer)"]
|
|
57
|
+
Systemctl["systemctl & journalctl"]
|
|
58
|
+
LinuxAdapt --> ServiceFile --> Systemctl
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
subgraph MacOSOS["macOS"]
|
|
62
|
+
PlistFile["launchd Plist<br/>(.plist)"]
|
|
63
|
+
Launchctl["launchctl (bootstrap / kickstart)"]
|
|
64
|
+
MacAdapt --> PlistFile --> Launchctl
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
subgraph WindowsOS["Windows"]
|
|
68
|
+
SCM["Windows SCM (sc.exe)"]
|
|
69
|
+
WinHost["Unitup Service Host"]
|
|
70
|
+
WinAdapt --> SCM --> WinHost
|
|
71
|
+
end
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
6
77
|
|
|
7
78
|
```bash
|
|
8
|
-
#
|
|
79
|
+
# Install globally
|
|
9
80
|
npm install -g unitup
|
|
10
81
|
|
|
11
|
-
|
|
12
|
-
unitup
|
|
13
|
-
unitup
|
|
82
|
+
# Cross-platform installation
|
|
83
|
+
unitup install server.js --name api --start
|
|
84
|
+
unitup status api
|
|
85
|
+
unitup logs api --follow
|
|
86
|
+
unitup restart api
|
|
87
|
+
unitup stop api
|
|
88
|
+
unitup uninstall api
|
|
89
|
+
|
|
90
|
+
# Inspect what would be generated without applying changes
|
|
91
|
+
unitup install server.js --name api --dry-run
|
|
92
|
+
|
|
93
|
+
# Run cross-platform system diagnostics
|
|
94
|
+
unitup doctor
|
|
14
95
|
|
|
15
96
|
# Multi-runtime & Native Executables
|
|
16
|
-
unitup
|
|
17
|
-
unitup
|
|
97
|
+
unitup install worker.py --runtime python --start
|
|
98
|
+
unitup install ./server --runtime native --name api --start
|
|
18
99
|
```
|
|
19
100
|
|
|
20
101
|
---
|