@keadex/docusaurus-plugin-mina 1.8.0 → 1.10.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 +14 -0
- package/README.md +13 -5
- package/package.json +7 -4
- package/src/index.js +28 -14
- package/src/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.9.0](https://github.com/keadex/keadex/compare/docusaurus-plugin-mina@1.8.0...docusaurus-plugin-mina@1.9.0) (2024-09-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **libs/docusaurus-plugin-mina:** minor change ([bb71c23](https://github.com/keadex/keadex/commit/bb71c238797ac1251f4c44c23167d65b4c53a8c1))
|
|
7
|
+
|
|
8
|
+
# [1.8.0](https://github.com/keadex/keadex/compare/docusaurus-plugin-mina@1.7.0...docusaurus-plugin-mina@1.8.0) (2024-08-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **libs/docusaurus-plugin-mina:** trigger docusaurus plugin release ([cf8be98](https://github.com/keadex/keadex/commit/cf8be988b783eee43b8b1ddcc3860cee77508cfd))
|
|
14
|
+
|
|
1
15
|
# [1.7.0](https://github.com/keadex/keadex/compare/docusaurus-plugin-mina@1.6.0...docusaurus-plugin-mina@1.7.0) (2024-08-15)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -51,6 +51,9 @@ export default config
|
|
|
51
51
|
|
|
52
52
|
### Include the diagram into MDX files
|
|
53
53
|
|
|
54
|
+
> [!WARNING]
|
|
55
|
+
> The `MinaReact` component does not support SSR. Therefore, ensure that it is rendered only on the client side.
|
|
56
|
+
|
|
54
57
|
`my-mina-diagram.mdx`
|
|
55
58
|
|
|
56
59
|
```md
|
|
@@ -60,12 +63,17 @@ sidebar_position: 1
|
|
|
60
63
|
|
|
61
64
|
# My Mina Diagram
|
|
62
65
|
|
|
63
|
-
import
|
|
66
|
+
import BrowserOnly from '@docusaurus/BrowserOnly';
|
|
64
67
|
|
|
65
68
|
<div style={{height: '50rem'}}>
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
<BrowserOnly fallback={<div>Loading...</div>}>
|
|
70
|
+
{() => {
|
|
71
|
+
const MinaReact = require('@keadex/mina-react').default;
|
|
72
|
+
return <MinaReact
|
|
73
|
+
projectRootUrl="https://raw.githubusercontent.com/keadex/keadex/main/examples/mina-react-example/demo_mina_project/Mina%20Demo"
|
|
74
|
+
diagramUrl="https://raw.githubusercontent.com/keadex/keadex/main/examples/mina-react-example/demo_mina_project/Mina%20Demo/diagrams/system-context/demo-diagram"
|
|
75
|
+
/>;
|
|
76
|
+
}}
|
|
77
|
+
</BrowserOnly>
|
|
70
78
|
</div>
|
|
71
79
|
```
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Docusaurus plugin to render C4 Model diagrams created with Keadex Mina.",
|
|
4
4
|
"author": "Keadex <keadex.it@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.10.0",
|
|
7
7
|
"private": false,
|
|
8
8
|
"type": "commonjs",
|
|
9
9
|
"main": "./src/index.js",
|
|
@@ -27,10 +27,13 @@
|
|
|
27
27
|
"mina"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
30
|
+
"bufferutil": "^4.0.8",
|
|
31
|
+
"copy-webpack-plugin": "^12.0.2",
|
|
32
|
+
"node-loader": "^2.0.0",
|
|
33
|
+
"tslib": "^2.6.2",
|
|
34
|
+
"utf-8-validate": "^6.0.4"
|
|
32
35
|
},
|
|
33
36
|
"devDependencies": {
|
|
34
|
-
"@docusaurus/types": "3.
|
|
37
|
+
"@docusaurus/types": "3.5.2"
|
|
35
38
|
}
|
|
36
39
|
}
|
package/src/index.js
CHANGED
|
@@ -8,31 +8,45 @@ function pluginMina({ siteConfig: { themeConfig }, }) {
|
|
|
8
8
|
return {
|
|
9
9
|
name: '@keadex/docusaurus-plugin-mina',
|
|
10
10
|
configureWebpack(config, isServer) {
|
|
11
|
+
const newConfig = {};
|
|
11
12
|
const minaReactPath = (0, path_1.dirname)(require.resolve('@keadex/mina-react', {
|
|
12
13
|
paths: [process.cwd()],
|
|
13
14
|
}));
|
|
14
15
|
if (minaReactPath) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return '[name][ext]';
|
|
24
|
-
},
|
|
16
|
+
newConfig.plugins = [
|
|
17
|
+
new CopyPlugin({
|
|
18
|
+
patterns: [
|
|
19
|
+
{
|
|
20
|
+
context: minaReactPath,
|
|
21
|
+
from: '*.wasm',
|
|
22
|
+
to() {
|
|
23
|
+
return `${config.mode === 'production' ? 'assets/js/' : ''}[name][ext]`;
|
|
25
24
|
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
}),
|
|
28
|
+
];
|
|
30
29
|
}
|
|
31
30
|
else {
|
|
32
31
|
throw new Error('Module @keadex/mina-react not found.');
|
|
33
32
|
}
|
|
33
|
+
if (isServer) {
|
|
34
|
+
newConfig.module = {
|
|
35
|
+
rules: [
|
|
36
|
+
{
|
|
37
|
+
test: /\.node$/,
|
|
38
|
+
loader: 'node-loader',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
newConfig.experiments = {
|
|
44
|
+
asyncWebAssembly: true,
|
|
45
|
+
};
|
|
46
|
+
return newConfig;
|
|
34
47
|
},
|
|
35
48
|
};
|
|
36
49
|
}
|
|
37
50
|
exports.default = pluginMina;
|
|
51
|
+
// trigger
|
|
38
52
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;;AAGtD,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,sDAAsD;;AAGtD,+BAA8B;AAE9B,8DAA8D;AAC9D,MAAM,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAEjD,SAAS,UAAU,CAAC,EAClB,UAAU,EAAE,EAAE,WAAW,EAAE,GACf;IACZ,OAAO;QACL,IAAI,EAAE,gCAAgC;QACtC,gBAAgB,CAAC,MAAM,EAAE,QAAQ;YAC/B,MAAM,SAAS,GAAQ,EAAE,CAAA;YAEzB,MAAM,aAAa,GAAG,IAAA,cAAO,EAC3B,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE;gBACpC,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;aACvB,CAAC,CACH,CAAA;YAED,IAAI,aAAa,EAAE;gBACjB,SAAS,CAAC,OAAO,GAAG;oBAClB,IAAI,UAAU,CAAC;wBACb,QAAQ,EAAE;4BACR;gCACE,OAAO,EAAE,aAAa;gCACtB,IAAI,EAAE,QAAQ;gCACd,EAAE;oCACA,OAAO,GACL,MAAM,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAChD,aAAa,CAAA;gCACf,CAAC;6BACF;yBACF;qBACF,CAAC;iBACH,CAAA;aACF;iBAAM;gBACL,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;aACxD;YAED,IAAI,QAAQ,EAAE;gBACZ,SAAS,CAAC,MAAM,GAAG;oBACjB,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,SAAS;4BACf,MAAM,EAAE,aAAa;yBACtB;qBACF;iBACF,CAAA;aACF;YAED,SAAS,CAAC,WAAW,GAAG;gBACtB,gBAAgB,EAAE,IAAI;aACvB,CAAA;YAED,OAAO,SAAS,CAAA;QAClB,CAAC;KACF,CAAA;AACH,CAAC;AAED,kBAAe,UAAU,CAAA;AAEzB,UAAU"}
|