Repository navigation
Conversation
- add scripts/plugin-api/generate-tester-templates.mjs and the plugin-api:tester and plugin-api:tester:check scripts - add request examples for adornment update, attribute delete, component delete, dataContext get and delete, and document update, so every documented action has one - move the fenced-code and heading-anchor rules into a shared markdown.mjs helper - document the tester scripts in the plugin-api-docs skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2746 +/- ##
==========================================
- Coverage 88.11% 88.10% -0.02%
==========================================
Files 825 825
Lines 47799 47799
Branches 12198 12185 -13
==========================================
- Hits 42117 42111 -6
- Misses 5666 5672 +6
Partials 16 16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
codap-v3
|
||||||||||||||||||||||||||||
| Project |
codap-v3
|
| Branch Review |
CODAP-1666-api-tester-templates
|
| Run status |
|
| Run duration | 07m 29s |
| Commit |
|
| Committer | null |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
1
|
|
|
82
|
|
|
0
|
|
|
387
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are recorded for the plugin API tester-template tooling changes.
No open issues 🎉
What changed in this PR
Adds tooling to generate plugin API Tester templates from CODAP v3’s API reference, supporting the companion tester update in codap-data-interactives.
Changes:
- Generates deduplicated request templates with descriptive names and reference links, excluding CODAP notifications.
- Adds missing request examples and shares Markdown parsing between the generator and documentation lint.
- Adds generation and stale-check commands, with guidance for maintaining the output in the sibling repository.
| File | Description |
|---|---|
v3/scripts/plugin-api/markdown.mjs |
Adds shared fenced-code masking and heading-anchor helpers. |
v3/scripts/plugin-api/lint-plugin-api-docs.mjs |
Uses the shared heading-anchor helper. |
v3/scripts/plugin-api/generate-tester-templates.mjs |
Generates tester templates and checks for stale output. |
v3/package.json |
Adds tester generation and check commands. |
v3/doc/plugin-api/resources/document.md |
Adds a document replacement request example. |
v3/doc/plugin-api/resources/data-context.md |
Adds get/delete requests and a sample get response. |
v3/doc/plugin-api/resources/component.md |
Adds a component deletion example. |
v3/doc/plugin-api/resources/attribute.md |
Adds an attribute deletion example. |
v3/doc/plugin-api/resources/adornment.md |
Adds an update example restoring adornment visibility. |
.claude/skills/plugin-api-docs/SKILL.md |
Documents template regeneration and cross-repository checks. |
Review effort: Balanced
Fixes CODAP-1666
The plugin API Tester (
DataInteractiveAPITesterin codap-data-interactives) hasn't changedsince 2021 and covers only part of the API. This PR adds a generator that turns the request
examples in
v3/doc/plugin-api/resources/into tester templates. The tester changes are inconcord-consortium/codap-data-interactives#165.
Generator
scripts/plugin-api/generate-tester-templates.mjskeeps every json block whose action theinventory lists for its resource type. That test is what drops notifications CODAP sends
(
logMessageNotice,documentChangeNotice,globalnotify).section of the reference, and is kept once when it appears on several pages.
npm run plugin-api:testerwrites the file into a sibling clone of codap-data-interactives;npm run plugin-api:tester:checkreports whether that copy is stale. CI can't run the check,because the file is in the other repo, so the plugin-api-docs skill now says when to run it.
markdown.mjs, which the lintnow uses as well.
Reference
Request examples added so every documented resource and action has one: adornment update,
attribute delete, component delete, dataContext get (with a response captured from the handler)
and delete, and document update.
Testing
npm run plugin-api:checkpasses.plugin.spec.ts(9/9) andmap.spec.ts(13 passing, 4 already skipped) pass against theupdated tester served locally.
🤖 Generated with Claude Code