@financial-times/x-engine 8.2.2 → 8.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +3 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financial-times/x-engine",
3
- "version": "8.2.2",
3
+ "version": "8.2.4",
4
4
  "description": "This module is a consolidation library to render x-dash components with any compatible runtime.",
5
5
  "main": "src/server.js",
6
6
  "browser": "src/client.js",
package/src/server.js CHANGED
@@ -4,13 +4,14 @@ const resolvePeer = require('./concerns/resolve-peer')
4
4
  const formatConfig = require('./concerns/format-config')
5
5
 
6
6
  // 1. try to load the application's package manifest
7
- const pkg = require(resolvePkg())
7
+ const pkgPath = resolvePkg()
8
+ const pkg = require(pkgPath)
8
9
 
9
10
  // 2. if we have the manifest then find the engine configuration
10
11
  const raw = deepGet(pkg, 'x-dash.engine.server')
11
12
 
12
13
  if (!raw) {
13
- throw new Error(`x-engine requires a server runtime to be specified. none found in ${pkg.name}`)
14
+ throw new Error(`x-engine server configuration not found in ${pkg.name}'s package.json (${pkgPath}). this configuration is required so that x-engine knows which JSX runtime to use. follow the configuration guide to add this configuration: https://github.com/Financial-Times/x-dash/tree/main/packages/x-engine#configuration`)
14
15
  }
15
16
 
16
17
  // 3. format the configuration we've loaded