Skip to content

chore/turbo-prettier #6291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"clean": "turbo clean",
"dev": "TURBO_UI=0 FORCE_COLOR=1 turbo dev --filter=@clerk/* --filter=!@clerk/clerk-expo --filter=!@clerk/tanstack-react-start --filter=!@clerk/elements --filter=!@clerk/remix --filter=!@clerk/chrome-extension",
"dev:js": "TURBO_UI=0 FORCE_COLOR=1 turbo dev:current --filter=@clerk/clerk-js",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"format": "turbo format && node scripts/format-non-workspace.mjs",
"format:check": "turbo format:check && node scripts/format-non-workspace.mjs --check",
"preinstall": "npx only-allow pnpm",
"integration:secrets": "node ./scripts/1password-keys.mjs",
"lint": "node ./scripts/lint.mjs",
Expand Down
2 changes: 2 additions & 0 deletions packages/agent-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
"build": "tsup --env.NODE_ENV production",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile esm-only",
"lint:publint": "publint",
Expand Down
17 changes: 10 additions & 7 deletions packages/astro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@

```astro
---
import { CreateOrganization } from '@clerk/astro/components'
import { CreateOrganization } from '@clerk/astro/components';
---

<CreateOrganization />
Expand Down Expand Up @@ -585,18 +585,21 @@
Regular usage without server islands:

```astro
<Protect role="admin">
<p slot="fallback">Not an admin</p>
<Protect role='admin'>
<p slot='fallback'>Not an admin</p>
<p>You're an admin</p>
</Protect>
```

Example with server islands:

```astro
<Protect server:defer role="admin">
<p slot="fallback">Loading...</p>
<p slot="protect-fallback">Not an admin</p>
<Protect
server:defer
role='admin'
>
<p slot='fallback'>Loading...</p>
<p slot='protect-fallback'>Not an admin</p>
<p>You're an admin</p>
</Protect>
```
Expand Down Expand Up @@ -1231,7 +1234,7 @@

```astro
---
import { SignInButton } from '@clerk/components/astro'
import { SignInButton } from '@clerk/components/astro';
---

