@tmorin/plantuml-libs 18.1.4 → 18.2.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/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [18.2.0](https://github.com/tmorin/plantuml-libs/compare/v18.1.4...v18.2.0) (2026-08-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * **eip:** refresh the package ([b880bcb](https://github.com/tmorin/plantuml-libs/commit/b880bcb4898d485e54e2166e5772eb93c9278569))
11
+ * **eip:** refresh the package ([f613242](https://github.com/tmorin/plantuml-libs/commit/f6132426064db47a86ff70b748fe111df82007ca))
12
+ * **eip:** refresh the package ([2c75adf](https://github.com/tmorin/plantuml-libs/commit/2c75adfcb6045acb029f5db4b2025ea1c0a45774))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **generator:** resolve TypeScript errors surfaced by TS 6.0.3 ([a0085a2](https://github.com/tmorin/plantuml-libs/commit/a0085a23fcc164e49626f59482eb5575b0b0e331))
18
+ * **test:** stabilize resolver tests ([5fc952b](https://github.com/tmorin/plantuml-libs/commit/5fc952b6e35a851d49d213612dbd80aaa11707b0))
19
+
5
20
  ### [18.1.4](https://github.com/tmorin/plantuml-libs/compare/v18.1.3...v18.1.4) (2026-04-11)
6
21
 
7
22
 
package/CLAUDE.md ADDED
@@ -0,0 +1,66 @@
1
+ # CLAUDE.md
2
+
3
+ Guidance for Claude Code when working in this repository.
4
+
5
+ ## Project
6
+
7
+ `@tmorin/plantuml-libs` — generates PlantUML sprite/icon libraries (AWS, Azure, C4, EIP, Font Awesome, GCP, Material, Simple Icons, etc.) and their documentation website. Node.js CLI entry point: `bin/gdiag.js`.
8
+
9
+ ## Stack
10
+
11
+ - TypeScript, run via `ts-node`, `moduleResolution: Node`. Source uses ESM `import` syntax but the package has no `"type": "module"` and `bin/gdiag.js` uses `require()` — this is CommonJS, not ESM, despite the import syntax.
12
+ - Node.js >=24 <25 (see `engines` in package.json)
13
+ - Mocha + `assert.strict` for tests
14
+ - ESLint flat config (`eslint.config.mjs`) + Prettier (no semicolons, double quotes)
15
+
16
+ Check `package.json` for exact dependency versions rather than assuming.
17
+
18
+ ## Architecture: Library vs Generator
19
+
20
+ - `source/library/` — one factory per technology package (`source/library/packages/{name}/index.ts`), each producing raw PlantUML sprite/icon resources. Packages are independent but follow shared patterns.
21
+ - `source/generator/workdir/` — orchestrates all library packages into a single `.workdir/library.yaml` manifest plus supporting assets. Run: `npm run generate:workdir`
22
+ - `source/generator/website/` — ETL pipeline (Extract → Transform → Load) that turns `.workdir/library.yaml` into the documentation site and `distribution/` output. Each stage implements the generic `Stage<I, O>` interface (`source/generator/website/stage.ts`).
23
+ - Full build: `scripts/generate-library.sh` chains workdir → website → distribution/. Requires Podman/Docker and the `plantuml-generator` image.
24
+ - Single-package build: `scripts/generate-package.sh <package>` (invoked via `npm run generate:package -- -p <package>`) regenerates the workdir then builds just that one package through Podman.
25
+
26
+ ## Code Conventions
27
+
28
+ - Classes: private constructor + static factory, e.g. `static create(...): X`
29
+ - Import aliases for common modules: `import P from "path"`, `import Fe from "fs-extra"`, `import U from "util"`
30
+ - Import order: stdlib → external packages → local modules, no blank lines between groups
31
+ - `readonly` for immutable class properties; interfaces declared inline near their implementation
32
+ - async/await throughout, no callbacks or `.then()` chains
33
+
34
+ ## Testing
35
+
36
+ - Files: `test/*.spec.js` / `test/*.spec.mjs`, run with `npm test`
37
+ - Run one file: `npm test -- test/gdiag.spec.js`
38
+ - Run by pattern: `npm test -- --grep "gdiag"`
39
+ - Test functions must be `async function` (not arrows) to access `this.timeout(...)`
40
+ - AWS/Azure spec files make real network requests — expect them to be slow
41
+ - Clean temp state in `beforeEach()`; use `.tmp/` for scratch output
42
+
43
+ ## Commands
44
+
45
+ ```bash
46
+ npm run generate:workdir # library packages -> .workdir/library.yaml
47
+ npm run generate:website # runs the website ETL stages
48
+ npm run generate:package -- -p aws # regenerate + build a single package (needs Podman)
49
+ scripts/generate-library.sh # full build: workdir -> website -> distribution/ (needs Podman/Docker)
50
+ npm test # mocha
51
+ npm run lint # eslint . (bin/**, test/**, .workdir/**, distribution/** ignored)
52
+ ```
53
+
54
+ ## Versioning & Commits
55
+
56
+ - Semantic Versioning via `standard-version` (`npm run release`)
57
+ - Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/): `type(scope): description` — common types `feat`, `fix`, `refactor`, `chore`, `docs`, `test`
58
+ - Pre-releases: `npm run alpha` (`--prerelease alpha`)
59
+
60
+ ## Package Upgrades
61
+
62
+ Upgrading an icon/shape package (AWS, Azure, EIP, Font Awesome, GCP, Material, Simple Icons) or npm dependencies has a dedicated skill under `.claude/skills/` for each package (e.g. `aws-package-upgrading`, `npm-dependency-management`) — use those rather than improvising the process.
63
+
64
+ ## When in Doubt
65
+
66
+ Match existing patterns in the surrounding file over generic best practices — this codebase has consistent, if unconventional, house style (no semicolons, aliased imports, factory-pattern classes).
package/bin/gdiag.js CHANGED
@@ -3,12 +3,15 @@
3
3
  const P = require("path")
4
4
  const F = require("fs")
5
5
  const CP = require("child_process")
6
- const fetch = require("node-fetch")
6
+ const fetchModule = require("node-fetch")
7
+ const fetch = fetchModule.default ?? fetchModule
7
8
  const moment = require("moment")
8
9
  const glob = require("glob")
9
10
 
10
11
  function getArgs() {
11
- return require("yargs")
12
+ const { hideBin } = require("yargs/helpers")
13
+ const yargs = require("yargs/yargs")
14
+ return yargs(hideBin(process.argv))
12
15
  .scriptName("gdiag")
13
16
  .env("GDIAG_")
14
17
  .option("work-directory", {
Binary file
Binary file
@@ -74,8 +74,10 @@ npm run generate:workdir -- -p eip
74
74
 
75
75
  Check the output:
76
76
  - `.workdir/library.yaml` should list the `eip` package with correct modules and examples
77
- - `.workdir/.cache/eip` should contain all expected shape modules
78
- - Verify the number of items against the previous version (changes indicate new/updated shapes)
77
+ - Verify the total number of items: expected ~61 items across 7 modules
78
+ - `MessageConstruction`, `MessageRouting`, `MessageTransformation`
79
+ - `MessagingChannels`, `MessagingEndpoints`, `MessagingSystems`, `SystemManagement`
80
+ - Changes in item count indicate new/updated shapes from the upstream repository
79
81
 
80
82
  ### 5. Commit and push the branch
81
83
 
@@ -99,26 +101,16 @@ git push -u origin feat/upgrade-eip-icons
99
101
 
100
102
  ### 6. Trigger the Package Builder pipeline
101
103
 
102
- **Primary (MCP)**: Use `github-mcp-server-create_dispatch_event` or similar to trigger the workflow
103
- ```
104
- create_dispatch_event(owner="tmorin", repo="plantuml-libs", event_type="package-builder",
105
- client_payload={"pkgName": "eip", "pkgVersion": "latest", "branch": "feat/upgrade-eip-icons"})
106
- ```
107
-
108
- Alternatively, use the MCP workflow trigger method (check your MCP server's available tools):
109
- ```
110
- trigger_workflow(owner="tmorin", repo="plantuml-libs", workflow_id="package-builder.yaml",
111
- inputs={"pkgName": "eip", "pkgVersion": "latest"}, ref="feat/upgrade-eip-icons")
112
- ```
113
-
114
- **Fallback (CLI)**:
104
+ **Primary (CLI)** (replace `<branch-name>` with your actual branch, e.g. `feat/upgrade-eip-icons`):
115
105
  ```bash
116
106
  gh workflow run package-builder.yaml \
117
107
  -f pkgName=eip \
118
- -f pkgVersion=latest \
119
- --ref feat/upgrade-eip-icons
108
+ --ref <branch-name>
120
109
  ```
121
110
 
111
+ **Manual fallback** (if the CLI returns a 403 or permission error):
112
+ Go to the [Package Builder workflow](https://github.com/tmorin/plantuml-libs/actions/workflows/package-builder.yaml) in the GitHub Actions tab, click **Run workflow**, select your branch, and set `pkgName` to `eip`.
113
+
122
114
  The pipeline will:
123
115
  1. Generate the work directory
124
116
  2. Render all PlantUML diagrams and examples
@@ -130,9 +122,6 @@ Processing typically takes several minutes. Monitor the run at the GitHub Action
130
122
 
131
123
  Once the pipeline completes, pull the generated files:
132
124
 
133
- **Primary (MCP)**: Use `github-mcp-server-get_commit` to verify changes and pull
134
-
135
- **Fallback (CLI)**:
136
125
  ```bash
137
126
  git pull origin feat/upgrade-eip-icons
138
127
  ```
@@ -146,9 +135,9 @@ ls -la distribution/eip/
146
135
  ```
147
136
 
148
137
  Verify:
149
- - `distribution/eip/Item/` - all shapes render correctly as PlantUML files
150
- - `distribution/eip/Group/` - all groups are properly styled
151
- - `distribution/eip/README.md` - auto-generated with updated shape counts
138
+ - `distribution/eip/MessageConstruction/`, `distribution/eip/MessageRouting/`, etc. - all shapes render correctly as PlantUML files
139
+ - Each item has `.puml`, `.Local.puml`, `.Remote.puml`, `.png`, `.Local.png`, `.md`, and Group variants
140
+ - `distribution/eip/README.md` - auto-generated with updated shape counts and module list
152
141
 
153
142
  ### 9. Create a pull request
154
143
 
@@ -220,4 +209,24 @@ Then re-run the pipeline.
220
209
 
221
210
  ---
222
211
 
212
+ ## Lessons Learned
213
+
214
+ ### Workflow Trigger Permissions
215
+
216
+ The Package Builder pipeline uses `workflow_dispatch` which requires the `workflows` scope on the GitHub token. The Copilot agent's token may not have this permission, causing `gh workflow run` to return a 403 error. In that case, the repository maintainer must trigger the pipeline manually via the GitHub Actions UI.
217
+
218
+ ### Workdir Validation is the Key Local Check
219
+
220
+ Running `npm run generate:workdir -- -p eip` is the best local validation. It downloads the upstream shapes, applies the discovery logic, and writes `library.yaml`. Verifying the item counts (expected ~61 items across 7 modules) before pushing gives confidence that the source code is correct.
221
+
222
+ ### Additional Icons Override Upstream Shapes
223
+
224
+ The `source/library/packages/eip/icons/` directory contains hand-crafted SVG files that complement the upstream shapes. The `unifyItems()` call merges additional icons (priority) with upstream shapes, so local icons take precedence when both have the same URN.
225
+
226
+ ### No `.workdir/.cache` Directory
227
+
228
+ Unlike some packages, the EIP workdir does not create a `.cache` directory. Generated artifacts are stored in `.workdir/.tmp/eip/` during the run and only `library.yaml` and `source/` are persisted for the pipeline.
229
+
230
+ ---
231
+
223
232
  This guide keeps maintenance changes small, reviewable, and focused. Always validate locally before pushing to remote.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmorin/plantuml-libs",
3
- "version": "18.1.4",
3
+ "version": "18.2.0",
4
4
  "description": "A set of resources for [PlantUML](https://plantuml.com) to define diagrams for AWS, Azure, EIP ...",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -53,39 +53,44 @@
53
53
  "test": "mocha"
54
54
  },
55
55
  "devDependencies": {
56
- "@eslint/eslintrc": "^3.1.0",
57
- "@types/extract-zip": "^2.0.1",
58
- "@types/fs-extra": "^11.0.1",
59
- "@types/html-minifier-terser": "^7.0.0",
60
- "@types/lodash": "^4.14.176",
56
+ "@eslint/eslintrc": "^3.3.5",
57
+ "@eslint/js": "^10.0.1",
58
+ "@types/extract-zip": "^2.0.3",
59
+ "@types/fs-extra": "^11.0.4",
60
+ "@types/html-minifier-terser": "^7.0.2",
61
+ "@types/lodash": "^4.17.24",
61
62
  "@types/mocha": "^10.0.10",
62
- "@types/node": "^24.12.2",
63
+ "@types/node": "^25.9.1",
63
64
  "@types/node-fetch": "^2.6.13",
64
65
  "@types/yaml": "^1.9.7",
65
- "@types/yargs": "^17.0.5",
66
- "@typescript-eslint/eslint-plugin": "^8.7.0",
67
- "@typescript-eslint/parser": "^8.7.0",
68
- "cheerio": "^1.1.2",
69
- "csv-parse": "^5.0.4",
70
- "eslint": "^9.11.1",
66
+ "@types/yargs": "^17.0.35",
67
+ "@typescript-eslint/eslint-plugin": "^8.60.0",
68
+ "@typescript-eslint/parser": "^8.60.0",
69
+ "cheerio": "^1.2.0",
70
+ "csv-parse": "^6.2.1",
71
+ "eslint": "^10.4.1",
71
72
  "extract-zip": "^2.0.1",
72
- "fs-extra": "^11.1.1",
73
- "html-minifier-terser": "^7.0.0",
74
- "lodash": "^4.17.21",
75
- "marked": "^15.0.6",
76
- "marked-gfm-heading-id": "^4.1.0",
77
- "marked-mangle": "^1.0.1",
78
- "mocha": "^11.7.5",
79
- "node-fetch": "^2.7.0",
80
- "prettier": "^3.0.3",
81
- "standard-version": "^9.3.2",
82
- "ts-node": "^10.4.0",
83
- "typescript": "^5.0.3",
84
- "yaml": "^2.1.1"
73
+ "fs-extra": "^11.3.5",
74
+ "html-minifier-terser": "^7.2.0",
75
+ "lodash": "^4.18.1",
76
+ "marked": "^18.0.4",
77
+ "marked-gfm-heading-id": "^4.1.4",
78
+ "marked-mangle": "^1.1.13",
79
+ "mocha": "^11.7.6",
80
+ "node-fetch": "^3.3.2",
81
+ "prettier": "^3.8.3",
82
+ "standard-version": "^9.5.0",
83
+ "ts-node": "^10.9.2",
84
+ "typescript": "^6.0.3",
85
+ "yaml": "^2.9.0"
85
86
  },
86
87
  "dependencies": {
87
- "glob": "^11.0.0",
88
- "moment": "^2.29.1",
89
- "yargs": "^17.2.1"
88
+ "glob": "^13.0.6",
89
+ "moment": "^2.30.1",
90
+ "yargs": "^18.0.0"
91
+ },
92
+ "overrides": {
93
+ "diff": "^8.0.3",
94
+ "serialize-javascript": "^7.0.5"
90
95
  }
91
96
  }