contentful-metalsmith
Advanced tools
Comparing version 0.9.1 to 0.10.0
'use strict' | ||
const processor = require('./lib/processor') | ||
const debug = require('debug')('metalsmith-contentful-files') | ||
@@ -25,2 +26,5 @@ /** | ||
debug('Files before processing:') | ||
debug(files) | ||
return new Promise(resolve => { | ||
@@ -43,2 +47,5 @@ resolve(Object.keys(files)) | ||
debug('Files after processing:') | ||
debug(files) | ||
done() | ||
@@ -45,0 +52,0 @@ }) |
'use strict' | ||
const contentful = require('contentful') | ||
const debug = require('debug')('metalsmith-contentful-queries') | ||
const validator = require('./validator') | ||
@@ -165,2 +166,6 @@ const util = require('./util') | ||
if (file._fileName) { | ||
debug('Query for', file._fileName, '->', query) | ||
} | ||
return client.getEntries(query) | ||
@@ -167,0 +172,0 @@ .catch(error => decorateAPIError(error, file)) |
@@ -16,2 +16,3 @@ { | ||
"contentful": "^3.5.0", | ||
"debug": "^2.6.3", | ||
"lodash.pick": "^4.4.0", | ||
@@ -47,3 +48,3 @@ "lodash.template": "^4.4.0", | ||
}, | ||
"version": "0.9.1" | ||
"version": "0.10.0" | ||
} |
@@ -139,4 +139,25 @@ # contentful-metalsmith | ||
## Debugging | ||
This project uses [debug](https://www.npmjs.com/package/debug) under the hood. If you want to see all debug messages by contentful-metalsmith you can do so by setting a wildcard debug environment variable. | ||
```bash | ||
$ DEBUG=metalsmith-contentful* your command | ||
``` | ||
Currently there are two different variables available to give you information about a specific area: | ||
- `metalsmith-contentful-files` - get information about file data before/after processing | ||
- `metalsmith-contentful-queries` - get information about queries and related files | ||
For example if you want to see what files went into the plugin and got out again: | ||
```bash | ||
$ DEBUG=metalsmith-contentful-files your command | ||
``` | ||
:point_up: *This debug information is good to validate what data is available in [metalsmith-layouts](https://www.npmjs.com/package/metalsmith-layouts).* | ||
# License | ||
MIT |
34110
414
163
5
+ Addeddebug@^2.6.3