From 2f3be1cfe5b0c0aa96c7b6d626e3735c1bfa6c43 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 29 May 2023 10:38:24 -0500 Subject: [PATCH 1/3] Add turborepo to monorepo. --- .gitignore | 3 +++ apps/web/next.config.js | 27 ++++++++++----------------- package.json | 8 ++++---- turbo.json | 13 +++++++++++++ 4 files changed, 30 insertions(+), 21 deletions(-) create mode 100644 turbo.json diff --git a/.gitignore b/.gitignore index 9965f5ca6..d7f66a11a 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,6 @@ yarn-error.log* next-env.d.ts .env .env.example + +# turborepo +.turbo \ No newline at end of file diff --git a/apps/web/next.config.js b/apps/web/next.config.js index c7b94279e..1ea48cefb 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -4,22 +4,15 @@ require("dotenv").config({ path: "../../.env" }); const nextConfig = { reactStrictMode: true, swcMinify: false, + transpilePackages: [ + "@documenso/prisma", + "@documenso/lib", + "@documenso/ui", + "@documenso/pdf", + "@documenso/features", + "@documenso/signing", + "react-signature-canvas", + ], }; -const transpileModules = require("next-transpile-modules")([ - "@documenso/prisma", - "@documenso/lib", - "@documenso/ui", - "@documenso/pdf", - "@documenso/features", - "@documenso/signing", - "react-signature-canvas", -]); - -const plugins = [ - transpileModules -]; - -const moduleExports = () => plugins.reduce((acc, next) => next(acc), nextConfig); - -module.exports = moduleExports; +module.exports = nextConfig; diff --git a/package.json b/package.json index 9c2a55c14..12d9db61c 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,9 @@ "name": "documenso-monorepo", "version": "0.0.0", "scripts": { - "dev": "npm run dev -w apps/web", - "build": "npm i && cd apps && cd web && npm i && next build", - "start": "cd apps && cd web && next start", + "dev": "turbo run dev --filter=web", + "build": "turbo run build --filter=web", + "start": "turbo run start --filter=web", "db-migrate:dev": "prisma migrate dev", "db-seed": "prisma db seed", "db-studio": "prisma studio", @@ -54,4 +54,4 @@ "prettier-plugin-tailwindcss": "^0.2.5", "typescript": "4.8.4" } -} \ No newline at end of file +} diff --git a/turbo.json b/turbo.json new file mode 100644 index 000000000..3def58b36 --- /dev/null +++ b/turbo.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://turbo.build/schema.json", + "globalDependencies": [".env"], + "pipeline": { + "build": { + "outputs": [".next/**", "!.next/cache/**"] + }, + "dev": { + "cache": false, + "persistent": true + } + } +} From 1e6f65f92d3f5cd32f711aabcbfe8d12c574b094 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 29 May 2023 19:46:24 -0500 Subject: [PATCH 2/3] Explicit deps --- turbo.json | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 3def58b36..d5daebec9 100644 --- a/turbo.json +++ b/turbo.json @@ -1,6 +1,26 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": [".env"], + "globalEnv": [ + "DATABASE_URL", + "NEXT_PUBLIC_WEBAPP_URL", + "NEXTAUTH_SECRET", + "NEXTAUTH_URL", + "CERT_FILE_PATH", + "CERT_PASSPHRASE", + "CERT_FILE_ENCODING", + "SENDGRID_API_KEY", + "SMTP_MAIL_HOST", + "SMTP_MAIL_PORT", + "SMTP_MAIL_USER", + "SMTP_MAIL_PASSWORD", + "MAIL_FROM", + "STRIPE_API_KEY", + "STRIPE_WEBHOOK_SECRET", + "NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_MONTHLY_PRICE_ID", + "NEXT_PUBLIC_STRIPE_COMMUNITY_PLAN_YEARLY_PRICE_ID", + "NEXT_PUBLIC_ALLOW_SIGNUP", + "NEXT_PUBLIC_ALLOW_SUBSCRIPTIONS" + ], "pipeline": { "build": { "outputs": [".next/**", "!.next/cache/**"] From d8ad4b4b2b5ddaccbcb461eb91baf94ae1b0b74f Mon Sep 17 00:00:00 2001 From: Mythie Date: Tue, 30 May 2023 18:56:41 +1000 Subject: [PATCH 3/3] fix: add turbo dep and start command --- package-lock.json | 153 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + turbo.json | 5 ++ 3 files changed, 159 insertions(+) diff --git a/package-lock.json b/package-lock.json index 3294ac71b..4e56abc72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.7", "prettier-plugin-tailwindcss": "^0.2.5", + "turbo": "^1.9.9", "typescript": "4.8.4" } }, @@ -7665,6 +7666,102 @@ "node": "*" } }, + "node_modules/turbo": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.9.9.tgz", + "integrity": "sha512-+ZS66LOT7ahKHxh6XrIdcmf2Yk9mNpAbPEj4iF2cs0cAeaDU3xLVPZFF0HbSho89Uxwhx7b5HBgPbdcjQTwQkg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "turbo": "bin/turbo" + }, + "optionalDependencies": { + "turbo-darwin-64": "1.9.9", + "turbo-darwin-arm64": "1.9.9", + "turbo-linux-64": "1.9.9", + "turbo-linux-arm64": "1.9.9", + "turbo-windows-64": "1.9.9", + "turbo-windows-arm64": "1.9.9" + } + }, + "node_modules/turbo-darwin-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.9.9.tgz", + "integrity": "sha512-UDGM9E21eCDzF5t1F4rzrjwWutcup33e7ZjNJcW/mJDPorazZzqXGKEPIy9kXwKhamUUXfC7668r6ZuA1WXF2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/turbo-darwin-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.9.9.tgz", + "integrity": "sha512-VyfkXzTJpYLTAQ9krq2myyEq7RPObilpS04lgJ4OO1piq76RNmSpX9F/t9JCaY9Pj/4TL7i0d8PM7NGhwEA5Ag==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/turbo-linux-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.9.9.tgz", + "integrity": "sha512-Fu1MY29Odg8dHOqXcpIIGC3T63XLOGgnGfbobXMKdrC7JQDvtJv8TUCYciRsyknZYjyyKK1z6zKuYIiDjf3KeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/turbo-linux-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.9.9.tgz", + "integrity": "sha512-50LI8NafPuJxdnMCBeDdzgyt1cgjQG7FwkyY336v4e95WJPUVjrHdrKH6jYXhOUyrv9+jCJxwX1Yrg02t5yJ1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/turbo-windows-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.9.9.tgz", + "integrity": "sha512-9IsTReoLmQl1IRsy3WExe2j2RKWXQyXujfJ4fXF+jp08KxjVF4/tYP2CIRJx/A7UP/7keBta27bZqzAjsmbSTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/turbo-windows-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.9.9.tgz", + "integrity": "sha512-CUu4hpeQo68JjDr0V0ygTQRLbS+/sNfdqEVV+Xz9136vpKn2WMQLAuUBVZV0Sp0S/7i+zGnplskT0fED+W46wQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", @@ -13859,6 +13956,62 @@ "safe-buffer": "^5.0.1" } }, + "turbo": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo/-/turbo-1.9.9.tgz", + "integrity": "sha512-+ZS66LOT7ahKHxh6XrIdcmf2Yk9mNpAbPEj4iF2cs0cAeaDU3xLVPZFF0HbSho89Uxwhx7b5HBgPbdcjQTwQkg==", + "dev": true, + "requires": { + "turbo-darwin-64": "1.9.9", + "turbo-darwin-arm64": "1.9.9", + "turbo-linux-64": "1.9.9", + "turbo-linux-arm64": "1.9.9", + "turbo-windows-64": "1.9.9", + "turbo-windows-arm64": "1.9.9" + } + }, + "turbo-darwin-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-darwin-64/-/turbo-darwin-64-1.9.9.tgz", + "integrity": "sha512-UDGM9E21eCDzF5t1F4rzrjwWutcup33e7ZjNJcW/mJDPorazZzqXGKEPIy9kXwKhamUUXfC7668r6ZuA1WXF2Q==", + "dev": true, + "optional": true + }, + "turbo-darwin-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-darwin-arm64/-/turbo-darwin-arm64-1.9.9.tgz", + "integrity": "sha512-VyfkXzTJpYLTAQ9krq2myyEq7RPObilpS04lgJ4OO1piq76RNmSpX9F/t9JCaY9Pj/4TL7i0d8PM7NGhwEA5Ag==", + "dev": true, + "optional": true + }, + "turbo-linux-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-linux-64/-/turbo-linux-64-1.9.9.tgz", + "integrity": "sha512-Fu1MY29Odg8dHOqXcpIIGC3T63XLOGgnGfbobXMKdrC7JQDvtJv8TUCYciRsyknZYjyyKK1z6zKuYIiDjf3KeQ==", + "dev": true, + "optional": true + }, + "turbo-linux-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-linux-arm64/-/turbo-linux-arm64-1.9.9.tgz", + "integrity": "sha512-50LI8NafPuJxdnMCBeDdzgyt1cgjQG7FwkyY336v4e95WJPUVjrHdrKH6jYXhOUyrv9+jCJxwX1Yrg02t5yJ1g==", + "dev": true, + "optional": true + }, + "turbo-windows-64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-windows-64/-/turbo-windows-64-1.9.9.tgz", + "integrity": "sha512-9IsTReoLmQl1IRsy3WExe2j2RKWXQyXujfJ4fXF+jp08KxjVF4/tYP2CIRJx/A7UP/7keBta27bZqzAjsmbSTA==", + "dev": true, + "optional": true + }, + "turbo-windows-arm64": { + "version": "1.9.9", + "resolved": "https://registry.npmjs.org/turbo-windows-arm64/-/turbo-windows-arm64-1.9.9.tgz", + "integrity": "sha512-CUu4hpeQo68JjDr0V0ygTQRLbS+/sNfdqEVV+Xz9136vpKn2WMQLAuUBVZV0Sp0S/7i+zGnplskT0fED+W46wQ==", + "dev": true, + "optional": true + }, "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", diff --git a/package.json b/package.json index 12d9db61c..d5790a9e7 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.8.7", "prettier-plugin-tailwindcss": "^0.2.5", + "turbo": "^1.9.9", "typescript": "4.8.4" } } diff --git a/turbo.json b/turbo.json index d5daebec9..ea51341b1 100644 --- a/turbo.json +++ b/turbo.json @@ -25,6 +25,11 @@ "build": { "outputs": [".next/**", "!.next/cache/**"] }, + "start": { + "dependsOn": ["build"], + "cache": false, + "persistent": true + }, "dev": { "cache": false, "persistent": true