payload 3.28.0-internal.2b0876e → 3.28.0-internal.4aa73c6

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.
Files changed (44) hide show
  1. package/dist/bin/generateImportMap/{utilities/getFromImportMap.d.ts → getFromImportMap.d.ts} +2 -2
  2. package/dist/bin/generateImportMap/getFromImportMap.d.ts.map +1 -0
  3. package/dist/bin/generateImportMap/getFromImportMap.js.map +1 -0
  4. package/dist/bin/generateImportMap/index.d.ts +10 -2
  5. package/dist/bin/generateImportMap/index.d.ts.map +1 -1
  6. package/dist/bin/generateImportMap/index.js +88 -20
  7. package/dist/bin/generateImportMap/index.js.map +1 -1
  8. package/dist/bin/generateImportMap/iterateConfig.js.map +1 -1
  9. package/dist/bin/generateImportMap/{utilities/parsePayloadComponent.d.ts → parsePayloadComponent.d.ts} +1 -1
  10. package/dist/bin/generateImportMap/parsePayloadComponent.d.ts.map +1 -0
  11. package/dist/bin/generateImportMap/parsePayloadComponent.js.map +1 -0
  12. package/dist/collections/config/types.d.ts +4 -0
  13. package/dist/collections/config/types.d.ts.map +1 -1
  14. package/dist/collections/config/types.js.map +1 -1
  15. package/dist/config/types.d.ts +14 -50
  16. package/dist/config/types.d.ts.map +1 -1
  17. package/dist/config/types.js.map +1 -1
  18. package/dist/exports/shared.d.ts +2 -2
  19. package/dist/exports/shared.d.ts.map +1 -1
  20. package/dist/exports/shared.js +2 -2
  21. package/dist/exports/shared.js.map +1 -1
  22. package/dist/fields/config/client.js +1 -1
  23. package/dist/fields/config/client.js.map +1 -1
  24. package/package.json +2 -2
  25. package/dist/bin/generateImportMap/generateImportMap.spec.js +0 -175
  26. package/dist/bin/generateImportMap/generateImportMap.spec.js.map +0 -1
  27. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts +0 -15
  28. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +0 -1
  29. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.js +0 -56
  30. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +0 -1
  31. package/dist/bin/generateImportMap/utilities/getFromImportMap.d.ts.map +0 -1
  32. package/dist/bin/generateImportMap/utilities/getFromImportMap.js.map +0 -1
  33. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts +0 -15
  34. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +0 -1
  35. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.js +0 -22
  36. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +0 -1
  37. package/dist/bin/generateImportMap/utilities/parsePayloadComponent.d.ts.map +0 -1
  38. package/dist/bin/generateImportMap/utilities/parsePayloadComponent.js.map +0 -1
  39. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts +0 -9
  40. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +0 -1
  41. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +0 -26
  42. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +0 -1
  43. /package/dist/bin/generateImportMap/{utilities/getFromImportMap.js → getFromImportMap.js} +0 -0
  44. /package/dist/bin/generateImportMap/{utilities/parsePayloadComponent.js → parsePayloadComponent.js} +0 -0
