@alfacapital-tech/c4builder 0.3.0-rc.3 → 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.
- package/README.MD +69 -18
- package/package.json +1 -1
package/README.MD
CHANGED
|
@@ -33,9 +33,11 @@ I strongly encourage people to check them out first but if you want to dive righ
|
|
|
33
33
|
`npm install` (no tag) always installs the latest stable release. Release candidates are
|
|
34
34
|
opt-in only — see [Installing a release candidate](#installing-a-release-candidate).
|
|
35
35
|
|
|
36
|
-
**Requirements:**
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
**Requirements:** Node.js ≥ 20.19. Local diagram generation needs Java 17+: a system
|
|
37
|
+
`java` (`JAVA_HOME`/`PATH`) is used when present, otherwise c4builder downloads a private
|
|
38
|
+
JRE into its cache automatically (`c4builder jre install` pre-warms it, `jre info` shows
|
|
39
|
+
what would be used). Graphviz is **not** required — layout is computed by PlantUML's
|
|
40
|
+
built-in Java engine (Smetana). The PlantUML jar and the diagram font are bundled.
|
|
39
41
|
|
|
40
42
|
With `diagramFormat: png`, diagrams are produced by rasterizing their SVG with
|
|
41
43
|
[`@resvg/resvg-js`](https://github.com/thx/resvg-js) (a bundled dependency, prebuilt
|
|
@@ -62,24 +64,36 @@ A sample project is available at [C4Builder-Demo](https://github.com/adrianvlupu
|
|
|
62
64
|
## Available Commands
|
|
63
65
|
|
|
64
66
|
```bash
|
|
65
|
-
|
|
67
|
+
$ c4builder --help
|
|
66
68
|
Usage: index [options]
|
|
67
69
|
|
|
68
70
|
Options:
|
|
69
|
-
-V, --version
|
|
70
|
-
new
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
71
|
+
-V, --version output the version number
|
|
72
|
+
--new create a new project from template
|
|
73
|
+
--name <name> project name for --new (skips the name prompt)
|
|
74
|
+
-y, --yes non-interactive --new: defaults, no prompts
|
|
75
|
+
(requires --name)
|
|
76
|
+
--force for `jre install`: force JRE download even if
|
|
77
|
+
system java is present
|
|
78
|
+
--config change configuration for the current directory
|
|
79
|
+
-c, --config-file <.c4builder> set the configuration file relative path
|
|
80
|
+
--list display the current configuration
|
|
81
|
+
--reset clear all configuration
|
|
82
|
+
--site serve the generated site
|
|
83
|
+
-w, --watch watch for changes and rebuild
|
|
84
|
+
-o, --open open the generated site in the browser (with
|
|
85
|
+
--site)
|
|
86
|
+
--docs a brief explanation for the available
|
|
87
|
+
configuration options
|
|
88
|
+
--system-fonts render with system fonts instead of the
|
|
89
|
+
bundled one (not deterministic)
|
|
90
|
+
-p, --port <n> port used for serving the generated site
|
|
91
|
+
-h, --help display help for command
|
|
81
92
|
```
|
|
82
93
|
|
|
94
|
+
There is also a `jre` subcommand: `c4builder jre install [--force]` pre-downloads the
|
|
95
|
+
private JRE cache, `c4builder jre info` prints which Java would be used.
|
|
96
|
+
|
|
83
97
|
By default, running `c4builder` will attempt to build the project.
|
|
84
98
|
|
|
85
99
|
If no configuration was set it will ask for it and then do the actual build. Running just `c4builder` after a configuration will no longer show the wizard.
|
|
@@ -217,7 +231,7 @@ The generated markdown file makes for an easy single page readme for the reposit
|
|
|
217
231
|
|
|
218
232
|
### Docsify site with a sidebar
|
|
219
233
|
|
|
220
|
-
After choosing to generate a docsify site, it can be viewed locally by running `c4builder site` and accessing `http://localhost:3000`;
|
|
234
|
+
After choosing to generate a docsify site, it can be viewed locally by running `c4builder --site` and accessing `http://localhost:3000`;
|
|
221
235
|
|
|
222
236
|
The site is minimalistic including only a sidebar with the System/Container/Components hierarchy.
|
|
223
237
|
|
|
@@ -264,6 +278,28 @@ Pre-release builds (`0.x.y-rc.N`) are published under the npm dist-tag `rc` and
|
|
|
264
278
|
|
|
265
279
|
`npm install` without a tag keeps installing the latest stable version.
|
|
266
280
|
|
|
281
|
+
## Docker
|
|
282
|
+
|
|
283
|
+
The image ships everything needed for a build (Node, JRE, PlantUML jar, fonts, D2) —
|
|
284
|
+
mount a project into `/pwd`:
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
docker run --rm -v "$PWD:/pwd" ghcr.io/alfacapital-tech/c4builder:latest c4builder
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Tags (in sync with npm dist-tags):
|
|
291
|
+
|
|
292
|
+
| tag | meaning |
|
|
293
|
+
|---|---|
|
|
294
|
+
| `X.Y.Z`, `sha-…` | immutable releases / commits |
|
|
295
|
+
| `latest` | latest stable release |
|
|
296
|
+
| `rc` | latest release candidate |
|
|
297
|
+
| `edge` | last master commit |
|
|
298
|
+
| `pr-N` | pull request builds |
|
|
299
|
+
|
|
300
|
+
Use the image directly in CI (GitHub Actions, GitLab CI) as the job image — the
|
|
301
|
+
`c4builder` binary is on `PATH`.
|
|
302
|
+
|
|
267
303
|
## Releasing
|
|
268
304
|
|
|
269
305
|
Publishing is triggered by pushing a git tag `v<version>` — pushes/merges to `master` alone
|
|
@@ -291,7 +327,22 @@ Publishes to dist-tag `latest`.
|
|
|
291
327
|
|
|
292
328
|
## v0.3.0
|
|
293
329
|
|
|
294
|
-
|
|
330
|
+
Full TypeScript rewrite (ESM, Node.js ≥ 20.19) with the same CLI and `.c4builder` format.
|
|
331
|
+
|
|
332
|
+
- PlantUML renders via a direct `java` call with the built-in Smetana layout — graphviz
|
|
333
|
+
is no longer needed; the jar is bundled (`vendor/`)
|
|
334
|
+
- Java itself is optional: system java ≥ 17 is used when present, otherwise a private
|
|
335
|
+
JRE is downloaded automatically (`c4builder jre install` / `jre info`)
|
|
336
|
+
- Second diagram backend: [D2](https://d2lang.com) (`.d2` files, optional
|
|
337
|
+
`@terrastruct/d2` dependency, imports supported)
|
|
338
|
+
- `diagramFormat: png` rasterizes SVG with `@resvg/resvg-js` — deterministic PNG for
|
|
339
|
+
PlantUML and D2 alike
|
|
340
|
+
- Bundled Nimbus Sans font for identical diagram geometry everywhere;
|
|
341
|
+
`useSystemFonts` / `--system-fonts` opts out
|
|
342
|
+
- Config is validated (zod): typos and wrong types fail with a clear message
|
|
343
|
+
- Docker image on GHCR with a tag scheme in sync with npm dist-tags (see [Docker](#docker))
|
|
344
|
+
- PDF output removed — use the docsify site or the single/collection markdown outputs
|
|
345
|
+
instead (the `pdf`/`pdfCss` options no longer exist)
|
|
295
346
|
|
|
296
347
|
## v0.2.20
|
|
297
348
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfacapital-tech/c4builder",
|
|
3
|
-
"version": "0.3.0
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A CLI tool designed to compile a folder structure of markdowns and plant uml files into a site, single file markdown or a collection of markdowns with links",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|