Skip to content

Commit

Permalink
fix: artalk obj not a constructor issue
Browse files Browse the repository at this point in the history
Signed-off-by: qwqcode <qwqcode@gmail.com>
  • Loading branch information
qwqcode committed Sep 26, 2022
1 parent 90e6fa1 commit a1c133c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/artalk-sidebar/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@artalk/artalk-sidebar",
"version": "1.0.0",
"version": "1.0.1",
"license": "LGPL-3.0",
"description": "The sidebar of artalk",
"private": true,
Expand Down
5 changes: 2 additions & 3 deletions packages/artalk-sidebar/src/pages/comments.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { artalk } from '../global'
import { ListLite } from 'artalk'
import Artalk from 'artalk'
import { useNavStore } from '../stores/nav'
import { useUserStore } from '../stores/user'
import { storeToRefs } from 'pinia'
Expand Down Expand Up @@ -38,8 +38,7 @@ onMounted(() => {
})
// 初始化评论列表
const list = new ListLite(artalk!.ctx)
// @ts-ignore
const list = new Artalk.ListLite(artalk!.ctx)
artalk!.ctx.setList(list)
list.flatMode = true
Expand Down
2 changes: 1 addition & 1 deletion packages/artalk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "artalk",
"version": "2.4.0",
"version": "2.4.1",
"backendMinVersion": "2.2.0",
"license": "LGPL-3.0",
"description": "A Selfhosted Comment System",
Expand Down
2 changes: 2 additions & 0 deletions packages/artalk/src/artalk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Context from '~/types/context'
import ConcreteContext from './context'
import defaults from './defaults'

import ListLite from './list/list-lite'
import CheckerLauncher from './lib/checker'
import Editor from './editor'
import List from './list'
Expand All @@ -23,6 +24,7 @@ import * as Stat from './lib/stat'
* @website https://artalk.js.org
*/
export default class Artalk {
public static ListLite = ListLite
public static readonly defaults: ArtalkConfig = defaults

public conf!: ArtalkConfig
Expand Down
3 changes: 0 additions & 3 deletions packages/artalk/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import Artalk from './artalk'
import ListLite from './list/list-lite'

export default Artalk

export { ListLite }
4 changes: 0 additions & 4 deletions packages/artalk/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ export default Utils.mergeDeep(baseConf, defineConfig({
rollupOptions: {
output: {
assetFileNames: (assetInfo) => (/\.css$/.test(assetInfo.name || '') ? "Artalk.css" : "[name].[ext]"),

// Entry module "src/main.ts" is using named and default exports together.
// Consumers of your bundle will have to use `Artalk["default"]` to access the default export
exports: 'named'
}
}
},
Expand Down

0 comments on commit a1c133c

Please sign in to comment.