@barzhsieh/nuxt-content-mermaid 1.0.0 → 1.0.1

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/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^4.0.0"
6
6
  },
7
- "version": "1.0.0",
7
+ "version": "1.0.1",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -1,12 +1,6 @@
1
1
  import { defineNuxtModule, createResolver, addPlugin, addComponent, addTypeTemplate } from '@nuxt/kit';
2
2
  import { defu } from 'defu';
3
-
4
- const DEFAULT_IMPORT_SOURCE = "https://cdn.jsdelivr.net/npm/mermaid@11.12.1/dist/mermaid.esm.min.mjs";
5
- const DEFAULT_LIGHT_THEME = "default";
6
- const DEFAULT_DARK_THEME = "dark";
7
- const DEFAULT_MERMAID_INIT = {
8
- startOnLoad: false
9
- };
3
+ import { DEFAULT_MERMAID_INIT, DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, DEFAULT_IMPORT_SOURCE } from '../dist/runtime/constants.js';
10
4
 
11
5
  const MERMAID_BLOCK = /```mermaid([\s\S]*?)```/gi;
12
6
  const DEFAULTS = {
@@ -0,0 +1,5 @@
1
+ import type { MermaidConfig } from 'mermaid';
2
+ export declare const DEFAULT_IMPORT_SOURCE = "https://cdn.jsdelivr.net/npm/mermaid@11.12.1/dist/mermaid.esm.min.mjs";
3
+ export declare const DEFAULT_LIGHT_THEME: MermaidConfig['theme'];
4
+ export declare const DEFAULT_DARK_THEME: MermaidConfig['theme'];
5
+ export declare const DEFAULT_MERMAID_INIT: MermaidConfig;
@@ -0,0 +1,6 @@
1
+ export const DEFAULT_IMPORT_SOURCE = "https://cdn.jsdelivr.net/npm/mermaid@11.12.1/dist/mermaid.esm.min.mjs";
2
+ export const DEFAULT_LIGHT_THEME = "default";
3
+ export const DEFAULT_DARK_THEME = "dark";
4
+ export const DEFAULT_MERMAID_INIT = {
5
+ startOnLoad: false
6
+ };
@@ -2,7 +2,7 @@ import { defineNuxtPlugin, useRuntimeConfig } from "#app";
2
2
  import {
3
3
  DEFAULT_IMPORT_SOURCE,
4
4
  DEFAULT_MERMAID_INIT
5
- } from "../../constants";
5
+ } from "../constants.js";
6
6
  const globalWithLoader = globalThis;
7
7
  const ABSOLUTE_URL_REGEX = /^(?:https?:)?\/\//;
8
8
  function resolveSource(source) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@barzhsieh/nuxt-content-mermaid",
3
- "version": "1.0.0",
4
- "description": "My new Nuxt module",
3
+ "version": "1.0.1",
4
+ "description": "A Nuxt module designed for integrating Mermaid with `@nuxt/content`. It automatically converts `mermaid` code blocks in Markdown into responsive chart components, and supports lazy loading and dark/light theme switching.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/andy820621/nuxt-content-mermaid.git"
@@ -25,6 +25,22 @@
25
25
  "files": [
26
26
  "dist"
27
27
  ],
28
+ "scripts": {
29
+ "prepack": "nuxt-module-build build",
30
+ "dev": "npm run dev:prepare && nuxi dev playground",
31
+ "dev:build": "nuxi build playground",
32
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
33
+ "release:base": "npm run lint && npm run test && npm run prepack",
34
+
35
+ "release:patch": "npm run release:base && changelogen --release --patch --push --publish",
36
+ "release:minor": "npm run release:base && changelogen --release --minor --push --publish",
37
+ "release:major": "npm run release:base && changelogen --release --major --push --publish",
38
+ "release": "npm run release:patch",
39
+ "lint": "eslint .",
40
+ "test": "vitest run",
41
+ "test:watch": "vitest watch",
42
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
43
+ },
28
44
  "dependencies": {
29
45
  "@nuxt/kit": "^4.2.1",
30
46
  "defu": "^6.1.4"
@@ -51,15 +67,5 @@
51
67
  },
52
68
  "volta": {
53
69
  "node": "22.21.1"
54
- },
55
- "scripts": {
56
- "dev": "npm run dev:prepare && nuxi dev playground",
57
- "dev:build": "nuxi build playground",
58
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
59
- "release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
60
- "lint": "eslint .",
61
- "test": "vitest run",
62
- "test:watch": "vitest watch",
63
- "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
64
70
  }
65
- }
71
+ }