Skip to content

Syncpack setup v2#624

Open
ryanbas21 wants to merge 1 commit into
mainfrom
syncpack-setup-v2
Open

Syncpack setup v2#624
ryanbas21 wants to merge 1 commit into
mainfrom
syncpack-setup-v2

Conversation

@ryanbas21
Copy link
Copy Markdown
Collaborator

@ryanbas21 ryanbas21 commented May 5, 2026

JIRA Ticket

N/A

Description

sets up syncpack so it automatically keeps our versions aligned and everything.

Summary by CodeRabbit

  • Updates

    • Davinci client API: polling method renamed from poll() to pollStatus()
    • Workspace package catalog entries standardized for consistent versions
    • Added npm scripts to lint/fix dependency alignment
  • CI/CD

    • PR checks now include a dependency-version lint step
  • Chores

    • Pre-commit hook added to enforce dependency/version consistency
  • Tests

    • End-to-end logout flow simplified to rely only on token revocation response

Review Change Stack

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

⚠️ No Changeset found

Latest commit: faba81f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1038536a-4481-49de-ab24-b34c61677fac

📥 Commits

Reviewing files that changed from the base of the PR and between d474593 and faba81f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • .syncpackrc
  • e2e/am-mock-api/package.json
  • e2e/davinci-app/main.ts
  • e2e/davinci-app/package.json
  • e2e/davinci-app/tsconfig.app.json
  • e2e/davinci-suites/src/basic.test.ts
  • e2e/device-client-app/package.json
  • e2e/protect-app/package.json
  • lefthook.yml
  • package.json
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/device-client/package.json
  • packages/journey-client/package.json
  • pnpm-workspace.yaml
  • scratchpad/package.json
  • tools/api-report/package.json
  • tools/interface-mapping-validator/package.json
💤 Files with no reviewable changes (1)
  • e2e/davinci-suites/src/basic.test.ts
✅ Files skipped from review due to trivial changes (5)
  • e2e/am-mock-api/package.json
  • packages/journey-client/package.json
  • pnpm-workspace.yaml
  • e2e/davinci-app/tsconfig.app.json
  • e2e/device-client-app/package.json
🚧 Files skipped from review as they are similar to previous changes (10)
  • .github/workflows/ci.yml
  • .syncpackrc
  • packages/device-client/package.json
  • tools/api-report/package.json
  • tools/interface-mapping-validator/package.json
  • lefthook.yml
  • e2e/protect-app/package.json
  • e2e/davinci-app/package.json
  • scratchpad/package.json
  • package.json

📝 Walkthrough

Walkthrough

Adds Syncpack configuration and automation, migrates many package.json entries to catalog/workspace specifiers and workspace catalog entries, updates generated DaVinci client API reports (rename poll → pollStatus), and switches the e2e Davinci app to @forgerock/oidc-client with token.exchange and logout changes.

Changes

Syncpack Dependency Version Management

