fix: import compatibility with ts-node/esm
see https://github.com/TypeStrong/ts-node/issues/1934
This commit is contained in:
parent
392ff5ad2d
commit
0b2ae3aac6
7 changed files with 21 additions and 16 deletions
|
@ -1,4 +1,5 @@
|
|||
const { MemoryStorage } = require('@mtcute/core/storage/memory.js')
|
||||
const { LogManager } = require('@mtcute/core/utils.js')
|
||||
|
||||
exports.getApiParams = () => {
|
||||
if (!process.env.API_ID || !process.env.API_HASH) {
|
||||
|
@ -10,5 +11,6 @@ exports.getApiParams = () => {
|
|||
apiHash: process.env.API_HASH,
|
||||
testMode: true,
|
||||
storage: new MemoryStorage(),
|
||||
logLevel: LogManager.DEBUG,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { MemoryStorage } from '@mtcute/core/storage/memory.js'
|
||||
import { LogManager } from '@mtcute/core/utils.js'
|
||||
|
||||
export const getApiParams = () => {
|
||||
if (!process.env.API_ID || !process.env.API_HASH) {
|
||||
|
@ -10,5 +11,6 @@ export const getApiParams = () => {
|
|||
apiHash: process.env.API_HASH,
|
||||
testMode: true,
|
||||
storage: new MemoryStorage(),
|
||||
logLevel: LogManager.DEBUG,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
/* eslint-disable no-restricted-globals */
|
||||
const cp = require('child_process')
|
||||
|
||||
const { fixForEsm } = require('./build-esm.cjs')
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { BaseTelegramClientOptions } from '@mtcute/core'
|
||||
import { MemoryStorage } from '@mtcute/core/storage/memory.js'
|
||||
import { LogManager } from '@mtcute/core/utils.js'
|
||||
|
||||
export const getApiParams = (): BaseTelegramClientOptions => {
|
||||
if (!process.env.API_ID || !process.env.API_HASH) {
|
||||
|
@ -11,5 +12,6 @@ export const getApiParams = (): BaseTelegramClientOptions => {
|
|||
apiHash: process.env.API_HASH,
|
||||
testMode: true,
|
||||
storage: new MemoryStorage(),
|
||||
logLevel: LogManager.DEBUG,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
"import": "./esm/index.js",
|
||||
"require": "./cjs/index.js"
|
||||
},
|
||||
"./methods/*.js": {
|
||||
"import": "./esm/methods/*.js",
|
||||
"require": "./cjs/methods/*.js"
|
||||
"./methods/*": {
|
||||
"import": "./esm/methods/*",
|
||||
"require": "./cjs/methods/*"
|
||||
},
|
||||
"./utils.js": {
|
||||
"import": "./esm/utils/index.js",
|
||||
|
|
|
@ -27,17 +27,17 @@
|
|||
"import": "./esm/utils/index.js",
|
||||
"require": "./cjs/utils/index.js"
|
||||
},
|
||||
"./utils/crypto/*.js": {
|
||||
"import": "./esm/utils/crypto/*.js",
|
||||
"require": "./cjs/utils/crypto/*.js"
|
||||
"./utils/crypto/*": {
|
||||
"import": "./esm/utils/crypto/*",
|
||||
"require": "./cjs/utils/crypto/*"
|
||||
},
|
||||
"./network/transports/*.js": {
|
||||
"import": "./esm/network/transports/*.js",
|
||||
"require": "./cjs/network/transports/*.js"
|
||||
"./network/transports/*": {
|
||||
"import": "./esm/network/transports/*",
|
||||
"require": "./cjs/network/transports/*"
|
||||
},
|
||||
"./storage/*.js": {
|
||||
"import": "./esm/storage/*.js",
|
||||
"require": "./cjs/storage/*.js"
|
||||
"./storage/*": {
|
||||
"import": "./esm/storage/*",
|
||||
"require": "./cjs/storage/*"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
"import": "./esm/index.js",
|
||||
"require": "./cjs/index.js"
|
||||
},
|
||||
"./plurals/*.js": {
|
||||
"import": "./esm/plurals/*.js",
|
||||
"require": "./cjs/plurals/*.js"
|
||||
"./plurals/*": {
|
||||
"import": "./esm/plurals/*",
|
||||
"require": "./cjs/plurals/*"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue