Skip to content

Commit

Permalink
fix: chatwoot
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Mar 28, 2023
1 parent 38caafe commit 421d443
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ npm add @productdevbook/chatwoot
add Main.ts

```ts
import { createChatWoot } from '@productdevbook/chatwoot/vue'
const chatwoot = createChatWoot({
init: {
websiteToken: 'b6BejyTTuxF4yPt61ZTZHjdB'
Expand All @@ -61,7 +62,7 @@ app.use(chatwoot)
```ts
export default defineNuxtConfig({
modules: [
'@productdevbook/chatwoot/nuxt'
'@productdevbook/chatwoot'
],

chatwoot: {
Expand Down
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const externals = [
]

export default defineBuildConfig({
entries: ['src/index', 'src/module'],
clean: true,
declaration: true,
externals,
outDir: 'dist',
})
5 changes: 1 addition & 4 deletions demo/nuxt3/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { } from '@productdevbook/chatwoot/nuxt'

export default defineNuxtConfig({
modules: [
'@productdevbook/chatwoot/nuxt',
'@productdevbook/chatwoot',
],

chatwoot: {
init: {
websiteToken: 'b6BejyTTuxF4yPt61ZTZHjdB',
Expand Down
2 changes: 1 addition & 1 deletion demo/vue3/chatwoot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createChatWoot } from '@productdevbook/chatwoot'
import { createChatWoot } from '@productdevbook/chatwoot/vue'

export default createChatWoot({
init: {
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs"
},
"./nuxt": {
"types": "./dist/types.d.ts",
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
},
"./vue": {
"types": "./dist/runtime/vue/index.d.ts",
"import": "./dist/runtime/vue/index.mjs"
},
"./*": "./*"
},
"main": "dist/index.mjs",
"types": "./dist/index.d.ts",
"main": "./dist/module.cjs",
"types": "./dist/types.d.ts",
"typesVersions": {
"*": {
"*": [
Expand Down Expand Up @@ -91,4 +91,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@nuxt/kit'
import defu from 'defu'
import { name, version } from '../package.json'
import type { OptionPlugin } from '.'
import type { OptionPlugin } from './runtime/vue'

export interface ModuleOptions extends OptionPlugin {}

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/useChatWoot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useChatWoot as ChatWoot } from '../../index'
import { useChatWoot as ChatWoot } from '../vue/index'
export function useChatWoot(
) {
return ChatWoot()
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createChatWoot } from '../index'
import { createChatWoot } from './vue'

import { defineNuxtPlugin, useRuntimeConfig } from '#app'

Expand Down
4 changes: 2 additions & 2 deletions src/index.ts → src/runtime/vue/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export { useChatWoot, createChatWoot } from './plugin'
export { useChatWoot, createChatWoot } from './vue'
export type {
OptionPlugin,
ChatwootSettings,
ChatwootSetUserProps,
Chatwoot,
ChatwootSdk,
} from './plugin'
} from './vue'
File renamed without changes.

0 comments on commit 421d443

Please sign in to comment.