@jsonpages/cli 3.0.68 → 3.0.70

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.
@@ -583,8 +583,9 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
583
583
  "scripts": {
584
584
  "dev": "vite",
585
585
  "dev:clean": "vite --force",
586
+ "prebuild": "node scripts/sync-pages-to-public.mjs",
586
587
  "build": "tsc && vite build",
587
- "dist": "bash ./src2Code.sh src index.html vite.config.ts scripts docs package.json",
588
+ "dist": "bash ./src2Code.sh src vercel.json index.html vite.config.ts scripts docs package.json",
588
589
  "preview": "vite preview",
589
590
  "bake:email": "tsx scripts/bake-email.tsx",
590
591
  "bakemail": "npm run bake:email --"
@@ -594,7 +595,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
594
595
  "@tiptap/extension-link": "^2.11.5",
595
596
  "@tiptap/react": "^2.11.5",
596
597
  "@tiptap/starter-kit": "^2.11.5",
597
- "@jsonpages/core": "^1.0.55",
598
+ "@jsonpages/core": "^1.0.57",
598
599
  "clsx": "^2.1.1",
599
600
  "lucide-react": "^0.474.0",
600
601
  "react": "^19.0.0",
@@ -890,6 +891,30 @@ main().catch((error) => {
890
891
  process.exit(1);
891
892
  });
892
893
 
894
+ END_OF_FILE_CONTENT
895
+ echo "Creating scripts/sync-pages-to-public.mjs..."
896
+ cat << 'END_OF_FILE_CONTENT' > "scripts/sync-pages-to-public.mjs"
897
+ import fs from 'fs';
898
+ import path from 'path';
899
+ import { fileURLToPath } from 'url';
900
+
901
+ const __filename = fileURLToPath(import.meta.url);
902
+ const __dirname = path.dirname(__filename);
903
+ const rootDir = path.resolve(__dirname, '..');
904
+ const sourceDir = path.join(rootDir, 'src', 'data', 'pages');
905
+ const targetDir = path.join(rootDir, 'public', 'pages');
906
+
907
+ if (!fs.existsSync(sourceDir)) {
908
+ console.warn('[sync-pages-to-public] Source directory not found:', sourceDir);
909
+ process.exit(0);
910
+ }
911
+
912
+ fs.rmSync(targetDir, { recursive: true, force: true });
913
+ fs.mkdirSync(targetDir, { recursive: true });
914
+ fs.cpSync(sourceDir, targetDir, { recursive: true });
915
+
916
+ console.log('[sync-pages-to-public] Synced pages to public/pages');
917
+
893
918
  END_OF_FILE_CONTENT
894
919
  mkdir -p "src"
895
920
  echo "Creating src/App.tsx..."
@@ -7502,6 +7527,33 @@ declare module '*?inline' {
7502
7527
 
7503
7528
 
7504
7529
 
7530
+ END_OF_FILE_CONTENT
7531
+ echo "Creating vercel.json..."
7532
+ cat << 'END_OF_FILE_CONTENT' > "vercel.json"
7533
+ {
7534
+ "rewrites": [
7535
+ {
7536
+ "source": "/:pagePath*.json",
7537
+ "destination": "/pages/:pagePath*.json"
7538
+ },
7539
+ {
7540
+ "source": "/(.*)",
7541
+ "destination": "/index.html"
7542
+ }
7543
+ ],
7544
+ "headers": [
7545
+ {
7546
+ "source": "/assets/(.*)",
7547
+ "headers": [
7548
+ {
7549
+ "key": "Cache-Control",
7550
+ "value": "public, max-age=31536000, immutable"
7551
+ }
7552
+ ]
7553
+ }
7554
+ ]
7555
+ }
7556
+
7505
7557
  END_OF_FILE_CONTENT
7506
7558
  echo "Creating vite.config.ts..."
7507
7559
  cat << 'END_OF_FILE_CONTENT' > "vite.config.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonpages/cli",
3
- "version": "3.0.68",
3
+ "version": "3.0.70",
4
4
  "description": "The Sovereign CLI Engine for JsonPages.",
5
5
  "type": "module",
6
6
  "bin": {