From 8ce5c106f0657783ea5b570e58bb859f15022c95 Mon Sep 17 00:00:00 2001 From: Andrew Jiang Date: Sat, 14 Sep 2024 19:04:24 -0400 Subject: [PATCH] fixes --- .github/actions/vercel/action.yml | 26 ++++++++++--------- .../workflows/deploy-docs-bundle-preview.yml | 3 +++ .github/workflows/deploy-docs-bundle-prod.yml | 5 ++++ clis/docs-migrator/tsconfig.json | 4 +-- clis/generator-cli/tsconfig.json | 4 +-- packages/commons/fdr-utils/tsconfig.json | 4 +-- packages/commons/loadable/tsconfig.json | 4 +-- .../react/common-components/tsconfig.json | 4 +-- .../commons/react/react-commons/tsconfig.json | 4 +-- .../react/react-query-utils/tsconfig.json | 4 +-- packages/commons/search-utils/tsconfig.json | 4 +-- packages/healthchecks/tsconfig.json | 4 +-- packages/template-resolver/tsconfig.json | 4 +-- packages/ui/components/tsconfig.json | 4 +-- packages/ui/fern-dashboard/tsconfig.json | 20 +++----------- servers/fdr/tsconfig.json | 8 ++---- servers/fern-bot/tsconfig.json | 26 +++++-------------- 17 files changed, 45 insertions(+), 87 deletions(-) diff --git a/.github/actions/vercel/action.yml b/.github/actions/vercel/action.yml index bf09d24fb7..7f7dfe0a31 100644 --- a/.github/actions/vercel/action.yml +++ b/.github/actions/vercel/action.yml @@ -29,6 +29,9 @@ outputs: deployment_url: description: The URL of the deployment value: ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} + skip: + description: Skip the deployment + value: ${{ steps.ignore-build.outputs.exit_code == 0 }} runs: using: "composite" @@ -40,33 +43,32 @@ runs: run_install: false # install is handled by vercel build - name: Ignore Build Step + id: ignore-build shell: bash - if: ${{ inputs.force == 'false' }} + if: inputs.force == 'false' continue-on-error: true run: | pnpx turbo-ignore ${{ inputs.package }} --fallback=HEAD^1 - EXIT_CODE=$? - if [ $EXIT_CODE -ne 0 ]; then - echo "No changes detected in ${{ inputs.package }} since last deployment. Skipping deployment." - exit 0 - fi + export "exit_code=$?" >> $GITHUB_OUTPUT - name: Install Vercel CLI + if: steps.ignore-build.outputs.exit_code == 1 shell: bash run: pnpm install --global vercel@latest - name: Pull Vercel Environment + if: steps.ignore-build.outputs.exit_code == 1 shell: bash run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ inputs.token }} - name: Build Vercel Preview shell: bash - if: ${{ inputs.environment == 'preview' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'preview' run: vercel build --yes --token=${{ inputs.token }} - name: Deploy Vercel Preview shell: bash - if: ${{ inputs.environment == 'preview' && inputs.skip_deploy == 'false' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'preview' && inputs.skip_deploy == 'false' id: deploy-preview run: | DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --token=${{ inputs.token }} --archive=tgz)" @@ -74,12 +76,12 @@ runs: - name: Build Vercel Production shell: bash - if: ${{ inputs.environment == 'production' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production' run: vercel build --yes --prod --token=${{ inputs.token }} - name: Deploy Vercel Production shell: bash - if: ${{ inputs.environment == 'production' && inputs.skip_deploy == 'false' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production' && inputs.skip_deploy == 'false' id: deploy-production run: | DEPLOYMENT_URL="$(vercel deploy --yes --prebuilt --prod --skip-domain --token=${{ inputs.token }} --archive=tgz)" @@ -87,10 +89,10 @@ runs: - name: Wait for Deployment shell: bash - if: ${{ inputs.skip_deploy == 'false' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.skip_deploy == 'false' run: vercel inspect ${{ steps.deploy-preview.outputs.deployment_url || steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }} --wait - name: Promote Vercel Production shell: bash - if: ${{ inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true' }} + if: steps.ignore-build.outputs.exit_code == 1 && inputs.environment == 'production' && inputs.skip_deploy == 'false' && inputs.promote == 'true' run: vercel promote ${{ steps.deploy-production.outputs.deployment_url }} --token=${{ inputs.token }} diff --git a/.github/workflows/deploy-docs-bundle-preview.yml b/.github/workflows/deploy-docs-bundle-preview.yml index 64fd9ef6fd..d12eace1c0 100644 --- a/.github/workflows/deploy-docs-bundle-preview.yml +++ b/.github/workflows/deploy-docs-bundle-preview.yml @@ -23,6 +23,7 @@ jobs: url: ${{ steps.deploy.outputs.deployment_url }} outputs: deployment_url: ${{ steps.deploy.outputs.deployment_url }} + skip: ${{ steps.deploy.outputs.skip }} steps: - uses: actions/checkout@v4 with: @@ -41,6 +42,7 @@ jobs: deploy-dev: needs: deploy # this will run after the deploy job to leverage turbo's build cache + if: needs.deploy.outputs.skip == 'false' runs-on: ubuntu-latest environment: name: Preview - app-dev.buildwithfern.com @@ -94,6 +96,7 @@ jobs: ete: needs: deploy + if: needs.deploy.outputs.skip == 'false' runs-on: ubuntu-latest permissions: write-all steps: diff --git a/.github/workflows/deploy-docs-bundle-prod.yml b/.github/workflows/deploy-docs-bundle-prod.yml index 9be159fd4a..7c9d0c012a 100644 --- a/.github/workflows/deploy-docs-bundle-prod.yml +++ b/.github/workflows/deploy-docs-bundle-prod.yml @@ -22,6 +22,7 @@ jobs: url: ${{ steps.deploy.outputs.deployment_url }} outputs: deployment_url: ${{ steps.deploy.outputs.deployment_url }} + skip: ${{ steps.deploy.outputs.skip }} env: VERCEL_PROJECT_ID: prj_QX3venU6jwRUmdt8ArfL8AU5r1d4 steps: @@ -45,6 +46,7 @@ jobs: url: ${{ steps.deploy.outputs.deployment_url }} outputs: deployment_url: ${{ steps.deploy.outputs.deployment_url }} + skip: ${{ steps.deploy.outputs.skip }} env: VERCEL_PROJECT_ID: prj_SfgTTzw7KefTMuVWsL5uhY8Y4BIt steps: @@ -68,6 +70,7 @@ jobs: url: ${{ steps.deploy.outputs.deployment_url }} outputs: deployment_url: ${{ steps.deploy.outputs.deployment_url }} + skip: ${{ steps.deploy.outputs.skip }} env: VERCEL_PROJECT_ID: prj_GGc6CEzrWNyUK0hq1UK7KmbgUmZn steps: @@ -85,6 +88,7 @@ jobs: ete: needs: deploy_app_buildwithfern_com + if: needs.deploy_app_buildwithfern_com.outputs.skip == 'false' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -112,6 +116,7 @@ jobs: - ${{ needs.deploy_app_buildwithfern_com.outputs.deployment_url }} - ${{ needs.deploy_app_ferndocs_com.outputs.deployment_url }} - ${{ needs.deploy_app-slash_ferndocs_com.outputs.deployment_url }} + if: needs.deploy_app_buildwithfern_com.outputs.skip == 'false' && needs.deploy_app_ferndocs_com.outputs.skip == 'false' && needs.deploy_app-slash_ferndocs_com.outputs.skip == 'false' steps: - uses: actions/checkout@v4 diff --git a/clis/docs-migrator/tsconfig.json b/clis/docs-migrator/tsconfig.json index 3eb112ce22..f3939f11eb 100644 --- a/clis/docs-migrator/tsconfig.json +++ b/clis/docs-migrator/tsconfig.json @@ -6,9 +6,7 @@ "outDir": "./dist", "rootDir": "." }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../packages/commons/core-utils" diff --git a/clis/generator-cli/tsconfig.json b/clis/generator-cli/tsconfig.json index f1896fb8e3..f3c6c4e432 100644 --- a/clis/generator-cli/tsconfig.json +++ b/clis/generator-cli/tsconfig.json @@ -5,9 +5,7 @@ "outDir": "dist", "rootDir": "." }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../packages/commons/github" diff --git a/packages/commons/fdr-utils/tsconfig.json b/packages/commons/fdr-utils/tsconfig.json index 3b65c40f44..54cc57ae2a 100644 --- a/packages/commons/fdr-utils/tsconfig.json +++ b/packages/commons/fdr-utils/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../fdr-sdk" diff --git a/packages/commons/loadable/tsconfig.json b/packages/commons/loadable/tsconfig.json index 0724f13639..574714c47f 100644 --- a/packages/commons/loadable/tsconfig.json +++ b/packages/commons/loadable/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../core-utils" diff --git a/packages/commons/react/common-components/tsconfig.json b/packages/commons/react/common-components/tsconfig.json index f7a51d8cf1..7c653b5944 100644 --- a/packages/commons/react/common-components/tsconfig.json +++ b/packages/commons/react/common-components/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../loadable" diff --git a/packages/commons/react/react-commons/tsconfig.json b/packages/commons/react/react-commons/tsconfig.json index 2aa52187be..ce834f533c 100644 --- a/packages/commons/react/react-commons/tsconfig.json +++ b/packages/commons/react/react-commons/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../core-utils" diff --git a/packages/commons/react/react-query-utils/tsconfig.json b/packages/commons/react/react-query-utils/tsconfig.json index f7a51d8cf1..7c653b5944 100644 --- a/packages/commons/react/react-query-utils/tsconfig.json +++ b/packages/commons/react/react-query-utils/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../loadable" diff --git a/packages/commons/search-utils/tsconfig.json b/packages/commons/search-utils/tsconfig.json index 5682b6117b..a865844d83 100644 --- a/packages/commons/search-utils/tsconfig.json +++ b/packages/commons/search-utils/tsconfig.json @@ -5,9 +5,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../fdr-sdk" diff --git a/packages/healthchecks/tsconfig.json b/packages/healthchecks/tsconfig.json index a7b02ded6c..616842c23b 100644 --- a/packages/healthchecks/tsconfig.json +++ b/packages/healthchecks/tsconfig.json @@ -5,9 +5,7 @@ "outDir": "dist", "rootDir": "." }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../commons/core-utils" diff --git a/packages/template-resolver/tsconfig.json b/packages/template-resolver/tsconfig.json index 30adfab35d..abb355044b 100644 --- a/packages/template-resolver/tsconfig.json +++ b/packages/template-resolver/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../fdr-sdk" diff --git a/packages/ui/components/tsconfig.json b/packages/ui/components/tsconfig.json index 8e8474e515..2f4f25b508 100644 --- a/packages/ui/components/tsconfig.json +++ b/packages/ui/components/tsconfig.json @@ -4,9 +4,7 @@ "outDir": "./dist", "rootDir": "./src" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../commons/react/react-commons" diff --git a/packages/ui/fern-dashboard/tsconfig.json b/packages/ui/fern-dashboard/tsconfig.json index f7529ad5cd..e9ec4fa32c 100644 --- a/packages/ui/fern-dashboard/tsconfig.json +++ b/packages/ui/fern-dashboard/tsconfig.json @@ -2,17 +2,10 @@ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true, - "lib": [ - "ES2020", - "DOM", - "DOM.Iterable" - ], + "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, - "types": [ - "vite/client", - "node" - ], + "types": ["vite/client", "node"], /* Bundler mode */ "moduleResolution": "bundler", "allowImportingTsExtensions": true, @@ -28,15 +21,10 @@ "noFallthroughCasesInSwitch": true, "baseUrl": ".", "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] } }, - "include": [ - "src", - "vite.config.ts" - ], + "include": ["src", "vite.config.ts"], "references": [ { "path": "../../commons/react/react-commons" diff --git a/servers/fdr/tsconfig.json b/servers/fdr/tsconfig.json index 86f08a7c60..e49360dea2 100644 --- a/servers/fdr/tsconfig.json +++ b/servers/fdr/tsconfig.json @@ -5,9 +5,7 @@ "rootDir": "./src", "isolatedModules": false, "paths": { - "@prisma/client": [ - "../prisma/client" - ] + "@prisma/client": ["../prisma/client"] }, "sourceMap": true, "inlineSources": true, @@ -16,9 +14,7 @@ // This improves issue grouping in Sentry. "sourceRoot": "/" }, - "include": [ - "./src/**/*" - ], + "include": ["./src/**/*"], "references": [ { "path": "../../packages/commons/github" diff --git a/servers/fern-bot/tsconfig.json b/servers/fern-bot/tsconfig.json index fbe38eb2b4..4fdcaabadc 100644 --- a/servers/fern-bot/tsconfig.json +++ b/servers/fern-bot/tsconfig.json @@ -3,17 +3,10 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@functions/*": [ - "src/functions/*" - ], - "@libs/*": [ - "src/libs/*" - ] + "@functions/*": ["src/functions/*"], + "@libs/*": ["src/libs/*"] }, - "lib": [ - "ESNext", - "DOM" - ], + "lib": ["ESNext", "DOM"], "module": "esnext", "moduleResolution": "node", "noUnusedLocals": true, @@ -24,14 +17,9 @@ "outDir": "lib", "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "types": [ - "vitest/globals" - ] + "types": ["vitest/globals"] }, - "include": [ - "src/**/*.ts", - "serverless.ts" - ], + "include": ["src/**/*.ts", "serverless.ts"], "exclude": [ "node_modules/**/*", ".serverless/**/*", @@ -41,9 +29,7 @@ "src/__test__/**/*" ], "ts-node": { - "require": [ - "tsconfig-paths/register" - ] + "require": ["tsconfig-paths/register"] }, "references": [ {