Merge pull request #11676 from Budibase/fix/backend-core-test-types
Fix backend core test types
This commit is contained in:
commit
a676839793
|
@ -4,6 +4,13 @@
|
||||||
"description": "Budibase backend core libraries used in server and worker",
|
"description": "Budibase backend core libraries used in server and worker",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/src/index.d.ts",
|
"types": "dist/src/index.d.ts",
|
||||||
|
"typesVersions": {
|
||||||
|
"*": {
|
||||||
|
"tests": [
|
||||||
|
"./dist/tests/index.d.ts"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist/index.js",
|
".": "./dist/index.js",
|
||||||
"./tests": "./dist/tests/index.js",
|
"./tests": "./dist/tests/index.js",
|
||||||
|
|
|
@ -17,5 +17,6 @@ for (const file of inputFiles) {
|
||||||
skipMeta: true,
|
skipMeta: true,
|
||||||
bundle: false,
|
bundle: false,
|
||||||
forcedFormat: "cjs",
|
forcedFormat: "cjs",
|
||||||
|
silent: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ mocks.licenses.useUnlimited()
|
||||||
import { init as dbInit } from "../../db"
|
import { init as dbInit } from "../../db"
|
||||||
dbInit()
|
dbInit()
|
||||||
import env from "../../environment"
|
import env from "../../environment"
|
||||||
import { env as coreEnv } from "@budibase/backend-core"
|
|
||||||
import {
|
import {
|
||||||
basicTable,
|
basicTable,
|
||||||
basicRow,
|
basicRow,
|
||||||
|
@ -33,6 +32,7 @@ import {
|
||||||
encryption,
|
encryption,
|
||||||
auth,
|
auth,
|
||||||
roles,
|
roles,
|
||||||
|
env as coreEnv,
|
||||||
} from "@budibase/backend-core"
|
} from "@budibase/backend-core"
|
||||||
import * as controllers from "./controllers"
|
import * as controllers from "./controllers"
|
||||||
import { cleanup } from "../../utilities/fileSystem"
|
import { cleanup } from "../../utilities/fileSystem"
|
||||||
|
@ -51,7 +51,6 @@ import {
|
||||||
UserRoles,
|
UserRoles,
|
||||||
Automation,
|
Automation,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { BUILTIN_ROLE_IDS } from "@budibase/backend-core/src/security/roles"
|
|
||||||
|
|
||||||
import API from "./api"
|
import API from "./api"
|
||||||
|
|
||||||
|
@ -317,7 +316,7 @@ class TestConfiguration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async createGroup(roleId: string = BUILTIN_ROLE_IDS.BASIC) {
|
async createGroup(roleId: string = roles.BUILTIN_ROLE_IDS.BASIC) {
|
||||||
return context.doInTenant(this.tenantId!, async () => {
|
return context.doInTenant(this.tenantId!, async () => {
|
||||||
const baseGroup = structures.userGroups.userGroup()
|
const baseGroup = structures.userGroups.userGroup()
|
||||||
baseGroup.roles = {
|
baseGroup.roles = {
|
||||||
|
|
|
@ -15,7 +15,11 @@ const { nodeExternalsPlugin } = require("esbuild-node-externals")
|
||||||
|
|
||||||
var argv = require("minimist")(process.argv.slice(2))
|
var argv = require("minimist")(process.argv.slice(2))
|
||||||
|
|
||||||
function runBuild(entry, outfile, opts = { skipMeta: false, bundle: true }) {
|
function runBuild(
|
||||||
|
entry,
|
||||||
|
outfile,
|
||||||
|
opts = { skipMeta: false, bundle: true, silent: false }
|
||||||
|
) {
|
||||||
const isDev = process.env.NODE_ENV !== "production"
|
const isDev = process.env.NODE_ENV !== "production"
|
||||||
const tsconfig = argv["p"] || `tsconfig.build.json`
|
const tsconfig = argv["p"] || `tsconfig.build.json`
|
||||||
const tsconfigPathPluginContent = JSON.parse(
|
const tsconfigPathPluginContent = JSON.parse(
|
||||||
|
@ -70,10 +74,11 @@ function runBuild(entry, outfile, opts = { skipMeta: false, bundle: true }) {
|
||||||
fs.copyFileSync(file, `${process.cwd()}/dist/${path.basename(file)}`)
|
fs.copyFileSync(file, `${process.cwd()}/dist/${path.basename(file)}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
!opts.silent &&
|
||||||
"\x1b[32m%s\x1b[0m",
|
console.log(
|
||||||
`Build successfully in ${(Date.now() - start) / 1000} seconds`
|
"\x1b[32m%s\x1b[0m",
|
||||||
)
|
`Build successfully in ${(Date.now() - start) / 1000} seconds`
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
if (metafile) {
|
if (metafile) {
|
||||||
|
|
Loading…
Reference in New Issue