diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index a15e3d9110..4e0bc8b3a9 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -44,7 +44,10 @@ jobs: node-version: 14.x cache: "yarn" - run: yarn - - run: yarn nx run-many -t=build --configuration=production + # Run build all the projects + - run: yarn build + # Check the types of the projects built via esbuild + - run: yarn check:types test-libraries: runs-on: ubuntu-latest diff --git a/package.json b/package.json index edbb82b892..b866dc3e23 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "devDependencies": { "@esbuild-plugins/node-resolve": "^0.2.2", "@esbuild-plugins/tsconfig-paths": "^0.1.2", - "@nx/esbuild": "16.2.1", "@nx/js": "16.2.1", "@rollup/plugin-json": "^4.0.2", "@typescript-eslint/parser": "5.45.0", @@ -34,6 +33,7 @@ "bootstrap": "./scripts/link-dependencies.sh && echo '***BOOTSTRAP ONLY REQUIRED FOR USE WITH ACCOUNT PORTAL***'", "build": "yarn nx run-many -t=build", "build:dev": "lerna run --stream prebuild && yarn nx run-many --target=build --output-style=dynamic --watch --preserveWatchOutput", + "check:types": "lerna run check:types --skip-nx-cache", "backend:bootstrap": "./scripts/scopeBackend.sh && yarn run bootstrap", "backend:build": "./scripts/scopeBackend.sh 'lerna run --stream build'", "build:sdk": "lerna run --stream build:sdk", diff --git a/packages/server/package.json b/packages/server/package.json index 2ec1395b71..0fc7ce53bd 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -11,6 +11,7 @@ "scripts": { "prebuild": "rimraf dist/", "build": "node ./scripts/build.js", + "check:types": "tsc -p tsconfig.build.json --noEmit", "postbuild": "copyfiles -f ../client/dist/budibase-client.js ../client/manifest.json client", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", "debug": "yarn build && node --expose-gc --inspect=9222 dist/index.js", diff --git a/packages/worker/.dockerignore b/packages/worker/.dockerignore index c4815909ba..8f79e19685 100644 --- a/packages/worker/.dockerignore +++ b/packages/worker/.dockerignore @@ -1,3 +1,4 @@ * !/dist/ -!/docker_run.sh \ No newline at end of file +!/docker_run.sh +!/package.json \ No newline at end of file diff --git a/packages/worker/Dockerfile b/packages/worker/Dockerfile index 7b8f991013..a80ae00af1 100644 --- a/packages/worker/Dockerfile +++ b/packages/worker/Dockerfile @@ -12,7 +12,7 @@ RUN apk add --no-cache --virtual .gyp python3 make g++ RUN yarn global add pm2 -COPY dist/package.json . +COPY package.json . RUN yarn install --frozen-lockfile --production=true # Remove unneeded data from file system to reduce image size RUN apk del .gyp \ diff --git a/packages/worker/package.json b/packages/worker/package.json index 684bd8755b..0a589e17ec 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -13,7 +13,8 @@ ], "scripts": { "prebuild": "rimraf dist/", - "build": "cd ../.. && nx build @budibase/worker", + "build": "node ../../scripts/build.js", + "check:types": "tsc -p tsconfig.build.json --noEmit", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", "run:docker": "node dist/index.js", "debug": "yarn build && node --expose-gc --inspect=9223 dist/index.js", diff --git a/packages/worker/project.json b/packages/worker/project.json deleted file mode 100644 index 65f9b2d567..0000000000 --- a/packages/worker/project.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "@budibase/worker", - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "targets": { - "build": { - "executor": "@nx/esbuild:esbuild", - "outputs": ["{options.outputPath}"], - "options": { - "main": "packages/worker/src/index.ts", - "outputPath": "packages/worker/dist", - "outputFileName": "index.js", - "tsConfig": "packages/worker/tsconfig.build.json", - "assets": [ - { - "glob": "**/*.hbs", - "input": "packages/worker/src/constants/templates", - "output": "." - } - ], - "external": ["graphql/*", "deasync", "mock-aws-s3", "nock"], - "format": ["cjs"], - "esbuildOptions": { - "outExtension": { - ".js": ".js" - }, - "sourcemap": true - }, - "minify": true, - "generatePackageJson": true, - "skipTypeCheck": true - }, - "configurations": { - "production": { - "skipTypeCheck": false, - "esbuildOptions": { - "sourcemap": false - } - } - }, - "dependsOn": [ - { - "projects": ["@budibase/types", "@budibase/string-templates"], - "target": "build" - } - ] - } - } -} diff --git a/yarn.lock b/yarn.lock index 0d9d795b8a..3eb037b40c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3780,13 +3780,6 @@ dependencies: "@nx/devkit" "16.2.2" -"@nrwl/esbuild@16.2.1": - version "16.2.1" - resolved "https://registry.yarnpkg.com/@nrwl/esbuild/-/esbuild-16.2.1.tgz#83f8fbf2c7c541c220ccfff8be17a0e542aa7d01" - integrity sha512-qyNpdtPAzk2IhYmK5Qzn9gM1cvEtWFp6vJfgdbCKQngdqioYcJpGtdKhRm6Vcj8mFXF7zDgtUd2ecqJSiJU6VA== - dependencies: - "@nx/esbuild" "16.2.1" - "@nrwl/js@16.2.1": version "16.2.1" resolved "https://registry.yarnpkg.com/@nrwl/js/-/js-16.2.1.tgz#6eacfa1f0658ca1e288da86b6c38be4846f2779a" @@ -3839,21 +3832,6 @@ tmp "~0.2.1" tslib "^2.3.0" -"@nx/esbuild@16.2.1": - version "16.2.1" - resolved "https://registry.yarnpkg.com/@nx/esbuild/-/esbuild-16.2.1.tgz#157a408a617b5095ba1372ec27b03d6c9aa3b78c" - integrity sha512-jG4zsGc1EN+SfEBUky44+4cpj7M0Sf0v3pGWsw4hCOuBeLl6qW+eAcFypDXecDosS7ct/M2nEtlZP45IVDMZgQ== - dependencies: - "@nrwl/esbuild" "16.2.1" - "@nx/devkit" "16.2.1" - "@nx/js" "16.2.1" - chalk "^4.1.0" - dotenv "~10.0.0" - fast-glob "3.2.7" - fs-extra "^11.1.0" - tsconfig-paths "^4.1.2" - tslib "^2.3.0" - "@nx/js@16.2.1": version "16.2.1" resolved "https://registry.yarnpkg.com/@nx/js/-/js-16.2.1.tgz#41c8c2d610131fa064bbb2b6bb25bd67ed06be79"