From 9651def41591cff87e7446cc19ce1d6eb17ca6fc Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 6 Sep 2023 00:58:33 +0200 Subject: [PATCH 1/5] Fix types --- packages/backend-core/package.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 970a4aab8d..501c42f349 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -3,7 +3,14 @@ "version": "0.0.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/index.js", - "types": "dist/src/index.d.ts", + "typesVersions": { + "*": { + "*": [ + "./dist/index.d.ts", + "./dist/tests/index.d.ts" + ] + } + }, "exports": { ".": "./dist/index.js", "./tests": "./dist/tests/index.js", From b3fc11089957ae739804c2792c56e4e9724db518 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 6 Sep 2023 01:10:30 +0200 Subject: [PATCH 2/5] Fix versions --- packages/backend-core/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 501c42f349..b0b27a7f4b 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -6,7 +6,9 @@ "typesVersions": { "*": { "*": [ - "./dist/index.d.ts", + "./dist/src/index.d.ts" + ], + "tests": [ "./dist/tests/index.d.ts" ] } From 73d9be41616de3d63bde7668a67266d870cba960 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 6 Sep 2023 01:45:59 +0200 Subject: [PATCH 3/5] Allow silent scripts --- packages/backend-core/scripts/build.js | 1 + scripts/build.js | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/backend-core/scripts/build.js b/packages/backend-core/scripts/build.js index 8a15d09708..b40404aade 100644 --- a/packages/backend-core/scripts/build.js +++ b/packages/backend-core/scripts/build.js @@ -17,5 +17,6 @@ for (const file of inputFiles) { skipMeta: true, bundle: false, forcedFormat: "cjs", + silent: true, }) } diff --git a/scripts/build.js b/scripts/build.js index 8356f2e035..a3a377593a 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -15,7 +15,11 @@ const { nodeExternalsPlugin } = require("esbuild-node-externals") 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 tsconfig = argv["p"] || `tsconfig.build.json` 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)}`) } - console.log( - "\x1b[32m%s\x1b[0m", - `Build successfully in ${(Date.now() - start) / 1000} seconds` - ) + !opts.silent && + console.log( + "\x1b[32m%s\x1b[0m", + `Build successfully in ${(Date.now() - start) / 1000} seconds` + ) }) if (metafile) { From 1c8060272d88e46ee70fe0aac18659443d56ed31 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 6 Sep 2023 01:49:54 +0200 Subject: [PATCH 4/5] Fix import --- packages/server/src/tests/utilities/TestConfiguration.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/server/src/tests/utilities/TestConfiguration.ts b/packages/server/src/tests/utilities/TestConfiguration.ts index 81bfa0abbd..4c6d0701f3 100644 --- a/packages/server/src/tests/utilities/TestConfiguration.ts +++ b/packages/server/src/tests/utilities/TestConfiguration.ts @@ -10,7 +10,6 @@ mocks.licenses.useUnlimited() import { init as dbInit } from "../../db" dbInit() import env from "../../environment" -import { env as coreEnv } from "@budibase/backend-core" import { basicTable, basicRow, @@ -33,6 +32,7 @@ import { encryption, auth, roles, + env as coreEnv, } from "@budibase/backend-core" import * as controllers from "./controllers" import { cleanup } from "../../utilities/fileSystem" @@ -51,7 +51,6 @@ import { UserRoles, Automation, } from "@budibase/types" -import { BUILTIN_ROLE_IDS } from "@budibase/backend-core/src/security/roles" 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 () => { const baseGroup = structures.userGroups.userGroup() baseGroup.roles = { From 743fe0e05c722d75a2189ec92cf3f1ae3c94dc55 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Wed, 6 Sep 2023 09:28:57 +0200 Subject: [PATCH 5/5] Keep types field --- packages/backend-core/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index b0b27a7f4b..4267425b84 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -3,11 +3,9 @@ "version": "0.0.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/index.js", + "types": "dist/src/index.d.ts", "typesVersions": { "*": { - "*": [ - "./dist/src/index.d.ts" - ], "tests": [ "./dist/tests/index.d.ts" ]