diff --git a/package.json b/package.json index c9eb33f5..b54eca07 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,10 @@ "prettier": "^2.6.2", "ts-node": "^10.7.0", "typedoc": "^0.22.15", - "typescript": "^4.6.3", + "typescript": "^4.6.4", "nyc": "^15.1.0", "rimraf": "^3.0.2", - "dotenv-flow": "^3.2.0" + "dotenv-flow": "^3.2.0", + "glob": "^8.0.1" } } diff --git a/packages/client/src/methods/chats/get-nearby-chats.ts b/packages/client/src/methods/chats/get-nearby-chats.ts index bdd95059..f957e8b1 100644 --- a/packages/client/src/methods/chats/get-nearby-chats.ts +++ b/packages/client/src/methods/chats/get-nearby-chats.ts @@ -2,7 +2,7 @@ import { TelegramClient } from '../../client' import { Chat } from '../../types' import { assertTypeIs } from '../../utils/type-assertion' import { getMarkedPeerId } from '@mtcute/core' -import { tl } from 'packages/tl' +import { tl } from '@mtcute/tl' import { assertIsUpdatesGroup } from '../../utils/updates-utils' /** diff --git a/packages/client/src/types/misc/takeout-session.ts b/packages/client/src/types/misc/takeout-session.ts index e5729055..67b30bf1 100644 --- a/packages/client/src/types/misc/takeout-session.ts +++ b/packages/client/src/types/misc/takeout-session.ts @@ -1,4 +1,4 @@ -import { tl } from 'packages/tl' +import { tl } from '@mtcute/tl' import { TelegramClient } from '../../client' import { makeInspectable } from '../utils' diff --git a/packages/client/src/types/peers/chat-event.ts b/packages/client/src/types/peers/chat-event.ts index 4d1e19e3..2968674b 100644 --- a/packages/client/src/types/peers/chat-event.ts +++ b/packages/client/src/types/peers/chat-event.ts @@ -9,7 +9,7 @@ import { ChatPermissions } from './chat-permissions' import { ChatLocation } from './chat-location' import { ChatInviteLink } from './chat-invite-link' import { PeersIndex } from './index' -import { toggleChannelIdMark } from '../../../../core' +import { toggleChannelIdMark } from '@mtcute/core' export namespace ChatEvent { diff --git a/packages/client/src/types/peers/chat-photo.ts b/packages/client/src/types/peers/chat-photo.ts index 10679fc7..a99a80f0 100644 --- a/packages/client/src/types/peers/chat-photo.ts +++ b/packages/client/src/types/peers/chat-photo.ts @@ -6,7 +6,7 @@ import { strippedPhotoToJpg } from '../../utils/file-utils' import { tdFileId, toFileId, toUniqueFileId } from '@mtcute/file-id' import { MtArgumentError } from '../errors' import Long from 'long' -import { toggleChannelIdMark } from '../../../../core' +import { toggleChannelIdMark } from '@mtcute/core' /** * A size of a chat photo diff --git a/packages/client/src/types/updates/delete-message-update.ts b/packages/client/src/types/updates/delete-message-update.ts index 9994099e..db2308ef 100644 --- a/packages/client/src/types/updates/delete-message-update.ts +++ b/packages/client/src/types/updates/delete-message-update.ts @@ -1,7 +1,7 @@ import { tl } from '@mtcute/tl' import { TelegramClient } from '../../client' import { makeInspectable } from '../utils' -import { toggleChannelIdMark } from '../../../../core' +import { toggleChannelIdMark } from '@mtcute/core' /** * One or more messages were deleted diff --git a/packages/mtproxy/index.ts b/packages/mtproxy/index.ts index ebe871d6..d669979e 100644 --- a/packages/mtproxy/index.ts +++ b/packages/mtproxy/index.ts @@ -6,8 +6,8 @@ import { parseUrlSafeBase64, BaseTcpTransport, TransportState, + tl } from '@mtcute/core' -import { tl } from '@mtcute/tl' import { connect } from 'net' import { FakeTlsPacketCodec, generateFakeTlsHeader } from './fake-tls' diff --git a/packages/tl-utils/package.json b/packages/tl-utils/package.json index 5d2a7986..e79db61e 100644 --- a/packages/tl-utils/package.json +++ b/packages/tl-utils/package.json @@ -16,5 +16,8 @@ }, "dependencies": { "crc-32": "1.2.0" + }, + "devDependencies": { + "@mtcute/tl-runtime": "workspace:^1.0.0" } } diff --git a/packages/tl-utils/src/patch.ts b/packages/tl-utils/src/patch.ts index a43de651..e43c0b00 100644 --- a/packages/tl-utils/src/patch.ts +++ b/packages/tl-utils/src/patch.ts @@ -1,4 +1,4 @@ -import { TlReaderMap, TlWriterMap } from '../../tl-runtime' +import { TlReaderMap, TlWriterMap } from '@mtcute/tl-runtime' import { parseTlToEntries } from './parse' import { generateReaderCodeForTlEntries } from './codegen/reader' import { generateWriterCodeForTlEntries } from './codegen/writer' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 658fe743..08799ef8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,6 +15,7 @@ importers: dotenv-flow: ^3.2.0 eslint: ^7.32.0 eslint-config-prettier: ^8.5.0 + glob: ^8.0.1 mocha: ^9.2.2 node-forge: ^1.3.1 node-gyp: ^9.0.0 @@ -23,7 +24,7 @@ importers: rimraf: ^3.0.2 ts-node: ^10.7.0 typedoc: ^0.22.15 - typescript: ^4.6.3 + typescript: ^4.6.4 dependencies: node-gyp: 9.0.0 devDependencies: @@ -32,20 +33,21 @@ importers: '@types/node': 14.18.16 '@types/node-forge': 1.0.2 '@types/ws': 7.4.7 - '@typescript-eslint/eslint-plugin': 4.33.0_0c49e12669280545a7ea3f36dba6eb0a - '@typescript-eslint/parser': 4.33.0_eslint@7.32.0+typescript@4.6.3 + '@typescript-eslint/eslint-plugin': 4.33.0_5e731fab734ce085fc02cd0ecce6c061 + '@typescript-eslint/parser': 4.33.0_eslint@7.32.0+typescript@4.6.4 chai: 4.3.6 dotenv-flow: 3.2.0 eslint: 7.32.0 eslint-config-prettier: 8.5.0_eslint@7.32.0 + glob: 8.0.1 mocha: 9.2.2 node-forge: 1.3.1 nyc: 15.1.0 prettier: 2.6.2 rimraf: 3.0.2 - ts-node: 10.7.0_2bdaecf545f082851b1b44d411115ce2 - typedoc: 0.22.15_typescript@4.6.3 - typescript: 4.6.3 + ts-node: 10.7.0_63845f5bc9a653846bd58de3c741e587 + typedoc: 0.22.15_typescript@4.6.4 + typescript: 4.6.4 packages/client: specifiers: @@ -249,9 +251,12 @@ importers: packages/tl-utils: specifiers: + '@mtcute/tl-runtime': workspace:^1.0.0 crc-32: 1.2.0 dependencies: crc-32: 1.2.0 + devDependencies: + '@mtcute/tl-runtime': link:../tl-runtime packages: @@ -685,7 +690,7 @@ packages: '@types/node': 14.18.16 dev: true - /@typescript-eslint/eslint-plugin/4.33.0_0c49e12669280545a7ea3f36dba6eb0a: + /@typescript-eslint/eslint-plugin/4.33.0_5e731fab734ce085fc02cd0ecce6c061: resolution: {integrity: sha512-aINiAxGVdOl1eJyVjaWn/YcVAq4Gi/Yo35qHGCnqbWVz61g39D0h23veY/MA0rFFGfxK7TySg2uwDeNv+JgVpg==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -696,8 +701,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/experimental-utils': 4.33.0_eslint@7.32.0+typescript@4.6.3 - '@typescript-eslint/parser': 4.33.0_eslint@7.32.0+typescript@4.6.3 + '@typescript-eslint/experimental-utils': 4.33.0_eslint@7.32.0+typescript@4.6.4 + '@typescript-eslint/parser': 4.33.0_eslint@7.32.0+typescript@4.6.4 '@typescript-eslint/scope-manager': 4.33.0 debug: 4.3.4 eslint: 7.32.0 @@ -705,13 +710,13 @@ packages: ignore: 5.2.0 regexpp: 3.2.0 semver: 7.3.7 - tsutils: 3.21.0_typescript@4.6.3 - typescript: 4.6.3 + tsutils: 3.21.0_typescript@4.6.4 + typescript: 4.6.4 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/experimental-utils/4.33.0_eslint@7.32.0+typescript@4.6.3: + /@typescript-eslint/experimental-utils/4.33.0_eslint@7.32.0+typescript@4.6.4: resolution: {integrity: sha512-zeQjOoES5JFjTnAhI5QY7ZviczMzDptls15GFsI6jyUOq0kOf9+WonkhtlIhh0RgHRnqj5gdNxW5j1EvAyYg6Q==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -720,7 +725,7 @@ packages: '@types/json-schema': 7.0.11 '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 - '@typescript-eslint/typescript-estree': 4.33.0_typescript@4.6.3 + '@typescript-eslint/typescript-estree': 4.33.0_typescript@4.6.4 eslint: 7.32.0 eslint-scope: 5.1.1 eslint-utils: 3.0.0_eslint@7.32.0 @@ -729,7 +734,7 @@ packages: - typescript dev: true - /@typescript-eslint/parser/4.33.0_eslint@7.32.0+typescript@4.6.3: + /@typescript-eslint/parser/4.33.0_eslint@7.32.0+typescript@4.6.4: resolution: {integrity: sha512-ZohdsbXadjGBSK0/r+d87X0SBmKzOq4/S5nzK6SBgJspFo9/CUDJ7hjayuze+JK7CZQLDMroqytp7pOcFKTxZA==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -741,10 +746,10 @@ packages: dependencies: '@typescript-eslint/scope-manager': 4.33.0 '@typescript-eslint/types': 4.33.0 - '@typescript-eslint/typescript-estree': 4.33.0_typescript@4.6.3 + '@typescript-eslint/typescript-estree': 4.33.0_typescript@4.6.4 debug: 4.3.4 eslint: 7.32.0 - typescript: 4.6.3 + typescript: 4.6.4 transitivePeerDependencies: - supports-color dev: true @@ -762,7 +767,7 @@ packages: engines: {node: ^8.10.0 || ^10.13.0 || >=11.10.1} dev: true - /@typescript-eslint/typescript-estree/4.33.0_typescript@4.6.3: + /@typescript-eslint/typescript-estree/4.33.0_typescript@4.6.4: resolution: {integrity: sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA==} engines: {node: ^10.12.0 || >=12.0.0} peerDependencies: @@ -777,8 +782,8 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.3.7 - tsutils: 3.21.0_typescript@4.6.3 - typescript: 4.6.3 + tsutils: 3.21.0_typescript@4.6.4 + typescript: 4.6.4 transitivePeerDependencies: - supports-color dev: true @@ -1897,7 +1902,6 @@ packages: minimatch: 5.0.1 once: 1.4.0 path-is-absolute: 1.0.1 - dev: false /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} @@ -3297,7 +3301,7 @@ packages: resolution: {integrity: sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=} dev: true - /ts-node/10.7.0_2bdaecf545f082851b1b44d411115ce2: + /ts-node/10.7.0_63845f5bc9a653846bd58de3c741e587: resolution: {integrity: sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A==} hasBin: true peerDependencies: @@ -3323,7 +3327,7 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.6.3 + typescript: 4.6.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -3336,14 +3340,14 @@ packages: resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} dev: true - /tsutils/3.21.0_typescript@4.6.3: + /tsutils/3.21.0_typescript@4.6.4: resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} peerDependencies: typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' dependencies: tslib: 1.14.1 - typescript: 4.6.3 + typescript: 4.6.4 dev: true /tunnel-agent/0.6.0: @@ -3380,7 +3384,7 @@ packages: is-typedarray: 1.0.0 dev: true - /typedoc/0.22.15_typescript@4.6.3: + /typedoc/0.22.15_typescript@4.6.4: resolution: {integrity: sha512-CMd1lrqQbFvbx6S9G6fL4HKp3GoIuhujJReWqlIvSb2T26vGai+8Os3Mde7Pn832pXYemd9BMuuYWhFpL5st0Q==} engines: {node: '>= 12.10.0'} hasBin: true @@ -3392,11 +3396,11 @@ packages: marked: 4.0.14 minimatch: 5.0.1 shiki: 0.10.1 - typescript: 4.6.3 + typescript: 4.6.4 dev: true - /typescript/4.6.3: - resolution: {integrity: sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==} + /typescript/4.6.4: + resolution: {integrity: sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==} engines: {node: '>=4.2.0'} hasBin: true dev: true diff --git a/tsconfig.json b/tsconfig.json index ff77a05b..7b675509 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,12 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "target": "es2018", + "target": "es2020", "allowJs": true, "sourceMap": true, "inlineSources": true, - "outDir": "dist", - "baseUrl": ".", "declaration": true, "esModuleInterop": true, "strict": true,