@nexushub/client 0.7.6 → 0.7.7

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/dist/index.cjs CHANGED
@@ -1048,7 +1048,7 @@ var ContentEngine = class {
1048
1048
  }
1049
1049
  return includeMetadata ? cached : cached.data;
1050
1050
  }
1051
- if (!forceRefresh) {
1051
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
1052
1052
  try {
1053
1053
  const localCollection = await this.localCache.getCollection(collectionId);
1054
1054
  if (localCollection) {
@@ -1123,7 +1123,7 @@ var ContentEngine = class {
1123
1123
  return cached;
1124
1124
  }
1125
1125
  }
1126
- if (!forceRefresh) {
1126
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
1127
1127
  try {
1128
1128
  const localGlobals = await this.localCache.getGlobals();
1129
1129
  if (localGlobals) {
@@ -1318,22 +1318,24 @@ var ContentEngine = class {
1318
1318
  };
1319
1319
  }
1320
1320
  }
1321
- if (key.startsWith("page:")) {
1322
- const slug = key.split(":")[1];
1323
- try {
1324
- const local = await this.localCache.getPage(slug);
1325
- if (local) {
1326
- return {
1327
- data: local,
1328
- metadata: {
1329
- timestamp: Date.now(),
1330
- expiresAt: Infinity,
1331
- tags: [],
1332
- etag: void 0
1333
- }
1334
- };
1321
+ if (process.env.NODE_ENV === "development") {
1322
+ if (key.startsWith("page:")) {
1323
+ const slug = key.split(":")[1];
1324
+ try {
1325
+ const local = await this.localCache.getPage(slug);
1326
+ if (local) {
1327
+ return {
1328
+ data: local,
1329
+ metadata: {
1330
+ timestamp: Date.now(),
1331
+ expiresAt: Infinity,
1332
+ tags: [],
1333
+ etag: void 0
1334
+ }
1335
+ };
1336
+ }
1337
+ } catch {
1335
1338
  }
1336
- } catch {
1337
1339
  }
1338
1340
  }
1339
1341
  return null;
@@ -1517,15 +1519,18 @@ var ContentEngine = class {
1517
1519
  tags = [],
1518
1520
  revalidate,
1519
1521
  ...fetchOptions
1520
- // 🚀 RESOLVED: Destructure with safe default to prevent undefined spreads
1521
1522
  } = options;
1522
1523
  const controller = new AbortController();
1523
1524
  const id = setTimeout(() => controller.abort(), timeout);
1524
- const nextConfig = this.isServer ? { next: { tags, revalidate } } : {};
1525
+ const nextConfig = this.isServer ? {
1526
+ cache: "force-cache",
1527
+ next: { tags, revalidate: revalidate === false ? false : revalidate }
1528
+ } : {};
1525
1529
  try {
1526
1530
  const response = await fetch(url, {
1527
1531
  ...fetchOptions,
1528
1532
  ...nextConfig,
1533
+ // Inject Next.js tags
1529
1534
  signal: controller.signal
1530
1535
  });
1531
1536
  clearTimeout(id);
package/dist/index.js CHANGED
@@ -1002,7 +1002,7 @@ var ContentEngine = class {
1002
1002
  }
1003
1003
  return includeMetadata ? cached : cached.data;
1004
1004
  }
1005
- if (!forceRefresh) {
1005
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
1006
1006
  try {
1007
1007
  const localCollection = await this.localCache.getCollection(collectionId);
1008
1008
  if (localCollection) {
@@ -1077,7 +1077,7 @@ var ContentEngine = class {
1077
1077
  return cached;
1078
1078
  }
1079
1079
  }
1080
- if (!forceRefresh) {
1080
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
1081
1081
  try {
1082
1082
  const localGlobals = await this.localCache.getGlobals();
1083
1083
  if (localGlobals) {
@@ -1272,22 +1272,24 @@ var ContentEngine = class {
1272
1272
  };
1273
1273
  }
1274
1274
  }
1275
- if (key.startsWith("page:")) {
1276
- const slug = key.split(":")[1];
1277
- try {
1278
- const local = await this.localCache.getPage(slug);
1279
- if (local) {
1280
- return {
1281
- data: local,
1282
- metadata: {
1283
- timestamp: Date.now(),
1284
- expiresAt: Infinity,
1285
- tags: [],
1286
- etag: void 0
1287
- }
1288
- };
1275
+ if (process.env.NODE_ENV === "development") {
1276
+ if (key.startsWith("page:")) {
1277
+ const slug = key.split(":")[1];
1278
+ try {
1279
+ const local = await this.localCache.getPage(slug);
1280
+ if (local) {
1281
+ return {
1282
+ data: local,
1283
+ metadata: {
1284
+ timestamp: Date.now(),
1285
+ expiresAt: Infinity,
1286
+ tags: [],
1287
+ etag: void 0
1288
+ }
1289
+ };
1290
+ }
1291
+ } catch {
1289
1292
  }
1290
- } catch {
1291
1293
  }
1292
1294
  }
1293
1295
  return null;
@@ -1471,15 +1473,18 @@ var ContentEngine = class {
1471
1473
  tags = [],
1472
1474
  revalidate,
1473
1475
  ...fetchOptions
1474
- // 🚀 RESOLVED: Destructure with safe default to prevent undefined spreads
1475
1476
  } = options;
1476
1477
  const controller = new AbortController();
1477
1478
  const id = setTimeout(() => controller.abort(), timeout);
1478
- const nextConfig = this.isServer ? { next: { tags, revalidate } } : {};
1479
+ const nextConfig = this.isServer ? {
1480
+ cache: "force-cache",
1481
+ next: { tags, revalidate: revalidate === false ? false : revalidate }
1482
+ } : {};
1479
1483
  try {
1480
1484
  const response = await fetch(url, {
1481
1485
  ...fetchOptions,
1482
1486
  ...nextConfig,
1487
+ // Inject Next.js tags
1483
1488
  signal: controller.signal
1484
1489
  });
1485
1490
  clearTimeout(id);
package/dist/react.cjs CHANGED
@@ -647,7 +647,7 @@ var ContentEngine = class {
647
647
  }
648
648
  return includeMetadata ? cached : cached.data;
649
649
  }
650
- if (!forceRefresh) {
650
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
651
651
  try {
652
652
  const localCollection = await this.localCache.getCollection(collectionId);
653
653
  if (localCollection) {
@@ -722,7 +722,7 @@ var ContentEngine = class {
722
722
  return cached;
723
723
  }
724
724
  }
725
- if (!forceRefresh) {
725
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
726
726
  try {
727
727
  const localGlobals = await this.localCache.getGlobals();
728
728
  if (localGlobals) {
@@ -917,22 +917,24 @@ var ContentEngine = class {
917
917
  };
918
918
  }
919
919
  }
920
- if (key.startsWith("page:")) {
921
- const slug = key.split(":")[1];
922
- try {
923
- const local = await this.localCache.getPage(slug);
924
- if (local) {
925
- return {
926
- data: local,
927
- metadata: {
928
- timestamp: Date.now(),
929
- expiresAt: Infinity,
930
- tags: [],
931
- etag: void 0
932
- }
933
- };
920
+ if (process.env.NODE_ENV === "development") {
921
+ if (key.startsWith("page:")) {
922
+ const slug = key.split(":")[1];
923
+ try {
924
+ const local = await this.localCache.getPage(slug);
925
+ if (local) {
926
+ return {
927
+ data: local,
928
+ metadata: {
929
+ timestamp: Date.now(),
930
+ expiresAt: Infinity,
931
+ tags: [],
932
+ etag: void 0
933
+ }
934
+ };
935
+ }
936
+ } catch (e7) {
934
937
  }
935
- } catch (e7) {
936
938
  }
937
939
  }
938
940
  return null;
@@ -1116,15 +1118,18 @@ var ContentEngine = class {
1116
1118
  tags = [],
1117
1119
  revalidate,
1118
1120
  ...fetchOptions
1119
- // 🚀 RESOLVED: Destructure with safe default to prevent undefined spreads
1120
1121
  } = options;
1121
1122
  const controller = new AbortController();
1122
1123
  const id = setTimeout(() => controller.abort(), timeout);
1123
- const nextConfig = this.isServer ? { next: { tags, revalidate } } : {};
1124
+ const nextConfig = this.isServer ? {
1125
+ cache: "force-cache",
1126
+ next: { tags, revalidate: revalidate === false ? false : revalidate }
1127
+ } : {};
1124
1128
  try {
1125
1129
  const response = await fetch(url, {
1126
1130
  ...fetchOptions,
1127
1131
  ...nextConfig,
1132
+ // Inject Next.js tags
1128
1133
  signal: controller.signal
1129
1134
  });
1130
1135
  clearTimeout(id);
package/dist/react.js CHANGED
@@ -647,7 +647,7 @@ var ContentEngine = class {
647
647
  }
648
648
  return includeMetadata ? cached : cached.data;
649
649
  }
650
- if (!forceRefresh) {
650
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
651
651
  try {
652
652
  const localCollection = await this.localCache.getCollection(collectionId);
653
653
  if (localCollection) {
@@ -722,7 +722,7 @@ var ContentEngine = class {
722
722
  return cached;
723
723
  }
724
724
  }
725
- if (!forceRefresh) {
725
+ if (!forceRefresh && process.env.NODE_ENV === "development") {
726
726
  try {
727
727
  const localGlobals = await this.localCache.getGlobals();
728
728
  if (localGlobals) {
@@ -917,22 +917,24 @@ var ContentEngine = class {
917
917
  };
918
918
  }
919
919
  }
920
- if (key.startsWith("page:")) {
921
- const slug = key.split(":")[1];
922
- try {
923
- const local = await this.localCache.getPage(slug);
924
- if (local) {
925
- return {
926
- data: local,
927
- metadata: {
928
- timestamp: Date.now(),
929
- expiresAt: Infinity,
930
- tags: [],
931
- etag: void 0
932
- }
933
- };
920
+ if (process.env.NODE_ENV === "development") {
921
+ if (key.startsWith("page:")) {
922
+ const slug = key.split(":")[1];
923
+ try {
924
+ const local = await this.localCache.getPage(slug);
925
+ if (local) {
926
+ return {
927
+ data: local,
928
+ metadata: {
929
+ timestamp: Date.now(),
930
+ expiresAt: Infinity,
931
+ tags: [],
932
+ etag: void 0
933
+ }
934
+ };
935
+ }
936
+ } catch {
934
937
  }
935
- } catch {
936
938
  }
937
939
  }
938
940
  return null;
@@ -1116,15 +1118,18 @@ var ContentEngine = class {
1116
1118
  tags = [],
1117
1119
  revalidate,
1118
1120
  ...fetchOptions
1119
- // 🚀 RESOLVED: Destructure with safe default to prevent undefined spreads
1120
1121
  } = options;
1121
1122
  const controller = new AbortController();
1122
1123
  const id = setTimeout(() => controller.abort(), timeout);
1123
- const nextConfig = this.isServer ? { next: { tags, revalidate } } : {};
1124
+ const nextConfig = this.isServer ? {
1125
+ cache: "force-cache",
1126
+ next: { tags, revalidate: revalidate === false ? false : revalidate }
1127
+ } : {};
1124
1128
  try {
1125
1129
  const response = await fetch(url, {
1126
1130
  ...fetchOptions,
1127
1131
  ...nextConfig,
1132
+ // Inject Next.js tags
1128
1133
  signal: controller.signal
1129
1134
  });
1130
1135
  clearTimeout(id);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nexushub/client",
3
3
  "private": false,
4
- "version": "0.7.6",
4
+ "version": "0.7.7",
5
5
  "description": "The God-Tier NexusHub SDK",
6
6
  "type": "module",
7
7
  "main": "./dist/index.cjs",