Layer / File(s) Summary
Workspace Catalog
pnpm-workspace.yaml
Added catalog entries for @forgerock/javascript-sdk, @types/express, tsx, and tslib.
Syncpack Configuration
.syncpackrc
Introduced Syncpack config pointing to the syncpack JSON schema and listing source package.json files across the monorepo.
Automation Setup
.github/workflows/ci.yml, lefthook.yml
Added pnpm syncpack:lint step in CI after project setup and a syncpack pre-commit command scoped by glob to monorepo package.json files.
Package Scripts & DevDependency
package.json
Added syncpack:lint and syncpack:fix scripts and syncpack devDependency; adjusted devDependency specifiers to use catalog entries.
Monorepo Package Updates
e2e/*, packages/*, tools/*, scratchpad/*
Migrated many package.json dependency specifiers to catalog: or workspace references (examples: @forgerock/javascript-sdk, @types/express, tsx, tslib, @effect/language-service).

DaVinci Client API Update

Layer / File(s) Summary
Public API Reports
packages/davinci-client/api-report/davinci-client.api.md, packages/davinci-client/api-report/davinci-client.types.api.md
Renamed polling method from poll(collector: PollingCollector) => Poller to pollStatus(collector: PollingCollector) => Poller; reordered union members in start, getClient, and getNode reports without changing included types.

e2e DaVinci App OIDC changes

Layer / File(s) Summary
OIDC integration and flows
e2e/davinci-app/main.ts, e2e/davinci-app/tsconfig.app.json, e2e/davinci-app/package.json, e2e/davinci-suites/src/basic.test.ts
Replaced legacy SDK token/logout flows with @forgerock/oidc-client initialization and token.exchange usage; logout now calls oidcClient.user.logout() then reloads; added tsconfig project reference for packages/oidc-client; simplified logout test to await /revoke only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • cerebrl

"🐰 I hopped through package trees tonight,
Syncpack tucked versions tidy and tight.
Davinci polls no more — pollStatus now sings,
OIDC tokens exchanged with new wings.
Hooray! 🥕"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Syncpack setup v2' directly describes the main change: configuring and setting up syncpack for version alignment across the repository.
Description check ✅ Passed The description covers the main objective of setting up syncpack for version alignment, but lacks detail on the specific changes made and rationale.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch syncpack-setup-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented May 5, 2026

View your CI Pipeline Execution ↗ for commit faba81f

Command Status Duration Result
nx run-many -t build --no-agents ✅ Succeeded <1s View ↗
nx affected -t build lint test typecheck e2e-ci ✅ Succeeded 1m 16s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-14 17:25:32 UTC

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 8cffe6b to 8978132 Compare May 5, 2026 21:38
Copy link
Copy Markdown
Contributor

@nx-cloud nx-cloud Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.

Nx Cloud is proposing a fix for your failed CI:

We updated the signoff assertion in basic.test.ts to use page.waitForRequest instead of page.waitForResponse for the /signoff check, which fixes the 30s timeout. With @forgerock/javascript-sdk 4.9.0 (introduced by this PR), endSession now uses window.location.assign() rather than fetch(), meaning the 302 redirect is a document navigation that Playwright's CDP-based waitForResponse does not capture. Switching to waitForRequest correctly intercepts the navigation request to /signoff, and the subsequent expect(page.getByText('Username/Password Form')).toBeVisible() continues to verify the full logout redirect completed.

Tip

We verified this fix by re-running @forgerock/davinci-suites:e2e-ci--src/basic.test.ts.

Warning

The suggested diff is too large to display here, but you can view it on Nx Cloud ↗


Apply fix via Nx Cloud  Reject fix via Nx Cloud


Or Apply changes locally with:

npx nx-cloud apply-locally DTyA-1GFB

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 54a6cfe to 4ff7f04 Compare May 5, 2026 22:41
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 5, 2026

Open in StackBlitz

@forgerock/davinci-client

pnpm add https://pkg.pr.new/@forgerock/davinci-client@624

@forgerock/device-client

pnpm add https://pkg.pr.new/@forgerock/device-client@624

@forgerock/journey-client

pnpm add https://pkg.pr.new/@forgerock/journey-client@624

@forgerock/oidc-client

pnpm add https://pkg.pr.new/@forgerock/oidc-client@624

@forgerock/protect

pnpm add https://pkg.pr.new/@forgerock/protect@624

@forgerock/sdk-types

pnpm add https://pkg.pr.new/@forgerock/sdk-types@624

@forgerock/sdk-utilities

pnpm add https://pkg.pr.new/@forgerock/sdk-utilities@624

@forgerock/iframe-manager

pnpm add https://pkg.pr.new/@forgerock/iframe-manager@624

@forgerock/sdk-logger

pnpm add https://pkg.pr.new/@forgerock/sdk-logger@624

@forgerock/sdk-oidc

pnpm add https://pkg.pr.new/@forgerock/sdk-oidc@624

@forgerock/sdk-request-middleware

pnpm add https://pkg.pr.new/@forgerock/sdk-request-middleware@624

@forgerock/storage

pnpm add https://pkg.pr.new/@forgerock/storage@624

commit: faba81f

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 18.07%. Comparing base (5d6747a) to head (faba81f).
⚠️ Report is 98 commits behind head on main.

❌ Your project status has failed because the head coverage (18.07%) is below the target coverage (40.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff             @@
##             main     #624       +/-   ##
===========================================
- Coverage   70.90%   18.07%   -52.84%     
===========================================
  Files          53      155      +102     
  Lines        2021    24398    +22377     
  Branches      377     1202      +825     
===========================================
+ Hits         1433     4410     +2977     
- Misses        588    19988    +19400     

see 101 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Deployed 4592387 to https://ForgeRock.github.io/ping-javascript-sdk/pr-624/45923879dbf82e4f96a9bfa858549a1dc95c1c50 branch gh-pages in ForgeRock/ping-javascript-sdk

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

📦 Bundle Size Analysis

📦 Bundle Size Analysis

🚨 Significant Changes

🔻 @forgerock/device-client - 0.0 KB (-10.0 KB, -100.0%)
🔻 @forgerock/journey-client - 0.0 KB (-91.9 KB, -100.0%)

📊 Minor Changes

📉 @forgerock/device-client - 10.0 KB (-0.0 KB)
📉 @forgerock/journey-client - 91.9 KB (-0.0 KB)

➖ No Changes

@forgerock/storage - 1.5 KB
@forgerock/sdk-request-middleware - 4.5 KB
@forgerock/iframe-manager - 2.4 KB
@forgerock/sdk-oidc - 4.8 KB
@forgerock/sdk-logger - 1.6 KB
@forgerock/sdk-types - 7.9 KB
@forgerock/davinci-client - 53.5 KB
@forgerock/protect - 144.6 KB
@forgerock/sdk-utilities - 11.2 KB
@forgerock/oidc-client - 25.2 KB


14 packages analyzed • Baseline from latest main build

Legend

🆕 New package
🔺 Size increased
🔻 Size decreased
➖ No change

ℹ️ How bundle sizes are calculated
  • Current Size: Total gzipped size of all files in the package's dist directory
  • Baseline: Comparison against the latest build from the main branch
  • Files included: All build outputs except source maps and TypeScript build cache
  • Exclusions: .map, .tsbuildinfo, and .d.ts.map files

🔄 Updated automatically on each push to this PR

@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from 4ff7f04 to d474593 Compare May 12, 2026 20:13
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@e2e/davinci-app/main.ts`:
- Around line 89-93: Don't cast DaVinciConfig to OidcConfig; instead
construct/validate a proper OidcConfig before calling oidc. Replace the `oidc({
config: config as OidcConfig })` call by building an explicit OidcConfig object
(containing required fields clientId, redirectUri, scope, and
serverConfig.wellknown) from the existing config or by calling a
conversion/validation helper (e.g., buildOidcConfig(config) /
validateOidcConfig(config)) so structural incompatibilities are caught at
compile time; then pass that validated OidcConfig into the oidc(...) call and
assign the result to oidcClient as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bee8a638-bca7-4225-a26a-5f93fbf736ca

📥 Commits

Reviewing files that changed from the base of the PR and between 8cffe6b and d474593.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (19)
  • .github/workflows/ci.yml
  • .syncpackrc
  • e2e/am-mock-api/package.json
  • e2e/davinci-app/main.ts
  • e2e/davinci-app/package.json
  • e2e/davinci-app/tsconfig.app.json
  • e2e/davinci-suites/src/basic.test.ts
  • e2e/device-client-app/package.json
  • e2e/protect-app/package.json
  • lefthook.yml
  • package.json
  • packages/davinci-client/api-report/davinci-client.api.md
  • packages/davinci-client/api-report/davinci-client.types.api.md
  • packages/device-client/package.json
  • packages/journey-client/package.json
  • pnpm-workspace.yaml
  • scratchpad/package.json
  • tools/api-report/package.json
  • tools/interface-mapping-validator/package.json
💤 Files with no reviewable changes (1)
  • e2e/davinci-suites/src/basic.test.ts
✅ Files skipped from review due to trivial changes (6)
  • scratchpad/package.json
  • e2e/davinci-app/tsconfig.app.json
  • packages/journey-client/package.json
  • .syncpackrc
  • e2e/am-mock-api/package.json
  • tools/api-report/package.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/ci.yml
  • packages/device-client/package.json
  • tools/interface-mapping-validator/package.json
  • pnpm-workspace.yaml
  • e2e/protect-app/package.json
  • e2e/device-client-app/package.json
  • lefthook.yml
  • package.json

Comment thread e2e/davinci-app/main.ts
Comment on lines +89 to +93
const oidcResult = await oidc({ config: config as OidcConfig });
if ('error' in oidcResult) {
throw new Error(`Failed to initialize oidc client: ${oidcResult.error}`);
}
const oidcClient = oidcResult;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect OidcConfig and the oidc() return type / error shape
fd -t f 'tsconfig.lib.json' packages/oidc-client 2>/dev/null
fd -t f -e ts . packages/oidc-client/src 2>/dev/null | head -50

# OidcConfig definition
ast-grep --pattern 'export type OidcConfig = $$$'
ast-grep --pattern 'export interface OidcConfig { $$$ }'

# DaVinciConfig definition
ast-grep --pattern 'export type DaVinciConfig = $$$'
ast-grep --pattern 'export interface DaVinciConfig { $$$ }'

# oidc() factory return type / error shape
ast-grep --pattern 'export function oidc($$$) { $$$ }'
ast-grep --pattern 'export const oidc = $$$'
rg -nP --type=ts -C3 "\berror\s*:" packages/oidc-client/src 2>/dev/null | head -60

Repository: ForgeRock/ping-javascript-sdk

Length of output: 5411


🏁 Script executed:

# Get OidcConfig definition
rg -n "export type OidcConfig|export interface OidcConfig" packages/oidc-client/src --type=ts -A 10

# Get DaVinciConfig definition
rg -n "export type DaVinciConfig|export interface DaVinciConfig" --type=ts -A 10

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1443


🏁 Script executed:

# Check the oidc function export and its return type
rg -n "export.*function oidc|export.*const oidc" packages/oidc-client/src --type=ts -A 5

# Look for the complete oidc API return type (likely has data + error union)
rg -n "type.*OidcFactoryResult|interface.*OidcFactoryResult|export.*Result.*oidc|return.*error.*data" packages/oidc-client/src --type=ts -B 2 -A 5

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1015


🏁 Script executed:

# Verify the error field type in the main oidc API
cat packages/oidc-client/src/lib/oidc.api.ts | head -200

Repository: ForgeRock/ping-javascript-sdk

Length of output: 6924


🏁 Script executed:

# Get full oidc function signature including return type
cat packages/oidc-client/src/lib/client.store.ts | sed -n '51,100p'

Repository: ForgeRock/ping-javascript-sdk

Length of output: 1549


🏁 Script executed:

# Search for the return type definition
rg -n "OidcClientResult|OidcFactoryResult|type.*oidc.*Result" packages/oidc-client/src --type=ts -A 3

Repository: ForgeRock/ping-javascript-sdk

Length of output: 55


🏁 Script executed:

# Look for where oidc function returns error
rg -n "return.*error|error.*:" packages/oidc-client/src/lib/client.store.ts --type=ts -B 2 -A 2 | head -80

Repository: ForgeRock/ping-javascript-sdk

Length of output: 3274


The type cast config as OidcConfig masks a structural incompatibility.

OidcConfig (extends AsyncLegacyConfigOptions with required clientId, redirectUri, scope, serverConfig.wellknown) is incompatible with DaVinciConfig (extends AsyncLegacyConfigOptions with only optional responseType). Casting bypasses type checking and will only surface missing required fields at runtime. Build an OidcConfig explicitly or export a validation/conversion helper instead of asserting the type.

The error message handling on line 91 is fine—oidcResult.error is always a string from the oidc factory.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@e2e/davinci-app/main.ts` around lines 89 - 93, Don't cast DaVinciConfig to
OidcConfig; instead construct/validate a proper OidcConfig before calling oidc.
Replace the `oidc({ config: config as OidcConfig })` call by building an
explicit OidcConfig object (containing required fields clientId, redirectUri,
scope, and serverConfig.wellknown) from the existing config or by calling a
conversion/validation helper (e.g., buildOidcConfig(config) /
validateOidcConfig(config)) so structural incompatibilities are caught at
compile time; then pass that validated OidcConfig into the oidc(...) call and
assign the result to oidcClient as before.

- Install syncpack@15 for monorepo dependency alignment enforcement
- Add .syncpackrc with JSON schema reference
- Add syncpack:lint and syncpack:fix scripts (with explicit --source to
  exclude dist/ build artifacts, which syncpack reads via pnpm-workspace)
- Extend pnpm default catalog with: @forgerock/javascript-sdk, @types/express,
  tslib, tsx
- Migrate all consumers to catalog: references — fixes DiffersToCatalog
  and DiffersToHighestOrLowestSemver across 11 package.json files
@ryanbas21 ryanbas21 force-pushed the syncpack-setup-v2 branch from d474593 to faba81f Compare May 14, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants