@olonjs/cli 3.0.155 → 3.0.157

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.
@@ -1817,9 +1817,9 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
1817
1817
  "@tiptap/extension-link": "^2.11.5",
1818
1818
  "@tiptap/react": "^2.11.5",
1819
1819
  "@tiptap/starter-kit": "^2.11.5",
1820
- "@olonjs/core": "^1.1.22",
1821
- "@olonjs/react": "^0.1.5",
1822
- "@olonjs/studio": "^0.1.5",
1820
+ "@olonjs/core": "^1.1.25",
1821
+ "@olonjs/react": "^0.1.8",
1822
+ "@olonjs/studio": "^0.1.8",
1823
1823
  "class-variance-authority": "^0.7.1",
1824
1824
  "clsx": "^2.1.1",
1825
1825
  "lucide-react": "^0.474.0",
@@ -1817,9 +1817,9 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
1817
1817
  "@tiptap/extension-link": "^2.11.5",
1818
1818
  "@tiptap/react": "^2.11.5",
1819
1819
  "@tiptap/starter-kit": "^2.11.5",
1820
- "@olonjs/core": "^1.1.22",
1821
- "@olonjs/react": "^0.1.5",
1822
- "@olonjs/studio": "^0.1.5",
1820
+ "@olonjs/core": "^1.1.25",
1821
+ "@olonjs/react": "^0.1.8",
1822
+ "@olonjs/studio": "^0.1.8",
1823
1823
  "class-variance-authority": "^0.7.1",
1824
1824
  "clsx": "^2.1.1",
1825
1825
  "lucide-react": "^0.474.0",
@@ -334,32 +334,32 @@ body {
334
334
  END_OF_FILE_CONTENT
335
335
  echo "Creating app/layout.tsx..."
336
336
  cat << 'END_OF_FILE_CONTENT' > "app/layout.tsx"
337
- import type { Metadata } from 'next';
338
- import type { ReactNode } from 'react';
339
- import { getFileSiteBundle } from '@/lib/loaders/getFileSiteConfig';
340
- import { serializeThemeRootCss } from '@/lib/css/serializeThemeRootCss';
341
- import './globals.css';
342
-
343
- export const metadata: Metadata = {
344
- title: 'OlonJS Next Starter',
345
- description: 'RSC visitors + admin client island (ADR-0017)',
346
- };
347
-
348
- export default function RootLayout({ children }: { children: ReactNode }) {
349
- const { themeConfig } = getFileSiteBundle();
350
- const themeCss = serializeThemeRootCss(themeConfig);
351
-
352
- return (
353
- <html lang="en">
354
- <head>
355
- {themeCss ? (
356
- <style id="olon-theme-vars" dangerouslySetInnerHTML={{ __html: themeCss }} />
357
- ) : null}
358
- </head>
359
- <body className="min-h-screen bg-background text-foreground antialiased">{children}</body>
360
- </html>
361
- );
362
- }
337
+ import type { Metadata } from 'next';
338
+ import type { ReactNode } from 'react';
339
+ import { getFileSiteBundle } from '@/lib/loaders/getFileSiteConfig';
340
+ import { serializeThemeRootCss } from '@/lib/css/serializeThemeRootCss';
341
+ import './globals.css';
342
+
343
+ export const metadata: Metadata = {
344
+ title: 'OlonJS Next Starter',
345
+ description: 'RSC visitors + admin client island (ADR-0017)',
346
+ };
347
+
348
+ export default function RootLayout({ children }: { children: ReactNode }) {
349
+ const { themeConfig } = getFileSiteBundle();
350
+ const themeCss = serializeThemeRootCss(themeConfig);
351
+
352
+ return (
353
+ <html lang="en">
354
+ <head>
355
+ {themeCss ? (
356
+ <style id="olon-theme-vars" dangerouslySetInnerHTML={{ __html: themeCss }} />
357
+ ) : null}
358
+ </head>
359
+ <body className="min-h-screen bg-background text-foreground antialiased">{children}</body>
360
+ </html>
361
+ );
362
+ }
363
363
 
364
364
  END_OF_FILE_CONTENT
365
365
  echo "Creating app/not-found.tsx..."
@@ -455,6 +455,15 @@ const publicPageJsonRewrites = [
455
455
  const nextConfig: NextConfig = {
456
456
  reactStrictMode: true,
457
457
  transpilePackages: ['@olonjs/next', '@olonjs/core', '@olonjs/react', '@olonjs/studio'],
458
+ /**
459
+ * Visitor/admin loaders read `src/data/**` via runtime `fs` (`getFilePages`, etc.).
460
+ * Those JSON files are never statically imported, so NFT omits them from the
461
+ * Vercel serverless bundle unless we force-include them — otherwise
462
+ * `getFilePages()` returns {} and the site shows EmptyTenantView.
463
+ */
464
+ outputFileTracingIncludes: {
465
+ '/*': ['./src/data/**/*'],
466
+ },
458
467
  async rewrites() {
459
468
  return publicPageJsonRewrites;
460
469
  },
@@ -472,19 +481,20 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
472
481
  "type": "module",
473
482
  "scripts": {
474
483
  "dev": "next dev",
484
+ "prebuild": "node scripts/sync-pages-to-public.mjs",
475
485
  "build": "next build",
476
486
  "start": "next start",
477
487
  "lint": "next lint",
478
488
  "test": "vitest run",
479
489
  "typecheck": "tsc --noEmit",
480
- "dist": "bash ./src2Code.sh --template next app src middleware.ts next.config.ts postcss.config.mjs tsconfig.json package.json next-env.d.ts vitest.config.ts",
490
+ "dist": "bash ./src2Code.sh --template next app src scripts middleware.ts next.config.ts postcss.config.mjs tsconfig.json package.json next-env.d.ts vitest.config.ts",
481
491
  "dist:dna": "npm run dist"
482
492
  },
483
493
  "dependencies": {
484
- "@olonjs/core": "^1.1.22",
485
- "@olonjs/next": "^0.0.2",
486
- "@olonjs/react": "^0.1.5",
487
- "@olonjs/studio": "^0.1.5",
494
+ "@olonjs/core": "^1.1.25",
495
+ "@olonjs/next": "^0.0.5",
496
+ "@olonjs/react": "^0.1.8",
497
+ "@olonjs/studio": "^0.1.8",
488
498
  "clsx": "^2.1.1",
489
499
  "lucide-react": "^0.474.0",
490
500
  "next": "^15.5.0",
@@ -517,6 +527,57 @@ const config = {
517
527
 
518
528
  export default config;
519
529
 
530
+ END_OF_FILE_CONTENT
531
+ mkdir -p "scripts"
532
+ echo "Creating scripts/sync-pages-to-public.mjs..."
533
+ cat << 'END_OF_FILE_CONTENT' > "scripts/sync-pages-to-public.mjs"
534
+ import fs from 'fs';
535
+ import path from 'path';
536
+ import { fileURLToPath } from 'url';
537
+
538
+ /**
539
+ * Mirror Vite/alpha Save2Repo publish surface:
540
+ * src/data/pages → public/pages
541
+ * src/data/collections → public/collections
542
+ * src/data/config/site.json → public/config/site.json
543
+ *
544
+ * Required so static boot can HTTP-fetch same-origin published JSON without
545
+ * hitting the /*.json → /api/public-page rewrite loop (afterFiles only skips
546
+ * when a real file exists under public/).
547
+ */
548
+ const __filename = fileURLToPath(import.meta.url);
549
+ const __dirname = path.dirname(__filename);
550
+ const rootDir = path.resolve(__dirname, '..');
551
+ const sourceDir = path.join(rootDir, 'src', 'data', 'pages');
552
+ const targetDir = path.join(rootDir, 'public', 'pages');
553
+ const sourceCollectionsDir = path.join(rootDir, 'src', 'data', 'collections');
554
+ const targetCollectionsDir = path.join(rootDir, 'public', 'collections');
555
+ const sourceSiteConfigPath = path.join(rootDir, 'src', 'data', 'config', 'site.json');
556
+ const targetConfigDir = path.join(rootDir, 'public', 'config');
557
+ const targetSiteConfigPath = path.join(targetConfigDir, 'site.json');
558
+
559
+ if (!fs.existsSync(sourceDir)) {
560
+ console.warn('[sync-pages-to-public] Source directory not found:', sourceDir);
561
+ process.exit(0);
562
+ }
563
+
564
+ fs.rmSync(targetDir, { recursive: true, force: true });
565
+ fs.mkdirSync(targetDir, { recursive: true });
566
+ fs.cpSync(sourceDir, targetDir, { recursive: true });
567
+
568
+ fs.rmSync(targetCollectionsDir, { recursive: true, force: true });
569
+ if (fs.existsSync(sourceCollectionsDir)) {
570
+ fs.mkdirSync(targetCollectionsDir, { recursive: true });
571
+ fs.cpSync(sourceCollectionsDir, targetCollectionsDir, { recursive: true });
572
+ }
573
+
574
+ if (fs.existsSync(sourceSiteConfigPath)) {
575
+ fs.mkdirSync(targetConfigDir, { recursive: true });
576
+ fs.cpSync(sourceSiteConfigPath, targetSiteConfigPath);
577
+ }
578
+
579
+ console.log('[sync-pages-to-public] Synced pages, collections, and site config to public/');
580
+
520
581
  END_OF_FILE_CONTENT
521
582
  mkdir -p "src"
522
583
  mkdir -p "src/collections"
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
1
  {
2
- "name": "@olonjs/cli",
3
- "version": "3.0.155",
4
- "description": "The Sovereign CLI Engine for OlonJS.",
5
- "type": "module",
6
- "bin": {
7
- "olonjs": "./src/index.js",
8
- "jsonpages": "./src/index.js"
9
- },
10
- "files": [
11
- "src",
12
- "assets/src_tenant_alpha.sh",
13
- "assets/templates"
14
- ],
15
- "author": "JsonPages Team",
16
- "license": "MIT",
17
- "homepage": "https://github.com/olonjs/npm-jpcore#readme",
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/olonjs/npm-jpcore.git",
21
- "directory": "packages/cli"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/olonjs/npm-jpcore/issues"
25
- },
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "scripts": {
30
- "build": "tsc -p .",
31
- "test": "node --test src/**/*.test.js",
32
- "check:templates": "node ../../scripts/check-cli-templates.mjs"
33
- },
34
- "dependencies": {
35
- "@olonjs/stack": "^1.0.0",
36
- "chalk": "^5.3.0",
37
- "commander": "^12.1.0",
38
- "execa": "^9.0.2",
39
- "fs-extra": "^11.2.0",
40
- "ora": "^8.0.1"
41
- },
42
- "devDependencies": {
43
- "@types/fs-extra": "^11.0.4",
44
- "@types/node": "^22.13.1",
45
- "typescript": "^5.7.3"
46
- }
2
+ "name": "@olonjs/cli",
3
+ "version": "3.0.157",
4
+ "description": "The Sovereign CLI Engine for OlonJS.",
5
+ "type": "module",
6
+ "bin": {
7
+ "olonjs": "./src/index.js",
8
+ "jsonpages": "./src/index.js"
9
+ },
10
+ "files": [
11
+ "src",
12
+ "assets/src_tenant_alpha.sh",
13
+ "assets/templates"
14
+ ],
15
+ "author": "JsonPages Team",
16
+ "license": "MIT",
17
+ "homepage": "https://github.com/olonjs/npm-jpcore#readme",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/olonjs/npm-jpcore.git",
21
+ "directory": "packages/cli"
22
+ },
23
+ "bugs": {
24
+ "url": "https://github.com/olonjs/npm-jpcore/issues"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "scripts": {
30
+ "build": "tsc -p .",
31
+ "test": "node --test src/**/*.test.js",
32
+ "check:templates": "node ../../scripts/check-cli-templates.mjs"
33
+ },
34
+ "dependencies": {
35
+ "@olonjs/stack": "^1.0.0",
36
+ "chalk": "^5.3.0",
37
+ "commander": "^12.1.0",
38
+ "execa": "^9.0.2",
39
+ "fs-extra": "^11.2.0",
40
+ "ora": "^8.0.1"
41
+ },
42
+ "devDependencies": {
43
+ "@types/fs-extra": "^11.0.4",
44
+ "@types/node": "^22.13.1",
45
+ "typescript": "^5.7.3"
46
+ }
47
47
  }