feat: auto-generate README dependency lists from Wizard API#165
Merged
Conversation
0e676fc to
e453bea
Compare
Add scripts/update-readme-deps.mjs which fetches the recommended Appodeal dependency blocks from the Dependencies Wizard API (mediations -> sdks -> dependencies) for android and ios, reading the SDK version from package.json. The API output is used verbatim, except the iOS Podfile target gets the React Native autolinking lines injected (the API renders a plain native target). Results are written between invisible HTML-comment markers (<!-- appodeal-deps:PLATFORM:start/end -->) in README.md; missing markers are a hard error so the file is never partially rewritten. The API base URL comes from the APPODEAL_API_URL env/repository variable (no hardcoded fallback). A GitHub Action regenerates the lists daily, on relevant pushes, and on manual dispatch, committing any diff. Run locally via `yarn update-readme-deps`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
e453bea to
a70cd45
Compare
dmitriifeshchenko
approved these changes
Jun 2, 2026
There was a problem hiding this comment.
Pull request overview
Introduces automation to keep the dependency snippets in README.md synchronized with the live Appodeal Dependencies Wizard API, avoiding manual drift as adapter versions change.
Changes:
- Added
scripts/update-readme-deps.mjsto fetch recommended dependencies from the Wizard API and rewrite marked README blocks. - Updated
README.mdto wrap iOS/Android dependency snippets in<!-- appodeal-deps:... -->markers for automated replacement. - Added a scheduled GitHub Action plus a
package.jsonscript to regenerate and commit README dependency changes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| scripts/update-readme-deps.mjs | New generator script that calls the Wizard API and rewrites README sections between markers. |
| README.md | Adds marker-wrapped dependency blocks for iOS/Android to be auto-updated by the generator. |
| package.json | Adds update-readme-deps npm script entrypoint for local/CI execution. |
| .github/workflows/update-readme-deps.yml | Automates periodic regeneration and auto-commit of README dependency block changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+125
to
+136
| async function main() { | ||
| const version = await getVersion(); | ||
| console.log(`Updating README dependency lists for Appodeal SDK ${version}`); | ||
|
|
||
| // android uses kts (`kt`) verbatim; ios ignores the language, returns Ruby, and gets | ||
| // the React Native linking injected into its target. | ||
| const android = await fetchDependencyBlock('android', version, 'kt'); | ||
| const ios = addReactNativeLinking(await fetchDependencyBlock('ios', version)); | ||
|
|
||
| let readme = await readFile(README, 'utf8'); | ||
| readme = replaceBetweenMarkers(readme, 'android', fenced('``` kotlin', android)); | ||
| readme = replaceBetweenMarkers(readme, 'ios', fenced('```ruby', ios)); |
Comment on lines
+2
to
+3
| // Updates the README.md dependency blocks from the Appodeal Wizard API. | ||
| // API output is used verbatim; only the iOS Podfile target gets RN linking injected. |
Comment on lines
+107
to
+110
| target 'Sample' do | ||
| project 'Sample/Sample.xcodeproj' | ||
| appodeal | ||
| use_modular_headers! |
| <!-- appodeal-deps:ios:start --> | ||
| ```ruby | ||
| source 'https://cdn.cocoapods.org' | ||
| platform :ios, '15.0' |
Comment on lines
195
to
+199
| Add dependencies into `android/app/build.gradle` | ||
|
|
||
| ``` groovy | ||
| <!-- appodeal-deps:android:start --> | ||
| ``` kotlin | ||
| repositories { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Auto-generates the Appodeal dependency lists in
README.mdfrom the live Dependencies Wizard API, so they no longer drift from the published adapter versions.How
scripts/update-readme-deps.mjsruns the 3-step recommended pipeline per platform:GET /v4/{platform}/{version}/mediations?recommended=truePOST /v4/{platform}/{version}/sdks?recommended=truePOST /v4/{platform}/{version}/dependencies/{kt|rb}package.json(single source of truth, built into the URL path).targetgets the React Native autolinking lines injected (use_native_modules!/use_react_native!) — the API renders a plain native target.<!-- appodeal-deps:PLATFORM:start/end -->; missing markers are a hard error, so the file is never partially rewritten.Config
APPODEAL_API_URLrepository variable (Settings → Secrets and variables → Actions → Variables). No hardcoded URL — the script fails loudly if unset.Automation
.github/workflows/update-readme-deps.ymlregenerates and commits any diff:mastertouchingpackage.json/ the scriptRun locally:
APPODEAL_API_URL=<url> yarn update-readme-depsNotes
🤖 Generated with Claude Code