From 70f505d562a804eeee0cda068164860d60c9477f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Tue, 25 Jul 2023 17:03:44 +0100 Subject: [PATCH 01/20] Update helm chart to expose OFFLINE_MODE env var --- charts/budibase/templates/app-service-deployment.yaml | 2 ++ charts/budibase/templates/worker-service-deployment.yaml | 2 ++ charts/budibase/values.yaml | 1 + 3 files changed, 5 insertions(+) diff --git a/charts/budibase/templates/app-service-deployment.yaml b/charts/budibase/templates/app-service-deployment.yaml index 2b2589406a..a1d4753cdb 100644 --- a/charts/budibase/templates/app-service-deployment.yaml +++ b/charts/budibase/templates/app-service-deployment.yaml @@ -120,6 +120,8 @@ spec: {{ end }} - name: MULTI_TENANCY value: {{ .Values.globals.multiTenancy | quote }} + - name: OFFLINE_MODE + value: {{ .Values.globals.offlineMode | quote }} - name: LOG_LEVEL value: {{ .Values.services.apps.logLevel | quote }} - name: REDIS_PASSWORD diff --git a/charts/budibase/templates/worker-service-deployment.yaml b/charts/budibase/templates/worker-service-deployment.yaml index 5fed80b355..3d1a7369c9 100644 --- a/charts/budibase/templates/worker-service-deployment.yaml +++ b/charts/budibase/templates/worker-service-deployment.yaml @@ -116,6 +116,8 @@ spec: value: {{ .Values.services.worker.port | quote }} - name: MULTI_TENANCY value: {{ .Values.globals.multiTenancy | quote }} + - name: OFFLINE_MODE + value: {{ .Values.globals.offlineMode | quote }} - name: LOG_LEVEL value: {{ .Values.services.worker.logLevel | quote }} - name: REDIS_PASSWORD diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml index 74e4c52654..bed92bfe05 100644 --- a/charts/budibase/values.yaml +++ b/charts/budibase/values.yaml @@ -82,6 +82,7 @@ globals: posthogToken: "phc_bIjZL7oh2GEUd2vqvTBH8WvrX0fWTFQMs6H5KQxiUxU" selfHosted: "1" # set to 0 for budibase cloud environment, set to 1 for self-hosted setup multiTenancy: "0" # set to 0 to disable multiple orgs, set to 1 to enable multiple orgs + offlineMode: "0" # set to 1 to enable offline mode accountPortalUrl: "" accountPortalApiKey: "" cookieDomain: "" From ac5ce13f80cdbb8e80e2b3b460888dd3c7fc8fcc Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Aug 2023 10:59:42 +0100 Subject: [PATCH 02/20] debug log for automation ID --- packages/server/src/threads/automation.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 9831a96936..7d4a0f1dd1 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -486,6 +486,7 @@ class Orchestrator { const end = performance.now() const executionTime = end - start + console.debug(`[Automation ID]: ${automation._id} completed`) console.info(`Execution time: ${executionTime} milliseconds`, { _logKey: "automation", executionTime, From e991a0bd9cc50cfdaf184762491a682448cb74c9 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 11:26:11 +0000 Subject: [PATCH 03/20] Bump version to 2.8.32 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 238a2a2192..84d2a24b86 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.32-alpha.1", + "version": "2.8.32", "npmClient": "yarn", "packages": [ "packages/*" From 14785ca49ddf158d3f29aca5dc855b609b7e261b Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Aug 2023 12:36:19 +0100 Subject: [PATCH 04/20] move to info log line --- packages/server/src/threads/automation.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index 7d4a0f1dd1..e06abcb665 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -486,8 +486,7 @@ class Orchestrator { const end = performance.now() const executionTime = end - start - console.debug(`[Automation ID]: ${automation._id} completed`) - console.info(`Execution time: ${executionTime} milliseconds`, { + console.info(`Automation ID: ${automation._id} Execution time: ${executionTime} milliseconds`, { _logKey: "automation", executionTime, }) From aed1874ef01613348d79f46e57b0dfba68f59bc0 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 11:51:58 +0000 Subject: [PATCH 05/20] Bump version to 2.9.0 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 84d2a24b86..15fea034e6 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.8.32", + "version": "2.9.0", "npmClient": "yarn", "packages": [ "packages/*" From b7810f915e89b40020d643738f00d5cb8b9d55d6 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Aug 2023 12:55:28 +0100 Subject: [PATCH 06/20] fix lint --- packages/server/src/threads/automation.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/server/src/threads/automation.ts b/packages/server/src/threads/automation.ts index e06abcb665..bc0629a939 100644 --- a/packages/server/src/threads/automation.ts +++ b/packages/server/src/threads/automation.ts @@ -486,10 +486,13 @@ class Orchestrator { const end = performance.now() const executionTime = end - start - console.info(`Automation ID: ${automation._id} Execution time: ${executionTime} milliseconds`, { - _logKey: "automation", - executionTime, - }) + console.info( + `Automation ID: ${automation._id} Execution time: ${executionTime} milliseconds`, + { + _logKey: "automation", + executionTime, + } + ) // store the logs for the automation run try { From 9bc008012d983068f476f46da8832ca7bd628129 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Mon, 7 Aug 2023 15:23:12 +0300 Subject: [PATCH 07/20] Update master pipeline to fix the current tag issue --- .github/workflows/release-master.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 7f8b8f1d55..4d836aa9e4 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -61,8 +61,8 @@ jobs: id: currenttag run: | version=v$(./scripts/getCurrentVersion.sh) - echo 'Using tag $version' - echo "::set-output name=tag::$resversionult" + echo "Using tag $version" + echo "version=$version" >> "$GITHUB_OUTPUT" - name: Build/release Docker images run: | @@ -71,7 +71,7 @@ jobs: env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} - BUDIBASE_RELEASE_VERSION: ${{ steps.currenttag.outputs.tag }} + BUDIBASE_RELEASE_VERSION: ${{ steps.currenttag.outputs.version }} release-helm-chart: needs: [release-images] From 4c9dfb85c81df20e697cf4772b2c35a5dad8052f Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 12:24:52 +0000 Subject: [PATCH 08/20] Bump version to 2.9.1 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 15fea034e6..911fd037d1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.0", + "version": "2.9.1", "npmClient": "yarn", "packages": [ "packages/*" From 889face88cb4bd9b6d944b8cdb7f13bb4b8ca40c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 7 Aug 2023 14:30:10 +0100 Subject: [PATCH 09/20] remove v from tagging --- .github/workflows/release-master.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-master.yml b/.github/workflows/release-master.yml index 4d836aa9e4..1dae4ae578 100644 --- a/.github/workflows/release-master.yml +++ b/.github/workflows/release-master.yml @@ -60,7 +60,7 @@ jobs: - name: "Get Current tag" id: currenttag run: | - version=v$(./scripts/getCurrentVersion.sh) + version=$(./scripts/getCurrentVersion.sh) echo "Using tag $version" echo "version=$version" >> "$GITHUB_OUTPUT" From e6196e5da63173a87de3608d094a842c628e4e62 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 13:30:34 +0000 Subject: [PATCH 10/20] Bump version to 2.9.2 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 911fd037d1..6a55972a43 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.1", + "version": "2.9.2", "npmClient": "yarn", "packages": [ "packages/*" From a2bf1e27fbcbff974432179ca56d2fbe05428a36 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 15:39:06 +0000 Subject: [PATCH 11/20] Bump version to 2.9.3 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 6a55972a43..14d17b0909 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.2", + "version": "2.9.3", "npmClient": "yarn", "packages": [ "packages/*" From 62b724400a4f7997c8c01de08257b199c2baf74a Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 15:55:09 +0000 Subject: [PATCH 12/20] Bump version to 2.9.4 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 14d17b0909..0aaf9376d5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.3", + "version": "2.9.4", "npmClient": "yarn", "packages": [ "packages/*" From 986939b85d4bb186258a370d95931b8a742ffcf9 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Aug 2023 17:44:44 +0100 Subject: [PATCH 13/20] Fix for DS+ unable to patch rows correctly. --- packages/server/src/api/controllers/row/external.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/server/src/api/controllers/row/external.ts b/packages/server/src/api/controllers/row/external.ts index 802c70b6cb..3ee4ca6edd 100644 --- a/packages/server/src/api/controllers/row/external.ts +++ b/packages/server/src/api/controllers/row/external.ts @@ -44,7 +44,7 @@ export async function handleRequest( export async function patch(ctx: UserCtx) { const tableId = ctx.params.tableId - const { id, ...rowData } = ctx.request.body + const { _id, ...rowData } = ctx.request.body const validateResult = await sdk.rows.utils.validate({ row: rowData, @@ -54,10 +54,10 @@ export async function patch(ctx: UserCtx) { throw { validation: validateResult.errors } } const response = await handleRequest(Operation.UPDATE, tableId, { - id: breakRowIdField(id), + id: breakRowIdField(_id), row: rowData, }) - const row = await sdk.rows.external.getRow(tableId, id, { + const row = await sdk.rows.external.getRow(tableId, _id, { relationships: true, }) const table = await sdk.tables.getTable(tableId) @@ -104,9 +104,9 @@ export async function find(ctx: UserCtx) { export async function destroy(ctx: UserCtx) { const tableId = ctx.params.tableId - const id = ctx.request.body._id + const _id = ctx.request.body._id const { row } = (await handleRequest(Operation.DELETE, tableId, { - id: breakRowIdField(id), + id: breakRowIdField(_id), includeSqlRelationships: IncludeRelationship.EXCLUDE, })) as { row: Row } return { response: { ok: true }, row } From b367c7cbe40fc08e0e0247f42299d5e259d095de Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 16:59:41 +0000 Subject: [PATCH 14/20] Bump version to 2.9.5 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 0aaf9376d5..660ac559ab 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.4", + "version": "2.9.5", "npmClient": "yarn", "packages": [ "packages/*" From 4d0c7e56e17c5f7917bbde00a38a75f494ead152 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Aug 2023 19:03:23 +0100 Subject: [PATCH 15/20] Utilising esbuild for the CLI to bundle in backend-core and types as required. --- packages/cli/package.json | 6 +++--- packages/cli/tsconfig.build.json | 7 ++++++- packages/cli/tsconfig.json | 7 +------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index cb59bf7c69..76780acf30 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -2,16 +2,16 @@ "name": "@budibase/cli", "version": "0.0.0", "description": "Budibase CLI, for developers, self hosting and migrations.", - "main": "dist/src/index.js", + "main": "dist/index.js", "bin": { - "budi": "dist/src/index.js" + "budi": "dist/index.js" }, "author": "Budibase", "license": "GPL-3.0", "scripts": { "prebuild": "rm -rf prebuilds 2> /dev/null && cp -r ../../node_modules/leveldown/prebuilds prebuilds", "rename": "renamer --find .node --replace .fake 'prebuilds/**'", - "tsc": "tsc -p tsconfig.build.json", + "tsc": "node ../../scripts/build.js", "pkg": "pkg . --out-path build --no-bytecode --public --public-packages \"*\" -C GZip", "build": "yarn prebuild && yarn rename && yarn tsc && yarn pkg && yarn postbuild", "check:types": "tsc -p tsconfig.json --noEmit --paths null", diff --git a/packages/cli/tsconfig.build.json b/packages/cli/tsconfig.build.json index 8b2d44aec8..34a89f54c3 100644 --- a/packages/cli/tsconfig.build.json +++ b/packages/cli/tsconfig.build.json @@ -10,7 +10,12 @@ "incremental": true, "types": [ "node", "jest" ], "outDir": "dist", - "skipLibCheck": true + "skipLibCheck": true, + "paths": { + "@budibase/types": ["../types/src"], + "@budibase/backend-core": ["../backend-core/src"], + "@budibase/backend-core/*": ["../backend-core/*"] + } }, "include": [ "src/**/*" diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index c2935129a8..6ca641e214 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -5,12 +5,7 @@ "declaration": true, "sourceMap": true, "baseUrl": ".", - "resolveJsonModule": true, - "paths": { - "@budibase/types": ["../types/src"], - "@budibase/backend-core": ["../backend-core/src"], - "@budibase/backend-core/*": ["../backend-core/*"] - } + "resolveJsonModule": true }, "ts-node": { "require": ["tsconfig-paths/register"], From cb1cec27746f29b441d07df544736a1785087464 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Mon, 7 Aug 2023 20:21:36 +0100 Subject: [PATCH 16/20] Fixing pkg built CLI after using esbuild. --- packages/cli/package.json | 7 +++---- packages/cli/src/prebuilds.ts | 15 +++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 76780acf30..99771adbd3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -19,12 +19,11 @@ }, "pkg": { "targets": [ - "node16-linux", - "node16-win", - "node16-macos" + "node18-linux", + "node18-win", + "node18-macos" ], "assets": [ - "node_modules/@budibase/backend-core/dist/**/*", "prebuilds/**/*" ], "outputPath": "build" diff --git a/packages/cli/src/prebuilds.ts b/packages/cli/src/prebuilds.ts index 17e084160a..21f3042274 100644 --- a/packages/cli/src/prebuilds.ts +++ b/packages/cli/src/prebuilds.ts @@ -5,7 +5,7 @@ import { error } from "./utils" const PREBUILDS = "prebuilds" const ARCH = `${os.platform()}-${os.arch()}` -const PREBUILD_DIR = join(process.execPath, "..", PREBUILDS, ARCH) +const PREBUILD_DIR = join(process.execPath, "..", "cli", PREBUILDS, ARCH) // running as built CLI pkg bundle if (!process.argv[0].includes("node")) { @@ -13,17 +13,19 @@ if (!process.argv[0].includes("node")) { } function checkForBinaries() { - const readDir = join(__filename, "..", "..", "..", PREBUILDS, ARCH) + const readDir = join(__filename, "..", "..", "..", "cli", PREBUILDS, ARCH) if (fs.existsSync(PREBUILD_DIR) || !fs.existsSync(readDir)) { return } const natives = fs.readdirSync(readDir) if (fs.existsSync(readDir)) { - fs.mkdirSync(PREBUILD_DIR, { recursive: true }) + const writePath = join(process.execPath, PREBUILDS, ARCH) + fs.mkdirSync(writePath, { recursive: true }) for (let native of natives) { const filename = `${native.split(".fake")[0]}.node` - fs.cpSync(join(readDir, native), join(PREBUILD_DIR, filename)) + fs.cpSync(join(readDir, native), join(writePath, filename)) } + console.log("copied something") } } @@ -39,8 +41,9 @@ function cleanup(evt?: number) { ) console.error(error(evt)) } - if (fs.existsSync(PREBUILD_DIR)) { - fs.rmSync(PREBUILD_DIR, { recursive: true }) + const path = join(process.execPath, PREBUILDS) + if (fs.existsSync(path)) { + fs.rmSync(path, { recursive: true }) } } From 3a99f6baa66b420c632d22d7b8e225e25aeb7183 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 19:35:14 +0000 Subject: [PATCH 17/20] Bump version to 2.9.6 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index 660ac559ab..f580610019 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.5", + "version": "2.9.6", "npmClient": "yarn", "packages": [ "packages/*" From ad882b6685c5c751caa74c459983feecf1c09bef Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Mon, 7 Aug 2023 21:06:40 +0100 Subject: [PATCH 18/20] Running the releases in parallel causes the old architecture tag that was released to be overwritten, meaning we only end up with a single release. --- .github/workflows/release-singleimage.yml | 78 +---------------------- 1 file changed, 2 insertions(+), 76 deletions(-) diff --git a/.github/workflows/release-singleimage.yml b/.github/workflows/release-singleimage.yml index 5b75c20d29..1f4a2d0b32 100644 --- a/.github/workflows/release-singleimage.yml +++ b/.github/workflows/release-singleimage.yml @@ -8,7 +8,7 @@ env: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} REGISTRY_URL: registry.hub.docker.com jobs: - build-amd64: + build-amd64-arm64: name: "build-amd64" runs-on: ubuntu-latest strategy: @@ -68,81 +68,7 @@ jobs: with: context: . push: true - platforms: linux/amd64 - tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }} - file: ./hosting/single/Dockerfile - - - name: Tag and release Budibase Azure App Service docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - platforms: linux/amd64 - build-args: TARGETBUILD=aas - tags: budibase/budibase-aas,budibase/budibase-aas:v${{ env.RELEASE_VERSION }} - file: ./hosting/single/Dockerfile - - build-arm64: - name: "build-arm64" - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - steps: - - name: Fail if not a tag - run: | - if [[ $GITHUB_REF != refs/tags/* ]]; then - echo "Workflow Dispatch can only be run on tags" - exit 1 - fi - - name: "Checkout" - uses: actions/checkout@v2 - with: - submodules: true - token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - fetch-depth: 0 - - name: Fail if tag is not in master - run: | - if ! git merge-base --is-ancestor ${{ github.sha }} origin/master; then - echo "Tag is not in master. This pipeline can only execute tags that are present on the master branch" - exit 1 - fi - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - name: Setup QEMU - uses: docker/setup-qemu-action@v1 - - name: Setup Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - name: Run Yarn - run: yarn - - name: Update versions - run: ./scripts/updateVersions.sh - - name: Runt Yarn Lint - run: yarn lint - - name: Update versions - run: ./scripts/updateVersions.sh - - name: Run Yarn Build - run: yarn build:docker:pre - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_API_KEY }} - - name: Get the latest release version - id: version - run: | - release_version=$(cat lerna.json | jq -r '.version') - echo $release_version - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Tag and release Budibase service docker image - uses: docker/build-push-action@v2 - with: - context: . - push: true - platforms: linux/arm64 + platforms: linux/amd64,linux/arm64 tags: budibase/budibase,budibase/budibase:v${{ env.RELEASE_VERSION }} file: ./hosting/single/Dockerfile From 2e4e55e2cfa5532a95e65faf8f19fd21840be972 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Mon, 7 Aug 2023 20:30:10 +0000 Subject: [PATCH 19/20] Bump version to 2.9.7 --- lerna.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lerna.json b/lerna.json index f580610019..86af55741a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.9.6", + "version": "2.9.7", "npmClient": "yarn", "packages": [ "packages/*" From f6c992964e3229b6f1d11f96c64e900b4fd3238b Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Mon, 7 Aug 2023 21:31:55 +0100 Subject: [PATCH 20/20] Fixing issue with CLI build, removing some old cjs exports that shouldn't be there. --- packages/cli/src/exec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/exec.ts b/packages/cli/src/exec.ts index b121ca0e03..fb84d4fd0f 100644 --- a/packages/cli/src/exec.ts +++ b/packages/cli/src/exec.ts @@ -1,5 +1,6 @@ import util from "util" -const runCommand = util.promisify(require("child_process").exec) +import childProcess from "child_process" +const runCommand = util.promisify(childProcess.exec) export async function exec(command: string, dir = "./") { const { stdout } = await runCommand(command, { cwd: dir }) @@ -16,12 +17,12 @@ export async function utilityInstalled(utilName: string) { } export async function runPkgCommand(command: string, dir = "./") { - const yarn = await exports.utilityInstalled("yarn") - const npm = await exports.utilityInstalled("npm") + const yarn = await utilityInstalled("yarn") + const npm = await utilityInstalled("npm") if (!yarn && !npm) { throw new Error("Must have yarn or npm installed to run build.") } const npmCmd = command === "install" ? `npm ${command}` : `npm run ${command}` const cmd = yarn ? `yarn ${command} --ignore-engines` : npmCmd - await exports.exec(cmd, dir) + await exec(cmd, dir) }