fundgraph 0.1.1 → 0.1.2

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 CHANGED
@@ -1,88 +1,89 @@
1
- <p align="center"><img src="assets/fundgraph-cli.svg" alt="FundGraph CLI: local dependency analysis from your terminal" width="100%"></p>
2
-
3
- <p align="center">
4
- <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-56d6be?style=flat-square" alt="MIT license"></a>
5
- <img src="https://img.shields.io/badge/Node.js-20%20%7C%2022-83a8ff?style=flat-square" alt="Node.js 20 and 22">
6
- <img src="https://img.shields.io/badge/command-fundgraph-b6a9ff?style=flat-square" alt="fundgraph command">
7
- </p>
8
-
9
- # fundgraph-cli
10
-
11
- The command-line interface for local dependency discovery and deterministic text or JSON reports. It uses
12
- `@fundgraph/core` for models and analysis; it does not duplicate domain logic.
13
-
14
- ## Current scope
15
-
16
- `fundgraph analyze` reads a supported project directory, a JSON model file, or JSON from stdin. Directory discovery
17
- supports npm, PyPI, Cargo, and baseline Go `go.mod` requirements. The default directory mode is local-only. Add
18
- `--network` to explicitly fetch public npm, PyPI, or crates.io metadata and produce the complete evidence-backed
19
- funding report. Go remains discovery-only because Go metadata and funding providers are not implemented.
20
-
21
- The CLI now orchestrates those stages for arbitrary npm, PyPI, and Cargo projects when `--network` is explicitly
22
- supplied. Default directory analysis remains local-only; Go is discovery-only.
23
-
24
- ## Commands
25
-
26
- ```text
27
- fundgraph --help
28
- fundgraph version
29
- fundgraph analyze [PATH] [--format text|json] [--offline|--network] [--strict]
30
- ```
31
-
32
- `PATH` defaults to the current directory. Use `-` or omit the path to read JSON from stdin. `--offline` makes the local
33
- only behavior explicit. `--strict` treats invalid model input as an error.
34
-
35
- | Exit code | Meaning |
36
- |---:|---|
37
- | `0` | Analysis completed without diagnostics |
38
- | `1` | Partial analysis or model diagnostics |
39
- | `2` | Usage or invalid input |
40
- | `3` | Unexpected internal failure |
41
-
42
- JSON output keeps the compatibility summary fields and includes the versioned core report under `report`. Text output
43
- prints the summary and deterministic report. `--network` is opt-in and uses the core network policy.
44
-
45
- ## Try it from the workspace
46
-
47
- The CLI package is not published yet. Run these commands from the `fundgraph-cli` repository directory:
48
-
49
- ```sh
50
- cd ../fundgraph-core
51
- npm ci
52
- npm run build
53
-
54
- cd ../fundgraph-cli
55
- npm install --ignore-scripts --no-save ../fundgraph-core
56
- npm run build
57
- node dist/main.js --help
58
- node dist/main.js analyze ../fundgraph-core/test/fixtures/npm-workspace --format text --offline
59
- node dist/main.js analyze ../fundgraph-core/test/fixtures/npm-workspace --format json --offline
60
- node dist/main.js analyze ./my-project --format json --network
61
- ```
62
-
63
- After compatible npm packages are published, install and run it with:
64
-
65
- ```sh
66
- npm install -g fundgraph
67
- fundgraph analyze ./my-project --format text --offline
68
- ```
69
-
70
- ## Ownership and safety
71
-
72
- - This repository owns argument parsing, terminal output, CLI errors, and process exit codes.
73
- - `fundgraph-core` owns dependency models, parsing, evidence, relationship logic, and opt-in project orchestration.
74
- - Input files are bounded and treated as data; the CLI does not execute project code.
75
- - The command does not identify maintainers, endorse funding destinations, manage wallets, or execute payments.
76
-
77
- ## Development
78
-
79
- ```sh
80
- npm run lint
81
- npm run typecheck
82
- npm test
83
- npm run build
84
- npm pack --dry-run
85
- ```
86
-
87
- CI defines Ubuntu, Windows, and macOS jobs on Node 20 and 22. See [`CONTRIBUTING.md`](CONTRIBUTING.md) and the
88
- project-level `fundgraph` repository for the cross-repository roadmap and policies.
1
+ <p align="center"><img src="assets/fundgraph-cli.svg" alt="FundGraph CLI: local dependency analysis from your terminal" width="100%"></p>
2
+
3
+ <p align="center">
4
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-56d6be?style=flat-square" alt="MIT license"></a>
5
+ <img src="https://img.shields.io/badge/Node.js-20%20%7C%2022-83a8ff?style=flat-square" alt="Node.js 20 and 22">
6
+ <img src="https://img.shields.io/badge/command-fundgraph-b6a9ff?style=flat-square" alt="fundgraph command">
7
+ </p>
8
+
9
+ # fundgraph-cli
10
+
11
+ The command-line interface for local dependency discovery and deterministic text or JSON reports. It uses
12
+ `@fundgraph/core` for models and analysis; it does not duplicate domain logic.
13
+
14
+ ## Current scope
15
+
16
+ `fundgraph analyze` reads a supported project directory, a JSON model file, or JSON from stdin. Directory discovery
17
+ supports npm, PyPI, Cargo, and baseline Go `go.mod` requirements. The default directory mode is local-only. Add
18
+ `--network` to explicitly fetch public npm, PyPI, or crates.io metadata and produce the complete evidence-backed
19
+ funding report. Go remains discovery-only because Go metadata and funding providers are not implemented.
20
+
21
+ The CLI now orchestrates those stages for arbitrary npm, PyPI, and Cargo projects when `--network` is explicitly
22
+ supplied. Default directory analysis remains local-only; Go is discovery-only.
23
+
24
+ ## Commands
25
+
26
+ ```text
27
+ fundgraph --help
28
+ fundgraph version
29
+ fundgraph analyze [PATH] [--format text|json] [--offline|--network] [--strict]
30
+ ```
31
+
32
+ `PATH` defaults to the current directory. Use `-` or omit the path to read JSON from stdin. `--offline` makes the local
33
+ only behavior explicit. `--strict` treats invalid model input as an error.
34
+
35
+ | Exit code | Meaning |
36
+ |---:|---|
37
+ | `0` | Analysis completed without diagnostics |
38
+ | `1` | Partial analysis or model diagnostics |
39
+ | `2` | Usage or invalid input |
40
+ | `3` | Unexpected internal failure |
41
+
42
+ JSON output keeps the compatibility summary fields and includes the versioned core report under `report`. Text output
43
+ prints the summary and deterministic report. `--network` is opt-in and uses the core network policy.
44
+
45
+ ## Try it from the workspace
46
+
47
+ For normal use, install the published CLI package:
48
+
49
+ ```sh
50
+ npm install -g fundgraph@0.1.2
51
+ fundgraph --version
52
+ fundgraph analyze ./my-project --format text --offline
53
+ ```
54
+
55
+ For repository development, run these commands from the `fundgraph-cli` repository directory:
56
+
57
+ ```sh
58
+ cd ../fundgraph-core
59
+ npm ci
60
+ npm run build
61
+
62
+ cd ../fundgraph-cli
63
+ npm install --ignore-scripts --no-save ../fundgraph-core
64
+ npm run build
65
+ node dist/main.js --help
66
+ node dist/main.js analyze ../fundgraph-core/test/fixtures/npm-workspace --format text --offline
67
+ node dist/main.js analyze ../fundgraph-core/test/fixtures/npm-workspace --format json --offline
68
+ node dist/main.js analyze ./my-project --format json --network
69
+ ```
70
+
71
+ ## Ownership and safety
72
+
73
+ - This repository owns argument parsing, terminal output, CLI errors, and process exit codes.
74
+ - `fundgraph-core` owns dependency models, parsing, evidence, relationship logic, and opt-in project orchestration.
75
+ - Input files are bounded and treated as data; the CLI does not execute project code.
76
+ - The command does not identify maintainers, endorse funding destinations, manage wallets, or execute payments.
77
+
78
+ ## Development
79
+
80
+ ```sh
81
+ npm run lint
82
+ npm run typecheck
83
+ npm test
84
+ npm run build
85
+ npm pack --dry-run
86
+ ```
87
+
88
+ CI defines Ubuntu, Windows, and macOS jobs on Node 20 and 22. See [`CONTRIBUTING.md`](CONTRIBUTING.md) and the
89
+ project-level `fundgraph` repository for the cross-repository roadmap and policies.
package/dist/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- export declare const CLI_VERSION = "0.1.1";
2
+ export declare const CLI_VERSION = "0.1.2";
3
3
  export declare const MAX_INPUT_BYTES = 1048576;
