@jsonpages/cli 3.0.74 → 3.0.75

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.
@@ -596,7 +596,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
596
596
  "@tiptap/extension-link": "^2.11.5",
597
597
  "@tiptap/react": "^2.11.5",
598
598
  "@tiptap/starter-kit": "^2.11.5",
599
- "@jsonpages/core": "^1.0.61",
599
+ "@jsonpages/core": "^1.0.62",
600
600
  "clsx": "^2.1.1",
601
601
  "lucide-react": "^0.474.0",
602
602
  "react": "^19.0.0",
@@ -1118,13 +1118,7 @@ function App() {
1118
1118
  addSection: addSectionConfig,
1119
1119
  persistence: {
1120
1120
  async saveToFile(state: ProjectState, slug: string): Promise<void> {
1121
- // ☁️ SCENARIO A: CLOUD BRIDGE (Production)
1122
- if (isCloudMode) {
1123
- await runCloudSave({ state, slug }, true);
1124
- return;
1125
- }
1126
-
1127
- // 💻 SCENARIO B: LOCAL FILESYSTEM (Development)
1121
+ // 💻 LOCAL FILESYSTEM (Development / legacy fallback)
1128
1122
  console.log(`💻 Saving ${slug} to Local Filesystem...`);
1129
1123
  const res = await fetch('/api/save-to-file', {
1130
1124
  method: 'POST',
@@ -1135,6 +1129,30 @@ function App() {
1135
1129
  const body = (await res.json().catch(() => ({}))) as { error?: string };
1136
1130
  if (!res.ok) throw new Error(body.error ?? `Save to file failed: ${res.status}`);
1137
1131
  },
1132
+ async hotSave(state: ProjectState, slug: string): Promise<void> {
1133
+ if (!isCloudMode || !CLOUD_API_URL || !CLOUD_API_KEY) {
1134
+ throw new Error('Cloud mode is not configured for hot save.');
1135
+ }
1136
+ const apiBase = CLOUD_API_URL.replace(/\/$/, '');
1137
+ const res = await fetch(`${apiBase}/save2edge`, {
1138
+ method: 'POST',
1139
+ headers: {
1140
+ 'Content-Type': 'application/json',
1141
+ Authorization: `Bearer ${CLOUD_API_KEY}`,
1142
+ },
1143
+ body: JSON.stringify({
1144
+ slug,
1145
+ type: 'page',
1146
+ data: state.page,
1147
+ }),
1148
+ });
1149
+ const body = (await res.json().catch(() => ({}))) as { error?: string; code?: string };
1150
+ if (!res.ok) {
1151
+ throw new Error(body.error || body.code || `Hot save failed: ${res.status}`);
1152
+ }
1153
+ },
1154
+ showLegacySave: !isCloudMode,
1155
+ showHotSave: isCloudMode,
1138
1156
  },
1139
1157
  assets: {
1140
1158
  assetsBaseUrl: '/assets',
@@ -596,7 +596,7 @@ cat << 'END_OF_FILE_CONTENT' > "package.json"
596
596
  "@tiptap/extension-link": "^2.11.5",
597
597
  "@tiptap/react": "^2.11.5",
598
598
  "@tiptap/starter-kit": "^2.11.5",
599
- "@jsonpages/core": "^1.0.61",
599
+ "@jsonpages/core": "^1.0.62",
600
600
  "clsx": "^2.1.1",
601
601
  "lucide-react": "^0.474.0",
602
602
  "react": "^19.0.0",
@@ -1118,13 +1118,7 @@ function App() {
1118
1118
  addSection: addSectionConfig,
1119
1119
  persistence: {
1120
1120
  async saveToFile(state: ProjectState, slug: string): Promise<void> {
1121
- // ☁️ SCENARIO A: CLOUD BRIDGE (Production)
1122
- if (isCloudMode) {
1123
- await runCloudSave({ state, slug }, true);
1124
- return;
1125
- }
1126
-
1127
- // 💻 SCENARIO B: LOCAL FILESYSTEM (Development)
1121
+ // 💻 LOCAL FILESYSTEM (Development / legacy fallback)
1128
1122
  console.log(`💻 Saving ${slug} to Local Filesystem...`);
1129
1123
  const res = await fetch('/api/save-to-file', {
1130
1124
  method: 'POST',
@@ -1135,6 +1129,30 @@ function App() {
1135
1129
  const body = (await res.json().catch(() => ({}))) as { error?: string };
1136
1130
  if (!res.ok) throw new Error(body.error ?? `Save to file failed: ${res.status}`);
1137
1131
  },
1132
+ async hotSave(state: ProjectState, slug: string): Promise<void> {
1133
+ if (!isCloudMode || !CLOUD_API_URL || !CLOUD_API_KEY) {
1134
+ throw new Error('Cloud mode is not configured for hot save.');
1135
+ }
1136
+ const apiBase = CLOUD_API_URL.replace(/\/$/, '');
1137
+ const res = await fetch(`${apiBase}/save2edge`, {
1138
+ method: 'POST',
1139
+ headers: {
1140
+ 'Content-Type': 'application/json',
1141
+ Authorization: `Bearer ${CLOUD_API_KEY}`,
1142
+ },
1143
+ body: JSON.stringify({
1144
+ slug,
1145
+ type: 'page',
1146
+ data: state.page,
1147
+ }),
1148
+ });
1149
+ const body = (await res.json().catch(() => ({}))) as { error?: string; code?: string };
1150
+ if (!res.ok) {
1151
+ throw new Error(body.error || body.code || `Hot save failed: ${res.status}`);
1152
+ }
1153
+ },
1154
+ showLegacySave: !isCloudMode,
1155
+ showHotSave: isCloudMode,
1138
1156
  },
1139
1157
  assets: {
1140
1158
  assetsBaseUrl: '/assets',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonpages/cli",
3
- "version": "3.0.74",
3
+ "version": "3.0.75",
4
4
  "description": "The Sovereign CLI Engine for JsonPages.",
5
5
  "type": "module",
6
6
  "bin": {