Skip to content

feat: auto-generate README dependency lists from Wizard API#165

Merged
da2gl merged 1 commit into
masterfrom
feature/dynamic-readme-deps
Jun 2, 2026
Merged

feat: auto-generate README dependency lists from Wizard API#165
da2gl merged 1 commit into
masterfrom
feature/dynamic-readme-deps

Conversation

@da2gl
Copy link
Copy Markdown
Collaborator

@da2gl da2gl commented Jun 2, 2026

What

Auto-generates the Appodeal dependency lists in README.md from the live Dependencies Wizard API, so they no longer drift from the published adapter versions.

How

scripts/update-readme-deps.mjs runs the 3-step recommended pipeline per platform:

  1. GET /v4/{platform}/{version}/mediations?recommended=true
  2. POST /v4/{platform}/{version}/sdks?recommended=true
  3. POST /v4/{platform}/{version}/dependencies/{kt|rb}
  • SDK version comes from package.json (single source of truth, built into the URL path).
  • API output is used verbatim, except the iOS Podfile target gets the React Native autolinking lines injected (use_native_modules! / use_react_native!) — the API renders a plain native target.
  • Results are written between invisible HTML-comment markers <!-- appodeal-deps:PLATFORM:start/end -->; missing markers are a hard error, so the file is never partially rewritten.

Config

  • API base URL comes from the APPODEAL_API_URL repository variable (Settings → Secrets and variables → Actions → Variables). No hardcoded URL — the script fails loudly if unset.

Automation

.github/workflows/update-readme-deps.yml regenerates and commits any diff:

  • daily (cron 06:00 UTC)
  • on push to master touching package.json / the script
  • manually (workflow_dispatch)

Run locally: APPODEAL_API_URL=<url> yarn update-readme-deps

Notes

  • The README dependency blocks currently hold a core-only stub; the first workflow run populates the full adapter list.
  • Podfile/build.gradle scaffolding outside the markers stays in README; only the fenced block content is regenerated.

🤖 Generated with Claude Code

@da2gl da2gl force-pushed the feature/dynamic-readme-deps branch 3 times, most recently from 0e676fc to e453bea Compare June 2, 2026 10:14
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>
@da2gl da2gl force-pushed the feature/dynamic-readme-deps branch from e453bea to a70cd45 Compare June 2, 2026 10:15
@da2gl da2gl requested a review from Copilot June 2, 2026 10:17
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.mjs to fetch recommended dependencies from the Wizard API and rewrite marked README blocks.
  • Updated README.md to wrap iOS/Android dependency snippets in <!-- appodeal-deps:... --> markers for automated replacement.
  • Added a scheduled GitHub Action plus a package.json script 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 thread README.md
Comment thread README.md
Comment thread scripts/update-readme-deps.mjs
@da2gl da2gl requested a review from Copilot June 2, 2026 10:23
@da2gl da2gl merged commit 3997067 into master Jun 2, 2026
2 checks passed
@da2gl da2gl deleted the feature/dynamic-readme-deps branch June 2, 2026 10:26
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

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 thread README.md
Comment on lines +107 to +110
target 'Sample' do
project 'Sample/Sample.xcodeproj'
appodeal
use_modular_headers!
Comment thread README.md
<!-- appodeal-deps:ios:start -->
```ruby
source 'https://cdn.cocoapods.org'
platform :ios, '15.0'
Comment thread README.md
Comment on lines 195 to +199
Add dependencies into `android/app/build.gradle`

``` groovy
<!-- appodeal-deps:android:start -->
``` kotlin
repositories {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants