From cadef2231e362eda59ecc8265d3e859dbda06c8a Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Sat, 14 Oct 2023 12:20:00 -0400 Subject: [PATCH 1/4] build(repo): Narrow Turborepo inputs for tasks --- ...est.afterEnv.ts => jest.setup-after-env.ts | 0 package.json | 8 ++-- packages/backend/turbo.json | 18 ++++++++ packages/chrome-extension/jest.config.js | 2 +- packages/chrome-extension/turbo.json | 29 ++++++++++++ packages/clerk-js/jest.config.js | 4 +- ...estAfterEnv.ts => jest.setup-after-env.ts} | 0 .../clerk-js/{setupJest.ts => jest.setup.ts} | 0 packages/clerk-js/tsconfig.test.json | 2 +- packages/clerk-js/turbo.json | 35 +++++++++++++++ packages/fastify/turbo.json | 20 +++++++++ packages/nextjs/turbo.json | 24 ++++++++++ packages/react/jest.config.js | 2 +- packages/react/turbo.json | 31 +++++++++++++ packages/remix/turbo.json | 31 +++++++++++++ packages/sdk-node/jest.config.js | 2 +- .../{setupEnvVars.js => jest.setup.js} | 0 packages/sdk-node/turbo.json | 32 +++++++++++++ packages/shared/jest.config.js | 2 +- .../shared/{setupJest.ts => jest.setup.ts} | 0 packages/shared/turbo.json | 33 ++++++++++++++ packages/themes/turbo.json | 8 ++++ packages/types/turbo.json | 8 ++++ tsconfig.eslint.json | 16 +++---- turbo.json | 45 +++++++++---------- 25 files changed, 308 insertions(+), 44 deletions(-) rename setupJest.afterEnv.ts => jest.setup-after-env.ts (100%) create mode 100644 packages/backend/turbo.json create mode 100644 packages/chrome-extension/turbo.json rename packages/clerk-js/{setupJestAfterEnv.ts => jest.setup-after-env.ts} (100%) rename packages/clerk-js/{setupJest.ts => jest.setup.ts} (100%) create mode 100644 packages/clerk-js/turbo.json create mode 100644 packages/fastify/turbo.json create mode 100644 packages/nextjs/turbo.json create mode 100644 packages/react/turbo.json create mode 100644 packages/remix/turbo.json rename packages/sdk-node/{setupEnvVars.js => jest.setup.js} (100%) create mode 100644 packages/sdk-node/turbo.json rename packages/shared/{setupJest.ts => jest.setup.ts} (100%) create mode 100644 packages/shared/turbo.json create mode 100644 packages/themes/turbo.json create mode 100644 packages/types/turbo.json diff --git a/setupJest.afterEnv.ts b/jest.setup-after-env.ts similarity index 100% rename from setupJest.afterEnv.ts rename to jest.setup-after-env.ts diff --git a/package.json b/package.json index b431372e4f..3fd2e42ea9 100644 --- a/package.json +++ b/package.json @@ -88,10 +88,10 @@ "version": "changeset version && ./scripts/version-info.sh", "version:snapshot": "./scripts/snapshot.mjs", "version:staging": "./scripts/staging.mjs", - "release": "FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags", - "release:snapshot": "FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag", - "release:staging": "FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag", - "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi", + "release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags", + "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag", + "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag", + "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi", "update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo" } } diff --git a/packages/backend/turbo.json b/packages/backend/turbo.json new file mode 100644 index 0000000000..bf9728f402 --- /dev/null +++ b/packages/backend/turbo.json @@ -0,0 +1,18 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": ["src/**", "tsup.config.ts", "tsconfig.json", "tsconfig.declarations.json"] + }, + "test": { + "inputs": [ + "src/**", + "tests/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "tsconfig.test.json" + ] + } + } +} diff --git a/packages/chrome-extension/jest.config.js b/packages/chrome-extension/jest.config.js index 882e10b0fe..6bab963d68 100644 --- a/packages/chrome-extension/jest.config.js +++ b/packages/chrome-extension/jest.config.js @@ -7,7 +7,7 @@ module.exports = { roots: ['/src'], testEnvironment: 'jsdom', - setupFilesAfterEnv: ['../../setupJest.afterEnv.ts'], + setupFilesAfterEnv: ['../../jest.setup-after-env.ts'], moduleDirectories: ['node_modules', '/src'], transform: { diff --git a/packages/chrome-extension/turbo.json b/packages/chrome-extension/turbo.json new file mode 100644 index 0000000000..806cc94fe2 --- /dev/null +++ b/packages/chrome-extension/turbo.json @@ -0,0 +1,29 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + + "!coverage/**", + "!src/**/*.test.*", + "!src/**/__snapshots__/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "jest.*", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + + "!coverage/**", + "!src/**/__snapshots__/**" + ] + } + } +} diff --git a/packages/clerk-js/jest.config.js b/packages/clerk-js/jest.config.js index 21b5eeb4c1..b845500891 100644 --- a/packages/clerk-js/jest.config.js +++ b/packages/clerk-js/jest.config.js @@ -5,8 +5,8 @@ const config = { testEnvironment: '/jsdom-with-timezone.ts', roots: ['/src'], - setupFiles: ['./setupJest.ts'], - setupFilesAfterEnv: ['./setupJestAfterEnv.ts'], + setupFiles: ['./jest.setup.ts'], + setupFilesAfterEnv: ['./jest.setup-after-env.ts'], testRegex: [ '/__tests__/(.+/)*.*.test.[jt]sx?$', '/ui/.*/__tests__/.*.test.[jt]sx?$', diff --git a/packages/clerk-js/setupJestAfterEnv.ts b/packages/clerk-js/jest.setup-after-env.ts similarity index 100% rename from packages/clerk-js/setupJestAfterEnv.ts rename to packages/clerk-js/jest.setup-after-env.ts diff --git a/packages/clerk-js/setupJest.ts b/packages/clerk-js/jest.setup.ts similarity index 100% rename from packages/clerk-js/setupJest.ts rename to packages/clerk-js/jest.setup.ts diff --git a/packages/clerk-js/tsconfig.test.json b/packages/clerk-js/tsconfig.test.json index 97f9024bed..72bee288c2 100644 --- a/packages/clerk-js/tsconfig.test.json +++ b/packages/clerk-js/tsconfig.test.json @@ -1,5 +1,5 @@ { "extends": "./tsconfig.json", - "include": ["src/**/*", "./setupJestAfterEnv.ts"], + "include": ["src/**/*", "./jest.setup-after-env.ts"], "exclude": ["node_modules"] } diff --git a/packages/clerk-js/turbo.json b/packages/clerk-js/turbo.json new file mode 100644 index 0000000000..777ad05788 --- /dev/null +++ b/packages/clerk-js/turbo.json @@ -0,0 +1,35 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "headless/**", + "bundlewatch.config.json", + "tsconfig.json", + "tsconfig.declarations.json", + "webpack.config.js", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "headless/**", + "jest.*", + "svgTransform.js", + "webpack.config.js", + "tsconfig.json", + "tsconfig.test.json", + "!**/__snapshots__/**", + "!coverage/**" + ] + } + } +} diff --git a/packages/fastify/turbo.json b/packages/fastify/turbo.json new file mode 100644 index 0000000000..aee16686bd --- /dev/null +++ b/packages/fastify/turbo.json @@ -0,0 +1,20 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "tsup.config.ts", + "tsconfig.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": ["src/**", "jest.*", "tsup.config.ts", "tsconfig.json", "!**/__snapshots__/**", "!coverage/**"] + } + } +} diff --git a/packages/nextjs/turbo.json b/packages/nextjs/turbo.json new file mode 100644 index 0000000000..83d85a35ec --- /dev/null +++ b/packages/nextjs/turbo.json @@ -0,0 +1,24 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "**/package.json", + "src/**", + "!examples/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**" + ] + }, + "test": { + "inputs": ["src/**", "jest.*", "tsup.config.ts", "tsconfig.*", "!**/__snapshots__/**", "!coverage/**"] + } + } +} diff --git a/packages/react/jest.config.js b/packages/react/jest.config.js index 44b634b714..e37103a571 100644 --- a/packages/react/jest.config.js +++ b/packages/react/jest.config.js @@ -4,7 +4,7 @@ module.exports = { roots: ['/src'], testEnvironment: 'jsdom', - setupFilesAfterEnv: ['../../setupJest.afterEnv.ts'], + setupFilesAfterEnv: ['../../jest.setup-after-env.ts'], moduleDirectories: ['node_modules', '/src'], transform: { diff --git a/packages/react/turbo.json b/packages/react/turbo.json new file mode 100644 index 0000000000..d2e77c6389 --- /dev/null +++ b/packages/react/turbo.json @@ -0,0 +1,31 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "jest.*", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.*.json", + "!**/__snapshots__/**", + "!coverage/**" + ] + } + } +} diff --git a/packages/remix/turbo.json b/packages/remix/turbo.json new file mode 100644 index 0000000000..d2e77c6389 --- /dev/null +++ b/packages/remix/turbo.json @@ -0,0 +1,31 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "jest.*", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.*.json", + "!**/__snapshots__/**", + "!coverage/**" + ] + } + } +} diff --git a/packages/sdk-node/jest.config.js b/packages/sdk-node/jest.config.js index 13a98183d6..bf00d606ee 100644 --- a/packages/sdk-node/jest.config.js +++ b/packages/sdk-node/jest.config.js @@ -4,7 +4,7 @@ module.exports = { transform: { '^.+\\.ts$': 'ts-jest', }, - setupFiles: ['/setupEnvVars.js'], + setupFiles: ['/jest.setup.js'], collectCoverage: true, // Jest currently does not support package.json subpath imports // so we manually map them to the actual files. See @clerk/backend/package.json diff --git a/packages/sdk-node/setupEnvVars.js b/packages/sdk-node/jest.setup.js similarity index 100% rename from packages/sdk-node/setupEnvVars.js rename to packages/sdk-node/jest.setup.js diff --git a/packages/sdk-node/turbo.json b/packages/sdk-node/turbo.json new file mode 100644 index 0000000000..aae5e90145 --- /dev/null +++ b/packages/sdk-node/turbo.json @@ -0,0 +1,32 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "scripts/**", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "jest.*", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.*.json", + "!**/__snapshots__/**", + "!coverage/**" + ] + } + } +} diff --git a/packages/shared/jest.config.js b/packages/shared/jest.config.js index d2615837d8..a2b723665c 100644 --- a/packages/shared/jest.config.js +++ b/packages/shared/jest.config.js @@ -5,7 +5,7 @@ const config = { testEnvironment: 'jsdom', roots: ['/src'], - setupFiles: ['./setupJest.ts'], + setupFiles: ['./jest.setup.ts'], collectCoverage: false, coverageProvider: 'v8', diff --git a/packages/shared/setupJest.ts b/packages/shared/jest.setup.ts similarity index 100% rename from packages/shared/setupJest.ts rename to packages/shared/jest.setup.ts diff --git a/packages/shared/turbo.json b/packages/shared/turbo.json new file mode 100644 index 0000000000..a426177a8c --- /dev/null +++ b/packages/shared/turbo.json @@ -0,0 +1,33 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": [ + "src/**", + "global.d.ts", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.declarations.json", + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**" + ] + }, + "test": { + "inputs": [ + "src/**", + "jest.*", + "global.d.ts", + "tsup.config.ts", + "tsconfig.json", + "tsconfig.*.json", + "!**/__snapshots__/**", + "!coverage/**" + ] + } + } +} diff --git a/packages/themes/turbo.json b/packages/themes/turbo.json new file mode 100644 index 0000000000..04b16095e1 --- /dev/null +++ b/packages/themes/turbo.json @@ -0,0 +1,8 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": ["src/**", "tsconfig.json", "tsconfig.buid.json"] + } + } +} diff --git a/packages/types/turbo.json b/packages/types/turbo.json new file mode 100644 index 0000000000..e8b84233f8 --- /dev/null +++ b/packages/types/turbo.json @@ -0,0 +1,8 @@ +{ + "extends": ["//"], + "pipeline": { + "build": { + "inputs": ["src/**", "tsconfig.*"] + } + } +} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index d67b88526c..cf89b1187b 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -5,16 +5,16 @@ "allowJs": true }, "include": [ + ".eslintrc.js", + "commitlint.config.js", + "jest.*.ts", + "integration/*/*.js", + "integration/**/*.ts", + "integration/**/*.tsx", "packages/*/src", + "packages/*/*.js", "packages/**/*.ts", "packages/**/*.tsx", - "packages/*/*.js", - "integration/**/*.ts", - "integration/**/*.tsx", - "integration/*/*.js", - ".eslintrc.js", - "commitlint.config.js", - "scripts/*.mjs", - "setupJest.afterEnv.ts" + "scripts/*.mjs" ] } diff --git a/turbo.json b/turbo.json index 4b1881aecf..4acc38ec0b 100644 --- a/turbo.json +++ b/turbo.json @@ -3,42 +3,34 @@ "remoteCache": { "signature": true }, - "globalDependencies": [ + ".*", + "jest.*.ts", "packages/eslint-config-custom/index.js", "package.json", "package-lock.json", - "setupJest.afterEnv.ts", "tsconfig.json", - "tsconfig.*.json" + "tsconfig.*.json", + "verdaccio.*.yaml" ], "globalEnv": [ + "CI", + "CLERK_*", + "GATSBY_CLERK_*", + "NEXT_PUBLIC_CLERK_*", + "NODE_ENV", + "NODE_EXTRA_CA_CERTS", "NODE_VERSION", "NPM_VERSION", - "NODE_ENV", - "VERCEL", - "CLERK_JS_VERSION", - "CLERK_API_URL", - "CLERK_API_VERSION", - "CLERK_API_KEY", - "CLERK_SECRET_KEY", - "GATSBY_CLERK_JS", - "GATSBY_CLERK_FRONTEND_API", - "GATSBY_CLERK_PROXY_URL", - "GATSBY_CLERK_PUBLISHABLE_KEY", - "NEXT_PUBLIC_CLERK_JS_VERSION", - "NEXT_PUBLIC_CLERK_JS", - "NEXT_PUBLIC_CLERK_FRONTEND_API", - "NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY", - "NEXT_PUBLIC_CLERK_DOMAIN", - "NEXT_PUBLIC_CLERK_PROXY_URL", - "NEXT_PUBLIC_CLERK_IS_SATELLITE", - "NEXT_PUBLIC_CLERK_SIGN_IN_URL", - "NEXT_PUBLIC_CLERK_SIGN_UP_URL" + "RUNNER_ARCH", + "RUNNER_DEBUG", + "RUNNER_OS", + "VERCEL" ], "pipeline": { "build": { "dependsOn": ["^build"], + "outputMode": "new-only", "outputs": ["dist/**"] }, "dev": { @@ -46,8 +38,8 @@ "cache": false }, "dev:current": { - "dependsOn": ["^build", "dev"], "cache": false, + "dependsOn": ["^build", "dev"], "persistent": true }, "clean": { @@ -56,14 +48,17 @@ }, "test": { "dependsOn": ["build"], + "outputMode": "new-only", "outputs": [] }, "test:ci": { "dependsOn": ["build"], + "outputMode": "new-only", "outputs": [] }, "lint": { - "dependsOn": ["build"], + "dependsOn": ["^build"], + "inputs": ["src/**"], "outputs": [] }, "lint:publint": { From 22ab6a918736645cb024a6783cfa428fb0fd3427 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Sat, 14 Oct 2023 13:41:05 -0400 Subject: [PATCH 2/4] build(repo): Consolidate common inputs --- .changeset/dull-ducks-dance.md | 2 + packages/backend/turbo.json | 18 ------- packages/chrome-extension/turbo.json | 29 ---------- packages/clerk-js/jest.config.js | 2 +- ...imezone.ts => jest.jsdom-with-timezone.ts} | 0 packages/clerk-js/turbo.json | 48 ++++++++++++++--- packages/fastify/turbo.json | 20 ------- packages/nextjs/turbo.json | 24 --------- packages/react/turbo.json | 31 ----------- packages/remix/turbo.json | 31 ----------- packages/sdk-node/turbo.json | 22 ++++---- packages/shared/turbo.json | 33 ------------ packages/themes/turbo.json | 8 --- packages/types/turbo.json | 8 --- turbo.json | 53 +++++++++++++++++++ 15 files changed, 106 insertions(+), 223 deletions(-) create mode 100644 .changeset/dull-ducks-dance.md delete mode 100644 packages/backend/turbo.json delete mode 100644 packages/chrome-extension/turbo.json rename packages/clerk-js/{jsdom-with-timezone.ts => jest.jsdom-with-timezone.ts} (100%) delete mode 100644 packages/fastify/turbo.json delete mode 100644 packages/nextjs/turbo.json delete mode 100644 packages/react/turbo.json delete mode 100644 packages/remix/turbo.json delete mode 100644 packages/shared/turbo.json delete mode 100644 packages/themes/turbo.json delete mode 100644 packages/types/turbo.json diff --git a/.changeset/dull-ducks-dance.md b/.changeset/dull-ducks-dance.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/dull-ducks-dance.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/packages/backend/turbo.json b/packages/backend/turbo.json deleted file mode 100644 index bf9728f402..0000000000 --- a/packages/backend/turbo.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": ["src/**", "tsup.config.ts", "tsconfig.json", "tsconfig.declarations.json"] - }, - "test": { - "inputs": [ - "src/**", - "tests/**", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - "tsconfig.test.json" - ] - } - } -} diff --git a/packages/chrome-extension/turbo.json b/packages/chrome-extension/turbo.json deleted file mode 100644 index 806cc94fe2..0000000000 --- a/packages/chrome-extension/turbo.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "src/**", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - - "!coverage/**", - "!src/**/*.test.*", - "!src/**/__snapshots__/**" - ] - }, - "test": { - "inputs": [ - "src/**", - "jest.*", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - - "!coverage/**", - "!src/**/__snapshots__/**" - ] - } - } -} diff --git a/packages/clerk-js/jest.config.js b/packages/clerk-js/jest.config.js index b845500891..3464b1d103 100644 --- a/packages/clerk-js/jest.config.js +++ b/packages/clerk-js/jest.config.js @@ -3,7 +3,7 @@ const config = { displayName: 'clerk-js', injectGlobals: true, - testEnvironment: '/jsdom-with-timezone.ts', + testEnvironment: '/jest.jsdom-with-timezone.ts', roots: ['/src'], setupFiles: ['./jest.setup.ts'], setupFilesAfterEnv: ['./jest.setup-after-env.ts'], diff --git a/packages/clerk-js/jsdom-with-timezone.ts b/packages/clerk-js/jest.jsdom-with-timezone.ts similarity index 100% rename from packages/clerk-js/jsdom-with-timezone.ts rename to packages/clerk-js/jest.jsdom-with-timezone.ts diff --git a/packages/clerk-js/turbo.json b/packages/clerk-js/turbo.json index 777ad05788..07391097f9 100644 --- a/packages/clerk-js/turbo.json +++ b/packages/clerk-js/turbo.json @@ -3,32 +3,66 @@ "pipeline": { "build": { "inputs": [ - "src/**", - "headless/**", + "*.d.ts", + "**/package.json", "bundlewatch.config.json", + "headless/**", + "src/**", "tsconfig.json", + "tsconfig.build.json", "tsconfig.declarations.json", + "tsup.config.ts", "webpack.config.js", + "!**/**/*.test.*", "!**/test/**", "!**/tests/**", "!**/__tests__/**", "!**/__mocks__/**", "!**/__snapshots__/**", - "!coverage/**" + "!coverage/**", + "!examples/**", + "!node_modules/**" ] }, "test": { "inputs": [ - "src/**", - "headless/**", + "*.d.ts", + "**/package.json", + "bundlewatch.config.json", "jest.*", + "src/**", "svgTransform.js", + "tests/**", + "tsconfig.json", + "tsconfig.*.json", + "tsup.config.ts", "webpack.config.js", + + "!**/__snapshots__/**", + "!coverage/**", + "!examples/**", + "!node_modules/**" + ] + }, + "test:ci": { + "dependsOn": ["build"], + "inputs": [ + "*.d.ts", + "**/package.json", + "bundlewatch.config.json", + "jest.*", + "src/**", + "tests/**", "tsconfig.json", - "tsconfig.test.json", + "tsconfig.*.json", + "tsup.config.ts", + "webpack.config.js", + "!**/__snapshots__/**", - "!coverage/**" + "!coverage/**", + "!examples/**", + "!node_modules/**" ] } } diff --git a/packages/fastify/turbo.json b/packages/fastify/turbo.json deleted file mode 100644 index aee16686bd..0000000000 --- a/packages/fastify/turbo.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "src/**", - "tsup.config.ts", - "tsconfig.json", - "!**/**/*.test.*", - "!**/test/**", - "!**/__mocks__/**", - "!**/__snapshots__/**", - "!coverage/**" - ] - }, - "test": { - "inputs": ["src/**", "jest.*", "tsup.config.ts", "tsconfig.json", "!**/__snapshots__/**", "!coverage/**"] - } - } -} diff --git a/packages/nextjs/turbo.json b/packages/nextjs/turbo.json deleted file mode 100644 index 83d85a35ec..0000000000 --- a/packages/nextjs/turbo.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "**/package.json", - "src/**", - "!examples/**", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - "!**/**/*.test.*", - "!**/test/**", - "!**/tests/**", - "!**/__tests__/**", - "!**/__mocks__/**", - "!**/__snapshots__/**" - ] - }, - "test": { - "inputs": ["src/**", "jest.*", "tsup.config.ts", "tsconfig.*", "!**/__snapshots__/**", "!coverage/**"] - } - } -} diff --git a/packages/react/turbo.json b/packages/react/turbo.json deleted file mode 100644 index d2e77c6389..0000000000 --- a/packages/react/turbo.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "src/**", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - "!**/**/*.test.*", - "!**/test/**", - "!**/tests/**", - "!**/__tests__/**", - "!**/__mocks__/**", - "!**/__snapshots__/**", - "!coverage/**" - ] - }, - "test": { - "inputs": [ - "src/**", - "jest.*", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.*.json", - "!**/__snapshots__/**", - "!coverage/**" - ] - } - } -} diff --git a/packages/remix/turbo.json b/packages/remix/turbo.json deleted file mode 100644 index d2e77c6389..0000000000 --- a/packages/remix/turbo.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "src/**", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - "!**/**/*.test.*", - "!**/test/**", - "!**/tests/**", - "!**/__tests__/**", - "!**/__mocks__/**", - "!**/__snapshots__/**", - "!coverage/**" - ] - }, - "test": { - "inputs": [ - "src/**", - "jest.*", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.*.json", - "!**/__snapshots__/**", - "!coverage/**" - ] - } - } -} diff --git a/packages/sdk-node/turbo.json b/packages/sdk-node/turbo.json index aae5e90145..ecf7ee4b7f 100644 --- a/packages/sdk-node/turbo.json +++ b/packages/sdk-node/turbo.json @@ -3,29 +3,25 @@ "pipeline": { "build": { "inputs": [ + "*.d.ts", + "**/package.json", + "cjs/**", + "esm/**", "src/**", "scripts/**", - "tsup.config.ts", "tsconfig.json", "tsconfig.declarations.json", + "tsup.config.ts", + "!**/**/*.test.*", "!**/test/**", "!**/tests/**", "!**/__tests__/**", "!**/__mocks__/**", "!**/__snapshots__/**", - "!coverage/**" - ] - }, - "test": { - "inputs": [ - "src/**", - "jest.*", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.*.json", - "!**/__snapshots__/**", - "!coverage/**" + "!coverage/**", + "!examples/**", + "!node_modules/**" ] } } diff --git a/packages/shared/turbo.json b/packages/shared/turbo.json deleted file mode 100644 index a426177a8c..0000000000 --- a/packages/shared/turbo.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": [ - "src/**", - "global.d.ts", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.declarations.json", - "!**/**/*.test.*", - "!**/test/**", - "!**/tests/**", - "!**/__tests__/**", - "!**/__mocks__/**", - "!**/__snapshots__/**", - "!coverage/**" - ] - }, - "test": { - "inputs": [ - "src/**", - "jest.*", - "global.d.ts", - "tsup.config.ts", - "tsconfig.json", - "tsconfig.*.json", - "!**/__snapshots__/**", - "!coverage/**" - ] - } - } -} diff --git a/packages/themes/turbo.json b/packages/themes/turbo.json deleted file mode 100644 index 04b16095e1..0000000000 --- a/packages/themes/turbo.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": ["src/**", "tsconfig.json", "tsconfig.buid.json"] - } - } -} diff --git a/packages/types/turbo.json b/packages/types/turbo.json deleted file mode 100644 index e8b84233f8..0000000000 --- a/packages/types/turbo.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "build": { - "inputs": ["src/**", "tsconfig.*"] - } - } -} diff --git a/turbo.json b/turbo.json index 4acc38ec0b..714d24c58e 100644 --- a/turbo.json +++ b/turbo.json @@ -25,11 +25,32 @@ "RUNNER_ARCH", "RUNNER_DEBUG", "RUNNER_OS", + "TZ", "VERCEL" ], "pipeline": { "build": { "dependsOn": ["^build"], + "inputs": [ + "*.d.ts", + "**/package.json", + "bundlewatch.config.json", + "src/**", + "tsconfig.json", + "tsconfig.build.json", + "tsconfig.declarations.json", + "tsup.config.ts", + + "!**/**/*.test.*", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**", + "!**/__mocks__/**", + "!**/__snapshots__/**", + "!coverage/**", + "!examples/**", + "!node_modules/**" + ], "outputMode": "new-only", "outputs": ["dist/**"] }, @@ -48,11 +69,43 @@ }, "test": { "dependsOn": ["build"], + "inputs": [ + "*.d.ts", + "**/package.json", + "bundlewatch.config.json", + "jest.*", + "src/**", + "tests/**", + "tsconfig.json", + "tsconfig.*.json", + "tsup.config.ts", + + "!**/__snapshots__/**", + "!coverage/**", + "!examples/**", + "!node_modules/**" + ], "outputMode": "new-only", "outputs": [] }, "test:ci": { "dependsOn": ["build"], + "inputs": [ + "*.d.ts", + "**/package.json", + "bundlewatch.config.json", + "jest.*", + "src/**", + "tests/**", + "tsconfig.json", + "tsconfig.*.json", + "tsup.config.ts", + + "!**/__snapshots__/**", + "!coverage/**", + "!examples/**", + "!node_modules/**" + ], "outputMode": "new-only", "outputs": [] }, From 201750ead46b27100da1a587d7239caea89f1ef2 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Tue, 17 Oct 2023 15:06:40 -0400 Subject: [PATCH 3/4] fix(repo): Fix typo --- package.json | 68 ++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 3fd2e42ea9..492f9dbab8 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,39 @@ "node": ">=16.8.0", "npm": ">=8.5.0" }, + "scripts": { + "build": "FORCE_COLOR=1 turbo build --concurrency=${TURBO_CONCURRENCY:-80%}", + "bundlewatch": "turbo bundlewatch", + "changeset": "npx changeset", + "changeset:empty": "npm run changeset -- --empty", + "clean": "turbo clean", + "dev": "FORCE_COLOR=1 turbo dev --filter=@clerk/* --filter=!@clerk/expo", + "dev:js": "FORCE_COLOR=1 turbo dev:current --filter=@clerk/clerk-js", + "format": "npx prettier --write .", + "format:check": "npx prettier --cache --check .", + "lint": "FORCE_COLOR=1 turbo lint", + "lint:attw": "FORCE_COLOR=1 turbo lint:attw", + "lint:fix": "FORCE_COLOR=1 turbo lint -- --fix", + "lint:publint": "FORCE_COLOR=1 turbo lint:publint", + "nuke": "./scripts/nuke.sh", + "prepare": "husky install", + "release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && npx changeset publish && git push --follow-tags", + "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && npx changeset publish --tag snapshot --no-git-tag", + "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && npx changeset publish --tag staging --no-git-tag", + "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && npx changeset publish --no-git-tag; fi", + "test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", + "test:ci": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", + "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts", + "test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts", + "test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic", + "test:integration:nextjs": "E2E_APP_ID=next.appRouter.withEmailCodes npm run test:integration:base -- --grep @generic", + "test:integration:remix": "echo 'placeholder'", + "update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo", + "version": "npx changeset version && ./scripts/version-info.sh", + "version:snapshot": "./scripts/snapshot.mjs", + "version:staging": "./scripts/staging.mjs", + "yalc:all": "for d in packages/*/; do echo $d; cd $d; yalc push --replace --sig; cd '../../'; done" + }, "devDependencies": { "@arethetypeswrong/cli": "^0.12.1", "@changesets/cli": "^2.26.2", @@ -45,9 +78,9 @@ "husky": "^8.0.3", "jest": "^29.3.1", "jest-environment-jsdom": "^29.3.1", + "lint-staged": "^14.0.1", "npm-cli-adduser": "^1.1.4", "npm-cli-login": "^1.0.0", - "lint-staged": "^14.0.1", "prettier": "^2.8.7", "publint": "^0.2.4", "react": "18.2.0", @@ -60,38 +93,5 @@ "typescript": "^5.2.2", "verdaccio": "^5.26.3", "zx": "^7.2.3" - }, - "scripts": { - "dev": "FORCE_COLOR=1 turbo dev --filter=@clerk/* --filter=!@clerk/expo", - "dev:js": "FORCE_COLOR=1 turbo dev:current --filter=@clerk/clerk-js", - "build": "FORCE_COLOR=1 turbo build --concurrency=${TURBO_CONCURRENCY:-80%}", - "test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", - "test:ci": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", - "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts", - "test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic", - "test:integration:nextjs": "E2E_APP_ID=next.appRouter.withEmailCodes npm run test:integration:base -- --grep \"@generic|@nextjs\"", - "test:integration:remix": "echo 'placeholder'", - "test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts", - "clean": "turbo clean", - "lint": "FORCE_COLOR=1 turbo lint", - "lint:publint": "FORCE_COLOR=1 turbo lint:publint", - "lint:attw": "FORCE_COLOR=1 turbo lint:attw", - "lint:fix": "FORCE_COLOR=1 turbo lint -- --fix", - "bundlewatch": "turbo bundlewatch", - "format": "prettier --write .", - "format:check": "prettier --cache --check .", - "nuke": "./scripts/nuke.sh", - "yalc:all": "for d in packages/*/; do echo $d; cd $d; yalc push --replace --sig; cd '../../'; done", - "prepare": "husky install", - "changeset": "changeset", - "changeset:empty": "npm run changeset -- --empty", - "version": "changeset version && ./scripts/version-info.sh", - "version:snapshot": "./scripts/snapshot.mjs", - "version:staging": "./scripts/staging.mjs", - "release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags", - "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag", - "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag", - "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi", - "update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo" } } From 25b5840dee399767b7963374381e3bfe857bfff4 Mon Sep 17 00:00:00 2001 From: Tom Milewski Date: Wed, 18 Oct 2023 14:49:24 -0400 Subject: [PATCH 4/4] chore(repo): Fix rebase inconsistency --- package.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 492f9dbab8..9fcda4dd92 100644 --- a/package.json +++ b/package.json @@ -1,47 +1,42 @@ { "name": "@clerk/javascript", + "version": "0.0.0", + "private": true, + "license": "MIT", "workspaces": { "packages": [ "packages/*" ] }, - "license": "MIT", - "version": "0.0.0", - "private": true, - "packageManager": "npm@8.5.0", - "engines": { - "node": ">=16.8.0", - "npm": ">=8.5.0" - }, "scripts": { "build": "FORCE_COLOR=1 turbo build --concurrency=${TURBO_CONCURRENCY:-80%}", "bundlewatch": "turbo bundlewatch", - "changeset": "npx changeset", + "changeset": "changeset", "changeset:empty": "npm run changeset -- --empty", "clean": "turbo clean", "dev": "FORCE_COLOR=1 turbo dev --filter=@clerk/* --filter=!@clerk/expo", "dev:js": "FORCE_COLOR=1 turbo dev:current --filter=@clerk/clerk-js", - "format": "npx prettier --write .", - "format:check": "npx prettier --cache --check .", + "format": "prettier --write .", + "format:check": "prettier --cache --check .", "lint": "FORCE_COLOR=1 turbo lint", "lint:attw": "FORCE_COLOR=1 turbo lint:attw", "lint:fix": "FORCE_COLOR=1 turbo lint -- --fix", "lint:publint": "FORCE_COLOR=1 turbo lint:publint", "nuke": "./scripts/nuke.sh", "prepare": "husky install", - "release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && npx changeset publish && git push --follow-tags", - "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && npx changeset publish --tag snapshot --no-git-tag", - "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && npx changeset publish --tag staging --no-git-tag", - "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && npx changeset publish --no-git-tag; fi", + "release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags", + "release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag", + "release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag", + "release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi", "test": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", "test:ci": "FORCE_COLOR=1 turbo test --concurrency=${TURBO_CONCURRENCY:-80%}", "test:integration:base": "DEBUG=1 npx playwright test --config integration/playwright.config.ts", "test:integration:deployment:nextjs": "DEBUG=1 npx playwright test --config integration/playwright.deployments.config.ts", "test:integration:generic": "E2E_APP_ID=react.vite.* npm run test:integration:base -- --grep @generic", - "test:integration:nextjs": "E2E_APP_ID=next.appRouter.withEmailCodes npm run test:integration:base -- --grep @generic", + "test:integration:nextjs": "E2E_APP_ID=next.appRouter.withEmailCodes npm run test:integration:base -- --grep \"@generic|@nextjs\"", "test:integration:remix": "echo 'placeholder'", "update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo", - "version": "npx changeset version && ./scripts/version-info.sh", + "version": "changeset version && ./scripts/version-info.sh", "version:snapshot": "./scripts/snapshot.mjs", "version:staging": "./scripts/staging.mjs", "yalc:all": "for d in packages/*/; do echo $d; cd $d; yalc push --replace --sig; cd '../../'; done" @@ -93,5 +88,10 @@ "typescript": "^5.2.2", "verdaccio": "^5.26.3", "zx": "^7.2.3" + }, + "packageManager": "npm@8.5.0", + "engines": { + "node": ">=16.8.0", + "npm": ">=8.5.0" } }