@grainulation/mill 1.0.0 → 1.0.1

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 (41) hide show
  1. package/CODE_OF_CONDUCT.md +25 -0
  2. package/CONTRIBUTING.md +101 -0
  3. package/README.md +90 -42
  4. package/bin/mill.js +233 -67
  5. package/lib/exporters/csv.js +35 -30
  6. package/lib/exporters/json-ld.js +19 -13
  7. package/lib/exporters/markdown.js +83 -44
  8. package/lib/exporters/pdf.js +15 -15
  9. package/lib/formats/bibtex.js +41 -34
  10. package/lib/formats/changelog.js +27 -26
  11. package/lib/formats/confluence-adf.js +312 -0
  12. package/lib/formats/csv.js +41 -37
  13. package/lib/formats/dot.js +45 -34
  14. package/lib/formats/evidence-matrix.js +17 -16
  15. package/lib/formats/executive-summary.js +89 -41
  16. package/lib/formats/github-issues.js +40 -33
  17. package/lib/formats/graphml.js +45 -32
  18. package/lib/formats/html-report.js +110 -63
  19. package/lib/formats/jira-csv.js +30 -29
  20. package/lib/formats/json-ld.js +6 -6
  21. package/lib/formats/markdown.js +53 -36
  22. package/lib/formats/ndjson.js +6 -6
  23. package/lib/formats/obsidian.js +43 -35
  24. package/lib/formats/opml.js +38 -28
  25. package/lib/formats/ris.js +29 -23
  26. package/lib/formats/rss.js +31 -28
  27. package/lib/formats/sankey.js +16 -15
  28. package/lib/formats/slide-deck.js +145 -57
  29. package/lib/formats/sql.js +57 -53
  30. package/lib/formats/static-site.js +64 -52
  31. package/lib/formats/treemap.js +16 -15
  32. package/lib/formats/typescript-defs.js +79 -76
  33. package/lib/formats/yaml.js +58 -40
  34. package/lib/formats.js +16 -16
  35. package/lib/index.js +5 -5
  36. package/lib/json-ld-common.js +37 -31
  37. package/lib/publishers/clipboard.js +21 -19
  38. package/lib/publishers/static.js +27 -12
  39. package/lib/serve-mcp.js +158 -83
  40. package/lib/server.js +252 -142
  41. package/package.json +7 -3
@@ -0,0 +1,25 @@
1
+ # Code of Conduct
2
+
3
+ ## Our standards
4
+
5
+ We are committed to providing a welcoming and productive environment for everyone. We expect participants to:
6
+
7
+ - Use welcoming and inclusive language
8
+ - Respect differing viewpoints and experiences
9
+ - Accept constructive criticism gracefully
10
+ - Focus on what is best for the community and the project
11
+ - Show empathy toward other participants
12
+
13
+ Unacceptable behavior includes harassment, trolling, personal attacks, and publishing others' private information without permission.
14
+
15
+ ## Scope
16
+
17
+ This code of conduct applies to all project spaces -- issues, pull requests, discussions, and any public channel where someone represents the project.
18
+
19
+ ## Enforcement
20
+
21
+ Instances of unacceptable behavior may be reported to the project maintainers. All complaints will be reviewed and investigated, and will result in a response deemed necessary and appropriate.
22
+
23
+ ## Attribution
24
+
25
+ Adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1.
@@ -0,0 +1,101 @@
1
+ # Contributing to Mill
2
+
3
+ Thanks for considering contributing. Mill is the format and export engine for the grainulation ecosystem -- it transforms structured claim data into multiple output formats.
4
+
5
+ ## Quick setup
6
+
7
+ ```bash
8
+ git clone https://github.com/grainulation/mill.git
9
+ cd mill
10
+ node bin/mill.js --help
11
+ ```
12
+
13
+ No `npm install` needed -- mill has zero dependencies.
14
+
15
+ ## How to contribute
16
+
17
+ ### Report a bug
18
+
19
+ Open an issue with:
20
+
21
+ - What you expected
22
+ - What happened instead
23
+ - Your Node version (`node --version`)
24
+ - Steps to reproduce
25
+
26
+ ### Suggest a feature
27
+
28
+ Open an issue describing the use case, not just the solution. "I need X because Y" is more useful than "add X."
29
+
30
+ ### Submit a PR
31
+
32
+ 1. Fork the repo
33
+ 2. Create a branch (`git checkout -b fix/description`)
34
+ 3. Make your changes
35
+ 4. Run the tests: `node test/basic.test.js`
36
+ 5. Commit with a clear message
37
+ 6. Open a PR
38
+
39
+ ### Add a format or exporter
40
+
41
+ Formats live in `lib/formats/` and exporters in `lib/publishers/`. To add one:
42
+
43
+ 1. Create your module in the appropriate directory
44
+ 2. Follow the pattern of existing formats/exporters
45
+ 3. Register it in `lib/formats.js` or the relevant index
46
+ 4. Add a test in `test/`
47
+
48
+ ## Architecture
49
+
50
+ ```
51
+ bin/mill.js CLI entrypoint -- dispatches subcommands
52
+ lib/index.js Core library -- format resolution and pipeline
53
+ lib/formats.js Format registry and selection
54
+ lib/formats/ Individual format implementations
55
+ lib/exporters/ Output target adapters (file, clipboard, etc.)
56
+ lib/publishers/ Publishing integrations
57
+ lib/json-ld-common.js Shared JSON-LD vocabulary helpers
58
+ lib/serve-mcp.js MCP (Model Context Protocol) server
59
+ lib/server.js Local preview server (SSE, zero deps)
60
+ public/ Web UI -- format preview and conversion
61
+ site/ Public website (mill.grainulation.com)
62
+ test/ Node built-in test runner tests
63
+ ```
64
+
65
+ The key architectural principle: **mill is a pipeline.** Data flows in as structured claims, passes through a format transform, and exits as the target format. Each format is a pure function: data in, string out.
66
+
67
+ ## Code style
68
+
69
+ - Zero dependencies. If you need something, write it or use Node built-ins.
70
+ - No transpilation. Ship what you write.
71
+ - ESM imports (`import`/`export`). Node 18+ required.
72
+ - Keep functions small. If a function needs a scroll, split it.
73
+ - No emojis in code, CLI output, or generated formats.
74
+
75
+ ## Testing
76
+
77
+ ```bash
78
+ node test/basic.test.js
79
+ ```
80
+
81
+ Tests use Node's built-in test runner. No test framework dependencies.
82
+
83
+ ## Commit messages
84
+
85
+ Follow the existing pattern:
86
+
87
+ ```
88
+ mill: <what changed>
89
+ ```
90
+
91
+ Examples:
92
+
93
+ ```
94
+ mill: add JSON-LD export format
95
+ mill: fix Markdown table alignment in brief output
96
+ mill: update MCP server protocol handling
97
+ ```
98
+
99
+ ## License
100
+
101
+ MIT. See LICENSE for details.
package/README.md CHANGED
@@ -1,69 +1,96 @@
1
- # mill
1
+ <p align="center">
2
+ <img src="site/wordmark.svg" alt="Mill" width="400">
3
+ </p>
2
4
 
3
- Turn sprint evidence into shareable artifacts.
5
+ <p align="center">
6
+ <a href="https://www.npmjs.com/package/@grainulation/mill"><img src="https://img.shields.io/npm/v/@grainulation/mill" alt="npm version"></a> <a href="https://www.npmjs.com/package/@grainulation/mill"><img src="https://img.shields.io/npm/dm/@grainulation/mill" alt="npm downloads"></a> <a href="https://github.com/grainulation/mill/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="license"></a> <a href="https://nodejs.org"><img src="https://img.shields.io/node/v/@grainulation/mill" alt="node"></a> <a href="https://github.com/grainulation/mill/actions"><img src="https://github.com/grainulation/mill/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
7
+ <a href="https://deepwiki.com/grainulation/mill"><img src="https://deepwiki.com/badge.svg" alt="Explore on DeepWiki"></a>
8
+ </p>
4
9
 
