Skip to content

Commit a1c133c

Browse files
committed
fix: artalk obj not a constructor issue
Signed-off-by: qwqcode <[email protected]>
1 parent 90e6fa1 commit a1c133c

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

packages/artalk-sidebar/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@artalk/artalk-sidebar",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"license": "LGPL-3.0",
55
"description": "The sidebar of artalk",
66
"private": true,

packages/artalk-sidebar/src/pages/comments.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { artalk } from '../global'
3-
import { ListLite } from 'artalk'
3+
import Artalk from 'artalk'
44
import { useNavStore } from '../stores/nav'
55
import { useUserStore } from '../stores/user'
66
import { storeToRefs } from 'pinia'
@@ -38,8 +38,7 @@ onMounted(() => {
3838
})
3939
4040
// 初始化评论列表
41-
const list = new ListLite(artalk!.ctx)
42-
// @ts-ignore
41+
const list = new Artalk.ListLite(artalk!.ctx)
4342
artalk!.ctx.setList(list)
4443
4544
list.flatMode = true

packages/artalk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "artalk",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"backendMinVersion": "2.2.0",
55
"license": "LGPL-3.0",
66
"description": "A Selfhosted Comment System",

packages/artalk/src/artalk.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Context from '~/types/context'
77
import ConcreteContext from './context'
88
import defaults from './defaults'
99

10+
import ListLite from './list/list-lite'
1011
import CheckerLauncher from './lib/checker'
1112
import Editor from './editor'
1213
import List from './list'
@@ -23,6 +24,7 @@ import * as Stat from './lib/stat'
2324
* @website https://artalk.js.org
2425
*/
2526
export default class Artalk {
27+
public static ListLite = ListLite
2628
public static readonly defaults: ArtalkConfig = defaults
2729

2830
public conf!: ArtalkConfig

packages/artalk/src/main.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
import Artalk from './artalk'
2-
import ListLite from './list/list-lite'
32

43
export default Artalk
5-
6-
export { ListLite }

packages/artalk/vite.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ export default Utils.mergeDeep(baseConf, defineConfig({
1818
rollupOptions: {
1919
output: {
2020
assetFileNames: (assetInfo) => (/\.css$/.test(assetInfo.name || '') ? "Artalk.css" : "[name].[ext]"),
21-
22-
// Entry module "src/main.ts" is using named and default exports together.
23-
// Consumers of your bundle will have to use `Artalk["default"]` to access the default export
24-
exports: 'named'
2521
}
2622
}
2723
},

0 commit comments

Comments
 (0)