From a4a149af100bbba3c6d02a28362e864dd774eb07 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Sat, 14 Sep 2024 18:09:03 -0400 Subject: [PATCH] test --- .github/workflows/analyze-docs-bundle.yml | 76 ------------------- .../workflows/deploy-docs-bundle-preview.yml | 30 ++++++++ packages/ui/app/package.json | 2 +- packages/ui/app/tsconfig.json | 4 +- packages/ui/chatbot/package.json | 1 - packages/ui/chatbot/tsconfig.app.json | 3 +- packages/ui/chatbot/tsconfig.json | 11 +-- 7 files changed, 35 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/analyze-docs-bundle.yml diff --git a/.github/workflows/analyze-docs-bundle.yml b/.github/workflows/analyze-docs-bundle.yml deleted file mode 100644 index 0f7d4086fa..0000000000 --- a/.github/workflows/analyze-docs-bundle.yml +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright (c) HashiCorp, Inc. -# SPDX-License-Identifier: MPL-2.0 - -name: "Next.js Bundle Analysis" -env: - VERCEL_ORG_ID: team_6FKOM5nw037hv8g2mTk3gaH7 - VERCEL_PROJECT_ID: prj_QX3venU6jwRUmdt8ArfL8AU5r1d4 - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: "buildwithfern" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - -on: - pull_request: - push: - branches: - - main # change this if your default branch is named differently - workflow_dispatch: - -defaults: - run: - # change this if your nextjs app does not live at the root of the repo - working-directory: ./ - -permissions: - contents: read # for checkout repository - actions: read # for fetching base branch bundle stats - pull-requests: write # for comments - -jobs: - analyze: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Build bundle analysis - uses: ./.github/actions/vercel - id: deploy - env: - ANALYZE: 1 - with: - token: ${{ secrets.VERCEL_TOKEN }} - package: "@fern-ui/docs-bundle" - environment: production - skip_deploy: true - - - name: Analyze bundle - run: pnpm --package=nextjs-bundle-analysis dlx report - - - name: Upload analysis - uses: actions/upload-artifact@v4 - with: - name: analyze - path: packages/ui/docs-bundle/.next/analyze/ - - - name: Download base branch bundle stats - uses: dawidd6/action-download-artifact@v2 - if: success() && github.event.number - with: - workflow: nextjs_bundle_analysis.yml - branch: ${{ github.event.pull_request.base.ref }} - path: packages/ui/docs-bundle/.next/analyze/base - - # https://infrequently.org/2021/03/the-performance-inequality-gap/ - - name: Compare with base branch bundle - if: success() && github.event.number - run: ls -laR packages/ui/docs-bundle/.next/analyze/base && pnpm --package=nextjs-bundle-analysis dlx compare - - - name: Comment PR Preview - uses: thollander/actions-comment-pull-request@v2 - with: - filePath: packages/ui/docs-bundle/.next/analyze/__bundle_analysis_comment.txt - comment_tag: bundle_analysis diff --git a/.github/workflows/deploy-docs-bundle-preview.yml b/.github/workflows/deploy-docs-bundle-preview.yml index 52c018a58f..ee5d7088f5 100644 --- a/.github/workflows/deploy-docs-bundle-preview.yml +++ b/.github/workflows/deploy-docs-bundle-preview.yml @@ -65,6 +65,7 @@ jobs: uses: ./.github/actions/vercel id: deploy env: + ANALYZE: 1 VERCEL_PROJECT_ID: prj_QnsiTm1ijJP6cS23K5da6lL02wbp with: token: ${{ secrets.VERCEL_TOKEN }} @@ -80,6 +81,35 @@ jobs: name: domains path: domains.txt + - name: Analyze bundle + run: pnpm --package=nextjs-bundle-analysis dlx report + + - name: Upload analysis + uses: actions/upload-artifact@v4 + with: + name: analyze + path: packages/ui/docs-bundle/.next/analyze/ + + - name: Download base branch bundle stats + uses: dawidd6/action-download-artifact@v2 + if: success() && github.event.number + with: + workflow: nextjs_bundle_analysis.yml + branch: ${{ github.event.pull_request.base.ref }} + path: packages/ui/docs-bundle/.next/analyze/base + + # https://infrequently.org/2021/03/the-performance-inequality-gap/ + - name: Compare with base branch bundle + if: success() && github.event.number + run: ls -laR packages/ui/docs-bundle/.next/analyze/base && pnpm --package=nextjs-bundle-analysis dlx compare + + - name: Comment PR Preview + if: github.event_name == 'pull_request' + uses: thollander/actions-comment-pull-request@v2 + with: + filePath: packages/ui/docs-bundle/.next/analyze/__bundle_analysis_comment.txt + comment_tag: bundle_analysis + ete: needs: deploy runs-on: ubuntu-latest diff --git a/packages/ui/app/package.json b/packages/ui/app/package.json index e78f4c6e8d..23455897f5 100644 --- a/packages/ui/app/package.json +++ b/packages/ui/app/package.json @@ -35,7 +35,7 @@ ], "scripts": { "clean": "rm -rf ./lib && tsc --build --clean", - "compile": "tsc --build", + "build": "tsc --build", "test": "vitest --run --passWithNoTests --globals --disable-console-intercept", "lint:eslint": "eslint --max-warnings 0 . --ignore-path=../../../.eslintignore", "lint:eslint:fix": "pnpm lint:eslint --fix", diff --git a/packages/ui/app/tsconfig.json b/packages/ui/app/tsconfig.json index 3fad2464da..21f290192a 100644 --- a/packages/ui/app/tsconfig.json +++ b/packages/ui/app/tsconfig.json @@ -6,9 +6,7 @@ "outDir": "./dist", "rootDir": "." }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../commons/core-utils" diff --git a/packages/ui/chatbot/package.json b/packages/ui/chatbot/package.json index e1fb79d866..34c09611df 100644 --- a/packages/ui/chatbot/package.json +++ b/packages/ui/chatbot/package.json @@ -14,7 +14,6 @@ "source": "src/index.ts", "module": "src/index.ts", "main": "src/index.ts", - "types": "src/index.ts", "sideEffects": [ "*.css", "*.scss" diff --git a/packages/ui/chatbot/tsconfig.app.json b/packages/ui/chatbot/tsconfig.app.json index d739292ae0..525d53e51a 100644 --- a/packages/ui/chatbot/tsconfig.app.json +++ b/packages/ui/chatbot/tsconfig.app.json @@ -23,5 +23,6 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": ["src"] + "include": ["src"], + "references": [{ "path": "../../commons/react/react-commons" }, { "path": "../components" }] } diff --git a/packages/ui/chatbot/tsconfig.json b/packages/ui/chatbot/tsconfig.json index a1f1e72ff1..ea9d0cd825 100644 --- a/packages/ui/chatbot/tsconfig.json +++ b/packages/ui/chatbot/tsconfig.json @@ -1,20 +1,11 @@ { "files": [], "references": [ - { - "path": "../../commons/react/react-commons" - }, - { - "path": "../components" - }, { "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" } - ], - "compilerOptions": { - "composite": true - } + ] }