Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy monorepo setup #15128

Merged
merged 28 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/nextjs-api-sales/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"react-notifications-component": "^3.4.1"
},
"devDependencies": {
"@types/node": "17.0.21",
"@types/node": "^20.17.9",
"@types/react": "17.0.39",
"eslint": "8.10.0",
"eslint-config-next": "12.1.0",
Expand Down
23 changes: 15 additions & 8 deletions examples/nextjs-api-sales/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,12 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=

"@types/node@17.0.21":
version "17.0.21"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644"
integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ==
"@types/node@^20.17.9":
version "20.17.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.9.tgz#5f141d4b7ee125cdee5faefe28de095398865bab"
integrity sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw==
dependencies:
undici-types "~6.19.2"

"@types/prop-types@*":
version "15.7.4"
Expand Down Expand Up @@ -1746,10 +1748,10 @@ type-fest@^0.20.2:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4"
integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==

typescript@5.5.2:
version "5.5.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.2.tgz#c26f023cb0054e657ce04f72583ea2d85f8d0507"
integrity sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==
typescript@5.7.2:
version "5.7.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.2.tgz#3169cf8c4c8a828cde53ba9ecb3d2b1d5dd67be6"
integrity sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==

unbox-primitive@^1.0.1:
version "1.0.1"
Expand All @@ -1761,6 +1763,11 @@ unbox-primitive@^1.0.1:
has-symbols "^1.0.2"
which-boxed-primitive "^1.0.2"

undici-types@~6.19.2:
version "6.19.8"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02"
integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==

uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
Expand Down
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"inputs": [
"{workspaceRoot}/scripts/*",
"{workspaceRoot}/lerna.json",
"{workspaceRoot}/.github/workflows/*"
"{workspaceRoot}/.github/workflows/*",
"{workspaceRoot}/tsconfig.build.json"
]
},
"test": {
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@babel/eslint-parser": "7.25.9",
"@babel/preset-env": "^7.22.5",
"@esbuild-plugins/tsconfig-paths": "^0.1.2",
"@types/node": "20.10.0",
"@types/node": "^20.17.9",
"@types/proper-lockfile": "^4.1.4",
"@typescript-eslint/parser": "8.17.0",
"@vitest/eslint-plugin": "^1.1.14",
Expand All @@ -21,6 +21,7 @@
"husky": "^8.0.3",
"kill-port": "^1.6.1",
"lerna": "7.4.2",
"load-tsconfig": "^0.2.5",
"madge": "^6.0.0",
"nx-cloud": "16.0.5",
"prettier": "2.8.8",
Expand Down Expand Up @@ -99,10 +100,10 @@
]
},
"resolutions": {
"@budibase/backend-core": "0.0.0",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/backend-core": "*",
"@budibase/shared-core": "*",
"@budibase/string-templates": "*",
"@budibase/types": "*",
"@budibase/pro": "npm:@budibase/pro@latest",
"tough-cookie": "4.1.3",
"node-fetch": "2.6.7",
Expand Down
10 changes: 5 additions & 5 deletions packages/backend-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,19 @@
"scripts": {
"prebuild": "rimraf dist/",
"prepack": "cp package.json dist",
"build": "tsc -p tsconfig.build.json --paths null && node ./scripts/build.js",
"build": "node ./scripts/build.js && tsc -p tsconfig.build.json --emitDeclarationOnly --paths null",
"build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput",
"check:types": "tsc -p tsconfig.json --noEmit --paths null --target es2020",
"build:oss": "node ./scripts/build.js",
"check:types": "tsc -p tsconfig.json --noEmit --paths null",
"check:dependencies": "node ../../scripts/depcheck.js",
"test": "bash scripts/test.sh",
"test:watch": "jest --watchAll"
},
"dependencies": {
"@budibase/nano": "10.1.5",
"@budibase/pouchdb-replication-stream": "1.2.11",
"@budibase/shared-core": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/shared-core": "*",
"@budibase/types": "*",
"@techpass/passport-openidconnect": "0.3.3",
"aws-cloudfront-sign": "3.0.2",
"aws-sdk": "2.1692.0",
Expand Down Expand Up @@ -76,7 +77,6 @@
"@types/cookies": "0.7.8",
"@types/jest": "29.5.5",
"@types/lodash": "4.14.200",
"@types/node": "^22.9.0",
"@types/node-fetch": "2.6.4",
"@types/pouchdb": "6.4.2",
"@types/redlock": "4.0.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/backend-core/src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ const environment = {
BUDIBASE_ENVIRONMENT: process.env.BUDIBASE_ENVIRONMENT,
JS_BCRYPT: process.env.JS_BCRYPT,
JWT_SECRET: process.env.JWT_SECRET
? createSecretKey(Buffer.from(process.env.JWT_SECRET))
? createSecretKey(process.env.JWT_SECRET, "utf8")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a strange case... We are using node 20, and based on their docs, it should accept "buffer" as a parameter. But the types don't allow it. Until now it was working as we were wrongly using node 22 types

: undefined,
JWT_SECRET_FALLBACK: process.env.JWT_SECRET_FALLBACK
? createSecretKey(Buffer.from(process.env.JWT_SECRET_FALLBACK))
? createSecretKey(process.env.JWT_SECRET_FALLBACK, "utf8")
: undefined,
ENCRYPTION_KEY: process.env.ENCRYPTION_KEY,
API_ENCRYPTION_KEY: getAPIEncryptionKey(),
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-core/src/events/processors/types.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { EventProcessor } from "@budibase/types"
export type { EventProcessor } from "@budibase/types"
2 changes: 1 addition & 1 deletion packages/backend-core/src/queue/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { addListeners, StalledFn } from "./listeners"
import { Duration } from "../utils"
import * as timers from "../timers"

export { QueueOptions, Queue, JobOptions } from "bull"
export type { QueueOptions, Queue, JobOptions } from "bull"

// the queue lock is held for 5 minutes
const QUEUE_LOCK_MS = Duration.fromMinutes(5).toMs()
Expand Down
20 changes: 2 additions & 18 deletions packages/backend-core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2020"],
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"sourceMap": true,
"declaration": true,
"types": ["node", "jest"],
"outDir": "dist",
"skipLibCheck": true,
"paths": {
"@budibase/types": ["../types/src"],
"@budibase/shared-core": ["../shared-core/src"]
}
"outDir": "dist"
},
"include": ["**/*.js", "**/*.ts"],
"exclude": [
"node_modules",
"dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/bbui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "1.2.1",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/shared-core": "*",
"@budibase/string-templates": "*",
"@spectrum-css/accordion": "3.0.24",
"@spectrum-css/actionbutton": "1.0.1",
"@spectrum-css/actiongroup": "1.0.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
]
},
"dependencies": {
"@budibase/bbui": "0.0.0",
"@budibase/frontend-core": "0.0.0",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/bbui": "*",
"@budibase/frontend-core": "*",
"@budibase/shared-core": "*",
"@budibase/string-templates": "*",
"@budibase/types": "*",
"@codemirror/autocomplete": "^6.7.1",
"@codemirror/commands": "^6.2.4",
"@codemirror/lang-javascript": "^6.1.8",
Expand Down
13 changes: 2 additions & 11 deletions packages/builder/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2019"],
"allowJs": true,
"outDir": "dist",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"skipLibCheck": true
"allowJs": true
},
"include": ["./src/**/*"],
"exclude": ["node_modules", "**/*.json", "**/*.spec.ts", "**/*.spec.js"]
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"scripts": {
"tsc": "node ../../scripts/build.js",
"build": "yarn tsc",
"check:types": "tsc -p tsconfig.json --noEmit --paths null --target es2020",
"check:types": "tsc -p tsconfig.json --noEmit --paths null",
"start": "ts-node ./src/index.ts"
},
"dependencies": {
"@budibase/backend-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/backend-core": "*",
"@budibase/string-templates": "*",
"@budibase/types": "*",
"chalk": "4.1.0",
"cli-progress": "3.11.2",
"commander": "7.1.0",
Expand Down
22 changes: 1 addition & 21 deletions packages/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,5 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2020"],
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"types": ["node", "jest"],
"outDir": "dist",
"skipLibCheck": true,
"baseUrl": ".",
"paths": {
"@budibase/types": ["../types/src"],
"@budibase/backend-core": ["../backend-core/src"],
"@budibase/backend-core/*": ["../backend-core/*"],
"@budibase/shared-core": ["../shared-core/src"],
"@budibase/string-templates": ["../string-templates/src"]
}
},
"extends": "../../tsconfig.build.json",
"include": ["src/**/*"],
"exclude": ["node_modules", "dist", "**/*.spec.ts", "**/*.spec.js"]
}
14 changes: 6 additions & 8 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
"dev": "vite build --watch"
},
"dependencies": {
"@budibase/bbui": "0.0.0",
"@budibase/frontend-core": "0.0.0",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/bbui": "*",
"@budibase/frontend-core": "*",
"@budibase/shared-core": "*",
"@budibase/string-templates": "*",
"@budibase/types": "*",
"@spectrum-css/card": "3.0.3",
"apexcharts": "^3.48.0",
"dayjs": "^1.10.8",
Expand Down Expand Up @@ -61,9 +61,7 @@
"dependsOn": [
{
"projects": [
"@budibase/shared-core",
"@budibase/string-templates",
"@budibase/types"
"@budibase/string-templates"
],
"target": "build"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/frontend-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "0.0.0",
"@budibase/shared-core": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/bbui": "*",
"@budibase/shared-core": "*",
"@budibase/types": "*",
"dayjs": "^1.10.8",
"lodash": "4.17.21",
"shortid": "2.2.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/pro
Submodule pro updated from 9d88d3 to 977bac
19 changes: 9 additions & 10 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prebuild": "rimraf dist/",
"build": "node ./scripts/build.js",
"postbuild": "copyfiles -f ../client/dist/budibase-client.js ../client/manifest.json client && copyfiles -f ../../yarn.lock ./dist/",
"check:types": "tsc -p tsconfig.json --noEmit --paths null --target es2020",
"check:types": "tsc -p tsconfig.json --noEmit --paths null",
"check:dependencies": "node ../../scripts/depcheck.js",
"build:isolated-vm-lib:snippets": "esbuild --minify --bundle src/jsRunner/bundles/snippets.ts --outfile=src/jsRunner/bundles/snippets.ivm.bundle.js --platform=node --format=iife --global-name=snippets",
"build:isolated-vm-lib:string-templates": "esbuild --minify --bundle src/jsRunner/bundles/index-helpers.ts --outfile=src/jsRunner/bundles/index-helpers.ivm.bundle.js --platform=node --format=iife --external:handlebars --global-name=helpers",
Expand Down Expand Up @@ -51,14 +51,14 @@
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@azure/msal-node": "^2.5.1",
"@budibase/backend-core": "0.0.0",
"@budibase/client": "0.0.0",
"@budibase/frontend-core": "0.0.0",
"@budibase/backend-core": "*",
"@budibase/client": "*",
"@budibase/frontend-core": "*",
"@budibase/nano": "10.1.5",
"@budibase/pro": "0.0.0",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@budibase/pro": "*",
"@budibase/shared-core": "*",
"@budibase/string-templates": "*",
"@budibase/types": "*",
"@bull-board/api": "5.10.2",
"@bull-board/koa": "5.10.2",
"@elastic/elasticsearch": "7.10.0",
Expand Down Expand Up @@ -147,7 +147,6 @@
"@types/koa__router": "12.0.4",
"@types/lodash": "4.14.200",
"@types/mssql": "9.1.5",
"@types/node": "^22.9.0",
"@types/node-fetch": "2.6.4",
"@types/oracledb": "6.5.1",
"@types/pg": "8.6.6",
Expand Down Expand Up @@ -188,7 +187,7 @@
"projects": [
"@budibase/backend-core"
],
"target": "build"
"target": "build:oss"
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
DatabaseName,
datasourceDescribe,
} from "../../../../integrations/tests/utils"
import { Expectations } from "src/tests/utilities/api/base"
import { Expectations } from "../../../../tests/utilities/api/base"
import { events } from "@budibase/backend-core"
import { Knex } from "knex"
import { generator } from "@budibase/backend-core/tests"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppStatus } from "../../../../db/utils"
import { roles, tenancy, context, db } from "@budibase/backend-core"
import env from "../../../../environment"
import Nano from "@budibase/nano"
import TestConfiguration from "src/tests/utilities/TestConfiguration"
import TestConfiguration from "../../../../tests/utilities/TestConfiguration"

class Request {
appId: any
Expand Down
Loading
Loading