Skip to content
Open
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
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ jobs:

- name: Formatting checks
run: pnpm format:check
continue-on-error: true

- name: Lint
run: pnpm lint
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"test": "pnpm -r run test",
"typecheck": "pnpm -r run typecheck",
"lint": "pnpm -r run lint",
"format": "prettier --write .",
"format:check": "prettier --check .",
"format": "node scripts/check-prettier-version.js && prettier --write .",
"format:check": "node scripts/check-prettier-version.js && prettier --check .",
"down": "docker compose down && (lsof -ti:4010,4020,5173 | xargs kill -9 2>/dev/null; true)",
"dev:engine": "pnpm --filter @stripe/sync-engine dev",
"dev": "docker compose up -d; concurrently -n engine,service,worker,dashboard -c cyan,green,yellow,magenta \"pnpm --filter @stripe/sync-engine dev\" \"pnpm --filter @stripe/sync-service dev:serve\" \"pnpm --filter @stripe/sync-service dev:worker\" \"pnpm --filter @stripe/sync-dashboard dev\"",
Expand Down
6 changes: 3 additions & 3 deletions packages/source-stripe/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ export function makeClient(

async createWebhookEndpoint(params: {
url: string
enabled_events: string[],
api_version: string,
metadata?: Record<string, string>,
enabled_events: string[]
api_version: string
metadata?: Record<string, string>
}): Promise<StripeWebhookEndpoint> {
const json = await requestWithRetry('POST', '/v1/webhook_endpoints', params)
return StripeWebhookEndpointSchema.parse(json)
Expand Down
2 changes: 1 addition & 1 deletion packages/source-stripe/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export function createStripeSource(
url: config.webhook_url,
enabled_events: ['*'],
metadata: { managed_by: 'stripe-sync' },
api_version: config.api_version ?? BUNDLED_API_VERSION
api_version: config.api_version ?? BUNDLED_API_VERSION,
})
// Secret is only available at creation time — not on list/retrieve
if (!config.webhook_secret && created.secret) {
Expand Down
31 changes: 31 additions & 0 deletions scripts/check-prettier-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { execSync } from 'node:child_process'
import { readFileSync } from 'node:fs'

try {
// Read expected version directly from pnpm-lock.yaml
const lockStr = readFileSync(new URL('../pnpm-lock.yaml', import.meta.url), 'utf8')

// Look for the exact resolved version of Prettier in the lockfile
const lockMatch = lockStr.match(/(?:^|\n)\s*prettier@(\d+\.\d+\.\d+):/)

if (!lockMatch) {
throw new Error('Prettier version not found in pnpm-lock.yaml')
}

const expectedVersion = lockMatch[1]

// Get currently active version (this works because it's run from an npm script so prettier is in PATH)
const installedVersion = execSync('prettier --version', { encoding: 'utf8' }).trim()

if (installedVersion !== expectedVersion) {
console.error(
`\x1b[31m❌ ERROR: Installed Prettier version (${installedVersion}) does not match the expected locked version in pnpm-lock.yaml (${expectedVersion}).\x1b[0m`
)
console.error(
`\x1b[31m Please run 'pnpm install' to sync your local environment with CI and prevent formatting drift.\x1b[0m\n`
)
process.exit(1)
}
} catch (error) {
// Silently ignore errors (like missing dependencies) so we don't break the formatting workflow
}
Loading