Skip to content

Commit

Permalink
Merge pull request #149 from contentstack/staging
Browse files Browse the repository at this point in the history
merge staging with master
  • Loading branch information
abhishek305 authored May 25, 2022
2 parents 5c0d5b3 + f55d552 commit 7c7a941
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"@babel/preset-env",
{
"targets": {
"node": 12.13
"node": 14.15
},
"forceAllTransforms": true
}
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ To use this, you need to have the following plugins installed:
- gatsby-transformer-sharp
- gatsby-plugin-sharp
- gatsby-source-filesystem
- gatsby-plugin-image

```graphql
{
Expand Down Expand Up @@ -258,7 +259,9 @@ Here’s an example of the same:
}
```

For more information checkout gatsby's documentation on usage of the [new image plugin](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/adding-gatsby-image-support/).
For more information checkout gatsby's image plugin documentation on usage of the [new image plugin](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/adding-gatsby-image-support/).

For more information on region support please refer [About Region's](https://www.contentstack.com/docs/developers/contentstack-regions/api-endpoints/)

[gatsby]: https://www.gatsbyjs.org/
[contentstack]: https://www.contentstack.com/
8 changes: 4 additions & 4 deletions normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,14 @@ var buildCustomSchema = exports.buildCustomSchema = function (schema, types, ref

if (field.mandatory && !disableMandatoryFields) {
if (field.multiple) {
fields[field.uid].type = '[Int]!';
fields[field.uid].type = '[Float]!';
} else {
fields[field.uid].type = 'Int!';
fields[field.uid].type = 'Float!';
}
} else if (field.multiple) {
fields[field.uid].type = '[Int]';
fields[field.uid].type = '[Float]';
} else {
fields[field.uid].type = 'Int';
fields[field.uid].type = 'Float';
}

break;
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "gatsby-source-contentstack",
"version": "3.1.4",
"version": "4.0.2",
"description": "Gatsby source plugin for building websites using Contentstack as a data source",
"scripts": {
"prepublish": "npm run build",
"build": "babel src --out-dir .",
"watch": "babel -w src --out-dir ."
},
"engines": {
"node": ">=12.13.0"
"node": ">=14.15.0"
},
"main": "gatsby-node.js",
"repository": {
Expand All @@ -27,7 +27,7 @@
"license": "MIT",
"dependencies": {
"gatsby-core-utils": "^3.3.0",
"gatsby-source-filesystem": "^3.13.0",
"gatsby-source-filesystem": "^4.4.0",
"node-fetch": "2.1.2",
"progress": "^2.0.3",
"query-string": "6.0.0"
Expand Down Expand Up @@ -57,12 +57,12 @@
"semantic-release": "^17.4.4"
},
"peerDependencies": {
"gatsby": "^3.0.0",
"gatsby": "^3.0.0 || ^4.0.0",
"gatsby-plugin-image": "^2.0.0-next"
},
"husky": {
"hooks": {
"commit-msg": "npx --no-install commitlint --edit '$1'"
}
}
}
}
8 changes: 4 additions & 4 deletions src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,14 @@ const buildCustomSchema = (exports.buildCustomSchema = (schema, types, reference
};
if (field.mandatory && !disableMandatoryFields) {
if (field.multiple) {
fields[field.uid].type = '[Int]!';
fields[field.uid].type = '[Float]!';
} else {
fields[field.uid].type = 'Int!';
fields[field.uid].type = 'Float!';
}
} else if (field.multiple) {
fields[field.uid].type = '[Int]';
fields[field.uid].type = '[Float]';
} else {
fields[field.uid].type = 'Int';
fields[field.uid].type = 'Float';
}
break;
// This is to support custom field types nested inside groups, global_fields & modular_blocks
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ exports.checkIfUnsupportedFormat = data => {
};

exports.SUPPORTED_FILES_COUNT = 'SUPPORTED_FILES_COUNT';
exports.IMAGE_REGEXP = new RegExp('https://(stag-images|(eu-)?images).(blz-)?contentstack.(io|com)/v3/assets/');
exports.IMAGE_REGEXP = new RegExp('https://(stag-images|(eu-|azure-na-|azure-k8s-)?images).(blz-)?contentstack.(io|com)/v3/assets/');
exports.ASSET_NODE_UIDS = 'ASSET_NODE_UIDS';

exports.CODES = {
Expand Down
2 changes: 1 addition & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ exports.checkIfUnsupportedFormat = function (data) {
};

exports.SUPPORTED_FILES_COUNT = 'SUPPORTED_FILES_COUNT';
exports.IMAGE_REGEXP = new RegExp('https://(stag-images|(eu-)?images).(blz-)?contentstack.(io|com)/v3/assets/');
exports.IMAGE_REGEXP = new RegExp('https://(stag-images|(eu-|azure-na-|azure-k8s-)?images).(blz-)?contentstack.(io|com)/v3/assets/');
exports.ASSET_NODE_UIDS = 'ASSET_NODE_UIDS';
exports.CODES = {
SyncError: '10001',
Expand Down

0 comments on commit 7c7a941

Please sign in to comment.