greenbump 0.5.0 → 0.7.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/README.md +696 -66
- package/README.zh-CN.md +539 -100
- package/dist/agent/fixer.js +165 -12
- package/dist/agent/fixer.js.map +1 -1
- package/dist/agent/fixer.test.js +410 -0
- package/dist/agent/fixer.test.js.map +1 -0
- package/dist/cli/interactive.js +81 -0
- package/dist/cli/interactive.js.map +1 -0
- package/dist/cli.js +59 -0
- package/dist/cli.js.map +1 -1
- package/dist/engine/analyzers/changelog-parser.js +121 -0
- package/dist/engine/analyzers/changelog-parser.js.map +1 -0
- package/dist/engine/batch.js +24 -0
- package/dist/engine/batch.js.map +1 -1
- package/dist/engine/batch.test.js +59 -0
- package/dist/engine/batch.test.js.map +1 -0
- package/dist/engine/cache/manager.js +165 -0
- package/dist/engine/cache/manager.js.map +1 -0
- package/dist/engine/cache/manager.test.js +75 -0
- package/dist/engine/cache/manager.test.js.map +1 -0
- package/dist/engine/checks.test.js +92 -0
- package/dist/engine/checks.test.js.map +1 -0
- package/dist/engine/context/optimizer.js +189 -0
- package/dist/engine/context/optimizer.js.map +1 -0
- package/dist/engine/context/optimizer.test.js +81 -0
- package/dist/engine/context/optimizer.test.js.map +1 -0
- package/dist/engine/ecosystems/parsers.test.js +255 -0
- package/dist/engine/ecosystems/parsers.test.js.map +1 -0
- package/dist/engine/fixer/patterns.js +597 -0
- package/dist/engine/fixer/patterns.js.map +1 -0
- package/dist/engine/fixer/patterns.test.js +316 -0
- package/dist/engine/fixer/patterns.test.js.map +1 -0
- package/dist/engine/git.test.js +111 -0
- package/dist/engine/git.test.js.map +1 -0
- package/dist/engine/run.js +66 -1
- package/dist/engine/run.js.map +1 -1
- package/dist/engine/run.test.js +47 -0
- package/dist/engine/run.test.js.map +1 -0
- package/dist/engine/stats/recorder.js +48 -0
- package/dist/engine/stats/recorder.js.map +1 -0
- package/dist/engine/stats/recorder.test.js +71 -0
- package/dist/engine/stats/recorder.test.js.map +1 -0
- package/dist/engine/stats/report.js +157 -0
- package/dist/engine/stats/report.js.map +1 -0
- package/dist/engine/stats/report.test.js +83 -0
- package/dist/engine/stats/report.test.js.map +1 -0
- package/dist/engine/verifiers/ast-analyzer.js +212 -0
- package/dist/engine/verifiers/ast-analyzer.js.map +1 -0
- package/dist/engine/verifiers/ast-analyzer.test.js +96 -0
- package/dist/engine/verifiers/ast-analyzer.test.js.map +1 -0
- package/dist/engine/workspace.test.js +95 -0
- package/dist/engine/workspace.test.js.map +1 -0
- package/dist/exitcode.test.js +62 -0
- package/dist/exitcode.test.js.map +1 -0
- package/dist/format.js +15 -0
- package/dist/format.js.map +1 -1
- package/dist/report.test.js +56 -0
- package/dist/report.test.js.map +1 -0
- package/package.json +7 -4
- package/CHANGELOG.md +0 -136
- package/CONTRIBUTING.md +0 -52
- package/SECURITY.md +0 -38
- package/action-dist/index.cjs +0 -20730
- package/action.yml +0 -76
- package/competitive-analysis.md +0 -304
- package/examples/greenbump.yml +0 -37
- package/examples/legacy-repo/package.json +0 -12
- package/examples/legacy-repo/test.js +0 -17
- package/examples/multi-file-repo/models/todo.js +0 -8
- package/examples/multi-file-repo/models/user.js +0 -11
- package/examples/multi-file-repo/package.json +0 -12
- package/examples/multi-file-repo/services/session.js +0 -9
- package/examples/multi-file-repo/test.js +0 -19
- package/optimization-roadmap.md +0 -772
package/CONTRIBUTING.md
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
# Contributing
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npm install
|
|
7
|
-
npm run build
|
|
8
|
-
npm test
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
`npm test` builds the project then runs every `*.test.js` file under `dist/`
|
|
12
|
-
with Node's built-in test runner. Some tests (`git.test.ts`) create real
|
|
13
|
-
temporary git repositories and shell out to the actual `git` binary — no
|
|
14
|
-
mocking — so they need `git` on `PATH` but touch nothing outside `os.tmpdir()`.
|
|
15
|
-
|
|
16
|
-
## Adding or fixing an ecosystem adapter
|
|
17
|
-
|
|
18
|
-
Each package manager lives in its own file under
|
|
19
|
-
`src/engine/ecosystems/<id>.ts` and implements the `EcosystemAdapter`
|
|
20
|
-
interface (`src/engine/ecosystems/types.ts`): `detect`, `outdated`, `install`,
|
|
21
|
-
`defaultCheckCommands`.
|
|
22
|
-
|
|
23
|
-
If you're fixing a parser bug, please:
|
|
24
|
-
1. Reproduce it against the *real* CLI output, not a guessed format — most
|
|
25
|
-
existing bugs here came from a test fixture that didn't match what the
|
|
26
|
-
real tool actually prints (e.g. `mix hex.outdated`'s "Only" column, or
|
|
27
|
-
`pod outdated`'s `(latest version X)` suffix).
|
|
28
|
-
2. Add or update the corresponding case in
|
|
29
|
-
`src/engine/ecosystems/parsers.test.ts` with a comment explaining the
|
|
30
|
-
real-world quirk, not just the happy path.
|
|
31
|
-
3. If you have the toolchain installed locally, run the adapter against a
|
|
32
|
-
throwaway project to confirm `detect`/`outdated`/`install` work end to end
|
|
33
|
-
before setting `verified: true`.
|
|
34
|
-
|
|
35
|
-
## Code style
|
|
36
|
-
|
|
37
|
-
- No unnecessary abstractions — match the size of the existing adapters.
|
|
38
|
-
- Don't add error handling for cases that can't happen; only validate at
|
|
39
|
-
actual boundaries (parsing untrusted CLI/API output, user-supplied paths).
|
|
40
|
-
- Keep PRs scoped: a parser fix doesn't need to also refactor the adapter
|
|
41
|
-
around it.
|
|
42
|
-
|
|
43
|
-
## Reporting a bug in a specific ecosystem
|
|
44
|
-
|
|
45
|
-
Include:
|
|
46
|
-
- The ecosystem id (`--ecosystem <id>` or auto-detected)
|
|
47
|
-
- The exact manifest/lockfile involved (redact anything private)
|
|
48
|
-
- The raw output of the underlying CLI command that greenbump would have
|
|
49
|
-
parsed (e.g. `npm outdated --json`, `pod outdated`)
|
|
50
|
-
|
|
51
|
-
For security issues, see [SECURITY.md](SECURITY.md) instead of opening a
|
|
52
|
-
public issue.
|
package/SECURITY.md
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Security Policy
|
|
2
|
-
|
|
3
|
-
## Reporting a vulnerability
|
|
4
|
-
|
|
5
|
-
Please do **not** open a public GitHub issue for security vulnerabilities.
|
|
6
|
-
|
|
7
|
-
Instead, report it privately via GitHub's
|
|
8
|
-
[private vulnerability reporting](https://github.com/shidesheng0218/greenbump/security/advisories/new)
|
|
9
|
-
(https://github.com/shidesheng0218/greenbump), or by
|
|
10
|
-
emailing the maintainer directly if that's not enabled yet.
|
|
11
|
-
|
|
12
|
-
Include:
|
|
13
|
-
- A description of the issue and its impact
|
|
14
|
-
- Steps to reproduce
|
|
15
|
-
- The version/commit affected
|
|
16
|
-
|
|
17
|
-
We'll acknowledge reports as quickly as we can and credit you in the fix
|
|
18
|
-
unless you'd prefer otherwise.
|
|
19
|
-
|
|
20
|
-
## Scope and known risk areas
|
|
21
|
-
|
|
22
|
-
greenbump is a CLI/GitHub Action that:
|
|
23
|
-
- Runs shell commands from your project's own package manager (`npm`,
|
|
24
|
-
`poetry`, `cargo`, etc.) against your working directory.
|
|
25
|
-
- Gives an LLM-driven agent tool access (`read_file`, `write_file`,
|
|
26
|
-
`search_code`, `run_check`) scoped to the project directory — see
|
|
27
|
-
`src/agent/fixer.ts`'s `safePath()` for the path-escape guard.
|
|
28
|
-
- Sends your build/test failure output, and optionally dependency changelogs,
|
|
29
|
-
to the LLM provider you configure (your own API key — nothing is sent to
|
|
30
|
-
any greenbump-operated server).
|
|
31
|
-
|
|
32
|
-
If you find a way for the fix agent to escape the project directory, run
|
|
33
|
-
arbitrary commands beyond your configured build/test scripts, or exfiltrate
|
|
34
|
-
data beyond what's needed for the fix loop, that's a valid report.
|
|
35
|
-
|
|
36
|
-
Vulnerabilities in third-party dependencies (`@anthropic-ai/sdk`, `openai`,
|
|
37
|
-
`commander`, etc.) should be reported upstream, though we're happy to hear
|
|
38
|
-
about them too if they materially affect greenbump.
|