@nextblock-cms/db 0.17.2 → 0.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,53 +1,53 @@
1
- -- 02005: home "Live Demo" promo copy -- reset cadence "daily" -> "every 15 minutes".
2
- --
3
- -- cms.nextblock.dev now runs on Vercel Pro and its reset cron in vercel.json is
4
- -- */15 * * * * (was 0 3 * * *, daily). The promo section on the EN ('home') and FR
5
- -- ('accueil') home pages still advertises a daily reset; it already shipped through
6
- -- 02000 (catch-up) / 02004 (baseline) and lives on real installs, so per the append-only
7
- -- rule this is a forward-only data fix instead of an edit to those files.
8
- --
9
- -- Targets the promo by its nb-sandbox-promo sentinel + parent page (never blocks.id:
10
- -- ids drift on every install) and rewrites only the six cadence phrases (EN + FR) with
11
- -- replace(), leaving the rest of the block untouched. page_revisions rows carrying the
12
- -- sentinel get the same rewrite so restoring a seeded revision cannot bring the "daily"
13
- -- copy back. Idempotent: a second run matches zero rows (content already equals the
14
- -- rewritten text). On the sandbox the promo is still stripped afterward by
15
- -- removeSandboxPromoSections in the reset-sandbox route.
16
- --
17
- -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
18
- -- excludes any migration whose filename contains "sandbox" from the reset bundle.
19
-
20
- CREATE OR REPLACE FUNCTION pg_temp.nb_promo_cadence_15min(src text)
21
- RETURNS text
22
- LANGUAGE sql
23
- IMMUTABLE
24
- AS $fn$
25
- SELECT replace(replace(replace(replace(replace(replace(src,
26
- 'It resets daily, so explore',
27
- 'It resets every 15 minutes, so explore'),
28
- '&middot; Resets daily</p>',
29
- '&middot; Resets every 15 minutes</p>'),
30
- 'Wipes clean daily</strong>',
31
- 'Wipes clean every 15 minutes</strong>'),
32
- 'Il se r&eacute;initialise chaque jour :',
33
- 'Il se r&eacute;initialise toutes les 15 minutes :'),
34
- 'R&eacute;initialis&eacute; chaque jour</p>',
35
- 'R&eacute;initialis&eacute; toutes les 15 minutes</p>'),
36
- 'Remis &agrave; z&eacute;ro chaque jour</strong>',
37
- 'Remis &agrave; z&eacute;ro toutes les 15 minutes</strong>')
38
- $fn$;
39
-
40
- UPDATE public.blocks
41
- SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb,
42
- updated_at = now()
43
- WHERE block_type = 'section'
44
- AND page_id IS NOT NULL
45
- AND content::text LIKE '%nb-sandbox-promo%'
46
- AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
47
-
48
- UPDATE public.page_revisions
49
- SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb
50
- WHERE content::text LIKE '%nb-sandbox-promo%'
51
- AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
52
-
53
- DROP FUNCTION IF EXISTS pg_temp.nb_promo_cadence_15min(text);
1
+ -- 02005: home "Live Demo" promo copy -- reset cadence "daily" -> "every 15 minutes".
2
+ --
3
+ -- cms.nextblock.dev now runs on Vercel Pro and its reset cron in vercel.json is
4
+ -- */15 * * * * (was 0 3 * * *, daily). The promo section on the EN ('home') and FR
5
+ -- ('accueil') home pages still advertises a daily reset; it already shipped through
6
+ -- 02000 (catch-up) / 02004 (baseline) and lives on real installs, so per the append-only
7
+ -- rule this is a forward-only data fix instead of an edit to those files.
8
+ --
9
+ -- Targets the promo by its nb-sandbox-promo sentinel + parent page (never blocks.id:
10
+ -- ids drift on every install) and rewrites only the six cadence phrases (EN + FR) with
11
+ -- replace(), leaving the rest of the block untouched. page_revisions rows carrying the
12
+ -- sentinel get the same rewrite so restoring a seeded revision cannot bring the "daily"
13
+ -- copy back. Idempotent: a second run matches zero rows (content already equals the
14
+ -- rewritten text). On the sandbox the promo is still stripped afterward by
15
+ -- removeSandboxPromoSections in the reset-sandbox route.
16
+ --
17
+ -- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
18
+ -- excludes any migration whose filename contains "sandbox" from the reset bundle.
19
+
20
+ CREATE OR REPLACE FUNCTION pg_temp.nb_promo_cadence_15min(src text)
21
+ RETURNS text
22
+ LANGUAGE sql
23
+ IMMUTABLE
24
+ AS $fn$
25
+ SELECT replace(replace(replace(replace(replace(replace(src,
26
+ 'It resets daily, so explore',
27
+ 'It resets every 15 minutes, so explore'),
28
+ '&middot; Resets daily</p>',
29
+ '&middot; Resets every 15 minutes</p>'),
30
+ 'Wipes clean daily</strong>',
31
+ 'Wipes clean every 15 minutes</strong>'),
32
+ 'Il se r&eacute;initialise chaque jour :',
33
+ 'Il se r&eacute;initialise toutes les 15 minutes :'),
34
+ 'R&eacute;initialis&eacute; chaque jour</p>',
35
+ 'R&eacute;initialis&eacute; toutes les 15 minutes</p>'),
36
+ 'Remis &agrave; z&eacute;ro chaque jour</strong>',
37
+ 'Remis &agrave; z&eacute;ro toutes les 15 minutes</strong>')
38
+ $fn$;
39
+
40
+ UPDATE public.blocks
41
+ SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb,
42
+ updated_at = now()
43
+ WHERE block_type = 'section'
44
+ AND page_id IS NOT NULL
45
+ AND content::text LIKE '%nb-sandbox-promo%'
46
+ AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
47
+
48
+ UPDATE public.page_revisions
49
+ SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb
50
+ WHERE content::text LIKE '%nb-sandbox-promo%'
51
+ AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
52
+
53
+ DROP FUNCTION IF EXISTS pg_temp.nb_promo_cadence_15min(text);
@@ -0,0 +1,56 @@
1
+ -- 02006: home marketing copy -- fix two WCAG AA colour-contrast failures.
2
+ --
3
+ -- Lighthouse Accessibility dropped from 100 to 97 on the home page after the
4
+ -- marketing revamp, on two seeded elements (EN 'home' and FR 'accueil'):
5
+ --
6
+ -- 1. The competitor column header of the comparison table
7
+ -- ("Lovable, Bolt, v0"): text-rose-600 (#ec003f) on the thead's bg-slate-50
8
+ -- (#f8fafc) is 4.32:1 at 12px; AA needs 4.5:1. text-rose-700 gives ~5.8:1.
9
+ -- 2. The small caption under each of the three pillar cards ("mt-10 grid ...
10
+ -- md:grid-cols-3"): text-slate-500 (#65758b) on the violet card's tinted
11
+ -- background (#f8f7ff) is 4.41:1 at 14px. text-slate-600 gives ~7:1, and is
12
+ -- just as legible on the emerald and sky cards, so all three move together.
13
+ --
14
+ -- Both strings already shipped through 02000 (catch-up) / 02004 (baseline) and live
15
+ -- on real installs, so per the append-only rule this is a forward-only data fix
16
+ -- instead of an edit to those files. Dark-mode classes are untouched.
17
+ --
18
+ -- Targets the blocks by content signature + parent (never blocks.id: ids drift on
19
+ -- every install) and rewrites only the two class strings with replace(), leaving the
20
+ -- rest of the block untouched. page_revisions rows carrying the same markup get the
21
+ -- same rewrite so restoring a seeded revision cannot bring the failures back.
22
+ -- Idempotent: a second run matches zero rows (content already equals the rewritten
23
+ -- text).
24
+
25
+ CREATE OR REPLACE FUNCTION pg_temp.nb_home_marketing_contrast(src text)
26
+ RETURNS text
27
+ LANGUAGE sql
28
+ IMMUTABLE
29
+ AS $fn$
30
+ SELECT replace(replace(src,
31
+ 'tracking-[0.2em] text-rose-600 dark:text-rose-300',
32
+ 'tracking-[0.2em] text-rose-700 dark:text-rose-300'),
33
+ '<p class=''mt-3 text-sm text-slate-500 dark:text-slate-400''>',
34
+ '<p class=''mt-3 text-sm text-slate-600 dark:text-slate-400''>')
35
+ $fn$;
36
+
37
+ UPDATE public.blocks
38
+ SET content = pg_temp.nb_home_marketing_contrast(content::text)::jsonb,
39
+ updated_at = now()
40
+ WHERE block_type IN ('section', 'text')
41
+ AND page_id IS NOT NULL
42
+ AND (
43
+ content::text LIKE '%tracking-[0.2em] text-rose-600 dark:text-rose-300%'
44
+ OR content::text LIKE '%<p class=''mt-3 text-sm text-slate-500 dark:text-slate-400''>%'
45
+ )
46
+ AND content::text <> pg_temp.nb_home_marketing_contrast(content::text);
47
+
48
+ UPDATE public.page_revisions
49
+ SET content = pg_temp.nb_home_marketing_contrast(content::text)::jsonb
50
+ WHERE (
51
+ content::text LIKE '%tracking-[0.2em] text-rose-600 dark:text-rose-300%'
52
+ OR content::text LIKE '%<p class=''mt-3 text-sm text-slate-500 dark:text-slate-400''>%'
53
+ )
54
+ AND content::text <> pg_temp.nb_home_marketing_contrast(content::text);
55
+
56
+ DROP FUNCTION IF EXISTS pg_temp.nb_home_marketing_contrast(text);