payload 1.5.3 → 1.5.4

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.
@@ -77,6 +77,7 @@ export type InitOptions = {
77
77
  * See Pino Docs for options: https://getpino.io/#/docs/api?id=options
78
78
  */
79
79
  loggerOptions?: LoggerOptions;
80
+ config?: SanitizedConfig;
80
81
  };
81
82
  /**
82
83
  * This result is calculated on the server
package/dist/init.js CHANGED
@@ -7,6 +7,7 @@ exports.initSync = exports.initAsync = exports.init = void 0;
7
7
  /* eslint-disable no-param-reassign */
8
8
  const express_1 = __importDefault(require("express"));
9
9
  const crypto_1 = __importDefault(require("crypto"));
10
+ const path_1 = __importDefault(require("path"));
10
11
  const mongoose_1 = __importDefault(require("mongoose"));
11
12
  const authenticate_1 = __importDefault(require("./express/middleware/authenticate"));
12
13
  const connect_1 = __importDefault(require("./mongoose/connect"));
@@ -31,6 +32,7 @@ const logger_1 = __importDefault(require("./utilities/logger"));
31
32
  const dataloader_1 = require("./collections/dataloader");
32
33
  const mountEndpoints_1 = __importDefault(require("./express/mountEndpoints"));
33
34
  const model_1 = __importDefault(require("./preferences/model"));
35
+ const find_1 = __importDefault(require("./config/find"));
34
36
  const init = (payload, options) => {
35
37
  payload.logger.info('Starting Payload...');
36
38
  if (!options.secret) {
@@ -46,7 +48,21 @@ const init = (payload, options) => {
46
48
  .digest('hex')
47
49
  .slice(0, 32);
48
50
  payload.local = options.local;
49
- payload.config = (0, load_1.default)(payload.logger);
51
+ if (options.config) {
52
+ payload.config = options.config;
53
+ const configPath = (0, find_1.default)();
54
+ payload.config = {
55
+ ...options.config,
56
+ paths: {
57
+ configDir: path_1.default.dirname(configPath),
58
+ config: configPath,
59
+ rawConfig: configPath,
60
+ },
61
+ };
62
+ }
63
+ else {
64
+ payload.config = (0, load_1.default)(payload.logger);
65
+ }
50
66
  // If not initializing locally, scaffold router
51
67
  if (!payload.local) {
52
68
  payload.router = express_1.default.Router();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payload",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "Node, React and MongoDB Headless CMS and Application Framework",
5
5
  "license": "MIT",
6
6
  "engines": {