rampway 0.2.6 → 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.
Files changed (47) hide show
  1. package/README.md +12 -0
  2. package/build/src/cli.d.ts.map +1 -1
  3. package/build/src/cli.js +35 -7
  4. package/build/src/cli.js.map +1 -1
  5. package/build/src/commands/task.d.ts +9 -0
  6. package/build/src/commands/task.d.ts.map +1 -0
  7. package/build/src/commands/task.js +23 -0
  8. package/build/src/commands/task.js.map +1 -0
  9. package/build/src/config/validate-config.d.ts +5 -0
  10. package/build/src/config/validate-config.d.ts.map +1 -1
  11. package/build/src/config/validate-config.js +139 -0
  12. package/build/src/config/validate-config.js.map +1 -1
  13. package/build/src/core/deploy-runner.js +5 -5
  14. package/build/src/core/deploy-runner.js.map +1 -1
  15. package/build/src/core/locks.d.ts +2 -1
  16. package/build/src/core/locks.d.ts.map +1 -1
  17. package/build/src/core/locks.js +28 -9
  18. package/build/src/core/locks.js.map +1 -1
  19. package/build/src/core/operational-task-runner.d.ts +21 -0
  20. package/build/src/core/operational-task-runner.d.ts.map +1 -0
  21. package/build/src/core/operational-task-runner.js +66 -0
  22. package/build/src/core/operational-task-runner.js.map +1 -0
  23. package/build/src/core/redaction.d.ts +31 -3
  24. package/build/src/core/redaction.d.ts.map +1 -1
  25. package/build/src/core/redaction.js +83 -5
  26. package/build/src/core/redaction.js.map +1 -1
  27. package/build/src/core/release-manager.d.ts +11 -0
  28. package/build/src/core/release-manager.d.ts.map +1 -1
  29. package/build/src/core/release-manager.js +22 -0
  30. package/build/src/core/release-manager.js.map +1 -1
  31. package/build/src/core/task-runner.d.ts +4 -2
  32. package/build/src/core/task-runner.d.ts.map +1 -1
  33. package/build/src/core/task-runner.js +34 -8
  34. package/build/src/core/task-runner.js.map +1 -1
  35. package/build/src/transports/local-transport.d.ts +19 -2
  36. package/build/src/transports/local-transport.d.ts.map +1 -1
  37. package/build/src/transports/local-transport.js +97 -9
  38. package/build/src/transports/local-transport.js.map +1 -1
  39. package/build/src/transports/ssh-transport.d.ts +43 -4
  40. package/build/src/transports/ssh-transport.d.ts.map +1 -1
  41. package/build/src/transports/ssh-transport.js +105 -12
  42. package/build/src/transports/ssh-transport.js.map +1 -1
  43. package/build/src/types.d.ts +20 -0
  44. package/build/src/types.d.ts.map +1 -1
  45. package/docs/config-reference.md +42 -0
  46. package/docs/migration-from-capistrano.md +25 -3
  47. package/package.json +1 -1
@@ -38,6 +38,7 @@ Each stage under `stages` supports:
38
38
  | `linkedFiles` | array | no | `[]` | Files symlinked from `shared/` into each release. See Linked files below. |
39
39
  | `linkedDirs` | array | no | `[]` | Directories symlinked from `shared/` into each release. |
40
40
  | `tasks` | object | no | `{}` | Named task groups executed in order during deploy. See Tasks below. |
41
+ | `operationalTasks` | object | no | `{}` | Explicit standalone tasks that run against the active release. See Operational tasks below. |
41
42
  | `hooks` | object | no | `{}` | Lifecycle-phase hooks executed at specific points in the deploy pipeline. See Hooks below. |
42
43
  | `runtime` | object | no | `{type: "none"}` | Runtime adapter config. See Runtime below. |
43
44
  | `healthChecks` | array | no | `[]` | Checks run after tasks and before publish. See Health checks below. |
@@ -198,6 +199,47 @@ rampway production tasks --json
198
199
 
199
200
  Each entry shows its command plus any `cwd`, `env`, `optional`, and `onlyIfChanged` metadata. Secret-like env values and `KEY=value` assignments in commands are redacted in both the human and `--json` output.
200
201
 
