create-nextblock 0.17.1 → 0.17.2
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.
- package/package.json +1 -1
- package/templates/nextblock-template/app/api/cron/reset-sandbox/sandboxResetSql.ts +58 -1
- package/templates/nextblock-template/app/cms/settings/security/page.tsx +1 -1
- package/templates/nextblock-template/docs/12-VERCEL-DEPLOYMENT.md +12 -9
- package/templates/nextblock-template/docs/TECHNICAL_SPECIFICATION.md +59 -59
- package/templates/nextblock-template/lib/config/email-settings.ts +323 -323
- package/templates/nextblock-template/lib/setup/migrations-bundle.ts +5 -0
- package/templates/nextblock-template/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nextblock",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "Scaffold a production-ready NextBlock CMS project — the open-source, full-stack AI-native CMS for Next.js 16, Supabase, and Tailwind CSS.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12064,6 +12064,62 @@ END
|
|
|
12064
12064
|
$nb_baseline_seed$;
|
|
12065
12065
|
|
|
12066
12066
|
|
|
12067
|
+
-- >>> FROM: 02005_home_live_demo_promo_cadence_15min.sql <<<
|
|
12068
|
+
-- 02005: home "Live Demo" promo copy -- reset cadence "daily" -> "every 15 minutes".
|
|
12069
|
+
--
|
|
12070
|
+
-- cms.nextblock.dev now runs on Vercel Pro and its reset cron in vercel.json is
|
|
12071
|
+
-- */15 * * * * (was 0 3 * * *, daily). The promo section on the EN ('home') and FR
|
|
12072
|
+
-- ('accueil') home pages still advertises a daily reset; it already shipped through
|
|
12073
|
+
-- 02000 (catch-up) / 02004 (baseline) and lives on real installs, so per the append-only
|
|
12074
|
+
-- rule this is a forward-only data fix instead of an edit to those files.
|
|
12075
|
+
--
|
|
12076
|
+
-- Targets the promo by its nb-sandbox-promo sentinel + parent page (never blocks.id:
|
|
12077
|
+
-- ids drift on every install) and rewrites only the six cadence phrases (EN + FR) with
|
|
12078
|
+
-- replace(), leaving the rest of the block untouched. page_revisions rows carrying the
|
|
12079
|
+
-- sentinel get the same rewrite so restoring a seeded revision cannot bring the "daily"
|
|
12080
|
+
-- copy back. Idempotent: a second run matches zero rows (content already equals the
|
|
12081
|
+
-- rewritten text). On the sandbox the promo is still stripped afterward by
|
|
12082
|
+
-- removeSandboxPromoSections in the reset-sandbox route.
|
|
12083
|
+
--
|
|
12084
|
+
-- NOTE: keep the word "sandbox" OUT of this filename -- generate-sandbox-reset.ts
|
|
12085
|
+
-- excludes any migration whose filename contains "sandbox" from the reset bundle.
|
|
12086
|
+
|
|
12087
|
+
CREATE OR REPLACE FUNCTION pg_temp.nb_promo_cadence_15min(src text)
|
|
12088
|
+
RETURNS text
|
|
12089
|
+
LANGUAGE sql
|
|
12090
|
+
IMMUTABLE
|
|
12091
|
+
AS $fn$
|
|
12092
|
+
SELECT replace(replace(replace(replace(replace(replace(src,
|
|
12093
|
+
'It resets daily, so explore',
|
|
12094
|
+
'It resets every 15 minutes, so explore'),
|
|
12095
|
+
'· Resets daily</p>',
|
|
12096
|
+
'· Resets every 15 minutes</p>'),
|
|
12097
|
+
'Wipes clean daily</strong>',
|
|
12098
|
+
'Wipes clean every 15 minutes</strong>'),
|
|
12099
|
+
'Il se réinitialise chaque jour :',
|
|
12100
|
+
'Il se réinitialise toutes les 15 minutes :'),
|
|
12101
|
+
'Réinitialisé chaque jour</p>',
|
|
12102
|
+
'Réinitialisé toutes les 15 minutes</p>'),
|
|
12103
|
+
'Remis à zéro chaque jour</strong>',
|
|
12104
|
+
'Remis à zéro toutes les 15 minutes</strong>')
|
|
12105
|
+
$fn$;
|
|
12106
|
+
|
|
12107
|
+
UPDATE public.blocks
|
|
12108
|
+
SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb,
|
|
12109
|
+
updated_at = now()
|
|
12110
|
+
WHERE block_type = 'section'
|
|
12111
|
+
AND page_id IS NOT NULL
|
|
12112
|
+
AND content::text LIKE '%nb-sandbox-promo%'
|
|
12113
|
+
AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
|
|
12114
|
+
|
|
12115
|
+
UPDATE public.page_revisions
|
|
12116
|
+
SET content = pg_temp.nb_promo_cadence_15min(content::text)::jsonb
|
|
12117
|
+
WHERE content::text LIKE '%nb-sandbox-promo%'
|
|
12118
|
+
AND content::text <> pg_temp.nb_promo_cadence_15min(content::text);
|
|
12119
|
+
|
|
12120
|
+
DROP FUNCTION IF EXISTS pg_temp.nb_promo_cadence_15min(text);
|
|
12121
|
+
|
|
12122
|
+
|
|
12067
12123
|
-- Step D: Record the applied migrations in history (truncated in Step B) so
|
|
12068
12124
|
-- \`npm run db:migrate:check\` reports up to date instead of listing every file as pending.
|
|
12069
12125
|
INSERT INTO supabase_migrations.schema_migrations (version, name) VALUES
|
|
@@ -12071,7 +12127,8 @@ $nb_baseline_seed$;
|
|
|
12071
12127
|
('02001', 'baseline_schema'),
|
|
12072
12128
|
('02002', 'baseline_constraints_and_indexes'),
|
|
12073
12129
|
('02003', 'baseline_security_and_grants'),
|
|
12074
|
-
('02004', 'baseline_seed')
|
|
12130
|
+
('02004', 'baseline_seed'),
|
|
12131
|
+
('02005', 'home_live_demo_promo_cadence_15min')
|
|
12075
12132
|
ON CONFLICT (version) DO NOTHING;
|
|
12076
12133
|
|
|
12077
12134
|
-- Step E: Anchor preserved profiles
|
|
@@ -14,7 +14,7 @@ export default async function SecuritySettingsPage() {
|
|
|
14
14
|
<CardTitle>Security & 2FA</CardTitle>
|
|
15
15
|
<CardDescription>
|
|
16
16
|
Security settings are disabled in the sandbox/demo environment, which runs on a
|
|
17
|
-
shared account and resets
|
|
17
|
+
shared account and resets every 15 minutes. They are available in a real installation.
|
|
18
18
|
</CardDescription>
|
|
19
19
|
</CardHeader>
|
|
20
20
|
<CardContent />
|
|
@@ -167,15 +167,18 @@ the question entirely by resolving everything in-app, so the button prompts for
|
|
|
167
167
|
|
|
168
168
|
## Cron jobs and the Hobby plan
|
|
169
169
|
|
|
170
|
-
`vercel.json` declares two crons
|
|
171
|
-
`/api/cron/sync-currencies` at 18:00
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
`vercel.json` declares two crons: `/api/cron/reset-sandbox` **every 15 minutes**
|
|
171
|
+
(`*/15 * * * *`) and `/api/cron/sync-currencies` daily at 18:00 UTC. The 15-minute
|
|
172
|
+
schedule is what keeps the public sandbox at `cms.nextblock.dev` fresh; that project
|
|
173
|
+
runs on **Vercel Pro**, which allows cron schedules down to once per minute with
|
|
174
|
+
per-minute precision.
|
|
175
|
+
|
|
176
|
+
Vercel’s **Hobby (free) tier only allows cron jobs that run at most once per day**
|
|
177
|
+
(timing is approximate, ±59 min), and **a sub-daily schedule fails the deployment**
|
|
178
|
+
outright. So on a Hobby project you must **delete the `reset-sandbox` entry from
|
|
179
|
+
`vercel.json`** before deploying. Nothing is lost: `reset-sandbox` only does work in
|
|
180
|
+
sandbox mode — it returns 404 otherwise — so on a normal deploy it is a harmless
|
|
181
|
+
no-op anyway. `sync-currencies` is daily and deploys fine on Hobby.
|
|
179
182
|
|
|
180
183
|
## After deploy
|
|
181
184
|
|