diff --git a/docs/docs/package.json b/docs/docs/package.json index 2a1b2937..20eb5fa8 100644 --- a/docs/docs/package.json +++ b/docs/docs/package.json @@ -21,7 +21,7 @@ "vitepress": "1.1.4" }, "dependencies": { - "@artalk/plugin-katex": "^0.1.8", + "@artalk/plugin-katex": "^0.1.9", "vue": "^3.4.26" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 621bdd71..6d8844ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -99,8 +99,8 @@ importers: docs/docs: dependencies: '@artalk/plugin-katex': - specifier: ^0.1.8 - version: 0.1.8 + specifier: ^0.1.9 + version: 0.1.9 vue: specifier: ^3.4.26 version: 3.4.26(typescript@5.4.5) @@ -342,6 +342,9 @@ importers: ui/plugin-kit: dependencies: + '@microsoft/api-extractor': + specifier: ^7.46.1 + version: 7.46.2(@types/node@20.12.8) artalk: specifier: workspace:^ version: link:../artalk @@ -349,9 +352,6 @@ importers: specifier: ^1.0.1 version: 1.0.1 devDependencies: - '@microsoft/api-extractor': - specifier: ^7.46.1 - version: 7.46.2(@types/node@20.12.8) esbuild-plugin-raw: specifier: ^0.1.8 version: 0.1.8(esbuild@0.19.12) @@ -457,8 +457,8 @@ packages: '@antfu/utils@0.7.7': resolution: {integrity: sha512-gFPqTG7otEJ8uP6wrhDv6mqwGWYZKNvAcCq6u9hOj0c+IKCEsY4L1oC9trPq2SaWIzAfHvqfBDxF591JkMf+kg==} - '@artalk/plugin-katex@0.1.8': - resolution: {integrity: sha512-LU8Yvg57ODNVLs0F7H6x6ZiSmS+62d9qHjZDWxhRTAgba6cxURBUUgDWxwYvonJBa6q8FKF/2rXCApkKm8VNXg==} + '@artalk/plugin-katex@0.1.9': + resolution: {integrity: sha512-/5GqIMPkQmJq+d5Jwt8z/Otc5/VawnQH1j/wNQU1epEc4sIr7DtHpZ6V3rO4QrN/IbGVJ2xN3BC2V+WlVvA3LA==} '@babel/code-frame@7.24.2': resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} @@ -4827,7 +4827,7 @@ snapshots: '@antfu/utils@0.7.7': {} - '@artalk/plugin-katex@0.1.8': + '@artalk/plugin-katex@0.1.9': dependencies: artalk: 2.8.6 katex: 0.16.10 diff --git a/ui/plugin-katex/package.json b/ui/plugin-katex/package.json index 286a0626..0080cc56 100644 --- a/ui/plugin-katex/package.json +++ b/ui/plugin-katex/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-katex", - "version": "0.1.8", + "version": "0.1.9", "minAppVersion": "2.8.6", "license": "MIT", "description": "The katex plugin for artalk", @@ -14,9 +14,7 @@ "scripts": { "dev": "vite", "build": "vite build", - "serve": "vite preview", - "prepublish": "pnpm build", - "publish": "pnpm publish --access=public" + "serve": "vite preview" }, "dependencies": { "artalk": "workspace:^", diff --git a/ui/plugin-kit/package.json b/ui/plugin-kit/package.json index 8b81813e..9d4ac44a 100644 --- a/ui/plugin-kit/package.json +++ b/ui/plugin-kit/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-kit", - "version": "1.0.0", + "version": "1.0.3", "description": "The plugin kit for Artalk", "type": "module", "main": "dist/main.js", @@ -27,10 +27,10 @@ "license": "MIT", "dependencies": { "artalk": "workspace:^", - "picocolors": "^1.0.1" + "picocolors": "^1.0.1", + "@microsoft/api-extractor": "^7.46.1" }, "devDependencies": { - "@microsoft/api-extractor": "^7.46.1", "esbuild-plugin-raw": "^0.1.8", "tsup": "^8.0.2" } diff --git a/ui/plugin-kit/src/plugin/main.ts b/ui/plugin-kit/src/plugin/main.ts index c4beeec2..74bbd4e2 100644 --- a/ui/plugin-kit/src/plugin/main.ts +++ b/ui/plugin-kit/src/plugin/main.ts @@ -128,6 +128,7 @@ export const ViteArtalkPluginKit = (opts: ViteArtalkPluginKitOptions = {}): Plug preserveSymlinks: false, noEmitOnError: undefined, target: ts.ScriptTarget.ESNext, + moduleResolution: ts.ModuleResolutionKind.Bundler, outDir: '.', declarationDir: '.', } @@ -153,7 +154,7 @@ export const ViteArtalkPluginKit = (opts: ViteArtalkPluginKitOptions = {}): Plug return { code: `${code} // Mount plugin to browser window global - if (window) { + if (typeof window !== 'undefined') { !window.ArtalkPlugins && (window.ArtalkPlugins = {}) window.ArtalkPlugins.${ctx.entryExportName} = ${ctx.entryExportName} window.Artalk?.use(${ctx.entryExportName})