One-shot tooling for the speedcdnjs → KV-backed worker-api migration.
Everything in this directory is transitional. It exists to verify the new
worker returns the same data as the legacy metadata.speedcdnjs.com origin,
and should be deleted once the migration is complete and the shadow-comparison
D1 is no longer needed.
-
create-d1.sh— Provisions the per-env D1 database that backs the shadow-comparison drift table (seesrc/shadow.jsandmigrations/0001_shadow_mismatches.sql). Two-phase:createprints adatabase_idyou paste intoworker-api-cdnjs-account-wrangler.toml, thenmigrateapplies the schema remotely../scripts/migration/create-d1.sh staging create # paste database_id into worker-api-cdnjs-account-wrangler.toml ./scripts/migration/create-d1.sh staging migrate
When the migration is complete:
- Drop
SHADOW_DB,SHADOW_ORIGIN,SHADOW_SAMPLE_RATEfromworker-api-cdnjs-account-wrangler.toml. - Delete
src/shadow.jsand theshadowComparecall insrc/index.js. - Delete the D1 databases:
npx wrangler d1 delete cdnjs-shadow-mismatches-{staging,production}. - Delete this directory.