docs: add comprehensive interface mapping and fix migration guide#564
docs: add comprehensive interface mapping and fix migration guide#564
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
b02a17e to
7ab96b1
Compare
|
View your CI Pipeline Execution ↗ for commit 7ab96b1
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We fixed two lint errors in the newly added interface-mapping-validator tool: the package.json scripts were reordered alphabetically to satisfy the package-json/sort-collections rule, and the generateSections(...) call in generator.test.ts was reformatted to place each argument on its own line per Prettier's rules. These changes are purely stylistic and do not alter any logic or behaviour.
Tip
✅ We verified this fix by re-running @forgerock/interface-mapping-validator:lint.
Suggested Fix changes
diff --git a/tools/interface-mapping-validator/package.json b/tools/interface-mapping-validator/package.json
index 04b604423..ee19e3a45 100644
--- a/tools/interface-mapping-validator/package.json
+++ b/tools/interface-mapping-validator/package.json
@@ -6,12 +6,12 @@
"type": "module",
"scripts": {
"build": "pnpm nx nxBuild",
+ "generate": "tsx src/main.ts --generate",
"lint": "pnpm nx nxLint",
"test": "pnpm nx nxTest",
"test:watch": "pnpm nx nxTest --watch",
"validate": "tsx src/main.ts",
- "validate:fix": "tsx src/main.ts --fix",
- "generate": "tsx src/main.ts --generate"
+ "validate:fix": "tsx src/main.ts --fix"
},
"dependencies": {
"ts-morph": "^25.0.0"
diff --git a/tools/interface-mapping-validator/src/generator.test.ts b/tools/interface-mapping-validator/src/generator.test.ts
index 6803441d3..92190c189 100644
--- a/tools/interface-mapping-validator/src/generator.test.ts
+++ b/tools/interface-mapping-validator/src/generator.test.ts
@@ -382,9 +382,14 @@ describe('generateSections', () => {
});
it('includes package map entries', () => {
- const result = generateSections(makeLegacy([]), makeNewSdk([]), {}, {
- '@forgerock/ping-protect': { new: '@forgerock/protect', note: 'Protect integration' },
- });
+ const result = generateSections(
+ makeLegacy([]),
+ makeNewSdk([]),
+ {},
+ {
+ '@forgerock/ping-protect': { new: '@forgerock/protect', note: 'Protect integration' },
+ },
+ );
expect(result.migrationDependencies).toContain('@forgerock/ping-protect');
expect(result.migrationDependencies).toContain('@forgerock/protect');
Or Apply changes locally with:
npx nx-cloud apply-locally Tj02-Jp9E
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Add tools/interface-mapping-validator — a CLI tool that validates and generates the interface_mapping.md and MIGRATION.md documents from a TypeScript mapping config combined with auto-discovered SDK exports. Three CLI modes: - validate: check for drift between docs and SDK exports - generate (--generate): rebuild sections 0, 1, 5 from config - fix (--fix): patch existing tables Also: - Migrate git hooks from husky/lint-staged to lefthook - Add CI step that validates interface mapping on PRs with auto-updating comments - Add root-level scripts: pnpm run mapping:validate, pnpm run mapping:generate 97 tests, functional core / imperative shell architecture.
7ab96b1 to
f0fefe0
Compare
https://pingidentity.atlassian.net/browse/SDKS-4884
Summary
tools/interface-mapping-validator— a CLI tool that validates and generates theinterface_mapping.mdandMIGRATION.mddocuments from a TypeScript mapping config + auto-discovered SDK exportsInterface Mapping Validator
Three CLI modes:
What it generates
interface_mapping.mdSYMBOL_MAPconfig + auto-discovered callbacks + 1:1 name matchesinterface_mapping.mdSYMBOL_MAP, grouped by target packageinterface_mapping.md@forgerock/journey-client/typesexportsMIGRATION.mdSYMBOL_MAP+PACKAGE_MAPAll other sections remain hand-authored.
Adding a new symbol
pnpm run mapping:validateto see the drift reporttools/interface-mapping-validator/src/mapping-config.tspnpm run mapping:generateand commitArchitecture
97 tests, all passing. Modules: extractors (legacy, new-sdk, markdown), generator, writer, differ, fixer, reporter.
Lefthook Migration
lefthook.ymlwith pre-commit (nx sync, typecheck/lint/build, format, interface mapping validation), commit-msg (commitlint), prepare-commit-msg (commitizen)CI Integration
Test plan
pnpm run mapping:validate— 0 errors, warnings only for new SDK exports without legacy equivalentspnpm run mapping:generate— regenerates all target sections, formats with prettier