diff --git a/.gitignore b/.gitignore index fbd8b8a9..4e805282 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ -# Project dependencies -node_modules - -# Output files -/gatsby-node.js -/normalize.js +# Project dependencies +node_modules + +# Output files +/gatsby-node.js +/normalize.js +/config.js diff --git a/.npmignore b/.npmignore index 68be49d2..89444707 100644 --- a/.npmignore +++ b/.npmignore @@ -6,6 +6,7 @@ # Recursively allow files under subtree¨ !gatsby-node.js !normalize.js +!config.js !package.json !.npmignore !README.md diff --git a/package.json b/package.json index 66473249..9f46270d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-source-kentico-cloud", - "version": "2.2.0", + "version": "2.2.1", "description": "Gatsby source plugin for Kentico Cloud", "main": "./gatsby-node.js", "scripts": { diff --git a/src/__tests__/gatsby-node.spec.js b/src/__tests__/gatsby-node.spec.js index 6a7548a2..adfea0a8 100644 --- a/src/__tests__/gatsby-node.spec.js +++ b/src/__tests__/gatsby-node.spec.js @@ -1,6 +1,7 @@ const { TestHttpService } = require('kentico-cloud-core'); -const { customTrackingHeader, sourceNodes } = require('../gatsby-node'); +const { sourceNodes } = require('../gatsby-node'); +const { customTrackingHeader } = require('../config'); const { name, version } = require('../../package.json'); describe('customTrackingHeader', () => { diff --git a/src/config.js b/src/config.js new file mode 100644 index 00000000..916bccfe --- /dev/null +++ b/src/config.js @@ -0,0 +1,6 @@ +const customTrackingHeader = { + header: 'X-KC-SOURCE', + value: 'gatsby-source-kentico-cloud;2.2.1', +}; + +exports.customTrackingHeader = customTrackingHeader; diff --git a/src/gatsby-node.js b/src/gatsby-node.js index ebe7cfeb..650033e7 100644 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -3,13 +3,10 @@ const _ = require(`lodash`); const { DeliveryClient } = require(`kentico-cloud-delivery`); const normalize = require(`./normalize`); const { parse, stringify } = require(`flatted/cjs`); +const { customTrackingHeader } = require('./config') + const defaultLanguageLiteral = `default`; -const customTrackingHeader = { - header: 'X-KC-SOURCE', - value: 'gatsby-source-kentico-cloud;2.2.0', -}; -exports.customTrackingHeader = customTrackingHeader; exports.sourceNodes = async ({ actions: { createNode }, createNodeId },