<SignInButton asChild>
Expand Down
2 changes: 2 additions & 0 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"build:dts": "tsc --emitDeclarationOnly --declaration",
"copy:components": "rm -rf ./components && mkdir -p ./components/ && cp -r ./src/astro-components/* ./components/ && cp ./src/types.ts ./",
"dev": "tsup --watch --onSuccess \"pnpm build:dts\"",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src env.d.ts",
"lint:attw": "attw --pack . --profile esm-only --ignore-rules internal-resolution-error",
"lint:publint": "pnpm copy:components && publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16 --ignore-rules false-cjs",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
Expand Down
5 changes: 5 additions & 0 deletions packages/clerk-js/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist/
coverage/
node_modules/
.turbo/
*.js.map
2 changes: 2 additions & 0 deletions packages/clerk-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"dev:headless": "rspack serve --config rspack.config.js --env variant=\"clerk.headless.browser\"",
"dev:origin": "rspack serve --config rspack.config.js --env devOrigin=http://localhost:${PORT:-4000}",
"dev:sandbox": "rspack serve --config rspack.config.js --env devOrigin=http://localhost:${PORT:-4000} --env sandbox=1",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16 --ignore-rules named-exports",
"lint:publint": "publint || true",
Expand Down
2 changes: 2 additions & 0 deletions packages/dev-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"clerk-dev": "bin/cli.js"
},
"scripts": {
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/elements/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"build:declarations": "tsc -p tsconfig.declarations.json",
"dev": "tsup --env.NODE_ENV development --watch",
"dev:example": "concurrently \"pnpm dev\" \"pnpm app:dev\"",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/expo-passkeys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"open:android": "open -a \"Android Studio\" example/android",
"open:ios": "xed example/ios",
Expand Down
2 changes: 2 additions & 0 deletions packages/expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"publish:local": "pnpm yalc push --replace --sig",
"test": "vitest run",
Expand Down
2 changes: 2 additions & 0 deletions packages/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"build": "tsup --env.NODE_ENV production",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16 --ignore-rules unexpected-module-syntax",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/localizations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
"postbuild": "node ../../scripts/subpath-workaround.mjs localizations",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"generate": "tsc src/utils/generate.ts && node src/utils/generate.js && prettier --write src/*.ts",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16"
Expand Down
2 changes: 2 additions & 0 deletions packages/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16 --ignore-rules unexpected-module-syntax",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile esm-only",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
"scripts": {
"build": "tsup",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile esm-only",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"postinstall": "node ./scripts/postinstall.mjs",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
Expand Down
2 changes: 2 additions & 0 deletions packages/tanstack-react-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"dev:publish": "pnpm dev -- --env.publish",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile esm-only",
"lint:publint": "publint",
Expand Down
2 changes: 2 additions & 0 deletions packages/testing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"build": "tsup --env.NODE_ENV production",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions packages/themes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"build": "tsc -p tsconfig.build.json",
"clean": "rimraf ./dist",
"dev": "tsc -p tsconfig.build.json --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"build:declarations": "tsc -p tsconfig.declarations.json",
"clean": "rimraf ./dist",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile node16",
"publish:local": "pnpm yalc push --replace --sig"
Expand Down
2 changes: 2 additions & 0 deletions packages/upgrade/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
"build": "pnpm clean && NODE_ENV=production babel --keep-file-extension --out-dir=dist src --copy-files",
"clean": "rm -rf dist/*",
"dev": "babel --keep-file-extension --out-dir=dist --watch src --copy-files",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src/",
"lint:publint": "publint",
"test": "vitest run",
Expand Down
2 changes: 2 additions & 0 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"build": "tsup --onSuccess \"pnpm build:dts\"",
"build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.build.json",
"dev": "tsup --watch",
"format": "prettier --write .",
"format:check": "prettier --cache --check .",
"lint": "eslint src",
"lint:attw": "attw --pack . --profile esm-only --ignore-rules internal-resolution-error",
"lint:publint": "publint",
Expand Down
46 changes: 46 additions & 0 deletions scripts/format-non-workspace.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env node

import { $ } from 'zx';

/**
* Format files that are not part of workspace packages.
* This includes:
* - integration/ directory
* - playground/ directory
* - scripts/ directory
* - .github/ directory
* - Root level config files
*/

const NON_WORKSPACE_PATHS = [
'integration',
'playground',
'scripts',
'.github',
// Root level config files
'*.json',
'*.md',
'*.mjs',
'*.ts',
'*.yaml',
'.prettierrc*',
];

async function formatNonWorkspaceFiles() {
const isCheck = process.argv.includes('--check');
const baseArgs = isCheck
? ['prettier', '--cache', '--check', '--ignore-unknown']
: ['prettier', '--write', '--ignore-unknown'];

console.log(`${isCheck ? 'Checking' : 'Formatting'} non-workspace files...`);

try {
await $`pnpm ${baseArgs} ${NON_WORKSPACE_PATHS}`;
console.log(`✅ Non-workspace files ${isCheck ? 'check passed' : 'formatted successfully'}`);
} catch (error) {
console.error(`❌ Non-workspace files ${isCheck ? 'check failed' : 'formatting failed'}`);
process.exit(1);
}
}

formatNonWorkspaceFiles().catch(console.error);
44 changes: 44 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,51 @@
],
"outputs": []
},
"format": {
"inputs": [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.json",
"**/*.md",
"**/*.mdx",
"**/*.vue",
"**/*.astro",
"**/*.css",
"**/*.scss",
"**/*.html",
"!**/__snapshots__/**",
"!CHANGELOG.md",
"!coverage/**",
"!dist/**",
"!examples/**",
"!node_modules/**"
],
"outputs": [],
"cache": false
},
"format:check": {
"inputs": [
"**/*.js",
"**/*.jsx",
"**/*.ts",
"**/*.tsx",
"**/*.json",
"**/*.md",
"**/*.mdx",
"**/*.vue",
"**/*.astro",
"**/*.css",
"**/*.scss",
"**/*.html",
"!**/__snapshots__/**",
"!CHANGELOG.md",
"!coverage/**",
"!dist/**",
"!examples/**",
"!node_modules/**"
],
"outputs": []
},
"//#test:integration:ap-flows": {
Expand Down
Loading