diff --git a/examples/vue-advanced-chat/src/chatkitty/index.ts b/examples/vue-advanced-chat/src/chatkitty/index.ts index 3bafd564..5011ad29 100644 --- a/examples/vue-advanced-chat/src/chatkitty/index.ts +++ b/examples/vue-advanced-chat/src/chatkitty/index.ts @@ -1,6 +1,6 @@ -import ChatKitty from '@chatkitty/core'; +import ChatKitty from '../../../../libraries/legacy'; -import type { CurrentUser, Channel, Message, User } from '@chatkitty/core'; +import type { CurrentUser, Channel, Message, User } from '../../../../libraries/legacy'; import { parseTimestamp } from '@/utils/dates'; export const chatkitty = ChatKitty.getInstance('afaac908-1db3-4b5c-a7ae-c040b9684403'); diff --git a/examples/vue-advanced-chat/tsconfig.json b/examples/vue-advanced-chat/tsconfig.json index 81e8a347..308a11bd 100644 --- a/examples/vue-advanced-chat/tsconfig.json +++ b/examples/vue-advanced-chat/tsconfig.json @@ -2,7 +2,7 @@ "files": [], "references": [ { - "path": "../../libraries/core" + "path": "../../libraries/legacy" }, { "path": "./tsconfig.app.json" diff --git a/libraries/typescript/download-assets.js b/libraries/core/download-assets.js similarity index 100% rename from libraries/typescript/download-assets.js rename to libraries/core/download-assets.js diff --git a/libraries/core/moon.yml b/libraries/core/moon.yml index 55617fb2..24dcd5ee 100644 --- a/libraries/core/moon.yml +++ b/libraries/core/moon.yml @@ -1,7 +1,15 @@ type: 'library' language: 'typescript' +workspace: + inheritedTasks: + exclude: ['build'] + tasks: build: + command: 'pnpm build' + inputs: + - '@group(app)' + - '@group(sources)' outputs: - - 'esm' + - 'dist' diff --git a/libraries/core/package.json b/libraries/core/package.json index 5381dd63..048de1c2 100644 --- a/libraries/core/package.json +++ b/libraries/core/package.json @@ -1,57 +1,34 @@ { - "name": "@chatkitty/core", - "version": "1.11.0", - "description": "ChatKitty core JS package.", - "keywords": [ - "node", - "lib", - "esm" - ], - "author": "ChatKitty", + "name": "chatkitty", + "version": "2.6.1", + "description": "A powerful tool for integrating chat features into your web applications.", "license": "MIT", - "repository": "https://github.com/ChatKitty/chatkitty-js", - "type": "module", + "files": [ + "dist" + ], + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", "scripts": { + "build": "node download-assets.js", "release": "release-it --ci" }, - "packemon": { - "format": [ - "esm" - ], - "platform": "browser" - }, - "engines": { - "node": ">=14.15.0" - }, - "files": [ - "esm/**/*", - "src/**/*" - ], - "main": "./esm/index.js", - "module": "./esm/index.js", - "types": "./esm/index.d.ts", "exports": { - "./package.json": "./package.json", ".": { - "types": "./esm/index.d.ts", - "import": "./esm/index.js" - } + "import": "./dist/index.mjs", + "require": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./esm": "./dist/index.mjs", + "./cjs": "./dist/index.js", + "./package.json": "./package.json" }, "dependencies": { "@stomp/rx-stomp": "^2.0.0", "@stomp/stompjs": "^7.0.0", - "axios": "^0.27.2", - "base-64": "^1.0.0", - "rxjs": "^7.8.1", - "sockjs-client": "^1.6.1", - "text-encoding-polyfill": "^0.6.7", - "uuid": "^10.0.0" - }, - "devDependencies": { - "@chatkitty/release-config": "workspace:*", - "@types/base-64": "^1.0.2", - "@types/node": "^22.7.5", - "@types/sockjs-client": "^1.5.4", - "@types/uuid": "^10.0.0" + "axios": "^1.5.1", + "lit-html": "^2.7.0", + "rxjs": "^7.2.0", + "uuid": "^9.0.0" } } diff --git a/libraries/core/tsconfig.json b/libraries/core/tsconfig.json index 4b67a05d..294dd2bc 100644 --- a/libraries/core/tsconfig.json +++ b/libraries/core/tsconfig.json @@ -3,11 +3,7 @@ "include": [ "**/*" ], - "references": [ - { - "path": "../../tools/release-config" - } - ], + "references": [], "compilerOptions": { "outDir": "../../.moon/cache/types/libraries/core" } diff --git a/libraries/core/.release-it.cjs b/libraries/legacy/.release-it.cjs similarity index 100% rename from libraries/core/.release-it.cjs rename to libraries/legacy/.release-it.cjs diff --git a/libraries/core/CHANGELOG.md b/libraries/legacy/CHANGELOG.md similarity index 100% rename from libraries/core/CHANGELOG.md rename to libraries/legacy/CHANGELOG.md diff --git a/libraries/core/LICENSE b/libraries/legacy/LICENSE similarity index 100% rename from libraries/core/LICENSE rename to libraries/legacy/LICENSE diff --git a/libraries/core/README.md b/libraries/legacy/README.md similarity index 100% rename from libraries/core/README.md rename to libraries/legacy/README.md diff --git a/libraries/legacy/moon.yml b/libraries/legacy/moon.yml new file mode 100644 index 00000000..55617fb2 --- /dev/null +++ b/libraries/legacy/moon.yml @@ -0,0 +1,7 @@ +type: 'library' +language: 'typescript' + +tasks: + build: + outputs: + - 'esm' diff --git a/libraries/legacy/package.json b/libraries/legacy/package.json new file mode 100644 index 00000000..5381dd63 --- /dev/null +++ b/libraries/legacy/package.json @@ -0,0 +1,57 @@ +{ + "name": "@chatkitty/core", + "version": "1.11.0", + "description": "ChatKitty core JS package.", + "keywords": [ + "node", + "lib", + "esm" + ], + "author": "ChatKitty", + "license": "MIT", + "repository": "https://github.com/ChatKitty/chatkitty-js", + "type": "module", + "scripts": { + "release": "release-it --ci" + }, + "packemon": { + "format": [ + "esm" + ], + "platform": "browser" + }, + "engines": { + "node": ">=14.15.0" + }, + "files": [ + "esm/**/*", + "src/**/*" + ], + "main": "./esm/index.js", + "module": "./esm/index.js", + "types": "./esm/index.d.ts", + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./esm/index.d.ts", + "import": "./esm/index.js" + } + }, + "dependencies": { + "@stomp/rx-stomp": "^2.0.0", + "@stomp/stompjs": "^7.0.0", + "axios": "^0.27.2", + "base-64": "^1.0.0", + "rxjs": "^7.8.1", + "sockjs-client": "^1.6.1", + "text-encoding-polyfill": "^0.6.7", + "uuid": "^10.0.0" + }, + "devDependencies": { + "@chatkitty/release-config": "workspace:*", + "@types/base-64": "^1.0.2", + "@types/node": "^22.7.5", + "@types/sockjs-client": "^1.5.4", + "@types/uuid": "^10.0.0" + } +} diff --git a/libraries/core/src/channel.ts b/libraries/legacy/src/channel.ts similarity index 100% rename from libraries/core/src/channel.ts rename to libraries/legacy/src/channel.ts diff --git a/libraries/core/src/chat-session.ts b/libraries/legacy/src/chat-session.ts similarity index 100% rename from libraries/core/src/chat-session.ts rename to libraries/legacy/src/chat-session.ts diff --git a/libraries/core/src/chatkitty.ts b/libraries/legacy/src/chatkitty.ts similarity index 100% rename from libraries/core/src/chatkitty.ts rename to libraries/legacy/src/chatkitty.ts diff --git a/libraries/core/src/configuration.ts b/libraries/legacy/src/configuration.ts similarity index 100% rename from libraries/core/src/configuration.ts rename to libraries/legacy/src/configuration.ts diff --git a/libraries/core/src/current-user.ts b/libraries/legacy/src/current-user.ts similarity index 100% rename from libraries/core/src/current-user.ts rename to libraries/legacy/src/current-user.ts diff --git a/libraries/core/src/emoji.ts b/libraries/legacy/src/emoji.ts similarity index 100% rename from libraries/core/src/emoji.ts rename to libraries/legacy/src/emoji.ts diff --git a/libraries/core/src/environment/environment.ts b/libraries/legacy/src/environment/environment.ts similarity index 100% rename from libraries/core/src/environment/environment.ts rename to libraries/legacy/src/environment/environment.ts diff --git a/libraries/core/src/environment/index.ts b/libraries/legacy/src/environment/index.ts similarity index 100% rename from libraries/core/src/environment/index.ts rename to libraries/legacy/src/environment/index.ts diff --git a/libraries/core/src/environment/version.ts b/libraries/legacy/src/environment/version.ts similarity index 100% rename from libraries/core/src/environment/version.ts rename to libraries/legacy/src/environment/version.ts diff --git a/libraries/core/src/error.ts b/libraries/legacy/src/error.ts similarity index 100% rename from libraries/core/src/error.ts rename to libraries/legacy/src/error.ts diff --git a/libraries/core/src/event.ts b/libraries/legacy/src/event.ts similarity index 100% rename from libraries/core/src/event.ts rename to libraries/legacy/src/event.ts diff --git a/libraries/core/src/file.ts b/libraries/legacy/src/file.ts similarity index 100% rename from libraries/core/src/file.ts rename to libraries/legacy/src/file.ts diff --git a/libraries/core/src/index.ts b/libraries/legacy/src/index.ts similarity index 100% rename from libraries/core/src/index.ts rename to libraries/legacy/src/index.ts diff --git a/libraries/core/src/keystrokes.ts b/libraries/legacy/src/keystrokes.ts similarity index 100% rename from libraries/core/src/keystrokes.ts rename to libraries/legacy/src/keystrokes.ts diff --git a/libraries/core/src/message.ts b/libraries/legacy/src/message.ts similarity index 100% rename from libraries/core/src/message.ts rename to libraries/legacy/src/message.ts diff --git a/libraries/core/src/model.ts b/libraries/legacy/src/model.ts similarity index 100% rename from libraries/core/src/model.ts rename to libraries/legacy/src/model.ts diff --git a/libraries/core/src/notification.ts b/libraries/legacy/src/notification.ts similarity index 100% rename from libraries/core/src/notification.ts rename to libraries/legacy/src/notification.ts diff --git a/libraries/core/src/observer.ts b/libraries/legacy/src/observer.ts similarity index 100% rename from libraries/core/src/observer.ts rename to libraries/legacy/src/observer.ts diff --git a/libraries/core/src/pagination.ts b/libraries/legacy/src/pagination.ts similarity index 100% rename from libraries/core/src/pagination.ts rename to libraries/legacy/src/pagination.ts diff --git a/libraries/core/src/polyfills/index.js b/libraries/legacy/src/polyfills/index.js similarity index 100% rename from libraries/core/src/polyfills/index.js rename to libraries/legacy/src/polyfills/index.js diff --git a/libraries/core/src/reaction.ts b/libraries/legacy/src/reaction.ts similarity index 100% rename from libraries/core/src/reaction.ts rename to libraries/legacy/src/reaction.ts diff --git a/libraries/core/src/read-receipt.ts b/libraries/legacy/src/read-receipt.ts similarity index 100% rename from libraries/core/src/read-receipt.ts rename to libraries/legacy/src/read-receipt.ts diff --git a/libraries/core/src/result.ts b/libraries/legacy/src/result.ts similarity index 100% rename from libraries/core/src/result.ts rename to libraries/legacy/src/result.ts diff --git a/libraries/core/src/sockjs-client.d.ts b/libraries/legacy/src/sockjs-client.d.ts similarity index 100% rename from libraries/core/src/sockjs-client.d.ts rename to libraries/legacy/src/sockjs-client.d.ts diff --git a/libraries/core/src/stompx.ts b/libraries/legacy/src/stompx.ts similarity index 100% rename from libraries/core/src/stompx.ts rename to libraries/legacy/src/stompx.ts diff --git a/libraries/core/src/thread.ts b/libraries/legacy/src/thread.ts similarity index 100% rename from libraries/core/src/thread.ts rename to libraries/legacy/src/thread.ts diff --git a/libraries/core/src/user-blocked-record.ts b/libraries/legacy/src/user-blocked-record.ts similarity index 100% rename from libraries/core/src/user-blocked-record.ts rename to libraries/legacy/src/user-blocked-record.ts diff --git a/libraries/core/src/user-session.ts b/libraries/legacy/src/user-session.ts similarity index 100% rename from libraries/core/src/user-session.ts rename to libraries/legacy/src/user-session.ts diff --git a/libraries/core/src/user.ts b/libraries/legacy/src/user.ts similarity index 100% rename from libraries/core/src/user.ts rename to libraries/legacy/src/user.ts diff --git a/libraries/core/tsconfig.esm.json b/libraries/legacy/tsconfig.esm.json similarity index 100% rename from libraries/core/tsconfig.esm.json rename to libraries/legacy/tsconfig.esm.json diff --git a/libraries/legacy/tsconfig.json b/libraries/legacy/tsconfig.json new file mode 100644 index 00000000..7da56539 --- /dev/null +++ b/libraries/legacy/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../tsconfig.options.json", + "include": [ + "**/*" + ], + "references": [ + { + "path": "../../tools/release-config" + } + ], + "compilerOptions": { + "outDir": "../../.moon/cache/types/libraries/legacy" + } +} diff --git a/libraries/react/tsconfig.json b/libraries/react/tsconfig.json index 89b2434b..5dede5c3 100644 --- a/libraries/react/tsconfig.json +++ b/libraries/react/tsconfig.json @@ -6,6 +6,9 @@ }, { "path": "./tsconfig.node.json" + }, + { + "path": "../core" } ], "compilerOptions": { diff --git a/libraries/typescript/moon.yml b/libraries/typescript/moon.yml deleted file mode 100644 index 24dcd5ee..00000000 --- a/libraries/typescript/moon.yml +++ /dev/null @@ -1,15 +0,0 @@ -type: 'library' -language: 'typescript' - -workspace: - inheritedTasks: - exclude: ['build'] - -tasks: - build: - command: 'pnpm build' - inputs: - - '@group(app)' - - '@group(sources)' - outputs: - - 'dist' diff --git a/libraries/typescript/package.json b/libraries/typescript/package.json deleted file mode 100644 index 048de1c2..00000000 --- a/libraries/typescript/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "chatkitty", - "version": "2.6.1", - "description": "A powerful tool for integrating chat features into your web applications.", - "license": "MIT", - "files": [ - "dist" - ], - "main": "./dist/index.js", - "module": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "scripts": { - "build": "node download-assets.js", - "release": "release-it --ci" - }, - "exports": { - ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.js", - "types": "./dist/index.d.ts" - }, - "./esm": "./dist/index.mjs", - "./cjs": "./dist/index.js", - "./package.json": "./package.json" - }, - "dependencies": { - "@stomp/rx-stomp": "^2.0.0", - "@stomp/stompjs": "^7.0.0", - "axios": "^1.5.1", - "lit-html": "^2.7.0", - "rxjs": "^7.2.0", - "uuid": "^9.0.0" - } -} diff --git a/libraries/typescript/tsconfig.json b/libraries/typescript/tsconfig.json deleted file mode 100644 index f8c56fc8..00000000 --- a/libraries/typescript/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.options.json", - "include": [ - "**/*" - ], - "references": [], - "compilerOptions": { - "outDir": "../../.moon/cache/types/libraries/typescript" - } -} diff --git a/tsconfig.json b/tsconfig.json index 230ac56a..d219210e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,13 +3,13 @@ "files": [], "references": [ { - "path": "libraries/core" + "path": "libraries/legacy" }, { "path": "libraries/react" }, { - "path": "libraries/typescript" + "path": "libraries/core" }, { "path": "tools/release-config"