@teamflojo/floimg-mermaid 0.1.0 → 0.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/README.md +27 -27
- package/dist/index.d.ts +1 -1
- package/package.json +13 -12
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# floimg-mermaid
|
|
2
2
|
|
|
3
|
-
Mermaid diagram generator for
|
|
3
|
+
Mermaid diagram generator for floimg - create flowcharts, sequence diagrams, class diagrams, and more using Mermaid syntax.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install
|
|
8
|
+
npm install @teamflojo/floimg @teamflojo/floimg-mermaid
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
This will install Mermaid CLI (~50MB including dependencies).
|
|
@@ -13,10 +13,10 @@ This will install Mermaid CLI (~50MB including dependencies).
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
import createClient from '
|
|
17
|
-
import mermaid from '
|
|
16
|
+
import createClient from '@teamflojo/floimg';
|
|
17
|
+
import mermaid from '@teamflojo/floimg-mermaid';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const floimg = createClient({
|
|
20
20
|
store: {
|
|
21
21
|
default: 's3',
|
|
22
22
|
s3: { region: 'us-east-1', bucket: 'my-diagrams' }
|
|
@@ -24,10 +24,10 @@ const imgflo = createClient({
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
// Register the Mermaid generator
|
|
27
|
-
|
|
27
|
+
floimg.registerGenerator(mermaid());
|
|
28
28
|
|
|
29
29
|
// Generate a flowchart
|
|
30
|
-
const diagram = await
|
|
30
|
+
const diagram = await floimg.generate({
|
|
31
31
|
generator: 'mermaid',
|
|
32
32
|
params: {
|
|
33
33
|
code: `
|
|
@@ -42,7 +42,7 @@ const diagram = await imgflo.generate({
|
|
|
42
42
|
});
|
|
43
43
|
|
|
44
44
|
// Upload to S3
|
|
45
|
-
const result = await
|
|
45
|
+
const result = await floimg.save(diagram, './output/flow.svg');
|
|
46
46
|
console.log(result.url);
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -53,7 +53,7 @@ Mermaid supports many diagram types - all available via pass-through syntax:
|
|
|
53
53
|
### Flowchart
|
|
54
54
|
|
|
55
55
|
```typescript
|
|
56
|
-
await
|
|
56
|
+
await floimg.generate({
|
|
57
57
|
generator: 'mermaid',
|
|
58
58
|
params: {
|
|
59
59
|
code: `
|
|
@@ -70,7 +70,7 @@ await imgflo.generate({
|
|
|
70
70
|
### Sequence Diagram
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
await
|
|
73
|
+
await floimg.generate({
|
|
74
74
|
generator: 'mermaid',
|
|
75
75
|
params: {
|
|
76
76
|
code: `
|
|
@@ -86,7 +86,7 @@ await imgflo.generate({
|
|
|
86
86
|
### Class Diagram
|
|
87
87
|
|
|
88
88
|
```typescript
|
|
89
|
-
await
|
|
89
|
+
await floimg.generate({
|
|
90
90
|
generator: 'mermaid',
|
|
91
91
|
params: {
|
|
92
92
|
code: `
|
|
@@ -109,7 +109,7 @@ await imgflo.generate({
|
|
|
109
109
|
### State Diagram
|
|
110
110
|
|
|
111
111
|
```typescript
|
|
112
|
-
await
|
|
112
|
+
await floimg.generate({
|
|
113
113
|
generator: 'mermaid',
|
|
114
114
|
params: {
|
|
115
115
|
code: `
|
|
@@ -128,7 +128,7 @@ await imgflo.generate({
|
|
|
128
128
|
### Entity Relationship Diagram
|
|
129
129
|
|
|
130
130
|
```typescript
|
|
131
|
-
await
|
|
131
|
+
await floimg.generate({
|
|
132
132
|
generator: 'mermaid',
|
|
133
133
|
params: {
|
|
134
134
|
code: `
|
|
@@ -144,7 +144,7 @@ await imgflo.generate({
|
|
|
144
144
|
### Gantt Chart
|
|
145
145
|
|
|
146
146
|
```typescript
|
|
147
|
-
await
|
|
147
|
+
await floimg.generate({
|
|
148
148
|
generator: 'mermaid',
|
|
149
149
|
params: {
|
|
150
150
|
code: `
|
|
@@ -162,7 +162,7 @@ await imgflo.generate({
|
|
|
162
162
|
### Pie Chart
|
|
163
163
|
|
|
164
164
|
```typescript
|
|
165
|
-
await
|
|
165
|
+
await floimg.generate({
|
|
166
166
|
generator: 'mermaid',
|
|
167
167
|
params: {
|
|
168
168
|
code: `
|
|
@@ -178,7 +178,7 @@ await imgflo.generate({
|
|
|
178
178
|
### Git Graph
|
|
179
179
|
|
|
180
180
|
```typescript
|
|
181
|
-
await
|
|
181
|
+
await floimg.generate({
|
|
182
182
|
generator: 'mermaid',
|
|
183
183
|
params: {
|
|
184
184
|
code: `
|
|
@@ -201,7 +201,7 @@ await imgflo.generate({
|
|
|
201
201
|
### Generator Options
|
|
202
202
|
|
|
203
203
|
```typescript
|
|
204
|
-
|
|
204
|
+
floimg.registerGenerator(mermaid({
|
|
205
205
|
theme: 'dark', // Default theme
|
|
206
206
|
backgroundColor: '#1a1a1a', // Default background
|
|
207
207
|
format: 'svg', // 'svg' | 'png'
|
|
@@ -213,7 +213,7 @@ imgflo.registerGenerator(mermaid({
|
|
|
213
213
|
### Per-Diagram Overrides
|
|
214
214
|
|
|
215
215
|
```typescript
|
|
216
|
-
await
|
|
216
|
+
await floimg.generate({
|
|
217
217
|
generator: 'mermaid',
|
|
218
218
|
params: {
|
|
219
219
|
code: '...',
|
|
@@ -238,7 +238,7 @@ await imgflo.generate({
|
|
|
238
238
|
Pass Mermaid config object directly:
|
|
239
239
|
|
|
240
240
|
```typescript
|
|
241
|
-
await
|
|
241
|
+
await floimg.generate({
|
|
242
242
|
generator: 'mermaid',
|
|
243
243
|
params: {
|
|
244
244
|
code: '...',
|
|
@@ -272,7 +272,7 @@ Since this generator uses Mermaid syntax directly, refer to the official Mermaid
|
|
|
272
272
|
### System Architecture
|
|
273
273
|
|
|
274
274
|
```typescript
|
|
275
|
-
const architecture = await
|
|
275
|
+
const architecture = await floimg.generate({
|
|
276
276
|
generator: 'mermaid',
|
|
277
277
|
params: {
|
|
278
278
|
code: `
|
|
@@ -300,7 +300,7 @@ const architecture = await imgflo.generate({
|
|
|
300
300
|
### User Journey
|
|
301
301
|
|
|
302
302
|
```typescript
|
|
303
|
-
const journey = await
|
|
303
|
+
const journey = await floimg.generate({
|
|
304
304
|
generator: 'mermaid',
|
|
305
305
|
params: {
|
|
306
306
|
code: `
|
|
@@ -321,12 +321,12 @@ const journey = await imgflo.generate({
|
|
|
321
321
|
### Mind Map
|
|
322
322
|
|
|
323
323
|
```typescript
|
|
324
|
-
const mindMap = await
|
|
324
|
+
const mindMap = await floimg.generate({
|
|
325
325
|
generator: 'mermaid',
|
|
326
326
|
params: {
|
|
327
327
|
code: `
|
|
328
328
|
mindmap
|
|
329
|
-
root((
|
|
329
|
+
root((floimg))
|
|
330
330
|
Generators
|
|
331
331
|
Shapes
|
|
332
332
|
OpenAI
|
|
@@ -349,7 +349,7 @@ const mindMap = await imgflo.generate({
|
|
|
349
349
|
|
|
350
350
|
```typescript
|
|
351
351
|
// Returns scalable vector graphic
|
|
352
|
-
const svg = await
|
|
352
|
+
const svg = await floimg.generate({
|
|
353
353
|
generator: 'mermaid',
|
|
354
354
|
params: { code: '...', format: 'svg' }
|
|
355
355
|
});
|
|
@@ -359,7 +359,7 @@ const svg = await imgflo.generate({
|
|
|
359
359
|
|
|
360
360
|
```typescript
|
|
361
361
|
// Returns raster image
|
|
362
|
-
const png = await
|
|
362
|
+
const png = await floimg.generate({
|
|
363
363
|
generator: 'mermaid',
|
|
364
364
|
params: {
|
|
365
365
|
code: '...',
|
|
@@ -421,6 +421,6 @@ MIT
|
|
|
421
421
|
|
|
422
422
|
## See Also
|
|
423
423
|
|
|
424
|
-
- [
|
|
424
|
+
- [floimg](https://github.com/bcooke/floimg) - Core library
|
|
425
425
|
- [Mermaid](https://mermaid.js.org) - Diagram library
|
|
426
426
|
- [Mermaid Live Editor](https://mermaid.live) - Test diagrams
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const mermaidSchema: GeneratorSchema;
|
|
|
7
7
|
* Mermaid diagram generator - creates diagrams using Mermaid syntax
|
|
8
8
|
*
|
|
9
9
|
* This generator accepts Mermaid diagram syntax directly (pass-through pattern).
|
|
10
|
-
* No
|
|
10
|
+
* No floimg abstraction - you get full Mermaid capabilities.
|
|
11
11
|
*
|
|
12
12
|
* @see https://mermaid.js.org/intro/ - Mermaid documentation
|
|
13
13
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamflojo/floimg-mermaid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Mermaid diagram generator for floimg - create flowcharts, sequence diagrams, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
"README.md",
|
|
17
17
|
"LICENSE"
|
|
18
18
|
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc",
|
|
21
|
+
"dev": "tsc --watch",
|
|
22
|
+
"test": "vitest",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"clean": "rm -rf dist",
|
|
25
|
+
"postinstall": "puppeteer browsers install chrome",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
19
28
|
"keywords": [
|
|
20
29
|
"floimg",
|
|
21
30
|
"mermaid",
|
|
@@ -41,19 +50,11 @@
|
|
|
41
50
|
},
|
|
42
51
|
"devDependencies": {
|
|
43
52
|
"@types/node": "^22.10.2",
|
|
53
|
+
"@teamflojo/floimg": "workspace:*",
|
|
44
54
|
"typescript": "^5.7.2",
|
|
45
|
-
"vitest": "^2.1.8"
|
|
46
|
-
"@teamflojo/floimg": "0.1.0"
|
|
55
|
+
"vitest": "^2.1.8"
|
|
47
56
|
},
|
|
48
57
|
"engines": {
|
|
49
58
|
"node": ">=18.0.0"
|
|
50
|
-
},
|
|
51
|
-
"scripts": {
|
|
52
|
-
"build": "tsc",
|
|
53
|
-
"dev": "tsc --watch",
|
|
54
|
-
"test": "vitest",
|
|
55
|
-
"typecheck": "tsc --noEmit",
|
|
56
|
-
"clean": "rm -rf dist",
|
|
57
|
-
"postinstall": "puppeteer browsers install chrome"
|
|
58
59
|
}
|
|
59
|
-
}
|
|
60
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Brett Cooke
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|