PR comments - still experiencing build issues.

This commit is contained in:
mike12345567 2022-11-17 13:31:54 +00:00
parent 242a529b2e
commit 4c44b7a224
14 changed files with 21 additions and 19 deletions

View File

@ -1,7 +1,7 @@
import { AsyncLocalStorage } from "async_hooks"
import { ContextMap } from "./constants"
export class Context {
export default class Context {
static storage = new AsyncLocalStorage<ContextMap>()
static run(context: ContextMap, func: any) {

View File

@ -8,7 +8,7 @@ import {
getDB,
PouchLike,
} from "../db"
import { Context } from "./localStorage"
import Context from "./Context"
import { IdentityContext } from "@budibase/types"
import { DEFAULT_TENANT_ID as _DEFAULT_TENANT_ID } from "../constants"
import { ContextMap } from "./constants"

View File

@ -1,4 +1,4 @@
export * from "./connections"
export * from "./pouchLike"
export * from "./PouchLike"
export * from "./utils"
export { init, getPouch, getPouchDB, closePouchDB } from "./pouchDB"

View File

@ -5,3 +5,4 @@ export * from "./views"
export * from "./constants"
export * from "./conversions"
export * from "./tenancy"
export { PouchLike } from "./couch"

View File

@ -21,10 +21,9 @@ import * as middleware from "./middleware"
import plugins from "./plugin"
import encryption from "./security/encryption"
import * as queue from "./queue"
import * as types from "./types"
import * as db from "./db"
// mimic the outer package exports
import * as db from "./db"
import * as objectStore from "./pkg/objectStore"
import * as utils from "./pkg/utils"
import redis from "./pkg/redis"
@ -68,7 +67,6 @@ const core = {
encryption,
queue,
permissions,
...types,
}
export = core

View File

@ -1 +0,0 @@
export { PouchLike } from "./db"

View File

@ -3,9 +3,9 @@ import {
getUsersByAppParams,
getProdAppID,
generateAppUserID,
} from "./db/utils"
import { queryGlobalView } from "./db/views"
import { UNICODE_MAX } from "./db/constants"
queryGlobalView,
UNICODE_MAX,
} from "./db"
import { BulkDocsResponse, User } from "@budibase/types"
import { getGlobalDB } from "./context"

View File

@ -12,7 +12,7 @@
"sourceMap": true,
"declaration": true,
"types": [ "node", "jest" ],
"outDir": "dist"
"outDir": "dist",
},
"include": [
"**/*.js",

View File

@ -9,9 +9,13 @@ import {
checkDebounce,
setDebounce,
} from "../utilities/redis"
import { db as dbCore, cache, permissions } from "@budibase/backend-core"
import {
db as dbCore,
cache,
permissions,
PouchLike,
} from "@budibase/backend-core"
import { BBContext } from "@budibase/types"
import { PouchLike } from "@budibase/backend-core/src/db"
const DEBOUNCE_TIME_SEC = 30

View File

@ -3,7 +3,7 @@ import { BBContext } from "@budibase/types"
// if added as a middleware will stop requests unless builder is in self host mode
// or cloud is in self host
module.exports = async (ctx: BBContext, next: any) => {
export = async (ctx: BBContext, next: any) => {
if (env.SELF_HOSTED) {
await next()
return

View File

@ -479,7 +479,7 @@ export const bulkDelete = async (
(user: RowResponse<User>) => {
return user.doc
}
) as User[]
)
// Delete from DB
const toDelete = usersToDelete.map(user => ({

View File

@ -142,7 +142,7 @@ async function buildEmail(
* @return {Promise<object|null>} returns the SMTP configuration if it exists
*/
async function getSmtpConfiguration(
db: PouchLike,
db: dbCore.PouchLike,
workspaceId?: string,
automation?: boolean
) {

View File

@ -1,17 +1,17 @@
{
"compilerOptions": {
"target": "es6",
"skipLibCheck": true,
"module": "commonjs",
"lib": ["es2020"],
"allowJs": true,
"outDir": "dist",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"types": [ "node", "jest"],
"types": [ "node", "jest" ],
"outDir": "dist",
"skipLibCheck": true
},
"include": [
"src/**/*"