@rainy-updates/cli 0.4.0 → 0.4.4
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 +24 -1
- package/CODE_OF_CONDUCT.md +25 -0
- package/README.md +136 -82
- package/SECURITY.md +18 -0
- package/dist/bin/cli.js +11 -3
- package/dist/cache/cache.js +1 -9
- package/dist/core/init-ci.d.ts +7 -1
- package/dist/core/init-ci.js +38 -7
- package/dist/core/options.d.ts +5 -1
- package/dist/core/options.js +33 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.4.4] - 2026-02-27
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Version bump to `0.4.4` for production stabilization.
|
|
10
|
+
- Simplified public documentation to focus on end-user CLI usage.
|
|
11
|
+
- Removed user-facing instructions for GitHub Actions configuration from README.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Removed optional `better-sqlite3` dependency to avoid deprecated native install warnings (`prebuild-install`).
|
|
16
|
+
- Cache backend now uses `bun:sqlite` when available and falls back cleanly to file-based cache without native Node addons.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `SECURITY.md` with vulnerability disclosure guidance.
|
|
21
|
+
- `CODE_OF_CONDUCT.md` for OSS community standards.
|
|
22
|
+
- Automatic CI bootstrap improvements in `init-ci`:
|
|
23
|
+
- `--mode minimal|strict`
|
|
24
|
+
- `--schedule weekly|daily|off`
|
|
25
|
+
- package-manager-aware install step generation (npm/pnpm)
|
|
26
|
+
|
|
27
|
+
|
|
5
28
|
## [0.4.0] - 2026-02-27
|
|
6
29
|
|
|
7
30
|
### Added
|
|
@@ -126,7 +149,7 @@ All notable changes to this project are documented in this file.
|
|
|
126
149
|
- `--dep-kinds deps,dev,optional,peer`
|
|
127
150
|
- Runtime controls:
|
|
128
151
|
- `--concurrency` for parallel dependency checks.
|
|
129
|
-
|
|
152
|
+
- `--cache-ttl` for cache freshness tuning.
|
|
130
153
|
- Cache layer improvements:
|
|
131
154
|
- SQLite-first cache backend when available.
|
|
132
155
|
- JSON fallback cache backend.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Standards
|
|
4
|
+
|
|
5
|
+
We are committed to a respectful, inclusive, and harassment-free community.
|
|
6
|
+
|
|
7
|
+
Expected behavior:
|
|
8
|
+
|
|
9
|
+
- be respectful and constructive
|
|
10
|
+
- focus on technical issues, not personal attacks
|
|
11
|
+
- welcome feedback and different viewpoints
|
|
12
|
+
|
|
13
|
+
Unacceptable behavior:
|
|
14
|
+
|
|
15
|
+
- harassment, discrimination, or abusive language
|
|
16
|
+
- doxxing or threats
|
|
17
|
+
- trolling and persistent disruption
|
|
18
|
+
|
|
19
|
+
## Enforcement
|
|
20
|
+
|
|
21
|
+
Project maintainers are responsible for clarifying and enforcing this code of conduct.
|
|
22
|
+
|
|
23
|
+
## Reporting
|
|
24
|
+
|
|
25
|
+
Report unacceptable behavior through private communication with maintainers or GitHub moderation tools.
|
package/README.md
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
# @rainy-updates/cli
|
|
2
2
|
|
|
3
|
-
Agentic
|
|
3
|
+
Agentic CLI to detect, control, and apply dependency updates across npm/pnpm projects and monorepos.
|
|
4
|
+
|
|
5
|
+
`@rainy-updates/cli` is built for teams that need fast dependency intelligence, policy-aware upgrades, and automation-ready output for CI/CD and pull request workflows.
|
|
6
|
+
|
|
7
|
+
## Why this package
|
|
8
|
+
|
|
9
|
+
- Detects updates quickly across single-package repos and workspaces.
|
|
10
|
+
- Applies updates safely with configurable targets (`patch`, `minor`, `major`, `latest`).
|
|
11
|
+
- Enforces policy rules per package (ignore rules and max upgrade level).
|
|
12
|
+
- Supports offline and cache-warmed execution for deterministic CI runs.
|
|
13
|
+
- Produces machine-readable artifacts (JSON, SARIF, GitHub outputs, PR markdown report).
|
|
4
14
|
|
|
5
15
|
## Install
|
|
6
16
|
|
|
@@ -10,64 +20,53 @@ npm i -D @rainy-updates/cli
|
|
|
10
20
|
pnpm add -D @rainy-updates/cli
|
|
11
21
|
```
|
|
12
22
|
|
|
13
|
-
##
|
|
23
|
+
## Core commands
|
|
14
24
|
|
|
15
|
-
- `check`:
|
|
16
|
-
- `upgrade`: rewrite dependency ranges
|
|
17
|
-
- `warm-cache`:
|
|
18
|
-
- `init-ci`: scaffold `.github/workflows/rainy-updates.yml`.
|
|
25
|
+
- `check`: analyze dependencies and report available updates.
|
|
26
|
+
- `upgrade`: rewrite dependency ranges in manifests, optionally install lockfile updates.
|
|
27
|
+
- `warm-cache`: prefetch package metadata for fast and offline checks.
|
|
19
28
|
|
|
20
|
-
## Quick
|
|
29
|
+
## Quick usage
|
|
21
30
|
|
|
22
31
|
```bash
|
|
23
|
-
#
|
|
24
|
-
npx @rainy-updates/cli check --
|
|
32
|
+
# 1) Detect updates
|
|
33
|
+
npx @rainy-updates/cli check --format table
|
|
25
34
|
|
|
26
|
-
#
|
|
27
|
-
npx @rainy-updates/cli
|
|
28
|
-
npx @rainy-updates/cli check --workspace --offline --ci
|
|
35
|
+
# 2) Strict CI mode (non-zero when updates exist)
|
|
36
|
+
npx @rainy-updates/cli check --workspace --ci --format json --json-file .artifacts/updates.json
|
|
29
37
|
|
|
30
|
-
#
|
|
38
|
+
# 3) Apply upgrades with workspace sync
|
|
31
39
|
npx @rainy-updates/cli upgrade --target latest --workspace --sync --install
|
|
32
40
|
|
|
33
|
-
#
|
|
34
|
-
npx @rainy-updates/cli
|
|
41
|
+
# 4) Warm cache for deterministic offline checks
|
|
42
|
+
npx @rainy-updates/cli warm-cache --workspace --concurrency 32
|
|
43
|
+
npx @rainy-updates/cli check --workspace --offline --ci
|
|
35
44
|
```
|
|
36
45
|
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
- `--target patch|minor|major|latest`
|
|
40
|
-
- `--filter <pattern>`
|
|
41
|
-
- `--reject <pattern>`
|
|
42
|
-
- `--dep-kinds deps,dev,optional,peer`
|
|
43
|
-
- `--workspace`
|
|
44
|
-
- `--concurrency <n>`
|
|
45
|
-
- `--cache-ttl <seconds>`
|
|
46
|
-
- `--offline` (cache-only mode)
|
|
47
|
-
- `--cwd <path>`
|
|
46
|
+
## What it does in production
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
### Update detection engine
|
|
50
49
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
- `--pr-report-file <path>` (generates markdown report for PR comments)
|
|
50
|
+
- Scans dependency groups: `dependencies`, `devDependencies`, `optionalDependencies`, `peerDependencies`.
|
|
51
|
+
- Resolves versions per unique package to reduce duplicate network requests.
|
|
52
|
+
- Uses network concurrency controls and resilient retries.
|
|
53
|
+
- Supports stale-cache fallback when registry calls fail.
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
### Workspace support
|
|
58
56
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
57
|
+
- Detects package workspaces from:
|
|
58
|
+
- `package.json` workspaces
|
|
59
|
+
- `pnpm-workspace.yaml`
|
|
60
|
+
- Handles multi-manifest upgrade flows.
|
|
61
|
+
- Graph-aware sync mode (`--sync`) avoids breaking `workspace:*` references.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
### Policy-aware control
|
|
64
64
|
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
- `rainy-updates.policy.json`
|
|
65
|
+
- Apply global ignore patterns.
|
|
66
|
+
- Apply package-specific rules.
|
|
67
|
+
- Enforce max upgrade target per package (for safer rollout).
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
Example policy file:
|
|
71
70
|
|
|
72
71
|
```json
|
|
73
72
|
{
|
|
@@ -79,63 +78,118 @@ Policy example:
|
|
|
79
78
|
}
|
|
80
79
|
```
|
|
81
80
|
|
|
82
|
-
|
|
81
|
+
Use it with:
|
|
83
82
|
|
|
84
83
|
```bash
|
|
85
|
-
rainy-updates --
|
|
86
|
-
rainy-updates <command> --help
|
|
87
|
-
rainy-updates --version
|
|
84
|
+
npx @rainy-updates/cli check --policy-file .rainyupdates-policy.json
|
|
88
85
|
```
|
|
89
86
|
|
|
90
|
-
##
|
|
87
|
+
## Output and reporting
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
- returns exit code `2` for operational errors (registry/IO/runtime failures).
|
|
89
|
+
### Human output
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
- `--format table`
|
|
92
|
+
- `--format minimal`
|
|
96
93
|
|
|
97
|
-
|
|
94
|
+
### Automation output
|
|
98
95
|
|
|
99
|
-
-
|
|
100
|
-
-
|
|
101
|
-
-
|
|
96
|
+
- `--format json`
|
|
97
|
+
- `--json-file <path>`
|
|
98
|
+
- `--sarif-file <path>`
|
|
99
|
+
- `--github-output <path>`
|
|
100
|
+
- `--pr-report-file <path>`
|
|
102
101
|
|
|
103
|
-
|
|
102
|
+
These outputs are designed for CI pipelines, security tooling, and PR review automation.
|
|
104
103
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
"prReportFile": ".artifacts/deps.md",
|
|
117
|
-
"policyFile": ".rainyupdates-policy.json"
|
|
118
|
-
}
|
|
119
|
-
}
|
|
104
|
+
|
|
105
|
+
## Automatic CI bootstrap
|
|
106
|
+
|
|
107
|
+
Generate a workflow in the target project automatically:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# strict mode (recommended)
|
|
111
|
+
npx @rainy-updates/cli init-ci --mode strict --schedule weekly
|
|
112
|
+
|
|
113
|
+
# lightweight mode
|
|
114
|
+
npx @rainy-updates/cli init-ci --mode minimal --schedule daily
|
|
120
115
|
```
|
|
121
116
|
|
|
122
|
-
|
|
117
|
+
Generated file:
|
|
118
|
+
|
|
119
|
+
- `.github/workflows/rainy-updates.yml`
|
|
120
|
+
|
|
121
|
+
Modes:
|
|
122
|
+
|
|
123
|
+
- `strict`: warm-cache + offline check + artifacts + SARIF upload.
|
|
124
|
+
- `minimal`: fast check-only workflow for quick adoption.
|
|
125
|
+
|
|
126
|
+
Schedule:
|
|
127
|
+
|
|
128
|
+
- `weekly`, `daily`, or `off` (manual dispatch only).
|
|
129
|
+
|
|
130
|
+
## Command options
|
|
131
|
+
|
|
132
|
+
### Global
|
|
133
|
+
|
|
134
|
+
- `--cwd <path>`
|
|
135
|
+
- `--workspace`
|
|
136
|
+
- `--target patch|minor|major|latest`
|
|
137
|
+
- `--filter <pattern>`
|
|
138
|
+
- `--reject <pattern>`
|
|
139
|
+
- `--dep-kinds deps,dev,optional,peer`
|
|
140
|
+
- `--concurrency <n>`
|
|
141
|
+
- `--cache-ttl <seconds>`
|
|
142
|
+
- `--offline`
|
|
143
|
+
- `--policy-file <path>`
|
|
144
|
+
- `--format table|json|minimal|github`
|
|
145
|
+
- `--json-file <path>`
|
|
146
|
+
- `--github-output <path>`
|
|
147
|
+
- `--sarif-file <path>`
|
|
148
|
+
- `--pr-report-file <path>`
|
|
149
|
+
- `--ci`
|
|
150
|
+
|
|
151
|
+
### Upgrade-only
|
|
152
|
+
|
|
153
|
+
- `--install`
|
|
154
|
+
- `--pm auto|npm|pnpm`
|
|
155
|
+
- `--sync`
|
|
156
|
+
|
|
157
|
+
## Config support
|
|
158
|
+
|
|
159
|
+
Configuration can be loaded from:
|
|
160
|
+
|
|
161
|
+
- `.rainyupdatesrc`
|
|
162
|
+
- `.rainyupdatesrc.json`
|
|
163
|
+
- `package.json` field: `rainyUpdates`
|
|
164
|
+
|
|
165
|
+
## CLI help
|
|
123
166
|
|
|
124
167
|
```bash
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
168
|
+
rainy-updates --help
|
|
169
|
+
rainy-updates <command> --help
|
|
170
|
+
rainy-updates --version
|
|
128
171
|
```
|
|
129
172
|
|
|
130
|
-
|
|
173
|
+
## Reliability characteristics
|
|
174
|
+
|
|
175
|
+
- Node.js 20+ runtime.
|
|
176
|
+
- Works with npm and pnpm workflows.
|
|
177
|
+
- Uses optional `undici` pool path for high-throughput HTTP.
|
|
178
|
+
- Cache-first architecture for speed and resilience.
|
|
179
|
+
|
|
180
|
+
## CI/CD included
|
|
181
|
+
|
|
182
|
+
This package ships with production CI/CD pipelines in the repository:
|
|
183
|
+
|
|
184
|
+
- Continuous integration pipeline for typecheck, tests, build, and production smoke checks.
|
|
185
|
+
- Tag-driven release pipeline for npm publishing with provenance.
|
|
186
|
+
- Release preflight validation for npm auth/scope checks before publishing.
|
|
187
|
+
|
|
131
188
|
|
|
132
|
-
|
|
189
|
+
## Product roadmap
|
|
133
190
|
|
|
134
|
-
-
|
|
135
|
-
- `.github/workflows/release.yml` for tag-driven npm publishing.
|
|
191
|
+
The long-term roadmap is maintained in [`ROADMAP.md`](./ROADMAP.md).
|
|
136
192
|
|
|
137
|
-
##
|
|
193
|
+
## License
|
|
138
194
|
|
|
139
|
-
|
|
140
|
-
- Uses `undici` pool with HTTP/2 when available; falls back to native `fetch` automatically.
|
|
141
|
-
- Uses layered cache with stale fallback for resilient CI runs.
|
|
195
|
+
MIT
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported versions
|
|
4
|
+
|
|
5
|
+
Security fixes are applied to the latest released version.
|
|
6
|
+
|
|
7
|
+
## Reporting vulnerabilities
|
|
8
|
+
|
|
9
|
+
Report vulnerabilities privately through GitHub Security Advisories.
|
|
10
|
+
|
|
11
|
+
Include:
|
|
12
|
+
|
|
13
|
+
- affected version
|
|
14
|
+
- reproduction steps
|
|
15
|
+
- impact assessment
|
|
16
|
+
- proof-of-concept if available
|
|
17
|
+
|
|
18
|
+
Do not open public issues for unpatched security vulnerabilities.
|
package/dist/bin/cli.js
CHANGED
|
@@ -25,7 +25,10 @@ async function main() {
|
|
|
25
25
|
}
|
|
26
26
|
const parsed = await parseCliArgs(argv);
|
|
27
27
|
if (parsed.command === "init-ci") {
|
|
28
|
-
const workflow = await initCiWorkflow(parsed.options.cwd, parsed.options.force
|
|
28
|
+
const workflow = await initCiWorkflow(parsed.options.cwd, parsed.options.force, {
|
|
29
|
+
mode: parsed.options.mode,
|
|
30
|
+
schedule: parsed.options.schedule,
|
|
31
|
+
});
|
|
29
32
|
process.stdout.write(workflow.created
|
|
30
33
|
? `Created CI workflow at ${workflow.path}\n`
|
|
31
34
|
: `CI workflow already exists at ${workflow.path}. Use --force to overwrite.\n`);
|
|
@@ -107,10 +110,15 @@ Options:
|
|
|
107
110
|
--pr-report-file <path>`;
|
|
108
111
|
}
|
|
109
112
|
if (isCommand && command === "init-ci") {
|
|
110
|
-
return `rainy-updates init-ci [
|
|
113
|
+
return `rainy-updates init-ci [options]
|
|
111
114
|
|
|
112
115
|
Create a GitHub Actions workflow template at:
|
|
113
|
-
.github/workflows/rainy-updates.yml
|
|
116
|
+
.github/workflows/rainy-updates.yml
|
|
117
|
+
|
|
118
|
+
Options:
|
|
119
|
+
--force
|
|
120
|
+
--mode minimal|strict
|
|
121
|
+
--schedule weekly|daily|off`;
|
|
114
122
|
}
|
|
115
123
|
return `rainy-updates <command> [options]
|
|
116
124
|
|
package/dist/cache/cache.js
CHANGED
|
@@ -110,16 +110,8 @@ async function tryCreateSqliteStore(dbPath) {
|
|
|
110
110
|
return new SqliteCacheStore(db);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
catch {
|
|
114
|
-
// noop
|
|
115
|
-
}
|
|
116
|
-
try {
|
|
117
|
-
const maybeRequire = Function("return require")();
|
|
118
|
-
const Database = maybeRequire("better-sqlite3");
|
|
119
|
-
const db = new Database(dbPath);
|
|
120
|
-
return new SqliteCacheStore(db);
|
|
121
|
-
}
|
|
122
113
|
catch {
|
|
123
114
|
return null;
|
|
124
115
|
}
|
|
116
|
+
return null;
|
|
125
117
|
}
|
package/dist/core/init-ci.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type InitCiMode = "minimal" | "strict";
|
|
2
|
+
export type InitCiSchedule = "weekly" | "daily" | "off";
|
|
3
|
+
export interface InitCiOptions {
|
|
4
|
+
mode: InitCiMode;
|
|
5
|
+
schedule: InitCiSchedule;
|
|
6
|
+
}
|
|
7
|
+
export declare function initCiWorkflow(cwd: string, force: boolean, options: InitCiOptions): Promise<{
|
|
2
8
|
path: string;
|
|
3
9
|
created: boolean;
|
|
4
10
|
}>;
|
package/dist/core/init-ci.js
CHANGED
|
@@ -1,20 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { access, writeFile, mkdir } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
export async function initCiWorkflow(cwd, force) {
|
|
3
|
+
export async function initCiWorkflow(cwd, force, options) {
|
|
4
4
|
const workflowPath = path.join(cwd, ".github", "workflows", "rainy-updates.yml");
|
|
5
5
|
try {
|
|
6
6
|
if (!force) {
|
|
7
|
-
await
|
|
7
|
+
await access(workflowPath);
|
|
8
8
|
return { path: workflowPath, created: false };
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
catch {
|
|
12
12
|
// missing file, continue create
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const packageManager = await detectPackageManager(cwd);
|
|
15
|
+
const scheduleBlock = renderScheduleBlock(options.schedule);
|
|
16
|
+
const workflow = options.mode === "minimal"
|
|
17
|
+
? minimalWorkflowTemplate(scheduleBlock, packageManager)
|
|
18
|
+
: strictWorkflowTemplate(scheduleBlock, packageManager);
|
|
19
|
+
await mkdir(path.dirname(workflowPath), { recursive: true });
|
|
20
|
+
await writeFile(workflowPath, workflow, "utf8");
|
|
16
21
|
return { path: workflowPath, created: true };
|
|
17
22
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
23
|
+
async function detectPackageManager(cwd) {
|
|
24
|
+
const pnpmLock = path.join(cwd, "pnpm-lock.yaml");
|
|
25
|
+
try {
|
|
26
|
+
await access(pnpmLock);
|
|
27
|
+
return "pnpm";
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return "npm";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function renderScheduleBlock(schedule) {
|
|
34
|
+
if (schedule === "off") {
|
|
35
|
+
return " workflow_dispatch:";
|
|
36
|
+
}
|
|
37
|
+
const cron = schedule === "daily" ? "0 8 * * *" : "0 8 * * 1";
|
|
38
|
+
return ` schedule:\n - cron: '${cron}'\n workflow_dispatch:`;
|
|
39
|
+
}
|
|
40
|
+
function installStep(packageManager) {
|
|
41
|
+
if (packageManager === "pnpm") {
|
|
42
|
+
return ` - name: Setup pnpm\n uses: pnpm/action-setup@v4\n with:\n version: 9\n\n - name: Install dependencies\n run: pnpm install --frozen-lockfile`;
|
|
43
|
+
}
|
|
44
|
+
return ` - name: Install dependencies\n run: npm ci`;
|
|
45
|
+
}
|
|
46
|
+
function minimalWorkflowTemplate(scheduleBlock, packageManager) {
|
|
47
|
+
return `name: Rainy Updates\n\non:\n${scheduleBlock}\n\njobs:\n dependency-check:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout\n uses: actions/checkout@v4\n\n - name: Setup Node\n uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n${installStep(packageManager)}\n\n - name: Run dependency check\n run: |\n npx @rainy-updates/cli check \\\n --workspace \\\n --ci \\\n --format table\n`;
|
|
48
|
+
}
|
|
49
|
+
function strictWorkflowTemplate(scheduleBlock, packageManager) {
|
|
50
|
+
return `name: Rainy Updates\n\non:\n${scheduleBlock}\n\npermissions:\n contents: read\n security-events: write\n\njobs:\n dependency-check:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout\n uses: actions/checkout@v4\n\n - name: Setup Node\n uses: actions/setup-node@v4\n with:\n node-version: '20'\n\n${installStep(packageManager)}\n\n - name: Warm cache\n run: npx @rainy-updates/cli warm-cache --workspace --concurrency 32\n\n - name: Run strict dependency check\n run: |\n npx @rainy-updates/cli check \\\n --workspace \\\n --offline \\\n --ci \\\n --concurrency 32 \\\n --format github \\\n --json-file .artifacts/deps-report.json \\\n --pr-report-file .artifacts/deps-report.md \\\n --sarif-file .artifacts/deps-report.sarif \\\n --github-output $GITHUB_OUTPUT\n\n - name: Upload report artifacts\n uses: actions/upload-artifact@v4\n with:\n name: rainy-updates-report\n path: .artifacts/\n\n - name: Upload SARIF\n uses: github/codeql-action/upload-sarif@v3\n with:\n sarif_file: .artifacts/deps-report.sarif\n`;
|
|
20
51
|
}
|
package/dist/core/options.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CheckOptions, UpgradeOptions } from "../types/index.js";
|
|
2
|
+
import type { InitCiMode, InitCiSchedule } from "./init-ci.js";
|
|
2
3
|
export type ParsedCliArgs = {
|
|
3
4
|
command: "check";
|
|
4
5
|
options: CheckOptions;
|
|
@@ -10,8 +11,11 @@ export type ParsedCliArgs = {
|
|
|
10
11
|
options: CheckOptions;
|
|
11
12
|
} | {
|
|
12
13
|
command: "init-ci";
|
|
13
|
-
options:
|
|
14
|
+
options: {
|
|
15
|
+
cwd: string;
|
|
14
16
|
force: boolean;
|
|
17
|
+
mode: InitCiMode;
|
|
18
|
+
schedule: InitCiSchedule;
|
|
15
19
|
};
|
|
16
20
|
};
|
|
17
21
|
export declare function parseCliArgs(argv: string[]): Promise<ParsedCliArgs>;
|
package/dist/core/options.js
CHANGED
|
@@ -36,6 +36,8 @@ export async function parseCliArgs(argv) {
|
|
|
36
36
|
prReportFile: undefined,
|
|
37
37
|
};
|
|
38
38
|
let force = false;
|
|
39
|
+
let initCiMode = "strict";
|
|
40
|
+
let initCiSchedule = "weekly";
|
|
39
41
|
let resolvedConfig = await loadConfig(base.cwd);
|
|
40
42
|
applyConfig(base, resolvedConfig);
|
|
41
43
|
for (let index = 0; index < args.length; index += 1) {
|
|
@@ -127,6 +129,16 @@ export async function parseCliArgs(argv) {
|
|
|
127
129
|
force = true;
|
|
128
130
|
continue;
|
|
129
131
|
}
|
|
132
|
+
if (current === "--mode" && next) {
|
|
133
|
+
initCiMode = ensureInitCiMode(next);
|
|
134
|
+
index += 1;
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (current === "--schedule" && next) {
|
|
138
|
+
initCiSchedule = ensureInitCiSchedule(next);
|
|
139
|
+
index += 1;
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
130
142
|
if (current === "--dep-kinds" && next) {
|
|
131
143
|
base.includeKinds = parseDependencyKinds(next);
|
|
132
144
|
index += 1;
|
|
@@ -148,7 +160,15 @@ export async function parseCliArgs(argv) {
|
|
|
148
160
|
return { command, options: base };
|
|
149
161
|
}
|
|
150
162
|
if (command === "init-ci") {
|
|
151
|
-
return {
|
|
163
|
+
return {
|
|
164
|
+
command,
|
|
165
|
+
options: {
|
|
166
|
+
cwd: base.cwd,
|
|
167
|
+
force,
|
|
168
|
+
mode: initCiMode,
|
|
169
|
+
schedule: initCiSchedule,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
152
172
|
}
|
|
153
173
|
return {
|
|
154
174
|
command: "check",
|
|
@@ -236,3 +256,15 @@ function parseDependencyKinds(value) {
|
|
|
236
256
|
}
|
|
237
257
|
return Array.from(new Set(mapped));
|
|
238
258
|
}
|
|
259
|
+
function ensureInitCiMode(value) {
|
|
260
|
+
if (value === "minimal" || value === "strict") {
|
|
261
|
+
return value;
|
|
262
|
+
}
|
|
263
|
+
throw new Error("--mode must be minimal or strict");
|
|
264
|
+
}
|
|
265
|
+
function ensureInitCiSchedule(value) {
|
|
266
|
+
if (value === "weekly" || value === "daily" || value === "off") {
|
|
267
|
+
return value;
|
|
268
|
+
}
|
|
269
|
+
throw new Error("--schedule must be weekly, daily or off");
|
|
270
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rainy-updates/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Agentic CLI to check and upgrade npm/pnpm dependencies for CI workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"dist",
|
|
37
37
|
"README.md",
|
|
38
38
|
"CHANGELOG.md",
|
|
39
|
-
"LICENSE"
|
|
39
|
+
"LICENSE",
|
|
40
|
+
"SECURITY.md",
|
|
41
|
+
"CODE_OF_CONDUCT.md"
|
|
40
42
|
],
|
|
41
43
|
"scripts": {
|
|
42
44
|
"clean": "rm -rf dist",
|
|
@@ -60,7 +62,6 @@
|
|
|
60
62
|
"typescript": "^5.9.3"
|
|
61
63
|
},
|
|
62
64
|
"optionalDependencies": {
|
|
63
|
-
"better-sqlite3": "^12.6.2",
|
|
64
65
|
"undici": "^7.22.0"
|
|
65
66
|
}
|
|
66
67
|
}
|