202
+ ## Operational tasks
203
+
204
+ `operationalTasks` is a strict namespace for reusable standalone operations. It is separate from deploy lifecycle `tasks`: an operational task runs only when its exact configured name is invoked.
205
+
206
+ ```js
207
+ operationalTasks: {
208
+ "cache:warm": [
209
+ {
210
+ command: "npm run cache:warm",
211
+ cwd: "backend",
212
+ env: {NODE_ENV: "production"},
213
+ forwardEnv: ["CACHE_WARM_CREDENTIAL"]
214
+ }
215
+ ]
216
+ }
217
+ ```
218
+
219
+ Each value is a command string, one entry object, or a non-empty ordered array of strings and entry objects. Entry objects accept only:
220
+
221
+ - `command` — required non-empty shell command from trusted configuration.
222
+ - `cwd` — optional non-empty release-relative directory; absolute and escaping paths are rejected.
223
+ - `env` — optional string-valued environment literals with safe shell names. Secret-like keys are rejected; use `forwardEnv`.
224
+ - `forwardEnv` — optional unique allowlist of safe environment names. Every named value must exist in Rampway's invocation environment and is always treated as sensitive.
225
+
226
+ Task names are 1–128 characters and match `^[A-Za-z0-9][A-Za-z0-9:_-]*$`. Selection is an exact name lookup; command text and arbitrary trailing arguments cannot come from the CLI.
227
+
228
+ ```bash
229
+ CACHE_WARM_CREDENTIAL=... rampway production task cache:warm
230
+ CACHE_WARM_CREDENTIAL=... rampway production task cache:warm --json
231
+ ```
232
+
233
+ Rampway resolves all forwarded values before transport work, acquires the same exclusive lock used by deploy and rollback, then strictly resolves `current` to one existing direct child of `releases/`. Every entry is required and runs in order against that immutable release path. Missing configuration, forwarded values, lock ownership, active release, command failures, and transport failures all fail closed. There is no task `--force`.
234
+
235
+ For SSH, forwarded values are sent to a fixed remote shell through stdin rather than SSH argv. Known values are redacted from streamed output, returned output, and errors even when echoed without their variable name or split across chunks. Human output identifies the application, stage, task, and release. JSON mode emits only:
236
+
237
+ ```json
238
+ {"application":"demo","stage":"production","task":"cache:warm","releaseId":"20260728120000","status":"passed"}
239
+ ```
240
+
241
+ Standalone task runs are not appended to the deployment report. The plural `rampway <stage> tasks` command remains a read-only inventory of deploy task groups.
242
+
201
243
  ## Hooks
202
244
 
203
245
  Hooks are lifecycle-phase callbacks that run commands at specific points during the deploy pipeline, outside the fixed task-group slot. Each hook phase accepts an array of task entries (strings or objects, same format as tasks).
@@ -17,6 +17,7 @@ Rampway is a JS-native alternative to Capistrano for Node projects. This guide m
17
17
  | `SSHKit` | `transport: {type: "ssh"}` |
18
18
  | `after/before` hooks | `tasks` run in config order, or use lifecycle `hooks` for phase-specific callbacks |
19
19
  | `deploy:starting` … `deploy:finished` | task groups + runtime deploy |
20
+ | Explicit custom task against `current` | `operationalTasks` + `rampway production task <exact-name>` |
20
21
  | `cap production deploy` | `rampway production deploy` |
21
22
  | `cap -T` / `cap production -T` | `rampway production tasks` |
22
23
  | `cap production deploy:rollback` | `rampway production rollback` |
@@ -106,7 +107,27 @@ tasks: {
106
107
  }
107
108
  ```
108
109
 
109
- ### 5. Convert process management
110
+ ### 5. Convert standalone operational tasks
111
+
112
+ Keep operations that were invoked explicitly in Capistrano out of deploy task groups. Declare each one under the strict `operationalTasks` namespace and invoke its exact configured name:
113
+
114
+ ```js
115
+ operationalTasks: {
116
+ "cache:warm": {
117
+ command: "npm run cache:warm",
118
+ cwd: "backend",
119
+ forwardEnv: ["CACHE_WARM_CREDENTIAL"]
120
+ }
121
+ }
122
+ ```
123
+
124
+ ```bash
125
+ CACHE_WARM_CREDENTIAL=... rampway production task cache:warm
126
+ ```
127
+
128
+ Rampway owns the configured transport, shared deploy lock, active-release resolution, and secret-value redaction. Replace the former caller's direct SSH with the Rampway invocation; do not retain an SSH fallback. Operational tasks are explicit and never run as part of every deploy.
129
+
130
+ ### 6. Convert process management
110
131
 
111
132
  Capistrano relies on SSH-based process management (puma, sidekiq, etc.) or custom tasks:
112
133
 
@@ -136,7 +157,7 @@ Rollbridge handles zero-downtime restarts, health checks, and log access. Rampwa
136
157
 
137
158
  For simple setups without a process manager, use `runtime: {type: "none"}` and handle process restarts yourself via task commands.
138
159
 
139
- ### 6. Run the first deploy
160
+ ### 7. Run the first deploy
140
161
 
141
162
  ```bash
142
163
  # Validate
@@ -149,7 +170,7 @@ rampway production plan
149
170
  rampway production deploy
150
171
  ```
151
172
 
152
- ### 7. Verify and cleanup
173
+ ### 8. Verify and cleanup
153
174
 
154
175
  ```bash
155
176
  rampway production status
@@ -162,6 +183,7 @@ After verifying the first deploy works, remove your old Capistrano config files.
162
183
 
163
184
  - **No Ruby dependency.** Rampway runs on Node.js, matching your JS/TS stack.
164
185
  - **Task groups replace hooks.** Order task groups instead of registering `after`/`before` callbacks. For Capistrano-style lifecycle callbacks, use `hooks` with named phases like `before_publish` and `after_cleanup`.
186
+ - **Operational tasks replace explicitly invoked remote tasks.** Configure an exact name under `operationalTasks`; Rampway executes it against the locked active release and securely forwards allowlisted caller environment values.
165
187
  - **Runtime adapters replace process management tasks.** Rollbridge or a custom adapter handles zero-downtime handoff.
166
188
  - **ESM config.** `rampway.config.mjs` uses ES module syntax, not Ruby DSL.
167
189
  - **Health checks are built in.** Add `healthChecks` to verify deploy readiness before publishing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rampway",
3
- "version": "0.2.6",
3
+ "version": "0.3.0",
4
4
  "description": "JS-native Capistrano-style release-directory deployments with Rollbridge integration.",
5
5
  "type": "module",
6
6
  "private": false,