This repository uses a devcontainer. Always run inside it. You do NOT have
access to Docker commands (docker, docker compose, etc.) from within the
devcontainer.
See the Updating dependencies section in CONTRIBUTING.md for the base commands.
The commands in CONTRIBUTING.md use --interactive for human use. As an agent,
follow this workflow instead:
IMPORTANT: This repository does NOT use npm workspaces. Each example is a
standalone project with its own package-lock.json. You must run npm install
in each example directory individually.
- Check available updates - Run the command without
--interactiveor-uto see what updates are available across all examples - Selectively update - Use
-uwith--filter 'package1,package2'to update specific packages in all examplepackage.jsonfiles - Install and verify per-example - Run
npm installin EACH example directory individually. - Handle peer dependency conflicts - If peer dependency warnings occur during install:
- First try:
npm install --legacy-peer-depsfollowed bynpm install - This two-step process resolves conflicts while keeping the lockfile clean
- If still problematic, revert packages for that example and inform the user
- First try:
- Clean up lockfile (CRITICAL) - If you revert any dependency changes, running
npm iagain is NOT sufficient. You MUST clean up the lockfile to prevent bloating the diff:git checkout main -- examples/[example-name]/package-lock.json cd examples/[example-name] npm install
Deno dependencies are managed manually. See CONTRIBUTING.md for the manual process.
Python dependencies are managed manually. See CONTRIBUTING.md for the manual process.
After dependency updates (or independently), resolve known vulnerabilities.
IMPORTANT: Security audits must be run PER-EXAMPLE since this is not a workspace.
- For each example with a
package-lock.json:cd examples/[example-name] npm ci # ensure lockfile is up to date npm audit
- For each vulnerability in an example, attempt a fix:
- Try
npm up <package>for the affected top-level dependency. - If
npm updoesn't help because the package is pinned, usenpx --no -- npm-check-updates --filter '<package>' --target minor -u(or--target patch) thennpm install. - Do not run
npm audit fixornpm audit fix --force— npm lies about what these will do and they can cause unintended major version bumps.
- Try
- After each dependency update, run
npm auditagain in that example:- If the vulnerability is resolved, commit the change immediately with
ONE COMMIT PER DEPENDENCY PER EXAMPLE:
deps(<example-name>): update <package> past <GHSA-ID(s)>For example, ifexamples/astrohas vulnerabilities indep-aanddep-b:Closely related packages (e.g.deps(astro): update dep-a past GHSA-xxxx deps(astro): update dep-b past GHSA-yyyy
svelte+@sveltejs/kit) may be combined into a single commit referencing all their GHSA IDs. - If the vulnerability is not resolved, revert the change, clean up the lockfile (see step 5 in Dependency updates), and record the package so you can report it to the user at the end.
- If the vulnerability is resolved, commit the change immediately with
ONE COMMIT PER DEPENDENCY PER EXAMPLE:
- After processing all examples, report any vulnerabilities that could not be resolved.