Skip to content

Commit e11d426

Browse files
committed
deps (vis-network): 9.1.2 → 9.1.9, provide an easy way to update the bundled vis-network lib (fixes #14)
1 parent 3c202ef commit e11d426

File tree

8 files changed

+1195
-28
lines changed

8 files changed

+1195
-28
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@ nodes=Page A, Page B
3131
}}
3232
```
3333

34+
## Updating `vis-network` Library
35+
36+
This extension uses the [`vis-network`](https://www.npmjs.com/package/vis-network) JavaScript library for rendering network diagrams. The version is managed via `npm` and bundled into the extension using a post-install script.
37+
38+
### How It Works
39+
40+
After running `npm install`, the following happens automatically:
41+
42+
1. **Copying Files**
43+
The `copy-files-from-to` tool copies the minified `vis-network` files from `node_modules` to the `resources/visNetwork/` directory:
44+
- `vis-network.min.js`
45+
- `vis-network.min.js.map`
46+
47+
2. **Injecting Comment**
48+
A custom script (`inject-nomin.js`) prepends the line `/*@nomin*/` to `vis-network.min.js`.
49+
This comment prevents MediaWiki's ResourceLoader from re-minifying the file.
50+
51+
### To Update `vis-network`
52+
53+
1. Open `package.json` and change the version under `"vis-network"`
54+
(e.g., `"vis-network": "latest"` or a specific version like `"9.1.9"`).
55+
56+
2. Run:
57+
58+
```bash
59+
npm install
60+
```
61+
3462

3563
## Credits
3664
https://github.com/OpenSemanticLab/mediawiki-extensions-InteractiveSemanticGraph

build

0 commit comments

Comments
 (0)