4
4
  export declare function run(argv: readonly string[]): Promise<number>;
5
5
  //# sourceMappingURL=main.d.ts.map
package/dist/main.js CHANGED
@@ -3,28 +3,28 @@ import { readFileSync, statSync } from 'node:fs';
3
3
  import { stderr, stdout } from 'node:process';
4
4
  import { analyzeProject, createReport, discoverDependencies, renderReportText, validateModel } from '@fundgraph/core';
5
5
  import { FundGraphCliError, parseArguments } from './options.js';
6
- export const CLI_VERSION = '0.1.1';
6
+ export const CLI_VERSION = '0.1.2';
7
7
  export const MAX_INPUT_BYTES = 1_048_576;
8
- const HELP = `FundGraph ${CLI_VERSION}
9
-
10
- Analyze a JSON model document and explain its validated model inventory.
11
-
12
- Usage:
13
- fundgraph analyze [PATH] [--format text|json] [--offline|--network] [--strict]
14
- fundgraph version
15
- fundgraph --help
16
-
17
- Input:
18
- PATH may be a project directory (npm, PyPI, or Cargo), a JSON file
19
- containing versioned FundGraph models, or -/omitted for stdin.
20
-
21
- Options:
22
- --format text|json Select output format (default: text)
23
- --offline Use only local input and do not enable network access
24
- --network Fetch public registry metadata and parse declared funding evidence
25
- --strict Treat invalid models as an invalid-input failure
26
- -h, --help Show this help
27
- -v, --version Show the CLI version
8
+ const HELP = `FundGraph ${CLI_VERSION}
9
+
10
+ Analyze a JSON model document and explain its validated model inventory.
11
+
12
+ Usage:
13
+ fundgraph analyze [PATH] [--format text|json] [--offline|--network] [--strict]
14
+ fundgraph version
15
+ fundgraph --help
16
+
17
+ Input:
18
+ PATH may be a project directory (npm, PyPI, or Cargo), a JSON file
19
+ containing versioned FundGraph models, or -/omitted for stdin.
20
+
21
+ Options:
22
+ --format text|json Select output format (default: text)
23
+ --offline Use only local input and do not enable network access
24
+ --network Fetch public registry metadata and parse declared funding evidence
25
+ --strict Treat invalid models as an invalid-input failure
26
+ -h, --help Show this help
27
+ -v, --version Show the CLI version
28
28
  `;
29
29
  function readInput(inputPath) {
30
30
  if (inputPath === '-')
package/package.json CHANGED
@@ -1,22 +1,45 @@
1
1
  {
2
2
  "name": "fundgraph",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for evidence-first dependency funding analysis",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "private": false,
8
- "bin": "./dist/main.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/FundGraph/fundgraph-cli.git"
11
+ },
12
+ "homepage": "https://github.com/FundGraph/fundgraph-cli#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/FundGraph/fundgraph-cli/issues"
15
+ },
16
+ "keywords": [
17
+ "dependency-analysis",
18
+ "open-source-funding",
19
+ "cli",
20
+ "provenance",
21
+ "typescript"
22
+ ],
23
+ "engines": {
24
+ "node": ">=20"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "bin": {
30
+ "fundgraph": "dist/main.js"
31
+ },
9
32
  "files": [
10
33
  "dist"
11
34
  ],
12
35
  "dependencies": {
13
- "@fundgraph/core": "0.1.0"
36
+ "@fundgraph/core": "0.1.1"
14
37
  },
15
38
  "scripts": {
16
39
  "build": "tsc -p tsconfig.json",
17
40
  "lint": "node scripts/lint.mjs",
18
41
  "typecheck": "tsc -p tsconfig.json --noEmit",
19
- "test": "npm run build && node --test test/cli.test.js"
42
+ "test": "npm run build && node --test test/cli.test.js test/package.test.js"
20
43
  },
21
44
  "devDependencies": {
22
45
  "@types/node": "^26.6.4",