Skip to content

feat: add v2 example sketches from the latest website/repo - #4407

Open
syedbarkath980 wants to merge 1 commit into
processing:developfrom
syedbarkath980:feat/add-v2-example-sketches-from-up-to-date-repo
Open

syedbarkath980 wants to merge 1 commit into
processing:developfrom
syedbarkath980:feat/add-v2-example-sketches-from-up-to-date-repo

Conversation

@syedbarkath980

Copy link
Copy Markdown

Issue:

Fixes #4106

Description

Updates server/scripts/examples.js to fetch example sketches from
both the legacy v1 source and the current v2 source, so the editor's
example picker includes up-to-date p5.js v2 sketches alongside the
existing v1 ones.

V1 Source (unchanged)

🗂️ processing/p5.js-website-legacy
src/data/examples/en

V2 Source (new)

🗂️ processing/p5.js-example
examples/<category>/<sketch>/code.js

Changes made:

  • Added authHeaders() helper to remove repeated auth header
    construction across all API calls
  • All existing v1 functions left completely untouched
    (getCategories, getSketchesInCategories, getSketchContent,
    addAssetsToProject, createProjectsInP5user)
  • Added importV2Examples() which fetches from processing/p5.js-example
  • Updated getp5User() to run both v1 and v2 imports sequentially
  • Switched project deletion from forEach to Promise.all for
    consistency with the rest of the async code

BEFORE (adding v2 example-sketches):

image

https://github.com/user-attachments/assets/a485ba7a-e9a7-4bc9-a5fe-3c9f6c4d723b

AFTER (adding v2 example-sketches):

image
example.sketches.After.v2.example.sketches.implementation.mp4

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@welcome

welcome Bot commented Nov 5, 2026

Copy link
Copy Markdown

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already.

@syedbarkath980
syedbarkath980 force-pushed the feat/add-v2-example-sketches-from-up-to-date-repo branch from a148f0f to afd49ac Compare November 15, 2026 06:03

This branch has not been deployed

No deployments
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.

Update Examples generation script to use up-to-date version

1 participant