@dyrected/core 2.5.6 → 2.5.8

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
@@ -904,13 +904,16 @@ var AUDIT_COLLECTION = {
904
904
  admin: { hidden: true }
905
905
  };
906
906
  function normalizeConfig(config) {
907
- const needsAudit = config.collections.some((col) => col.audit);
908
- const normalizedCollections = config.collections.map((col) => {
909
- const existingFieldNames = new Set(col.fields.map((f) => f.name));
907
+ const collections = config?.collections || [];
908
+ const globals = config?.globals || [];
909
+ const needsAudit = collections.some((col) => col.audit);
910
+ const normalizedCollections = collections.map((col) => {
911
+ const fields = col.fields || [];
912
+ const existingFieldNames = new Set(fields.map((f) => f.name));
910
913
  const fieldsToInject = SYSTEM_FIELDS.filter((f) => !existingFieldNames.has(f.name));
911
914
  return {
912
915
  ...col,
913
- fields: [...col.fields, ...fieldsToInject]
916
+ fields: [...fields, ...fieldsToInject]
914
917
  };
915
918
  });
916
919
  const hasAuditCollection = normalizedCollections.some(
@@ -921,7 +924,8 @@ function normalizeConfig(config) {
921
924
  collections: [
922
925
  ...normalizedCollections,
923
926
  ...needsAudit && !hasAuditCollection ? [AUDIT_COLLECTION] : []
924
- ]
927
+ ],
928
+ globals
925
929
  };
926
930
  }
927
931
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createDyrectedApp,
3
3
  normalizeConfig
4
- } from "./chunk-PH36WQYS.js";
4
+ } from "./chunk-TIJHR54M.js";
5
5
 
6
6
  // src/utils/setup-prompt.ts
7
7
  function buildEnvironmentSection(frameworkLabel, isSelfHosted, config) {
package/dist/server.cjs CHANGED
@@ -1847,13 +1847,16 @@ var AUDIT_COLLECTION = {
1847
1847
  admin: { hidden: true }
1848
1848
  };
1849
1849
  function normalizeConfig(config) {
1850
- const needsAudit = config.collections.some((col) => col.audit);
1851
- const normalizedCollections = config.collections.map((col) => {
1852
- const existingFieldNames = new Set(col.fields.map((f) => f.name));
1850
+ const collections = config?.collections || [];
1851
+ const globals = config?.globals || [];
1852
+ const needsAudit = collections.some((col) => col.audit);
1853
+ const normalizedCollections = collections.map((col) => {
1854
+ const fields = col.fields || [];
1855
+ const existingFieldNames = new Set(fields.map((f) => f.name));
1853
1856
  const fieldsToInject = SYSTEM_FIELDS.filter((f) => !existingFieldNames.has(f.name));
1854
1857
  return {
1855
1858
  ...col,
1856
- fields: [...col.fields, ...fieldsToInject]
1859
+ fields: [...fields, ...fieldsToInject]
1857
1860
  };
1858
1861
  });
1859
1862
  const hasAuditCollection = normalizedCollections.some(
@@ -1864,7 +1867,8 @@ function normalizeConfig(config) {
1864
1867
  collections: [
1865
1868
  ...normalizedCollections,
1866
1869
  ...needsAudit && !hasAuditCollection ? [AUDIT_COLLECTION] : []
1867
- ]
1870
+ ],
1871
+ globals
1868
1872
  };
1869
1873
  }
1870
1874
 
package/dist/server.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  PreviewController,
7
7
  createDyrectedApp,
8
8
  registerRoutes
9
- } from "./chunk-PH36WQYS.js";
9
+ } from "./chunk-TIJHR54M.js";
10
10
  export {
11
11
  AuthController,
12
12
  CollectionController,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/core",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",