PSPDFKit / PSPDFKit/nutrient-web-examples

Derive the bumped example list instead of hard-coding it

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
89
Forks
3
Avg merge
1d 7h
Merged PRs (30d)
5

Description

Follow-up from the review of #101.

scripts/update-nutrient-in-examples.sh ends in 20 literal upgrade_npm_in_example calls, and scripts/update-nutrient-in-cdn.js carries a hand-maintained cdnOcurrences map of the same shape. In both, an example that is missing from the list is simply never visited: no error, no warning, no diff.

That is not hypothetical. The map keyed examples/gatsbyjs as gatsby, so the entry was never looked up and the example sat eight minor versions behind for months; examples/nuxtjs was absent from the map entirely. #101 fixed both and added guards that catch a key matching no directory, but the guards only cover the CDN map. The shell list is still unguarded, and a new example added to examples/ is silently never bumped.

Now that the bump runs unattended on a schedule, nobody is watching for the omission.

What this needs

Deriving the list means scanning examples/ for a lockfile and a @nutrient-sdk/viewer dependency, which turns an include-list into an exclude-list. The exclusions are the part that needs agreement rather than code:

  • wasm-benchmark pins a version range on purpose and must not be bumped to an exact version.
  • examples/salesforce/README.md documents the CDN URL with a worked @1.0.0 example and must never be rewritten. #101 exempts it in the workflow check; a derived CDN map would need the same exemption.
  • Whether any other example is deliberately held back is unconfirmed.

Both scripts should be done in one pass, since they share the failure mode.

Why it was left out of #101

It changes which examples get bumped, so it needs its own verification, and #101 was already rewriting one of the two scripts.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read scripts/update-nutrient-in-examples.sh and scripts/update-nutrient-in-cdn.js, then inspect examples/ for lockfiles and @nutrient-sdk/viewer dependencies. Preserve the intentional wasm-benchmark and salesforce README.md exclusions, confirm whether other examples are held back, and verify that both bump paths cover every eligible example without rewriting exempt content.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, shell
Domain
build-system, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.