5
- ## Quick start
10
+ <p align="center"><strong>Turn sprint evidence into shareable artifacts.</strong></p>
11
+
12
+ 24 export formats. PDF, CSV, Markdown, slides, JSON-LD, Jira, GitHub Issues, and more. Give mill your claims or HTML output and it produces whatever your team needs.
13
+
14
+ ## Install
6
15
 
7
16
  ```bash
8
- # Export a brief to PDF
9
- npx @grainulation/mill export --format pdf output/brief.html
17
+ npm install -g @grainulation/mill
18
+ ```
10
19
 
11
- # Claims to CSV
20
+ Or use directly:
21
+
22
+ ```bash
12
23
  npx @grainulation/mill export --format csv claims.json
24
+ ```
13
25
 
14
- # HTML to clean Markdown
15
- npx @grainulation/mill convert --from html --to markdown output/brief.html
26
+ ## Quick start
16
27
 
17
- # Build a static site from sprint outputs
18
- npx @grainulation/mill publish --target static output/
28
+ ```bash
29
+ # Claims to CSV
30
+ mill export --format csv claims.json
31
+
32
+ # HTML brief to PDF
33
+ mill export --format pdf output/brief.html
34
+
35
+ # HTML to clean Markdown
36
+ mill convert --from html --to markdown output/brief.html
19
37
 
20
38
  # Claims to JSON-LD
21
- npx @grainulation/mill export --format json-ld claims.json -o claims.jsonld
39
+ mill export --format json-ld claims.json -o claims.jsonld
40
+
41
+ # Build a static site from sprint outputs
42
+ mill publish --target static output/
22
43
 
23
44
  # Copy to clipboard
24
- npx @grainulation/mill publish --target clipboard output/brief.html
45
+ mill publish --target clipboard output/brief.html
25
46
  ```
26
47
 
27
48
  ## Export formats
28
49
 
29
- 24 built-in formats in `lib/formats/`. Most commonly used:
30
-
31
- | Format | Input | Output | Notes |
32
- |--------|-------|--------|-------|
33
- | `pdf` | HTML, Markdown | PDF | Uses `npx md-to-pdf` or puppeteer |
34
- | `csv` | claims.json | CSV | Flat columns, semicolon-joined tags |
35
- | `markdown` | HTML | Markdown | Zero-dep tag stripping, handles wheat output |
36
- | `json-ld` | claims.json | JSON-LD | schema.org vocab, wheat namespace |
37
- | `html-report` | claims.json | HTML | Self-contained interactive report |
38
- | `slide-deck` | claims.json | HTML | Scroll-snap presentation |
39
- | `github-issues` | claims.json | JSON | GitHub Issues payloads |
40
- | `jira-csv` | claims.json | CSV | Jira-compatible import |
41
- | `yaml` | claims.json | YAML | YAML export |
42
- | `ndjson` | claims.json | NDJSON | Newline-delimited JSON |
43
-
44
- Run `mill formats` to see all 24 formats and publish targets.
50
+ 24 built-in formats:
51
+
52
+ | Format | Input | Output |
53
+ | ------------------- | -------------- | ----------------------------- |
54
+ | `pdf` | HTML, Markdown | PDF |
55
+ | `csv` | claims.json | CSV |
56
+ | `markdown` | HTML | Markdown |
57
+ | `json-ld` | claims.json | JSON-LD (schema.org) |
58
+ | `html-report` | claims.json | Interactive HTML report |
59
+ | `slide-deck` | claims.json | Scroll-snap HTML presentation |
60
+ | `github-issues` | claims.json | GitHub Issues JSON payloads |
61
+ | `jira-csv` | claims.json | Jira-compatible CSV import |
62
+ | `yaml` | claims.json | YAML |
63
+ | `ndjson` | claims.json | Newline-delimited JSON |
64
+ | `dot` | claims.json | Graphviz DOT |
65
+ | `graphml` | claims.json | GraphML |
66
+ | `bibtex` | claims.json | BibTeX citations |
67
+ | `ris` | claims.json | RIS citations |
68
+ | `rss` | claims.json | RSS feed |
69
+ | `opml` | claims.json | OPML outline |
70
+ | `obsidian` | claims.json | Obsidian vault |
71
+ | `sql` | claims.json | SQL INSERT statements |
72
+ | `typescript-defs` | claims.json | TypeScript type definitions |
73
+ | `executive-summary` | claims.json | Executive summary HTML |
74
+ | `evidence-matrix` | claims.json | Evidence tier matrix |
75
+ | `changelog` | claims.json | Sprint changelog |
76
+ | `sankey` | claims.json | Sankey diagram data |
77
+ | `treemap` | claims.json | Treemap data |
78
+
79
+ Run `mill formats` to see the full list with descriptions.
45
80
 
46
81
  ## Publish targets
47
82
 
48
- | Target | Input | Output | Notes |
49
- |--------|-------|--------|-------|
50
- | `static` | directory | `_site/` | Dark-themed index + copied artifacts |
51
- | `clipboard` | file or dir | clipboard | Uses pbcopy/xclip/clip |
83
+ | Target | Output |
84
+ | ----------- | ------------------------------------ |
85
+ | `static` | Dark-themed static site in `_site/` |
86
+ | `clipboard` | System clipboard (pbcopy/xclip/clip) |
52
87
 
53
- ## Zero dependencies
54
-
55
- Mill has no installed npm dependencies. Heavy operations (PDF generation) run via `npx` on demand, pulling packages only when needed.
56
-
57
- ## Works standalone
58
-
59
- Mill reads sprint output files directly. It does not require wheat to be installed -- give it HTML, Markdown, or claims JSON and it produces shareable formats.
60
-
61
- ## CLI reference
88
+ ## CLI
62
89
 
63
90
  ```
64
91
  mill export --format <fmt> <file> Export to target format
65
- mill publish --target <dest> <dir> Publish sprint outputs
66
92
  mill convert --from <fmt> --to <fmt> <file> Convert between formats
93
+ mill publish --target <dest> <dir> Publish sprint outputs
67
94
  mill formats List available formats
68
95
  mill serve [--port 9094] [--source <dir>] Start the export workbench UI
69
96
  mill serve-mcp Start the MCP server on stdio
@@ -71,6 +98,27 @@ mill serve-mcp Start the MCP server on stdio
71
98
 
72
99
  All commands accept `-o <path>` to set the output location.
73
100
 
101
+ ## Works standalone
102
+
103
+ Mill reads sprint output files directly. It does not require wheat -- give it HTML, Markdown, or claims JSON and it produces shareable formats.
104
+
105
+ ## Zero dependencies
106
+
107
+ Node built-in modules only. Heavy operations (PDF) run via `npx` on demand.
108
+
109
+ ## Part of the grainulation ecosystem
110
+
111
+ | Tool | Role |
112
+ | ------------------------------------------------------------ | ----------------------------------------------------------- |
113
+ | [wheat](https://github.com/grainulation/wheat) | Research engine -- grow structured evidence |
114
+ | [farmer](https://github.com/grainulation/farmer) | Permission dashboard -- approve AI actions in real time |
115
+ | [barn](https://github.com/grainulation/barn) | Shared tools -- templates, validators, sprint detection |
116
+ | **mill** | Format conversion -- export to PDF, CSV, slides, 24 formats |
117
+ | [silo](https://github.com/grainulation/silo) | Knowledge storage -- reusable claim libraries and packs |
118
+ | [harvest](https://github.com/grainulation/harvest) | Analytics -- cross-sprint patterns and prediction scoring |
119
+ | [orchard](https://github.com/grainulation/orchard) | Orchestration -- multi-sprint coordination and dependencies |
120
+ | [grainulation](https://github.com/grainulation/grainulation) | Unified CLI -- single entry point to the ecosystem |
121
+
74
122
  ## License
75
123
 
76
124
  MIT