From 1fdd28b2b31e5ca4f57467905551a3063cd6d9b2 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Mon, 13 May 2024 17:06:04 +0800 Subject: [PATCH] chore: build oauth2 connector on prepack (#5855) --- .github/workflows/main.yml | 4 ---- .github/workflows/upload-annotations.yml | 4 ---- .scripts/publish.js | 4 ---- packages/connectors/connector-oauth2/package.json | 3 ++- packages/connectors/templates/sync-preset.js | 4 +++- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dc43d495d..2bd1a7276 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,10 +40,6 @@ jobs: - name: Prepack run: pnpm prepack - # Build connectors before running lint since some connectors rely on the generated types - - name: Build connectors - run: pnpm connectors build - - name: Lint run: pnpm ci:lint diff --git a/.github/workflows/upload-annotations.yml b/.github/workflows/upload-annotations.yml index eba88c963..835c8fd07 100644 --- a/.github/workflows/upload-annotations.yml +++ b/.github/workflows/upload-annotations.yml @@ -29,10 +29,6 @@ jobs: - name: Prepack run: pnpm prepack - # Build connectors before running lint since some connectors rely on the generated types - - name: Build connectors - run: pnpm connectors build - - name: Lint with Report run: pnpm -r --parallel lint:report && node .scripts/merge-eslint-reports.js diff --git a/.scripts/publish.js b/.scripts/publish.js index 77dec0d57..e47612dc4 100644 --- a/.scripts/publish.js +++ b/.scripts/publish.js @@ -52,10 +52,6 @@ if (taggedPackages.length === 0) { try { execSync('pnpm prepack'); - /** - * Build connectors before publish since some connectors rely on the generated types from oauth2 connector package. - */ - execSync('pnpm connectors build'); execSync('pnpm -r publish'); execSync('git push --follow-tags'); } catch (error) { diff --git a/packages/connectors/connector-oauth2/package.json b/packages/connectors/connector-oauth2/package.json index f360e9382..d05c0b6a9 100644 --- a/packages/connectors/connector-oauth2/package.json +++ b/packages/connectors/connector-oauth2/package.json @@ -33,7 +33,8 @@ "lint:report": "pnpm lint --format json --output-file report.json", "test": "vitest src", "test:ci": "pnpm run test --silent --coverage", - "prepublishOnly": "pnpm build" + "prepublishOnly": "pnpm build", + "prepack": "pnpm build" }, "engines": { "node": "^20.9.0" diff --git a/packages/connectors/templates/sync-preset.js b/packages/connectors/templates/sync-preset.js index 65225ca18..324604176 100644 --- a/packages/connectors/templates/sync-preset.js +++ b/packages/connectors/templates/sync-preset.js @@ -17,8 +17,10 @@ const templateKeys = Object.keys(templateJson); /** * An object that contains exceptions for scripts that are allowed to be different from the template. + * Value format: `{ "": [""] }` + * Example: `{ "connector-oauth2": ["prepack"] }` */ -const scriptExceptions = {}; +const scriptExceptions = { 'connector-oauth2': ['prepack'] }; const sync = async () => { const packagesDirectory = './';