groceries: mobile-first tracker redesign — compact rows per product group (cheapest store badge, unit price, spread, promo), tap to compare stores; category tree (23 tops, subcategories, icons/colours) with chips, store tiles, sort and non-food toggle; owner shelf prices (manual source with date, photo, note)
Some checks failed
Deploy production / deploy (push) Failing after 1m1s
Some checks failed
Deploy production / deploy (push) Failing after 1m1s
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
importStore,
|
||||
regroup
|
||||
} from '../src/lib/server/groceries/import';
|
||||
import { applyTaxonomy } from '../src/lib/server/groceries/taxonomy';
|
||||
import { SOURCES } from '../src/lib/server/groceries/sources';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
@@ -86,6 +87,7 @@ try {
|
||||
}
|
||||
}
|
||||
await regroup(sql, log);
|
||||
await applyTaxonomy(sql, log);
|
||||
} finally {
|
||||
await sql.end();
|
||||
}
|
||||
|
||||
17
scripts/groceries-taxonomy.ts
Normal file
17
scripts/groceries-taxonomy.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// Re-sync the shared grocery category tree and reclassify all items and groups.
|
||||
//
|
||||
// bun scripts/groceries-taxonomy.ts
|
||||
//
|
||||
// The nightly import does the same after regrouping; run this after changing taxonomy.ts.
|
||||
import postgres from 'postgres';
|
||||
import { applyTaxonomy } from '../src/lib/server/groceries/taxonomy';
|
||||
|
||||
if (!process.env.DB_URL) throw new Error('DB_URL is not set');
|
||||
const sql = postgres(process.env.DB_URL, { max: 1, onnotice: () => {} });
|
||||
try {
|
||||
const t = Date.now();
|
||||
await applyTaxonomy(sql, (m) => console.log(m));
|
||||
console.log(`done in ${((Date.now() - t) / 1000).toFixed(1)} s`);
|
||||
} finally {
|
||||
await sql.end();
|
||||
}
|
||||
Reference in New Issue
Block a user