@@ -1,5 +1,5 @@
1
- import type { PayloadComponent } from '../../../config/types.js';
2
- import type { ImportMap } from '../index.js';
1
+ import type { PayloadComponent } from '../../config/types.js';
2
+ import type { ImportMap } from './index.js';
3
3
  export declare const getFromImportMap: <TOutput>(args: {
4
4
  importMap: ImportMap;
5
5
  PayloadComponent: PayloadComponent;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFromImportMap.d.ts","sourceRoot":"","sources":["../../../src/bin/generateImportMap/getFromImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAI3C,eAAO,MAAM,gBAAgB,GAAI,OAAO,QAAQ;IAC9C,SAAS,EAAE,SAAS,CAAA;IACpB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,KAAG,OAuBH,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/bin/generateImportMap/getFromImportMap.ts"],"sourcesContent":["import type { PayloadComponent } from '../../config/types.js'\nimport type { ImportMap } from './index.js'\n\nimport { parsePayloadComponent } from './parsePayloadComponent.js'\n\nexport const getFromImportMap = <TOutput>(args: {\n importMap: ImportMap\n PayloadComponent: PayloadComponent\n schemaPath?: string\n silent?: boolean\n}): TOutput => {\n const { importMap, PayloadComponent, schemaPath, silent } = args\n\n const { exportName, path } = parsePayloadComponent(PayloadComponent)\n\n const key = path + '#' + exportName\n\n const importMapEntry = importMap[key]\n\n if (!importMapEntry && !silent) {\n // eslint-disable-next-line no-console\n console.error(\n `getFromImportMap: PayloadComponent not found in importMap`,\n {\n key,\n PayloadComponent,\n schemaPath,\n },\n 'You may need to run the `payload generate:importmap` command to generate the importMap ahead of runtime.',\n )\n }\n\n return importMapEntry\n}\n"],"names":["parsePayloadComponent","getFromImportMap","args","importMap","PayloadComponent","schemaPath","silent","exportName","path","key","importMapEntry","console","error"],"mappings":"AAGA,SAASA,qBAAqB,QAAQ,6BAA4B;AAElE,OAAO,MAAMC,mBAAmB,CAAUC;IAMxC,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAEC,UAAU,EAAEC,MAAM,EAAE,GAAGJ;IAE5D,MAAM,EAAEK,UAAU,EAAEC,IAAI,EAAE,GAAGR,sBAAsBI;IAEnD,MAAMK,MAAMD,OAAO,MAAMD;IAEzB,MAAMG,iBAAiBP,SAAS,CAACM,IAAI;IAErC,IAAI,CAACC,kBAAkB,CAACJ,QAAQ;QAC9B,sCAAsC;QACtCK,QAAQC,KAAK,CACX,CAAC,yDAAyD,CAAC,EAC3D;YACEH;YACAL;YACAC;QACF,GACA;IAEJ;IAEA,OAAOK;AACT,EAAC"}
@@ -24,17 +24,25 @@ export type Imports = {
24
24
  export type ImportMap = {
25
25
  [path: UserImportPath]: any;
26
26
  };
27
+ export declare function addPayloadComponentToImportMap({ baseDir, importMap, imports, payloadComponent, }: {
28
+ baseDir: string;
29
+ importMap: InternalImportMap;
30
+ imports: Imports;
31
+ payloadComponent: PayloadComponent;
32
+ }): void;
27
33
  export type AddToImportMap = (payloadComponent: PayloadComponent | PayloadComponent[]) => void;
28
34
  export declare function generateImportMap(config: SanitizedConfig, options?: {
29
35
  force?: boolean;
30
36
  log: boolean;
31
37
  }): Promise<void>;
32
- export declare function writeImportMap({ componentMap, force, importMap, importMapFilePath, log, }: {
38
+ export declare function writeImportMap({ componentMap, config, fileName, force, importMap, log, rootDir, }: {
33
39
  componentMap: InternalImportMap;
40
+ config: SanitizedConfig;
41
+ fileName: string;
34
42
  force?: boolean;
35
43
  importMap: Imports;
36
- importMapFilePath: string;
37
44
  log?: boolean;
45
+ rootDir: string;
38
46
  }): Promise<void>;
39
47
  export {};
40
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bin/generateImportMap/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAO9E,KAAK,gBAAgB,GAAG,MAAM,CAAA;AAC9B,KAAK,eAAe,GAAG,MAAM,CAAA;AAC7B,KAAK,UAAU,GAAG,MAAM,CAAA;AACxB,KAAK,cAAc,GAAG,MAAM,CAAA;AAE5B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAAA;CACzC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG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AAG;IACpB,CAAC,UAAU,EAAE,gBAAgB,GAAG;QAC9B,IAAI,EAAE,UAAU,CAAA;QAChB,SAAS,EAAE,eAAe,CAAA;KAC3B,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,IAAI,EAAE,cAAc,GAAG,GAAG,CAAA;CAC5B,CAAA;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,OAAO,EACP,SAAS,EACT,OAAO,EACP,gBAAgB,GACjB,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,iBAAiB,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,gBAAgB,EAAE,gBAAgB,CAAA;CACnC,QAoCA;AAED,MAAM,MAAM,cAAc,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,KAAK,IAAI,CAAA;AAE9F,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,GAC1C,OAAO,CAAC,IAAI,CAAC,CAoGf;AAED,wBAAsB,cAAc,CAAC,EACnC,YAAY,EACZ,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,EACT,GAAG,EACH,OAAO,GACR,EAAE;IACD,YAAY,EAAE,iBAAiB,CAAA;IAC/B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CAChB,iBA2DA"}
@@ -1,9 +1,36 @@
1
- /* eslint-disable no-console */ import fs from 'fs';
1
+ import crypto from 'crypto';
2
+ import fs from 'fs';
2
3
  import process from 'node:process';
4
+ import path from 'path';
3
5
  import { iterateConfig } from './iterateConfig.js';
4
- import { addPayloadComponentToImportMap } from './utilities/addPayloadComponentToImportMap.js';
5
- import { getImportMapToBaseDirPath } from './utilities/getImportMapToBaseDirPath.js';
6
- import { resolveImportMapFilePath } from './utilities/resolveImportMapFilePath.js';
6
+ import { parsePayloadComponent } from './parsePayloadComponent.js';
7
+ export function addPayloadComponentToImportMap({ baseDir, importMap, imports, payloadComponent }) {
8
+ if (!payloadComponent) {
9
+ return;
10
+ }
11
+ const { exportName, path: componentPath } = parsePayloadComponent(payloadComponent);
12
+ if (importMap[componentPath + '#' + exportName]) {
13
+ return;
14
+ }
15
+ const importIdentifier = exportName + '_' + crypto.createHash('md5').update(componentPath).digest('hex');
16
+ // e.g. if baseDir is /test/fields and componentPath is /components/Field.tsx
17
+ // then path needs to be /test/fields/components/Field.tsx NOT /users/username/project/test/fields/components/Field.tsx
18
+ // so we need to append baseDir to componentPath
19
+ if (componentPath.startsWith('.') || componentPath.startsWith('/')) {
20
+ const normalizedBaseDir = baseDir.replace(/\\/g, '/');
21
+ const finalPath = normalizedBaseDir.startsWith('/../') ? `${normalizedBaseDir}${componentPath.slice(1)}` : path.posix.join(normalizedBaseDir, componentPath.slice(1));
22
+ imports[importIdentifier] = {
23
+ path: componentPath.startsWith('.') || componentPath.startsWith('/') ? finalPath : componentPath,
24
+ specifier: exportName
25
+ };
26
+ } else {
27
+ imports[importIdentifier] = {
28
+ path: componentPath,
29
+ specifier: exportName
30
+ };
31
+ }
32
+ importMap[componentPath + '#' + exportName] = importIdentifier;
33
+ }
7
34
  export async function generateImportMap(config, options) {
8
35
  const shouldLog = options?.log ?? true;
9
36
  if (shouldLog) {
@@ -11,18 +38,40 @@ export async function generateImportMap(config, options) {
11
38
  }
12
39
  const importMap = {};
13
40
  const imports = {};
14
- // Determine the root directory of the project - usually the directory where the src or app folder is located
15
41
  const rootDir = process.env.ROOT_DIR ?? process.cwd();
16
- const baseDir = config.admin.importMap.baseDir ?? process.cwd();
17
- const importMapFilePath = resolveImportMapFilePath({
18
- adminRoute: config.routes.admin,
19
- importMapFile: config?.admin?.importMap?.importMapFile,
20
- rootDir
21
- });
22
- const importMapToBaseDirPath = getImportMapToBaseDirPath({
23
- baseDir,
24
- importMapPath: importMapFilePath
25
- });
42
+ // get componentsBaseDir.
43
+ // E.g.:
44
+ // config.admin.importMap.baseDir = /test/fields/
45
+ // rootDir: /
46
+ // componentsBaseDir = /test/fields/
47
+ // or
48
+ // E.g.:
49
+ // config.admin.importMap.baseDir = /test/fields/
50
+ // rootDir: /test
51
+ // componentsBaseDir = /fields/
52
+ // or
53
+ // config.admin.importMap.baseDir = /
54
+ // rootDir: /
55
+ // componentsBaseDir = /
56
+ // E.g.:
57
+ // config.admin.importMap.baseDir = /test/fields/
58
+ // rootDir: /test/fields/prod
59
+ // componentsBaseDir = ../
60
+ // Check if rootDir is a subdirectory of baseDir
61
+ const baseDir = config.admin.importMap.baseDir;
62
+ const isSubdirectory = path.relative(baseDir, rootDir).startsWith('..');
63
+ let componentsBaseDir;
64
+ if (isSubdirectory) {
65
+ // Get the relative path from rootDir to baseDir
66
+ componentsBaseDir = path.relative(rootDir, baseDir);
67
+ } else {
68
+ // If rootDir is not a subdirectory, just return baseDir relative to rootDir
69
+ componentsBaseDir = `/${path.relative(rootDir, baseDir)}`;
70
+ }
71
+ // Ensure result has a trailing slash
72
+ if (!componentsBaseDir.endsWith('/')) {
73
+ componentsBaseDir += '/';
74
+ }
26
75
  const addToImportMap = (payloadComponent)=>{
27
76
  if (!payloadComponent) {
28
77
  return;
@@ -34,16 +83,16 @@ export async function generateImportMap(config, options) {
34
83
  if (Array.isArray(payloadComponent)) {
35
84
  for (const component of payloadComponent){
36
85
  addPayloadComponentToImportMap({
86
+ baseDir: componentsBaseDir,
37
87
  importMap,
38
- importMapToBaseDirPath,
39
88
  imports,
40
89
  payloadComponent: component
41
90
  });
42
91
  }
43
92
  } else {
44
93
  addPayloadComponentToImportMap({
94
+ baseDir: componentsBaseDir,
45
95
  importMap,
46
- importMapToBaseDirPath,
47
96
  imports,
48
97
  payloadComponent
49
98
  });
@@ -58,13 +107,32 @@ export async function generateImportMap(config, options) {
58
107
  });
59
108
  await writeImportMap({
60
109
  componentMap: importMap,
110
+ config,
111
+ fileName: 'importMap.js',
61
112
  force: options?.force,
62
113
  importMap: imports,
63
- importMapFilePath,
64
- log: shouldLog
114
+ log: shouldLog,
115
+ rootDir
65
116
  });
66
117
  }
67
- export async function writeImportMap({ componentMap, force, importMap, importMapFilePath, log }) {
118
+ export async function writeImportMap({ componentMap, config, fileName, force, importMap, log, rootDir }) {
119
+ let importMapFilePath = undefined;
120
+ if (config?.admin?.importMap?.importMapFile?.length) {
121
+ if (!fs.existsSync(config.admin.importMap.importMapFile)) {
122
+ throw new Error(`Could not find the import map file at ${config.admin.importMap.importMapFile}`);
123
+ }
124
+ importMapFilePath = config.admin.importMap.importMapFile;
125
+ } else {
126
+ const appLocation = path.resolve(rootDir, `app/(payload)${config.routes.admin}/`);
127
+ const srcAppLocation = path.resolve(rootDir, `src/app/(payload)${config.routes.admin}/`);
128
+ if (fs.existsSync(appLocation)) {
129
+ importMapFilePath = path.resolve(appLocation, fileName);
130
+ } else if (fs.existsSync(srcAppLocation)) {
131
+ importMapFilePath = path.resolve(srcAppLocation, fileName);
132
+ } else {
133
+ throw new Error(`Could not find Payload import map folder. Looked in ${appLocation} and ${srcAppLocation}`);
134
+ }
135
+ }
68
136
  const imports = [];
69
137
  for (const [identifier, { path, specifier }] of Object.entries(importMap)){
70
138
  imports.push(`import { ${specifier} as ${identifier} } from '${path}'`);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/bin/generateImportMap/index.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport fs from 'fs'\nimport process from 'node:process'\n\nimport type { PayloadComponent, SanitizedConfig } from '../../config/types.js'\n\nimport { iterateConfig } from './iterateConfig.js'\nimport { addPayloadComponentToImportMap } from './utilities/addPayloadComponentToImportMap.js'\nimport { getImportMapToBaseDirPath } from './utilities/getImportMapToBaseDirPath.js'\nimport { resolveImportMapFilePath } from './utilities/resolveImportMapFilePath.js'\n\ntype ImportIdentifier = string\ntype ImportSpecifier = string\ntype ImportPath = string\ntype UserImportPath = string\n\n/**\n * Import Map before being written to the file. Only contains all paths\n */\nexport type InternalImportMap = {\n [path: UserImportPath]: ImportIdentifier\n}\n\n/**\n * Imports of the import map.\n */\nexport type Imports = {\n [identifier: ImportIdentifier]: {\n path: ImportPath\n specifier: ImportSpecifier\n }\n}\n\n/**\n * Import Map after being imported from the actual import map. Contains all the actual imported components\n */\nexport type ImportMap = {\n [path: UserImportPath]: any\n}\n\nexport type AddToImportMap = (payloadComponent: PayloadComponent | PayloadComponent[]) => void\n\nexport async function generateImportMap(\n config: SanitizedConfig,\n options?: { force?: boolean; log: boolean },\n): Promise<void> {\n const shouldLog = options?.log ?? true\n\n if (shouldLog) {\n console.log('Generating import map')\n }\n\n const importMap: InternalImportMap = {}\n const imports: Imports = {}\n\n // Determine the root directory of the project - usually the directory where the src or app folder is located\n const rootDir = process.env.ROOT_DIR ?? process.cwd()\n\n const baseDir = config.admin.importMap.baseDir ?? process.cwd()\n\n const importMapFilePath = resolveImportMapFilePath({\n adminRoute: config.routes.admin,\n importMapFile: config?.admin?.importMap?.importMapFile,\n rootDir,\n })\n\n const importMapToBaseDirPath = getImportMapToBaseDirPath({\n baseDir,\n importMapPath: importMapFilePath,\n })\n\n const addToImportMap: AddToImportMap = (payloadComponent) => {\n if (!payloadComponent) {\n return\n }\n\n if (typeof payloadComponent !== 'object' && typeof payloadComponent !== 'string') {\n console.error(payloadComponent)\n throw new Error('addToImportMap > Payload component must be an object or a string')\n }\n\n if (Array.isArray(payloadComponent)) {\n for (const component of payloadComponent) {\n addPayloadComponentToImportMap({\n importMap,\n importMapToBaseDirPath,\n imports,\n payloadComponent: component,\n })\n }\n } else {\n addPayloadComponentToImportMap({\n importMap,\n importMapToBaseDirPath,\n imports,\n payloadComponent,\n })\n }\n }\n\n iterateConfig({\n addToImportMap,\n baseDir: config.admin.importMap.baseDir,\n config,\n importMap,\n imports,\n })\n\n await writeImportMap({\n componentMap: importMap,\n force: options?.force,\n importMap: imports,\n importMapFilePath,\n log: shouldLog,\n })\n}\n\nexport async function writeImportMap({\n componentMap,\n force,\n importMap,\n importMapFilePath,\n log,\n}: {\n componentMap: InternalImportMap\n force?: boolean\n importMap: Imports\n importMapFilePath: string\n log?: boolean\n}) {\n const imports: string[] = []\n for (const [identifier, { path, specifier }] of Object.entries(importMap)) {\n imports.push(`import { ${specifier} as ${identifier} } from '${path}'`)\n }\n\n const mapKeys: string[] = []\n for (const [userPath, identifier] of Object.entries(componentMap)) {\n mapKeys.push(` \"${userPath}\": ${identifier}`)\n }\n\n const importMapOutputFile = `${imports.join('\\n')}\n\nexport const importMap = {\n${mapKeys.join(',\\n')}\n}\n`\n\n if (!force) {\n // Read current import map and check in the IMPORTS if there are any new imports. If not, don't write the file.\n const currentImportMap = await fs.promises.readFile(importMapFilePath, 'utf-8')\n\n if (currentImportMap?.trim() === importMapOutputFile?.trim()) {\n if (log) {\n console.log('No new imports found, skipping writing import map')\n }\n return\n }\n }\n\n if (log) {\n console.log('Writing import map to', importMapFilePath)\n }\n\n await fs.promises.writeFile(importMapFilePath, importMapOutputFile)\n}\n"],"names":["fs","process","iterateConfig","addPayloadComponentToImportMap","getImportMapToBaseDirPath","resolveImportMapFilePath","generateImportMap","config","options","shouldLog","log","console","importMap","imports","rootDir","env","ROOT_DIR","cwd","baseDir","admin","importMapFilePath","adminRoute","routes","importMapFile","importMapToBaseDirPath","importMapPath","addToImportMap","payloadComponent","error","Error","Array","isArray","component","writeImportMap","componentMap","force","identifier","path","specifier","Object","entries","push","mapKeys","userPath","importMapOutputFile","join","currentImportMap","promises","readFile","trim","writeFile"],"mappings":"AAAA,6BAA6B,GAC7B,OAAOA,QAAQ,KAAI;AACnB,OAAOC,aAAa,eAAc;AAIlC,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,8BAA8B,QAAQ,gDA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EACnCC,YAAY,EACZC,KAAK,EACLvB,SAAS,EACTQ,iBAAiB,EACjBV,GAAG,EAOJ;IACC,MAAMG,UAAoB,EAAE;IAC5B,KAAK,MAAM,CAACuB,YAAY,EAAEC,IAAI,EAAEC,SAAS,EAAE,CAAC,IAAIC,OAAOC,OAAO,CAAC5B,WAAY;QACzEC,QAAQ4B,IAAI,CAAC,CAAC,SAAS,EAAEH,UAAU,IAAI,EAAEF,WAAW,SAAS,EAAEC,KAAK,CAAC,CAAC;IACxE;IAEA,MAAMK,UAAoB,EAAE;IAC5B,KAAK,MAAM,CAACC,UAAUP,WAAW,IAAIG,OAAOC,OAAO,CAACN,cAAe;QACjEQ,QAAQD,IAAI,CAAC,CAAC,GAAG,EAAEE,SAAS,GAAG,EAAEP,YAAY;IAC/C;IAEA,MAAMQ,sBAAsB,GAAG/B,QAAQgC,IAAI,CAAC,MAAM;;;AAGpD,EAAEH,QAAQG,IAAI,CAAC,OAAO;;AAEtB,CAAC;IAEC,IAAI,CAACV,OAAO;QACV,+GAA+G;QAC/G,MAAMW,mBAAmB,MAAM9C,GAAG+C,QAAQ,CAACC,QAAQ,CAAC5B,mBAAmB;QAEvE,IAAI0B,kBAAkBG,WAAWL,qBAAqBK,QAAQ;YAC5D,IAAIvC,KAAK;gBACPC,QAAQD,GAAG,CAAC;YACd;YACA;QACF;IACF;IAEA,IAAIA,KAAK;QACPC,QAAQD,GAAG,CAAC,yBAAyBU;IACvC;IAEA,MAAMpB,GAAG+C,QAAQ,CAACG,SAAS,CAAC9B,mBAAmBwB;AACjD"}
1
+ {"version":3,"sources":["../../../src/bin/generateImportMap/index.ts"],"sourcesContent":["import crypto from 'crypto'\nimport fs from 'fs'\nimport process from 'node:process'\nimport path from 'path'\n\nimport type { PayloadComponent, SanitizedConfig } from '../../config/types.js'\n\nimport { iterateConfig } from './iterateConfig.js'\nimport { parsePayloadComponent } from './parsePayloadComponent.js'\n\ntype ImportIdentifier = string\ntype ImportSpecifier = string\ntype ImportPath = string\ntype UserImportPath = string\n\n/**\n * Import Map before being written to the file. Only contains all paths\n */\nexport type InternalImportMap = {\n [path: UserImportPath]: ImportIdentifier\n}\n\n/**\n * Imports of the import map.\n */\nexport type Imports = {\n [identifier: ImportIdentifier]: {\n path: ImportPath\n specifier: ImportSpecifier\n }\n}\n\n/**\n * Import Map after being imported from the actual import map. Contains all the actual imported components\n */\nexport type ImportMap = {\n [path: UserImportPath]: any\n}\n\nexport function addPayloadComponentToImportMap({\n baseDir,\n importMap,\n imports,\n payloadComponent,\n}: {\n baseDir: string\n importMap: InternalImportMap\n imports: Imports\n payloadComponent: PayloadComponent\n}) {\n if (!payloadComponent) {\n return\n }\n const { exportName, path: componentPath } = parsePayloadComponent(payloadComponent)\n\n if (importMap[componentPath + '#' + exportName]) {\n return\n }\n\n const importIdentifier =\n exportName + '_' + crypto.createHash('md5').update(componentPath).digest('hex')\n\n // e.g. if baseDir is /test/fields and componentPath is /components/Field.tsx\n // then path needs to be /test/fields/components/Field.tsx NOT /users/username/project/test/fields/components/Field.tsx\n // so we need to append baseDir to componentPath\n\n if (componentPath.startsWith('.') || componentPath.startsWith('/')) {\n const normalizedBaseDir = baseDir.replace(/\\\\/g, '/')\n\n const finalPath = normalizedBaseDir.startsWith('/../')\n ? `${normalizedBaseDir}${componentPath.slice(1)}`\n : path.posix.join(normalizedBaseDir, componentPath.slice(1))\n\n imports[importIdentifier] = {\n path:\n componentPath.startsWith('.') || componentPath.startsWith('/') ? finalPath : componentPath,\n specifier: exportName,\n }\n } else {\n imports[importIdentifier] = {\n path: componentPath,\n specifier: exportName,\n }\n }\n importMap[componentPath + '#' + exportName] = importIdentifier\n}\n\nexport type AddToImportMap = (payloadComponent: PayloadComponent | PayloadComponent[]) => void\n\nexport async function generateImportMap(\n config: SanitizedConfig,\n options?: { force?: boolean; log: boolean },\n): Promise<void> {\n const shouldLog = options?.log ?? true\n\n if (shouldLog) {\n console.log('Generating import map')\n }\n\n const importMap: InternalImportMap = {}\n const imports: Imports = {}\n\n const rootDir = process.env.ROOT_DIR ?? process.cwd()\n\n // get componentsBaseDir.\n // E.g.:\n // config.admin.importMap.baseDir = /test/fields/\n // rootDir: /\n // componentsBaseDir = /test/fields/\n\n // or\n\n // E.g.:\n // config.admin.importMap.baseDir = /test/fields/\n // rootDir: /test\n // componentsBaseDir = /fields/\n\n // or\n // config.admin.importMap.baseDir = /\n // rootDir: /\n // componentsBaseDir = /\n\n // E.g.:\n // config.admin.importMap.baseDir = /test/fields/\n // rootDir: /test/fields/prod\n // componentsBaseDir = ../\n\n // Check if rootDir is a subdirectory of baseDir\n const baseDir = config.admin.importMap.baseDir\n const isSubdirectory = path.relative(baseDir, rootDir).startsWith('..')\n\n let componentsBaseDir\n\n if (isSubdirectory) {\n // Get the relative path from rootDir to baseDir\n componentsBaseDir = path.relative(rootDir, baseDir)\n } else {\n // If rootDir is not a subdirectory, just return baseDir relative to rootDir\n componentsBaseDir = `/${path.relative(rootDir, baseDir)}`\n }\n\n // Ensure result has a trailing slash\n if (!componentsBaseDir.endsWith('/')) {\n componentsBaseDir += '/'\n }\n\n const addToImportMap: AddToImportMap = (payloadComponent) => {\n if (!payloadComponent) {\n return\n }\n\n if (typeof payloadComponent !== 'object' && typeof payloadComponent !== 'string') {\n console.error(payloadComponent)\n throw new Error('addToImportMap > Payload component must be an object or a string')\n }\n\n if (Array.isArray(payloadComponent)) {\n for (const component of payloadComponent) {\n addPayloadComponentToImportMap({\n baseDir: componentsBaseDir,\n importMap,\n imports,\n payloadComponent: component,\n })\n }\n } else {\n addPayloadComponentToImportMap({\n baseDir: componentsBaseDir,\n importMap,\n imports,\n payloadComponent,\n })\n }\n }\n\n iterateConfig({\n addToImportMap,\n baseDir: config.admin.importMap.baseDir,\n config,\n importMap,\n imports,\n })\n\n await writeImportMap({\n componentMap: importMap,\n config,\n fileName: 'importMap.js',\n force: options?.force,\n importMap: imports,\n log: shouldLog,\n rootDir,\n })\n}\n\nexport async function writeImportMap({\n componentMap,\n config,\n fileName,\n force,\n importMap,\n log,\n rootDir,\n}: {\n componentMap: InternalImportMap\n config: SanitizedConfig\n fileName: string\n force?: boolean\n importMap: Imports\n log?: boolean\n rootDir: string\n}) {\n let importMapFilePath: string | undefined = undefined\n\n if (config?.admin?.importMap?.importMapFile?.length) {\n if (!fs.existsSync(config.admin.importMap.importMapFile)) {\n throw new Error(\n `Could not find the import map file at ${config.admin.importMap.importMapFile}`,\n )\n }\n importMapFilePath = config.admin.importMap.importMapFile\n } else {\n const appLocation = path.resolve(rootDir, `app/(payload)${config.routes.admin}/`)\n const srcAppLocation = path.resolve(rootDir, `src/app/(payload)${config.routes.admin}/`)\n\n if (fs.existsSync(appLocation)) {\n importMapFilePath = path.resolve(appLocation, fileName)\n } else if (fs.existsSync(srcAppLocation)) {\n importMapFilePath = path.resolve(srcAppLocation, fileName)\n } else {\n throw new Error(\n `Could not find Payload import map folder. Looked in ${appLocation} and ${srcAppLocation}`,\n )\n }\n }\n\n const imports: string[] = []\n for (const [identifier, { path, specifier }] of Object.entries(importMap)) {\n imports.push(`import { ${specifier} as ${identifier} } from '${path}'`)\n }\n\n const mapKeys: string[] = []\n for (const [userPath, identifier] of Object.entries(componentMap)) {\n mapKeys.push(` \"${userPath}\": ${identifier}`)\n }\n\n const importMapOutputFile = `${imports.join('\\n')}\n\nexport const importMap = {\n${mapKeys.join(',\\n')}\n}\n`\n\n if (!force) {\n // Read current import map and check in the IMPORTS if there are any new imports. If not, don't write the file.\n const currentImportMap = await fs.promises.readFile(importMapFilePath, 'utf-8')\n\n if (currentImportMap?.trim() === importMapOutputFile?.trim()) {\n if (log) {\n console.log('No new imports found, skipping writing import map')\n }\n return\n }\n }\n\n if (log) {\n console.log('Writing import map to', importMapFilePath)\n }\n\n await fs.promises.writeFile(importMapFilePath, importMapOutputFile)\n}\n"],"names":["crypto","fs","process","path","iterateConfig","parsePayloadComponent","addPayloadComponentToImportMap","baseDir","importMap","imports","payloadComponent","exportName","componentPath","importIdentifier","createHash","update","digest","startsWith","normalizedBaseDir","replace","finalPath","slice","posix","join","specifier","generateImportMap","config","options","shouldLog","log","console","rootDir","env","ROOT_DIR","cwd","admin","isSubdirectory","relative","componentsBaseDir","endsWith","addToImportMap","error","Error","Array","isArray","component","writeImportMap","componentMap","fileName","force","importMapFilePath","undefined","importMapFile","length","existsSync","appLocation","resolve","routes","srcAppLocation","identifier","Object","entries","push","mapKeys","userPath","importMapOutputFile","currentImportMap","promises","readFile","trim","writeFile"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAC3B,OAAOC,QAAQ,KAAI;AACnB,OAAOC,aAAa,eAAc;AAClC,OAAOC,UAAU,OAAM;AAIvB,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,qBAAqB,QAAQ,6BAA4B;AA+BlE,OAAO,SAASC,+BAA+B,EAC7CC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,gBAAgB,EAMjB;IACC,IAAI,CAACA,kBAAkB;QACrB;IACF;IACA,MAAM,EAAEC,UAAU,EAAER,MAAMS,aAAa,EAAE,GAAGP,sBAAsBK;IAElE,IAAIF,SAAS,CAACI,gBAAgB,MAAMD,WAAW,EAAE;QAC/C;IACF;IAEA,MAAME,mBACJF,aAAa,MAAMX,OAAOc,UAAU,CAAC,OAAOC,MAAM,CAACH,eAAeI,MAAM,CAAC;IAE3E,6EAA6E;IAC7E,uHAAuH;IACvH,gDAAgD;IAEhD,IAAIJ,cAAcK,UAAU,CAAC,QAAQL,cAAcK,UAAU,CAAC,MAAM;QAClE,MAAMC,oBAAoBX,QAAQY,OAAO,CAAC,OAAO;QAEjD,MAAMC,YAAYF,kBAAkBD,UAAU,CAAC,UAC3C,GAAGC,oBAAoBN,cAAcS,KAAK,CAAC,IAAI,GAC/ClB,KAAKmB,KAAK,CAACC,IAAI,CAACL,mBAAmBN,cAAcS,KAAK,CAAC;QAE3DZ,OAAO,CAACI,iBAAiB,GAAG;YAC1BV,MACES,cAAcK,UAAU,CAAC,QAAQL,cAAcK,UAAU,CA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ImportMap/iterateConfig.ts"],"sourcesContent":["// @ts-strict-ignore\n\nimport type { AdminViewConfig } from '../../admin/views/index.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { AddToImportMap, Imports, InternalImportMap } from './index.js'\n\nimport { iterateCollections } from './iterateCollections.js'\nimport { genImportMapIterateFields } from './iterateFields.js'\nimport { iterateGlobals } from './iterateGlobals.js'\n\nexport function iterateConfig({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n}: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n}) {\n iterateCollections({\n addToImportMap,\n baseDir,\n collections: config.collections,\n config,\n importMap,\n imports,\n })\n\n iterateGlobals({\n addToImportMap,\n baseDir,\n config,\n globals: config.globals,\n importMap,\n imports,\n })\n\n if (config?.blocks) {\n const blocks = Object.values(config.blocks)\n if (blocks?.length) {\n genImportMapIterateFields({\n addToImportMap,\n baseDir,\n config,\n fields: blocks,\n importMap,\n imports,\n })\n }\n }\n\n if (typeof config.admin?.avatar === 'object') {\n addToImportMap(config.admin?.avatar?.Component)\n }\n\n addToImportMap(config.admin?.components?.Nav)\n addToImportMap(config.admin?.components?.header)\n addToImportMap(config.admin?.components?.logout?.Button)\n addToImportMap(config.admin?.components?.graphics?.Icon)\n addToImportMap(config.admin?.components?.graphics?.Logo)\n\n addToImportMap(config.admin?.components?.actions)\n addToImportMap(config.admin?.components?.afterDashboard)\n addToImportMap(config.admin?.components?.afterLogin)\n addToImportMap(config.admin?.components?.afterNavLinks)\n addToImportMap(config.admin?.components?.beforeDashboard)\n addToImportMap(config.admin?.components?.beforeLogin)\n addToImportMap(config.admin?.components?.beforeNavLinks)\n\n addToImportMap(config.admin?.components?.providers)\n\n if (config.admin?.components?.views) {\n if (Object.keys(config.admin?.components?.views)?.length) {\n for (const key in config.admin?.components?.views) {\n const adminViewConfig: AdminViewConfig = config.admin?.components?.views[key]\n addToImportMap(adminViewConfig?.Component)\n }\n }\n }\n\n if (config?.admin?.importMap?.generators?.length) {\n for (const generator of config.admin.importMap.generators) {\n generator({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n })\n }\n }\n\n if (config?.admin?.dependencies) {\n for (const key in config.admin.dependencies) {\n const dependency = config.admin.dependencies[key]\n addToImportMap(dependency.path)\n }\n }\n\n /*\n if (\n config?.editor &&\n typeof config.editor === 'object' &&\n config.editor.generateImportMap &&\n typeof config.editor.generateImportMap === 'function'\n ) {\n config.editor.generateImportMap({\n addToImportMap,\n baseDir,\n componentMap,\n config,\n importMap,\n })\n }*/ // No need to do that here since in the sanitized editor config, this root editor is already added to the field editor - and we already process that in iterateFields\n}\n"],"names":["iterateCollections","genImportMapIterateFields","iterateGlobals","iterateConfig","addToImportMap","baseDir","config","importMap","imports","collections","globals","blocks","Object","values","length","fields","admin","avatar","Component","components","Nav","header","logout","Button","graphics","Icon","Logo","actions","afterDashboard","afterLogin","afterNavLinks","beforeDashboard","beforeLogin","beforeNavLinks","providers","views","keys","key","adminViewConfig","generators","generator","dependencies","dependency","path"],"mappings":"AAAA,oBAAoB;AAMpB,SAASA,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,yBAAyB,QAAQ,qBAAoB;AAC9D,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,OAAO,SAASC,cAAc,EAC5BC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,SAAS,EACTC,OAAO,EAOR;IACCR,mBAAmB;QACjBI;QACAC;QACAI,aAAaH,OAAOG,WAAW;QAC/BH;QACAC;QACAC;IACF;IAEAN,eAAe;QACbE;QACAC;QACAC;QACAI,SAASJ,OAAOI,OAAO;QACvBH;QACAC;IACF;IAEA,IAAIF,QAAQK,QAAQ;QAClB,MAAMA,SAASC,OAAOC,MAAM,CAACP,OAAOK,MAAM;QAC1C,IAAIA,QAAQG,QAAQ;YAClBb,0BAA0B;gBACxBG;gBACAC;gBACAC;gBACAS,QAAQJ;gBACRJ;gBACAC;YACF;QACF;IACF;I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AAK,MAAMJ,OAAO/B,OAAOU,KAAK,CAACyB,YAAY,CAAE;YAC3C,MAAMC,aAAapC,OAAOU,KAAK,CAACyB,YAAY,CAACJ,IAAI;YACjDjC,eAAesC,WAAWC,IAAI;QAChC;IACF;AAEA;;;;;;;;;;;;;;GAcC,GAAG,qKAAqK;AAC3K"}
1
+ {"version":3,"sources":["../../../src/bin/generateImportMap/iterateConfig.ts"],"sourcesContent":["// @ts-strict-ignore\n\nimport type { AdminViewConfig } from '../../admin/views/index.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { AddToImportMap, Imports, InternalImportMap } from './index.js'\n\nimport { iterateCollections } from './iterateCollections.js'\nimport { genImportMapIterateFields } from './iterateFields.js'\nimport { iterateGlobals } from './iterateGlobals.js'\n\nexport function iterateConfig({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n}: {\n addToImportMap: AddToImportMap\n baseDir: string\n config: SanitizedConfig\n importMap: InternalImportMap\n imports: Imports\n}) {\n iterateCollections({\n addToImportMap,\n baseDir,\n collections: config.collections,\n config,\n importMap,\n imports,\n })\n\n iterateGlobals({\n addToImportMap,\n baseDir,\n config,\n globals: config.globals,\n importMap,\n imports,\n })\n\n if (config?.blocks) {\n const blocks = Object.values(config.blocks)\n if (blocks?.length) {\n genImportMapIterateFields({\n addToImportMap,\n baseDir,\n config,\n fields: blocks,\n importMap,\n imports,\n })\n }\n }\n\n if (typeof config.admin?.avatar === 'object') {\n addToImportMap(config.admin?.avatar?.Component)\n }\n\n addToImportMap(config.admin?.components?.Nav)\n addToImportMap(config.admin?.components?.header)\n addToImportMap(config.admin?.components?.logout?.Button)\n addToImportMap(config.admin?.components?.graphics?.Icon)\n addToImportMap(config.admin?.components?.graphics?.Logo)\n\n addToImportMap(config.admin?.components?.actions)\n addToImportMap(config.admin?.components?.afterDashboard)\n addToImportMap(config.admin?.components?.afterLogin)\n addToImportMap(config.admin?.components?.afterNavLinks)\n addToImportMap(config.admin?.components?.beforeDashboard)\n addToImportMap(config.admin?.components?.beforeLogin)\n addToImportMap(config.admin?.components?.beforeNavLinks)\n\n addToImportMap(config.admin?.components?.providers)\n\n if (config.admin?.components?.views) {\n if (Object.keys(config.admin?.components?.views)?.length) {\n for (const key in config.admin?.components?.views) {\n const adminViewConfig = config.admin?.components?.views[key]\n addToImportMap(adminViewConfig?.Component)\n }\n }\n }\n\n if (config?.admin?.importMap?.generators?.length) {\n for (const generator of config.admin.importMap.generators) {\n generator({\n addToImportMap,\n baseDir,\n config,\n importMap,\n imports,\n })\n }\n }\n\n if (config?.admin?.dependencies) {\n for (const key in config.admin.dependencies) {\n const dependency = config.admin.dependencies[key]\n addToImportMap(dependency.path)\n }\n }\n\n /*\n if (\n config?.editor &&\n typeof config.editor === 'object' &&\n config.editor.generateImportMap &&\n typeof config.editor.generateImportMap === 'function'\n ) {\n config.editor.generateImportMap({\n addToImportMap,\n baseDir,\n componentMap,\n config,\n importMap,\n })\n }*/ // No need to do that here since in the sanitized editor config, this root editor is already added to the field editor - and we already process that in iterateFields\n}\n"],"names":["iterateCollections","genImportMapIterateFields","iterateGlobals","iterateConfig","addToImportMap","baseDir","config","importMap","imports","collections","globals","blocks","Object","values","length","fields","admin","avatar","Component","components","Nav","header","logout","Button","graphics","Icon","Logo","actions","afterDashboard","afterLogin","afterNavLinks","beforeDashboard","beforeLogin","beforeNavLinks","providers","views","keys","key","adminViewConfig","generators","generator","dependencies","dependency","path"],"mappings":"AAAA,oBAAoB;AAMpB,SAASA,kBAAkB,QAAQ,0BAAyB;AAC5D,SAASC,yBAAyB,QAAQ,qBAAoB;AAC9D,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,OAAO,SAASC,cAAc,EAC5BC,cAAc,EACdC,OAAO,EACPC,MAAM,EACNC,SAAS,EACTC,OAAO,EAOR;IACCR,mBAAmB;QACjBI;QACAC;QACAI,aAAaH,OAAOG,WAAW;QAC/BH;QACAC;QACAC;IACF;IAEAN,eAAe;QACbE;QACAC;QACAC;QACAI,SAASJ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IAAIZ,QAAQU,OAAOT,WAAWgC,YAAYzB,QAAQ;QAChD,KAAK,MAAM0B,aAAalC,OAAOU,KAAK,CAACT,SAAS,CAACgC,UAAU,CAAE;YACzDC,UAAU;gBACRpC;gBACAC;gBACAC;gBACAC;gBACAC;YACF;QACF;IACF;IAEA,IAAIF,QAAQU,OAAOyB,cAAc;QAC/B,IAAK,MAAMJ,OAAO/B,OAAOU,KAAK,CAACyB,YAAY,CAAE;YAC3C,MAAMC,aAAapC,OAAOU,KAAK,CAACyB,YAAY,CAACJ,IAAI;YACjDjC,eAAesC,WAAWC,IAAI;QAChC;IACF;AAEA;;;;;;;;;;;;;;GAcC,GAAG,qKAAqK;AAC3K"}
@@ -1,4 +1,4 @@
1
- import type { PayloadComponent } from '../../../config/types.js';
1
+ import type { PayloadComponent } from '../../config/types.js';
2
2
  export declare function parsePayloadComponent(PayloadComponent: PayloadComponent): {
3
3
  exportName: string;
4
4
  path: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsePayloadComponent.d.ts","sourceRoot":"","sources":["../../../src/bin/generateImportMap/parsePayloadComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,wBAAgB,qBAAqB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG;IACzE,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAsBA"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/bin/generateImportMap/parsePayloadComponent.ts"],"sourcesContent":["// @ts-strict-ignore\nimport type { PayloadComponent } from '../../config/types.js'\n\nexport function parsePayloadComponent(PayloadComponent: PayloadComponent): {\n exportName: string\n path: string\n} {\n if (!PayloadComponent) {\n return null\n }\n\n const pathAndMaybeExport =\n typeof PayloadComponent === 'string' ? PayloadComponent : PayloadComponent.path\n\n let path = ''\n let exportName = 'default'\n\n if (pathAndMaybeExport?.includes('#')) {\n ;[path, exportName] = pathAndMaybeExport.split('#')\n } else {\n path = pathAndMaybeExport\n }\n\n if (typeof PayloadComponent === 'object' && PayloadComponent.exportName) {\n exportName = PayloadComponent.exportName\n }\n\n return { exportName, path }\n}\n"],"names":["parsePayloadComponent","PayloadComponent","pathAndMaybeExport","path","exportName","includes","split"],"mappings":"AAAA,oBAAoB;AAGpB,OAAO,SAASA,sBAAsBC,gBAAkC;IAItE,IAAI,CAACA,kBAAkB;QACrB,OAAO;IACT;IAEA,MAAMC,qBACJ,OAAOD,qBAAqB,WAAWA,mBAAmBA,iBAAiBE,IAAI;IAEjF,IAAIA,OAAO;IACX,IAAIC,aAAa;IAEjB,IAAIF,oBAAoBG,SAAS,MAAM;;QACpC,CAACF,MAAMC,WAAW,GAAGF,mBAAmBI,KAAK,CAAC;IACjD,OAAO;QACLH,OAAOD;IACT;IAEA,IAAI,OAAOD,qBAAqB,YAAYA,iBAAiBG,UAAU,EAAE;QACvEA,aAAaH,iBAAiBG,UAAU;IAC1C;IAEA,OAAO;QAAEA;QAAYD;IAAK;AAC5B"}
@@ -461,6 +461,10 @@ export type SanitizedJoin = {
461
461
  export type SanitizedJoins = {
462
462
  [collectionSlug: string]: SanitizedJoin[];
463
463
  };
464
+ /**
465
+ * @todo remove the `DeepRequired` in v4.
466
+ * We don't actually guarantee that all properties are set when sanitizing configs.
467
+ */
464
468
  export interface SanitizedCollectionConfig extends Omit<DeepRequired<CollectionConfig>, 'auth' | 'endpoints' | 'fields' | 'slug' | 'upload' | 'versions'> {
465
469
  auth: Auth;
466
470
  endpoints: Endpoint[] | false;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/collections/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AACxF,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtE,OAA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AAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,GAAG,CAAA;IACX,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE;QACN,KAAK,EAAE,cAAc,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;QACrB,IAAI,EAAE,MAAM,CAAA;QACZ,gBAAgB,EAAE,OAAO,CAAA;KAC1B,EAAE,CAAA;IACH,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type {\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type BaseListFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\nexport type CollectionAdminOptions = {\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Set to a React component to replace the entire Edit View, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n edit?: EditConfig\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'slug' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n docId?: any\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAknBA,WAQC"}
1
+ {"version":3,"sources":["../../../src/collections/config/types.ts"],"sourcesContent":["import type { GraphQLInputObjectType, GraphQLNonNull, GraphQLObjectType } from 'graphql'\nimport type { DeepRequired, IsAny, MarkOptional } from 'ts-essentials'\n\nimport type { CustomUpload } from '../../admin/types.js'\nimport type { Arguments as MeArguments } from '../../auth/operations/me.js'\nimport type {\n Arguments as RefreshArguments,\n Result as RefreshResult,\n} from '../../auth/operations/refresh.js'\nimport type { Auth, ClientUser, IncomingAuthType } from '../../auth/types.js'\nimport type {\n Access,\n AfterErrorHookArgs,\n AfterErrorResult,\n CustomComponent,\n EditConfig,\n Endpoint,\n EntityDescription,\n EntityDescriptionComponent,\n GeneratePreviewURL,\n LabelFunction,\n LivePreviewConfig,\n MetaConfig,\n PayloadComponent,\n StaticLabel,\n} from '../../config/types.js'\nimport type { DBIdentifierName } from '../../database/types.js'\nimport type {\n Field,\n FlattenedField,\n JoinField,\n RelationshipField,\n UploadField,\n} from '../../fields/config/types.js'\nimport type {\n CollectionSlug,\n JsonObject,\n RequestContext,\n TypedAuthOperations,\n TypedCollection,\n TypedCollectionSelect,\n TypedLocale,\n} from '../../index.js'\nimport type {\n PayloadRequest,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../types/index.js'\nimport type { SanitizedUploadConfig, UploadConfig } from '../../uploads/types.js'\nimport type {\n IncomingCollectionVersions,\n SanitizedCollectionVersions,\n} from '../../versions/types.js'\nimport type { AfterOperationArg, AfterOperationMap } from '../operations/utils.js'\n\nexport type DataFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollection[TSlug]\n\nexport type SelectFromCollectionSlug<TSlug extends CollectionSlug> = TypedCollectionSelect[TSlug]\n\nexport type AuthOperationsFromCollectionSlug<TSlug extends CollectionSlug> =\n TypedAuthOperations[TSlug]\n\nexport type RequiredDataFromCollection<TData extends JsonObject> = MarkOptional<\n TData,\n 'createdAt' | 'id' | 'sizes' | 'updatedAt'\n>\n\nexport type RequiredDataFromCollectionSlug<TSlug extends CollectionSlug> =\n RequiredDataFromCollection<DataFromCollectionSlug<TSlug>>\n\nexport type HookOperationType =\n | 'autosave'\n | 'count'\n | 'countVersions'\n | 'create'\n | 'delete'\n | 'forgotPassword'\n | 'login'\n | 'read'\n | 'refresh'\n | 'update'\n\ntype CreateOrUpdateOperation = Extract<HookOperationType, 'create' | 'update'>\n\nexport type BeforeOperationHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Hook operation being performed\n */\n operation: HookOperationType\n req: PayloadRequest\n}) => any\n\nexport type BeforeValidateHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data?: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n data: Partial<T>\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n /**\n * Original document before change\n *\n * `undefined` on 'create' operation\n */\n originalDoc?: T\n req: PayloadRequest\n}) => any\n\nexport type AfterChangeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n /**\n * Hook operation being performed\n */\n operation: CreateOrUpdateOperation\n previousDoc: T\n req: PayloadRequest\n}) => any\n\nexport type BeforeReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n query: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type AfterReadHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n findMany?: boolean\n query?: { [key: string]: any }\n req: PayloadRequest\n}) => any\n\nexport type BeforeDeleteHook = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterDeleteHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n doc: T\n id: number | string\n req: PayloadRequest\n}) => any\n\nexport type AfterOperationHook<TOperationGeneric extends CollectionSlug = string> = (\n arg: AfterOperationArg<TOperationGeneric>,\n) =>\n | Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n | Promise<\n Awaited<\n ReturnType<AfterOperationMap<TOperationGeneric>[keyof AfterOperationMap<TOperationGeneric>]>\n >\n >\n\nexport type BeforeLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n user: T\n}) => any\n\nexport type AfterLoginHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n token: string\n user: T\n}) => any\n\nexport type AfterLogoutHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n}) => any\n\nexport type AfterMeHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n req: PayloadRequest\n response: unknown\n}) => any\n\nexport type RefreshHook<T extends TypeWithID = any> = (args: {\n args: RefreshArguments\n user: T\n}) => Promise<RefreshResult | void> | (RefreshResult | void)\n\nexport type MeHook<T extends TypeWithID = any> = (args: {\n args: MeArguments\n user: T\n}) => ({ exp: number; user: T } | void) | Promise<{ exp: number; user: T } | void>\n\nexport type AfterRefreshHook<T extends TypeWithID = any> = (args: {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n exp: number\n req: PayloadRequest\n token: string\n}) => any\n\nexport type AfterErrorHook = (\n args: { collection: SanitizedCollectionConfig } & AfterErrorHookArgs,\n) => AfterErrorResult | Promise<AfterErrorResult>\n\nexport type AfterForgotPasswordHook = (args: {\n args?: any\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n}) => any\n\nexport type BaseListFilter = (args: {\n limit: number\n locale?: TypedLocale\n page: number\n req: PayloadRequest\n sort: string\n}) => null | Promise<null | Where> | Where\n\nexport type CollectionAdminOptions = {\n baseListFilter?: BaseListFilter\n /**\n * Custom admin components\n */\n components?: {\n afterList?: CustomComponent[]\n afterListTable?: CustomComponent[]\n beforeList?: CustomComponent[]\n beforeListTable?: CustomComponent[]\n Description?: EntityDescriptionComponent\n /**\n * Components within the edit view\n */\n edit?: {\n /**\n * Replaces the \"Preview\" button\n */\n PreviewButton?: CustomComponent\n /**\n * Replaces the \"Publish\" button\n * + drafts must be enabled\n */\n PublishButton?: CustomComponent\n /**\n * Replaces the \"Save\" button\n * + drafts must be disabled\n */\n SaveButton?: CustomComponent\n /**\n * Replaces the \"Save Draft\" button\n * + drafts must be enabled\n * + autosave must be disabled\n */\n SaveDraftButton?: CustomComponent\n /**\n * Replaces the \"Upload\" section\n * + upload must be enabled\n */\n Upload?: CustomUpload\n }\n listMenuItems?: CustomComponent[]\n views?: {\n /**\n * Set to a React component to replace the entire Edit View, including all nested routes.\n * Set to an object to replace or modify individual nested routes, or to add new ones.\n */\n edit?: EditConfig\n list?: {\n actions?: CustomComponent[]\n Component?: PayloadComponent\n }\n }\n }\n /** Extension point to add your custom data. Available in server and client. */\n custom?: Record<string, any>\n /**\n * Default columns to show in list view\n */\n defaultColumns?: string[]\n /**\n * Custom description for collection. This will also be used as JSDoc for the generated types\n */\n description?: EntityDescription\n /**\n * Disable the Copy To Locale button in the edit document view\n * @default false\n */\n disableCopyToLocale?: boolean\n enableRichTextLink?: boolean\n enableRichTextRelationship?: boolean\n /**\n * Specify a navigational group for collections in the admin sidebar.\n * - Provide a string to place the entity in a custom group.\n * - Provide a record to define localized group names.\n * - Set to `false` to exclude the entity from the sidebar / dashboard without disabling its routes.\n */\n group?: false | Record<string, string> | string\n /**\n * Exclude the collection from the admin nav and routes\n */\n hidden?: ((args: { user: ClientUser }) => boolean) | boolean\n /**\n * Hide the API URL within the Edit view\n */\n hideAPIURL?: boolean\n /**\n * Additional fields to be searched via the full text search\n */\n listSearchableFields?: string[]\n /**\n * Live preview options\n */\n livePreview?: LivePreviewConfig\n meta?: MetaConfig\n pagination?: {\n defaultLimit?: number\n limits?: number[]\n }\n /**\n * Function to generate custom preview URL\n */\n preview?: GeneratePreviewURL\n /**\n * Field to use as title in Edit View and first column in List view\n */\n useAsTitle?: string\n}\n\n/** Manage all aspects of a data collection */\nexport type CollectionConfig<TSlug extends CollectionSlug = any> = {\n /**\n * Do not set this property manually. This is set to true during sanitization, to avoid\n * sanitizing the same collection multiple times.\n */\n _sanitized?: boolean\n /**\n * Access control\n */\n access?: {\n admin?: ({ req }: { req: PayloadRequest }) => boolean | Promise<boolean>\n create?: Access\n delete?: Access\n read?: Access\n readVersions?: Access\n unlock?: Access\n update?: Access\n }\n /**\n * Collection admin options\n */\n admin?: CollectionAdminOptions\n /**\n * Collection login options\n *\n * Use `true` to enable with default options\n */\n auth?: boolean | IncomingAuthType\n /** Extension point to add your custom data. Server only. */\n custom?: Record<string, any>\n /**\n * Used to override the default naming of the database table or collection with your using a function or string\n * @WARNING: If you change this property with existing data, you will need to handle the renaming of the table in your database or by using migrations\n */\n dbName?: DBIdentifierName\n defaultPopulate?: IsAny<SelectFromCollectionSlug<TSlug>> extends true\n ? SelectType\n : SelectFromCollectionSlug<TSlug>\n /**\n * Default field to sort by in collection list view\n */\n defaultSort?: Sort\n /**\n * When true, do not show the \"Duplicate\" button while editing documents within this collection and prevent `duplicate` from all APIs\n */\n disableDuplicate?: boolean\n /**\n * Custom rest api endpoints, set false to disable all rest endpoints for this collection.\n */\n endpoints?: false | Omit<Endpoint, 'root'>[]\n fields: Field[]\n /**\n * GraphQL configuration\n */\n graphQL?:\n | {\n disableMutations?: true\n disableQueries?: true\n pluralName?: string\n singularName?: string\n }\n | false\n /**\n * Hooks to modify Payload functionality\n */\n hooks?: {\n afterChange?: AfterChangeHook[]\n afterDelete?: AfterDeleteHook[]\n afterError?: AfterErrorHook[]\n afterForgotPassword?: AfterForgotPasswordHook[]\n afterLogin?: AfterLoginHook[]\n afterLogout?: AfterLogoutHook[]\n afterMe?: AfterMeHook[]\n afterOperation?: AfterOperationHook<TSlug>[]\n afterRead?: AfterReadHook[]\n afterRefresh?: AfterRefreshHook[]\n beforeChange?: BeforeChangeHook[]\n beforeDelete?: BeforeDeleteHook[]\n beforeLogin?: BeforeLoginHook[]\n beforeOperation?: BeforeOperationHook[]\n beforeRead?: BeforeReadHook[]\n beforeValidate?: BeforeValidateHook[]\n /**\n /**\n * Use the `me` hook to control the `me` operation.\n * Here, you can optionally instruct the me operation to return early,\n * and skip its default logic.\n */\n me?: MeHook[]\n /**\n * Use the `refresh` hook to control the refresh operation.\n * Here, you can optionally instruct the refresh operation to return early,\n * and skip its default logic.\n */\n refresh?: RefreshHook[]\n }\n /**\n * Define compound indexes for this collection.\n * This can be used to either speed up querying/sorting by 2 or more fields at the same time or\n * to ensure uniqueness between several fields.\n * Specify field paths\n * @example\n * [{ unique: true, fields: ['title', 'group.name'] }]\n * @default []\n */\n indexes?: CompoundIndex[]\n /**\n * Label configuration\n */\n labels?: {\n plural?: LabelFunction | StaticLabel\n singular?: LabelFunction | StaticLabel\n }\n /**\n * Enables / Disables the ability to lock documents while editing\n * @default true\n */\n lockDocuments?:\n | {\n duration: number\n }\n | false\n slug: string\n /**\n * Add `createdAt` and `updatedAt` fields\n *\n * @default true\n */\n timestamps?: boolean\n /**\n * Options used in typescript generation\n */\n typescript?: {\n /**\n * Typescript generation name given to the interface type\n */\n interface?: string\n }\n /**\n * Customize the handling of incoming file uploads\n *\n * @default false // disable uploads\n */\n upload?: boolean | UploadConfig\n /**\n * Enable versioning. Set it to true to enable default versions settings,\n * or customize versions options by setting the property equal to an object\n * containing the version options.\n *\n * @default false // disable versioning\n */\n versions?: boolean | IncomingCollectionVersions\n}\n\nexport type SanitizedJoin = {\n /**\n * The field configuration defining the join\n */\n field: JoinField\n getForeignPath?(args: { locale?: TypedLocale }): string\n /**\n * The path of the join field in dot notation\n */\n joinPath: string\n /**\n * `parentIsLocalized` is true if any parent field of the\n * field configuration defining the join is localized\n */\n parentIsLocalized: boolean\n targetField: RelationshipField | UploadField\n}\n\nexport type SanitizedJoins = {\n [collectionSlug: string]: SanitizedJoin[]\n}\n\n/**\n * @todo remove the `DeepRequired` in v4.\n * We don't actually guarantee that all properties are set when sanitizing configs.\n */\nexport interface SanitizedCollectionConfig\n extends Omit<\n DeepRequired<CollectionConfig>,\n 'auth' | 'endpoints' | 'fields' | 'slug' | 'upload' | 'versions'\n > {\n auth: Auth\n endpoints: Endpoint[] | false\n fields: Field[]\n /**\n * Fields in the database schema structure\n * Rows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded\n */\n flattenedFields: FlattenedField[]\n /**\n * Object of collections to join 'Join Fields object keyed by collection\n */\n joins: SanitizedJoins\n\n /**\n * List of all polymorphic join fields\n */\n polymorphicJoins: SanitizedJoin[]\n\n sanitizedIndexes: SanitizedCompoundIndex[]\n\n slug: CollectionSlug\n upload: SanitizedUploadConfig\n versions: SanitizedCollectionVersions\n}\n\nexport type Collection = {\n config: SanitizedCollectionConfig\n customIDType?: 'number' | 'text'\n graphQL?: {\n countType: GraphQLObjectType\n JWT: GraphQLObjectType\n mutationInputType: GraphQLNonNull<any>\n paginatedType: GraphQLObjectType\n type: GraphQLObjectType\n updateMutationInputType: GraphQLNonNull<any>\n versionType: GraphQLObjectType\n whereInputType: GraphQLInputObjectType\n }\n}\n\nexport type BulkOperationResult<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n docs: TransformCollectionWithSelect<TSlug, TSelect>[]\n errors: {\n id: DataFromCollectionSlug<TSlug>['id']\n message: string\n }[]\n}\n\nexport type AuthCollection = {\n config: SanitizedCollectionConfig\n}\n\nexport type TypeWithID = {\n docId?: any\n id: number | string\n}\n\nexport type TypeWithTimestamps = {\n [key: string]: unknown\n createdAt: string\n id: number | string\n updatedAt: string\n}\n\nexport type CompoundIndex = {\n fields: string[]\n unique?: boolean\n}\n\nexport type SanitizedCompoundIndex = {\n fields: {\n field: FlattenedField\n localizedPath: string\n path: string\n pathHasLocalized: boolean\n }[]\n unique: boolean\n}\n"],"names":[],"mappings":"AAqnBA,WAQC"}
@@ -3,6 +3,7 @@ import type { BusboyConfig } from 'busboy';
3
3
  import type GraphQL from 'graphql';
4
4
  import type { GraphQLFormattedError } from 'graphql';
5
5
  import type { JSONSchema4 } from 'json-schema';
6
+ import type { Metadata } from 'next';
6
7
  import type { DestinationStream, Level, pino } from 'pino';
7
8
  import type React from 'react';
8
9
  import type { default as sharp } from 'sharp';
@@ -90,28 +91,14 @@ export type OGImageConfig = {
90
91
  url: string;
91
92
  width?: number | string;
92
93
  };
93
- export type OpenGraphConfig = {
94
- description?: string;
95
- images?: OGImageConfig | OGImageConfig[];
96
- siteName?: string;
97
- title?: string;
98
- };
99
- export type IconConfig = {
100
- color?: string;
101
- /**
102
- * @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority
103
- */
104
- fetchPriority?: 'auto' | 'high' | 'low';
105
- media?: string;
106
- /** defaults to rel="icon" */
107
- rel?: string;
108
- sizes?: string;
109
- type?: string;
110
- /**
111
- * URL of the icon to use. You can use a relative path from the public folder (see https://nextjs.org/docs/app/building-your-application/optimizing/static-assets) or an absolute URL.
112
- */
113
- url: string;
114
- };
94
+ /**
95
+ * @todo find a way to remove the deep clone here.
96
+ * It can probably be removed after the `DeepRequired` from `Config` to `SanitizedConfig` is removed.
97
+ * Same with `CollectionConfig` to `SanitizedCollectionConfig`.
98
+ */
99
+ type DeepClone<T> = T extends object ? {
100
+ [K in keyof T]: DeepClone<T[K]>;
101
+ } : T;
115
102
  export type MetaConfig = {
116
103
  /**
117
104
  * When `static`, a pre-made image will be used for all pages.
@@ -120,39 +107,12 @@ export type MetaConfig = {
120
107
  * @default 'dynamic'
121
108
  */
122
109
  defaultOGImageType?: 'dynamic' | 'off' | 'static';
123
- /**
124
- * Overrides the auto-generated <meta name="description"> of admin pages
125
- * @example `"This is my custom CMS built with Payload."`
126
- */
127
- description?: string;
128
- /**
129
- * Icons to be rendered by devices and browsers.
130
- *
131
- * For example browser tabs, phone home screens, and search engine results.
132
- */
133
- icons?: IconConfig[];
134
- /**
135
- * Overrides the auto-generated <meta name="keywords"> of admin pages
136
- * @example `"CMS, Payload, Custom"`
137
- */
138
- keywords?: string;
139
- /**
140
- * Metadata to be rendered as `og` meta tags in the head of the Admin Panel.
141
- *
142
- * For example when sharing the Admin Panel on social media or through messaging services.
143
- */
144
- openGraph?: OpenGraphConfig;
145
- /**
146
- * Overrides the auto-generated <title> of admin pages
147
- * @example `"My Admin Panel"`
148
- */
149
- title?: string;
150
110
  /**
151
111
  * String to append to the auto-generated <title> of admin pages
152
112
  * @example `" - Custom CMS"`
153
113
  */
154
114
  titleSuffix?: string;
155
- };
115
+ } & DeepClone<Metadata>;
156
116
  export type ServerOnlyLivePreviewProperties = keyof Pick<LivePreviewConfig, 'url'>;
157
117
  type GeneratePreviewURLOptions = {
158
118
  locale: string;
@@ -1043,6 +1003,10 @@ export type Config = {
1043
1003
  */
1044
1004
  upload?: FetchAPIFileUploadOptions;
1045
1005
  };
1006
+ /**
1007
+ * @todo remove the `DeepRequired` in v4.
1008
+ * We don't actually guarantee that all properties are set when sanitizing configs.
1009
+ */
1046
1010
  export type SanitizedConfig = {
1047
1011
  admin: {
1048
1012
  timezones: SanitizedTimezoneConfig;