From ad917730cf490b1eec5893368f120bdb79ad3393 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:25:07 +0900 Subject: [PATCH] fix(deps): update turbo monorepo to v2 (major) (#384) * fix(deps): update turbo monorepo to v2 * fix turbo.json * fix dockerfile * fix docker build * fix format --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: chiol --- apps/web/next.config.mjs | 4 +- apps/web/package.json | 1 + .../ui/feedback-request-code-popover.ui.tsx | 2 +- .../tenant/ui/tenant-guard.ui.spec.tsx | 2 +- apps/web/src/{env.mjs => env.ts} | 0 .../sign-in-with-oauth.mock-handler.ts | 2 +- .../create-tenant/create-tenant-form.spec.tsx | 2 +- apps/web/src/pages/api/login.ts | 2 +- apps/web/src/pages/api/oauth.ts | 2 +- apps/web/src/pages/api/refresh-jwt.ts | 2 +- apps/web/src/server/iron-option.ts | 2 +- apps/web/src/shared/lib/client.ts | 2 +- apps/web/src/shared/ui/help-card-docs.tsx | 2 +- apps/web/src/shared/utils/path-parsing.ts | 2 +- .../model/feedback-table.context.tsx | 2 +- .../feedback-table/ui/feedback-table-bar.tsx | 2 +- docker/api.dockerfile | 2 +- docker/web.dockerfile | 4 +- package.json | 2 +- pnpm-lock.yaml | 79 ++++++++++--------- tooling/eslint/package.json | 2 +- turbo.json | 15 ++-- 22 files changed, 71 insertions(+), 64 deletions(-) rename apps/web/src/{env.mjs => env.ts} (100%) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index efba538cb..99f8a8549 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,10 +1,10 @@ -import './src/env.mjs'; - import path from 'path'; import { fileURLToPath } from 'url'; +import createJiti from 'jiti'; import * as i18nConfig from './next-i18next.config.js'; +createJiti(fileURLToPath(import.meta.url))('./src/env'); const __dirname = fileURLToPath(new URL('.', import.meta.url)); /** @type {import('next').NextConfig} */ diff --git a/apps/web/package.json b/apps/web/package.json index 6b50e9e36..b84227319 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -99,6 +99,7 @@ "eslint": "^9.0.0", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", + "jiti": "^1.21.6", "msw": "^2.3.0", "next-router-mock": "^0.9.13", "node-mocks-http": "^1.14.1", diff --git a/apps/web/src/entities/field/ui/feedback-request-code-popover.ui.tsx b/apps/web/src/entities/field/ui/feedback-request-code-popover.ui.tsx index 5c87107c0..a4d9178be 100644 --- a/apps/web/src/entities/field/ui/feedback-request-code-popover.ui.tsx +++ b/apps/web/src/entities/field/ui/feedback-request-code-popover.ui.tsx @@ -27,7 +27,7 @@ import { import { cn, useOAIQuery } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; interface IProps { channelId: number; diff --git a/apps/web/src/entities/tenant/ui/tenant-guard.ui.spec.tsx b/apps/web/src/entities/tenant/ui/tenant-guard.ui.spec.tsx index 07dc39071..f81364f30 100644 --- a/apps/web/src/entities/tenant/ui/tenant-guard.ui.spec.tsx +++ b/apps/web/src/entities/tenant/ui/tenant-guard.ui.spec.tsx @@ -19,7 +19,7 @@ import mockRouter from 'next-router-mock'; import { Path } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import { server } from '@/msw'; import { render, screen, waitFor } from '@/test-utils'; import { useTenantStore } from '../tenant.model'; diff --git a/apps/web/src/env.mjs b/apps/web/src/env.ts similarity index 100% rename from apps/web/src/env.mjs rename to apps/web/src/env.ts diff --git a/apps/web/src/features/auth/sign-in-with-oauth/__mocks__/sign-in-with-oauth.mock-handler.ts b/apps/web/src/features/auth/sign-in-with-oauth/__mocks__/sign-in-with-oauth.mock-handler.ts index 945d05e90..81b4f14c4 100644 --- a/apps/web/src/features/auth/sign-in-with-oauth/__mocks__/sign-in-with-oauth.mock-handler.ts +++ b/apps/web/src/features/auth/sign-in-with-oauth/__mocks__/sign-in-with-oauth.mock-handler.ts @@ -16,7 +16,7 @@ import { faker } from '@faker-js/faker'; import { http, HttpResponse } from 'msw'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; export const signInWithOAuthMockHandlers = [ http.get( diff --git a/apps/web/src/features/create-tenant/create-tenant-form.spec.tsx b/apps/web/src/features/create-tenant/create-tenant-form.spec.tsx index 2bd0aa04d..fab148fd3 100644 --- a/apps/web/src/features/create-tenant/create-tenant-form.spec.tsx +++ b/apps/web/src/features/create-tenant/create-tenant-form.spec.tsx @@ -17,7 +17,7 @@ import { faker } from '@faker-js/faker'; import userEvent from '@testing-library/user-event'; import { http, HttpResponse } from 'msw'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import { server } from '@/msw'; import { render, screen, waitFor } from '@/test-utils'; import CreateTenantForm from './create-tenant-form.ui'; diff --git a/apps/web/src/pages/api/login.ts b/apps/web/src/pages/api/login.ts index 0c6b2aad2..3cd84a570 100644 --- a/apps/web/src/pages/api/login.ts +++ b/apps/web/src/pages/api/login.ts @@ -20,7 +20,7 @@ import { z } from 'zod'; import type { Jwt } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import { createNextApiHandler, procedure } from '@/server/api-handler'; import type { JwtSession } from '@/server/iron-option'; import { ironOption } from '@/server/iron-option'; diff --git a/apps/web/src/pages/api/oauth.ts b/apps/web/src/pages/api/oauth.ts index 027082d90..dff87c749 100644 --- a/apps/web/src/pages/api/oauth.ts +++ b/apps/web/src/pages/api/oauth.ts @@ -19,7 +19,7 @@ import { z } from 'zod'; import type { Jwt } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import { createNextApiHandler, procedure } from '@/server/api-handler'; import type { JwtSession } from '@/server/iron-option'; import { ironOption } from '@/server/iron-option'; diff --git a/apps/web/src/pages/api/refresh-jwt.ts b/apps/web/src/pages/api/refresh-jwt.ts index 2e3cc5398..ed01d5c65 100644 --- a/apps/web/src/pages/api/refresh-jwt.ts +++ b/apps/web/src/pages/api/refresh-jwt.ts @@ -19,7 +19,7 @@ import { getIronSession } from 'iron-session'; import type { Jwt } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import { createNextApiHandler } from '@/server/api-handler'; import type { JwtSession } from '@/server/iron-option'; import { ironOption } from '@/server/iron-option'; diff --git a/apps/web/src/server/iron-option.ts b/apps/web/src/server/iron-option.ts index 3cced944c..37481911e 100644 --- a/apps/web/src/server/iron-option.ts +++ b/apps/web/src/server/iron-option.ts @@ -15,7 +15,7 @@ */ import type { SessionOptions } from 'iron-session'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; export const ironOption: SessionOptions = { cookieName: 'user-feedback', diff --git a/apps/web/src/shared/lib/client.ts b/apps/web/src/shared/lib/client.ts index 114fb63c1..cf096fb55 100644 --- a/apps/web/src/shared/lib/client.ts +++ b/apps/web/src/shared/lib/client.ts @@ -28,7 +28,7 @@ import type { OAIResponse, } from '@/shared'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; class client { private axiosInstance = axios.create({ diff --git a/apps/web/src/shared/ui/help-card-docs.tsx b/apps/web/src/shared/ui/help-card-docs.tsx index 5f492fb64..93d861adf 100644 --- a/apps/web/src/shared/ui/help-card-docs.tsx +++ b/apps/web/src/shared/ui/help-card-docs.tsx @@ -17,7 +17,7 @@ import { Trans } from 'react-i18next'; import { Icon } from '@ufb/ui'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; type I18nKey = | 'help-card.image-config' diff --git a/apps/web/src/shared/utils/path-parsing.ts b/apps/web/src/shared/utils/path-parsing.ts index 72479b9d7..d349c94a5 100644 --- a/apps/web/src/shared/utils/path-parsing.ts +++ b/apps/web/src/shared/utils/path-parsing.ts @@ -13,7 +13,7 @@ * License for the specific language governing permissions and limitations * under the License. */ -import { env } from '@/env.mjs'; +import { env } from '@/env'; export const getRequestUrl = ( path: string, diff --git a/apps/web/src/widgets/feedback-table/model/feedback-table.context.tsx b/apps/web/src/widgets/feedback-table/model/feedback-table.context.tsx index 527756556..8094487e1 100644 --- a/apps/web/src/widgets/feedback-table/model/feedback-table.context.tsx +++ b/apps/web/src/widgets/feedback-table/model/feedback-table.context.tsx @@ -20,7 +20,7 @@ import type { DateRangeType } from '@/shared'; import { DATE_FORMAT, useQueryParamsState } from '@/shared'; import { EMPTY_FUNCTION } from '@/shared/utils/empty-function'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; const DEFAULT_DATE_RANGE: DateRangeType = { startDate: dayjs().subtract(env.NEXT_PUBLIC_MAX_DAYS, 'day').toDate(), diff --git a/apps/web/src/widgets/feedback-table/ui/feedback-table-bar.tsx b/apps/web/src/widgets/feedback-table/ui/feedback-table-bar.tsx index 09e383d08..81d8654fb 100644 --- a/apps/web/src/widgets/feedback-table/ui/feedback-table-bar.tsx +++ b/apps/web/src/widgets/feedback-table/ui/feedback-table-bar.tsx @@ -22,7 +22,7 @@ import { DateRangePicker, TablePagination, TableSearchInput } from '@/shared'; import type { Field } from '@/entities/field'; import { useIssueSearch } from '@/entities/issue'; -import { env } from '@/env.mjs'; +import { env } from '@/env'; import type { FeedbackColumnType } from '../feedback-table-columns'; import { useFeedbackTable } from '../model'; import ChannelSelectBox from './channel-select-box'; diff --git a/docker/api.dockerfile b/docker/api.dockerfile index 26a88fd56..094f9f220 100644 --- a/docker/api.dockerfile +++ b/docker/api.dockerfile @@ -8,7 +8,7 @@ RUN apk add --no-cache libc6-compat # Set working directory WORKDIR /app -RUN npm install -g turbo@^1.13.2 +RUN npm install -g turbo COPY . . RUN turbo prune --scope=api --docker diff --git a/docker/web.dockerfile b/docker/web.dockerfile index 54f68d2ff..097816410 100644 --- a/docker/web.dockerfile +++ b/docker/web.dockerfile @@ -8,7 +8,7 @@ RUN apk add --no-cache libc6-compat # Set working directory WORKDIR /app -RUN npm install -g turbo@^1.13.2 +RUN npm install -g turbo COPY . . RUN turbo prune --scope=web --docker @@ -41,7 +41,7 @@ ARG TURBO_TEAM ENV TURBO_TEAM=${TURBO_TEAM} COPY --from=builder /app/apps/web/.env.build /app/apps/web/.env.production -RUN SKIP_ENV_VALIDATION=1 pnpm dlx turbo run build --filter=web... +RUN SKIP_ENV_VALIDATION=true pnpm dlx turbo run build --filter=web... FROM base AS runner WORKDIR /app diff --git a/package.json b/package.json index 19dd306d7..9e845f758 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@ufb/prettier-config": "workspace:*", "prettier": "^3.2.5", - "turbo": "^1.13.2", + "turbo": "^2.0.0", "typescript": "^5.4.5" }, "packageManager": "pnpm@9.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d3e7ead0e..dc42d1ea9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^3.2.5 version: 3.3.3 turbo: - specifier: ^1.13.2 - version: 1.13.4 + specifier: ^2.0.0 + version: 2.0.7 typescript: specifier: ^5.4.5 version: 5.5.3 @@ -487,6 +487,9 @@ importers: jest-environment-jsdom: specifier: ^29.7.0 version: 29.7.0 + jiti: + specifier: ^1.21.6 + version: 1.21.6 msw: specifier: ^2.3.0 version: 2.3.2(typescript@5.5.3) @@ -642,8 +645,8 @@ importers: specifier: ^9.1.0 version: 9.1.0(eslint@9.7.0) eslint-config-turbo: - specifier: ^1.13.2 - version: 1.13.4(eslint@9.7.0) + specifier: ^2.0.0 + version: 2.0.7(eslint@9.7.0) eslint-plugin-import: specifier: ^2.29.1 version: 2.29.1(@typescript-eslint/parser@7.16.1(eslint@9.7.0)(typescript@5.5.3))(eslint@9.7.0) @@ -5013,8 +5016,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-config-turbo@1.13.4: - resolution: {integrity: sha512-+we4eWdZlmlEn7LnhXHCIPX/wtujbHCS7XjQM/TN09BHNEl2fZ8id4rHfdfUKIYTSKyy8U/nNyJ0DNoZj5Q8bw==} + eslint-config-turbo@2.0.7: + resolution: {integrity: sha512-rs9QdVM3MSd1EQ0C13bbl1/9H6tYMOZSG3Dpfe+qcq6oZSdjrKh4+u/ALMO2nxF/FujioibzgbN3rI46L3BdUQ==} peerDependencies: eslint: '>6.6.0' @@ -5078,8 +5081,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - eslint-plugin-turbo@1.13.4: - resolution: {integrity: sha512-82GfMzrewI/DJB92Bbch239GWbGx4j1zvjk1lqb06lxIlMPnVwUHVwPbAnLfyLG3JuhLv9whxGkO/q1CL18JTg==} + eslint-plugin-turbo@2.0.7: + resolution: {integrity: sha512-HNrg6/8U4ZMj46ckX7GkwFOz4yLizZjCZb5xgoGF6pR5XwXxHBI4+fuVu9HGJXH0QRbNp3JQoxFYPB9y/cdv8w==} peerDependencies: eslint: '>6.6.0' @@ -8497,38 +8500,38 @@ packages: typescript: optional: true - turbo-darwin-64@1.13.4: - resolution: {integrity: sha512-A0eKd73R7CGnRinTiS7txkMElg+R5rKFp9HV7baDiEL4xTG1FIg/56Vm7A5RVgg8UNgG2qNnrfatJtb+dRmNdw==} + turbo-darwin-64@2.0.7: + resolution: {integrity: sha512-J1RBvQGqKeUwLJrZbfrm4tHshagdMeGAwd7rpLpfUrw0PNmGfcBazJf6dIGXG59/GHzJmS0/eAZ8qDchfVbIFA==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@1.13.4: - resolution: {integrity: sha512-eG769Q0NF6/Vyjsr3mKCnkG/eW6dKMBZk6dxWOdrHfrg6QgfkBUk0WUUujzdtVPiUIvsh4l46vQrNVd9EOtbyA==} + turbo-darwin-arm64@2.0.7: + resolution: {integrity: sha512-h1JK8uuEjoHx1SvvTZiottj+4kDmiv+hivnLUzNwO75qKblMsd38IsFB0J2sMRz7JacFlf+3ry8SItznBW67Xw==} cpu: [arm64] os: [darwin] - turbo-linux-64@1.13.4: - resolution: {integrity: sha512-Bq0JphDeNw3XEi+Xb/e4xoKhs1DHN7OoLVUbTIQz+gazYjigVZvtwCvgrZI7eW9Xo1eOXM2zw2u1DGLLUfmGkQ==} + turbo-linux-64@2.0.7: + resolution: {integrity: sha512-dsr7GFeHAYVMnXWDDjhpsAQetejU4OlkNBRA5hfmnIcl2sSyOYa3EvoeJ6j5z5vTNIJ9VO4I1h0jK3lTjEoonA==} cpu: [x64] os: [linux] - turbo-linux-arm64@1.13.4: - resolution: {integrity: sha512-BJcXw1DDiHO/okYbaNdcWN6szjXyHWx9d460v6fCHY65G8CyqGU3y2uUTPK89o8lq/b2C8NK0yZD+Vp0f9VoIg==} + turbo-linux-arm64@2.0.7: + resolution: {integrity: sha512-bJbwXvyX1XPzY1jHgkqggls/L4yFyHVK8GGACF3kcg6x7lYV2SXkUYRyOC3WqzW7euqa9Zw/32jrIPP4Qy31Vw==} cpu: [arm64] os: [linux] - turbo-windows-64@1.13.4: - resolution: {integrity: sha512-OFFhXHOFLN7A78vD/dlVuuSSVEB3s9ZBj18Tm1hk3aW1HTWTuAw0ReN6ZNlVObZUHvGy8d57OAGGxf2bT3etQw==} + turbo-windows-64@2.0.7: + resolution: {integrity: sha512-aBH+5A7IN957MqXMrw8xN0CWtH/fPFL+xTlloO6074Eaa8WfnctSAnaSujm6f4xF2T8lFx+ZprBvnO9oKvLQQQ==} cpu: [x64] os: [win32] - turbo-windows-arm64@1.13.4: - resolution: {integrity: sha512-u5A+VOKHswJJmJ8o8rcilBfU5U3Y1TTAfP9wX8bFh8teYF1ghP0EhtMRLjhtp6RPa+XCxHHVA2CiC3gbh5eg5g==} + turbo-windows-arm64@2.0.7: + resolution: {integrity: sha512-ButUCpO5nTi+jyTSIY2mQ9dVz+mCGxJ6sHyn0xGlNoJWdisKXb0BtWCLAjM26gg/yp9Kt1MBowMQyYVruPV0Qw==} cpu: [arm64] os: [win32] - turbo@1.13.4: - resolution: {integrity: sha512-1q7+9UJABuBAHrcC4Sxp5lOqYS5mvxRrwa33wpIyM18hlOCpRD/fTJNxZ0vhbMcJmz15o9kkVm743mPn7p6jpQ==} + turbo@2.0.7: + resolution: {integrity: sha512-76iNWZpmKAKjj+yL0Wtcu2LpDIM5Nz7JS3fHOZPYS0AKuC2boJ24276VAiK4PKwbpBB//TYKDpSLuQ6cfR49pg==} hasBin: true type-check@0.4.0: @@ -14315,10 +14318,10 @@ snapshots: dependencies: eslint: 9.7.0 - eslint-config-turbo@1.13.4(eslint@9.7.0): + eslint-config-turbo@2.0.7(eslint@9.7.0): dependencies: eslint: 9.7.0 - eslint-plugin-turbo: 1.13.4(eslint@9.7.0) + eslint-plugin-turbo: 2.0.7(eslint@9.7.0) eslint-import-resolver-node@0.3.9: dependencies: @@ -14402,7 +14405,7 @@ snapshots: string.prototype.matchall: 4.0.11 string.prototype.repeat: 1.0.0 - eslint-plugin-turbo@1.13.4(eslint@9.7.0): + eslint-plugin-turbo@2.0.7(eslint@9.7.0): dependencies: dotenv: 16.0.3 eslint: 9.7.0 @@ -18630,32 +18633,32 @@ snapshots: - tsx - yaml - turbo-darwin-64@1.13.4: + turbo-darwin-64@2.0.7: optional: true - turbo-darwin-arm64@1.13.4: + turbo-darwin-arm64@2.0.7: optional: true - turbo-linux-64@1.13.4: + turbo-linux-64@2.0.7: optional: true - turbo-linux-arm64@1.13.4: + turbo-linux-arm64@2.0.7: optional: true - turbo-windows-64@1.13.4: + turbo-windows-64@2.0.7: optional: true - turbo-windows-arm64@1.13.4: + turbo-windows-arm64@2.0.7: optional: true - turbo@1.13.4: + turbo@2.0.7: optionalDependencies: - turbo-darwin-64: 1.13.4 - turbo-darwin-arm64: 1.13.4 - turbo-linux-64: 1.13.4 - turbo-linux-arm64: 1.13.4 - turbo-windows-64: 1.13.4 - turbo-windows-arm64: 1.13.4 + turbo-darwin-64: 2.0.7 + turbo-darwin-arm64: 2.0.7 + turbo-linux-64: 2.0.7 + turbo-linux-arm64: 2.0.7 + turbo-windows-64: 2.0.7 + turbo-windows-arm64: 2.0.7 type-check@0.4.0: dependencies: diff --git a/tooling/eslint/package.json b/tooling/eslint/package.json index b9c678f33..505596472 100644 --- a/tooling/eslint/package.json +++ b/tooling/eslint/package.json @@ -18,7 +18,7 @@ "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint-config-prettier": "^9.1.0", - "eslint-config-turbo": "^1.13.2", + "eslint-config-turbo": "^2.0.0", "@ufb/eslint-plugin-header": "workspace:*", "eslint-plugin-import": "^2.29.1", "eslint-plugin-prettier": "^5.1.3", diff --git a/turbo.json b/turbo.json index 655b26106..a02672fdc 100644 --- a/turbo.json +++ b/turbo.json @@ -1,8 +1,7 @@ { "$schema": "https://turbo.build/schema.json", - "experimentalUI": true, - "globalDependencies": ["**/.env"], - "pipeline": { + "ui": "tui", + "tasks": { "topo": { "dependsOn": ["^topo"] }, @@ -22,7 +21,7 @@ }, "format": { "outputs": ["node_modules/.cache/.prettiercache"], - "outputMode": "new-only" + "outputLogs": "new-only" }, "@ufb/tailwind#build": { "outputs": ["dist/**"] @@ -48,6 +47,7 @@ "cache": false } }, + "globalDependencies": ["**/.env"], "globalEnv": [ "NODE_ENV", "SESSION_PASSWORD", @@ -72,6 +72,9 @@ "AUTO_MIGRATION", "MASTER_API_KEY", "BASE_URL", - "NEXT_PUBLIC_MAX_DAYS" - ] + "NEXT_PUBLIC_MAX_DAYS", + "SKIP_ENV_VALIDATION", + "PORT" + ], + "globalPassThroughEnv": ["NODE_ENV", "CI", "npm_lifecycle_event"] }