payload 3.0.0-alpha.50 → 3.0.0-alpha.51

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.
@@ -19,7 +19,7 @@ import path from 'path';
19
19
  });
20
20
  return Promise.all(files.map(async (filePath)=>{
21
21
  // eval used to circumvent errors bundling
22
- let migration = await eval(`${require ? 'require' : 'import'}('${filePath.replaceAll('\\', '/')}')`);
22
+ let migration = await eval(`${typeof require === 'function' ? 'require' : 'import'}('${filePath.replaceAll('\\', '/')}')`);
23
23
  if ('default' in migration) migration = migration.default;
24
24
  const result = {
25
25
  name: path.basename(filePath).split('.')?.[0],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/database/migrations/readMigrationFiles.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\nimport type { Payload } from '../../index.js'\nimport type { Migration } from '../types.js'\n\n/**\n * Read the migration files from disk\n */\nexport const readMigrationFiles = async ({\n payload,\n}: {\n payload: Payload\n}): Promise<Migration[]> => {\n if (!fs.existsSync(payload.db.migrationDir)) {\n payload.logger.error({\n msg: `No migration directory found at ${payload.db.migrationDir}`,\n })\n return []\n }\n\n payload.logger.info({\n msg: `Reading migration files from ${payload.db.migrationDir}`,\n })\n\n const files = fs\n .readdirSync(payload.db.migrationDir)\n .sort()\n .filter((f) => {\n return f.endsWith('.ts') || f.endsWith('.js')\n })\n .map((file) => {\n return path.resolve(payload.db.migrationDir, file)\n })\n\n return Promise.all(\n files.map(async (filePath) => {\n // eval used to circumvent errors bundling\n let migration = await eval(\n `${require ? 'require' : 'import'}('${filePath.replaceAll('\\\\', '/')}')`,\n )\n if ('default' in migration) migration = migration.default\n\n const result: Migration = {\n name: path.basename(filePath).split('.')?.[0],\n down: migration.down,\n up: migration.up,\n }\n\n return result\n }),\n )\n}\n"],"names":["fs","path","readMigrationFiles","payload","existsSync","db","migrationDir","logger","error","msg","info","files","readdirSync","sort","filter","f","endsWith","map","file","resolve","Promise","all","filePath","migration","eval","require","replaceAll","default","result","name","basename","split","down","up"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AAKvB;;CAEC,GACD,OAAO,MAAMC,qBAAqB,OAAO,EACvCC,OAAO,EAGR;IACC,IAAI,CAACH,GAAGI,UAAU,CAACD,QAAQE,EAAE,CAACC,YAAY,GAAG;QAC3CH,QAAQI,MAAM,CAACC,KAAK,CAAC;YACnBC,KAAK,CAAC,gCAAgC,EAAEN,QAAQE,EAAE,CAACC,YAAY,CAAC,CAAC;QACnE;QACA,OAAO,EAAE;IACX;IAEAH,QAAQI,MAAM,CAACG,IAAI,CAAC;QAClBD,KAAK,CAAC,6BAA6B,EAAEN,QAAQE,EAAE,CAACC,YAAY,CAAC,CAAC;IAChE;IAEA,MAAMK,QAAQX,GACXY,WAAW,CAACT,QAAQE,EAAE,CAACC,YAAY,EACnCO,IAAI,GACJC,MAAM,CAAC,CAACC;QACP,OAAOA,EAAEC,QAAQ,CAAC,UAAUD,EAAEC,QAAQ,CAAC;IACzC,GACCC,GAAG,CAAC,CAACC;QACJ,OAAOjB,KAAKkB,OAAO,CAAChB,QAAQE,EAAE,CAACC,YAAY,EAAEY;IAC/C;IAEF,OAAOE,QAAQC,GAAG,CAChBV,MAAMM,GAAG,CAAC,OAAOK;QACf,0CAA0C;QAC1C,IAAIC,YAAY,MAAMC,KACpB,CAAC,EAAEC,UAAU,YAAY,SAAS,EAAE,EAAEH,SAASI,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;QAE1E,IAAI,aAAaH,WAAWA,YAAYA,UAAUI,OAAO;QAEzD,MAAMC,SAAoB;YACxBC,MAAM5B,KAAK6B,QAAQ,CAACR,UAAUS,KAAK,CAAC,MAAM,CAAC,EAAE;YAC7CC,MAAMT,UAAUS,IAAI;YACpBC,IAAIV,UAAUU,EAAE;QAClB;QAEA,OAAOL;IACT;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../src/database/migrations/readMigrationFiles.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\n\nimport type { Payload } from '../../index.js'\nimport type { Migration } from '../types.js'\n\n/**\n * Read the migration files from disk\n */\nexport const readMigrationFiles = async ({\n payload,\n}: {\n payload: Payload\n}): Promise<Migration[]> => {\n if (!fs.existsSync(payload.db.migrationDir)) {\n payload.logger.error({\n msg: `No migration directory found at ${payload.db.migrationDir}`,\n })\n return []\n }\n\n payload.logger.info({\n msg: `Reading migration files from ${payload.db.migrationDir}`,\n })\n\n const files = fs\n .readdirSync(payload.db.migrationDir)\n .sort()\n .filter((f) => {\n return f.endsWith('.ts') || f.endsWith('.js')\n })\n .map((file) => {\n return path.resolve(payload.db.migrationDir, file)\n })\n\n return Promise.all(\n files.map(async (filePath) => {\n // eval used to circumvent errors bundling\n let migration = await eval(\n `${typeof require === 'function' ? 'require' : 'import'}('${filePath.replaceAll('\\\\', '/')}')`,\n )\n if ('default' in migration) migration = migration.default\n\n const result: Migration = {\n name: path.basename(filePath).split('.')?.[0],\n down: migration.down,\n up: migration.up,\n }\n\n return result\n }),\n )\n}\n"],"names":["fs","path","readMigrationFiles","payload","existsSync","db","migrationDir","logger","error","msg","info","files","readdirSync","sort","filter","f","endsWith","map","file","resolve","Promise","all","filePath","migration","eval","require","replaceAll","default","result","name","basename","split","down","up"],"mappings":"AAAA,OAAOA,QAAQ,KAAI;AACnB,OAAOC,UAAU,OAAM;AAKvB;;CAEC,GACD,OAAO,MAAMC,qBAAqB,OAAO,EACvCC,OAAO,EAGR;IACC,IAAI,CAACH,GAAGI,UAAU,CAACD,QAAQE,EAAE,CAACC,YAAY,GAAG;QAC3CH,QAAQI,MAAM,CAACC,KAAK,CAAC;YACnBC,KAAK,CAAC,gCAAgC,EAAEN,QAAQE,EAAE,CAACC,YAAY,CAAC,CAAC;QACnE;QACA,OAAO,EAAE;IACX;IAEAH,QAAQI,MAAM,CAACG,IAAI,CAAC;QAClBD,KAAK,CAAC,6BAA6B,EAAEN,QAAQE,EAAE,CAACC,YAAY,CAAC,CAAC;IAChE;IAEA,MAAMK,QAAQX,GACXY,WAAW,CAACT,QAAQE,EAAE,CAACC,YAAY,EACnCO,IAAI,GACJC,MAAM,CAAC,CAACC;QACP,OAAOA,EAAEC,QAAQ,CAAC,UAAUD,EAAEC,QAAQ,CAAC;IACzC,GACCC,GAAG,CAAC,CAACC;QACJ,OAAOjB,KAAKkB,OAAO,CAAChB,QAAQE,EAAE,CAACC,YAAY,EAAEY;IAC/C;IAEF,OAAOE,QAAQC,GAAG,CAChBV,MAAMM,GAAG,CAAC,OAAOK;QACf,0CAA0C;QAC1C,IAAIC,YAAY,MAAMC,KACpB,CAAC,EAAE,OAAOC,YAAY,aAAa,YAAY,SAAS,EAAE,EAAEH,SAASI,UAAU,CAAC,MAAM,KAAK,EAAE,CAAC;QAEhG,IAAI,aAAaH,WAAWA,YAAYA,UAAUI,OAAO;QAEzD,MAAMC,SAAoB;YACxBC,MAAM5B,KAAK6B,QAAQ,CAACR,UAAUS,KAAK,CAAC,MAAM,CAAC,EAAE;YAC7CC,MAAMT,UAAUS,IAAI;YACpBC,IAAIV,UAAUU,EAAE;QAClB;QAEA,OAAOL;IACT;AAEJ,EAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "3.0.0-alpha.50",
3
+ "version": "3.0.0-alpha.51",
4
4
  "description": "Node, React and MongoDB Headless CMS and Application Framework",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "sanitize-filename": "1.6.3",
51
51
  "scheduler": "0.23.0",
52
52
  "scmp": "2.1.0",
53
- "@payloadcms/translations": "3.0.0-alpha.50"
53
+ "@payloadcms/translations": "3.0.0-alpha.51"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@monaco-editor/react": "4.5.1",
package/uploads.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { getFileByPath } from './dist/uploads/getFileByPath.js';
2
- //# sourceMappingURL=uploads.d.ts.map
1
+ export { getFileByPath } from './dist/uploads/getFileByPath.js'
2
+ //# sourceMappingURL=uploads.d.ts.map
package/uploads.js CHANGED
@@ -1,3 +1,3 @@
1
- export { getFileByPath } from './dist/uploads/getFileByPath.js';
1
+ export { getFileByPath } from './dist/uploads/getFileByPath.js'
2
2
 
3
- //# sourceMappingURL=uploads.js.map
3
+ //# sourceMappingURL=uploads.js.map