refactor(scripts): delete 20 one-off/legacy scripts
The scripts/ directory had accumulated 29 entries, half of which were one-off fixes that had already done their job and several of which were Supabase-era artifacts that don't apply now that the project uses direct Postgres via `pg`. Deleted (none referenced from package.json, CLAUDE.md, MEMORY.md, .gitea/workflows/deploy.yml, db/seeds/, or src/): Supabase-era one-offs (the project moved off Supabase JS/REST): - apply-admin-create-stop.js (RPC installer against supabase.co) - fix-archived-rls.js (RLS repair against supabase.co) - seed.sh (pure supabase REST seeding) - seed_tuxedo_tour.py (Python equivalent of the JS seed) Codemods / lint fixers that ran once: - fix-server-auth.js, fix-server-auth-ast.js - fix-button-has-type.js, fix-control-has-associated-label.js Versioned iteration history of one-off checks: - check-stop-fns.js, check-stop-fns2.js, check-stop-fns3.js - verify-stop-fns.js (only referenced by apply-admin-create-stop.js) Other one-offs: - cleanup-duplicate-stops.ts - create-admin-user.ts, seed-admin.ts (superseded by provision-admin.ts) - seed-tuxedo.ts (superseded by seed-tuxedo-2026.js) - import-woo-to-route.ts (WooCommerce import, no longer used) - upload-tuxedo-video.mjs, verify-email.ts, e2e-test.sh Also updated one stale comment in src/actions/admin/users.ts that referenced scripts/seed-admin.ts. Kept (9 scripts, all live-referenced): - migrate.js (package.json + deploy.yml + MEMORY.md) - db-reset.js (package.json: db:reset) - seed-tuxedo-2026.js (package.json: db:seed:tour) - import-tuxedo-stops.ts (db/seeds preferred path) - provision-admin.ts (CLAUDE.md production bootstrap) - preflight-check.js, postflight-check.js (.gitea/workflows/deploy.yml) - generate-pwa-icons.js, generate-pwa-screenshots.js (reproducible PWA build assets, referenced in design docs) Verified: tsc clean, 174/175 tests pass (same baseline), package.json scripts and deploy.yml all still resolve to kept scripts.
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
require("dotenv").config({ path: require("path").resolve(__dirname, "../.env.local") });
|
||||
const { Client } = require("pg");
|
||||
|
||||
const url = process.env.NEXT_PUBLIC_SUPABASE_URL;
|
||||
const projectRef = url.replace("https://", "").split(".")[0];
|
||||
const pw = process.env.SUPABASE_SERVICE_ROLE_KEY;
|
||||
|
||||
const tries = [
|
||||
{ host: "aws-0-us-east-1.pooler.supabase.com", port: 6543, user: `postgres.${projectRef}`, database: "postgres" },
|
||||
{ host: "aws-0-us-east-1.pooler.supabase.com", port: 5432, user: `postgres.${projectRef}`, database: "postgres" },
|
||||
{ host: "aws-0-us-east-1.pooler.supabase.com", port: 6543, user: "postgres", database: "postgres" },
|
||||
];
|
||||
|
||||
(async () => {
|
||||
for (const cfg of tries) {
|
||||
const client = new Client({ ...cfg, password: pw, ssl: { rejectUnauthorized: false } });
|
||||
try {
|
||||
await client.connect();
|
||||
const r = await client.query(`
|
||||
SELECT p.proname,
|
||||
pg_get_function_identity_arguments(p.oid) AS id_args,
|
||||
p.prosecdef AS secdef
|
||||
FROM pg_proc p JOIN pg_namespace n ON p.pronamespace=n.oid
|
||||
WHERE n.nspname='public' AND p.proname IN
|
||||
('admin_create_stop','admin_create_stops_batch','delete_stop')
|
||||
ORDER BY p.proname;
|
||||
`);
|
||||
console.log(`\n✓ ${cfg.host}:${cfg.port} user=${cfg.user}`);
|
||||
console.log(JSON.stringify(r.rows, null, 2));
|
||||
|
||||
// Also check if migration tracking table exists
|
||||
const trk = await client.query(`
|
||||
SELECT version, name FROM supabase_migrations.schema_migrations
|
||||
WHERE version >= 145 ORDER BY version;
|
||||
`).catch(() => ({ rows: [] }));
|
||||
console.log("Recent migrations applied:", trk.rows);
|
||||
await client.end();
|
||||
return;
|
||||
} catch (e) {
|
||||
console.log(`✗ ${cfg.host}:${cfg.port} user=${cfg.user} → ${e.message}`);
|
||||
try { await client.end(); } catch {}
|
||||
}
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user