Skip to content

Commit d3d5919

Browse files
build: apply yarn for subsequent builds, replacing npm
1 parent 579a2c2 commit d3d5919

File tree

6 files changed

+37
-31
lines changed

6 files changed

+37
-31
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ __tests__
4242
package-lock.json
4343
yarn.lock
4444

45+
# Optional yarn cache directory
46+
.yarn
47+
4548
# Build files (*.js, *.js.map)
4649
gatsby-*.js
4750
gatsby-*.js.map

.husky/pre-commit

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npm run lint-staged --allow-empty
4+
yarn lint-staged --allow-empty

.lintstagedrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"**/*.{js,jsx,md,mdx,json}": [
3-
"npm run lint"
3+
"yarn lint"
44
]
55
}

.yarnrc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
nodeLinker: node-modules
2+
3+
yarnPath: .yarn/releases/yarn-3.2.4.cjs

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ This unofficial source plugin makes Optimizely/Episerver API data available in G
1818
## Features
1919

2020
- Support for multiple `optimizely/episerver` API versions
21-
- Log level options for `optimizely/episerver` API endpoint requests: `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly`
22-
- Support for multiple, additional custom **headers**
21+
- Support for multiple, additional custom headers
2322
- Support for custom request timeout in all `optimizely/episerver` API requests
2423
- Support for data caching on subsequent `gatsby` source plugin runs
25-
- Support for throttling `optimizely/episerver` API requests
26-
- Add support for `expanded` data on content blocks: `images`, `dynamicStyles`, `items`, `form` object data are currently supported with more to come in the future
24+
- Support for throttling and debouncing `optimizely/episerver` API requests
25+
- Add support for `expanded` data on some content blocks: `images`, `dynamicStyles`, `items`, `form` key fields are currently supported with more to come in the future
2726

2827
## Installation and Setup
2928

@@ -115,45 +114,45 @@ options: {
115114
}
116115
```
117116

118-
### Log Level
117+
### Request Timeout
119118

120-
Set the log level for the Optimizely/Episerver API requests. Currently utiilizes [**winston**](https://github.com/winstonjs/winston) for the log level settings. Currently supports `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly`.
119+
Set a custom request timeout for the Optimizely/Episerver API requests (in milliseconds).
121120

122-
**Default:** `debug`.
121+
**Default:** `120000` _(120 seconds)_.
123122

124123
```javascript
125124
options: {
126125
// ...
127126

128-
log_level: "debug";
127+
request_timeout: 120000;
129128
}
130129
```
131130

132-
### Request Timeout
131+
### Request Throttling
133132

134-
Set a custom request timeout for the Optimizely/Episerver API requests (in milliseconds).
133+
Set a custom request throttling interval for the Optimizely/Episerver API requests (in milliseconds).
135134

136-
**Default:** `30000`.
135+
**Default:** `3000`.
137136

138137
```javascript
139138
options: {
140139
// ...
141140

142-
request_timeout: 30000;
141+
request_throttle_interval: 3000;
143142
}
144143
```
145144

146-
### Request Throttling
145+
### Request Debouncing
147146

148-
Set a custom request throttling interval for the Optimizely/Episerver API requests (in milliseconds).
147+
Set a custom request debouncing interval for the Optimizely/Episerver API requests (in milliseconds).
149148

150149
**Default:** `3000`.
151150

152151
```javascript
153152
options: {
154153
// ...
155154

156-
request_throttle_interval: 3000;
155+
request_debounce_interval: 3000;
157156
}
158157
```
159158

package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"watch": "babel ./src/ --out-dir ./ --source-maps --watch",
88
"lint:eslint": "eslint \"./src/**/*.js\" --quiet --fix --color --ignore-path .gitignore",
99
"lint:prettier": "prettier \"./src/**/*.js\" --write --ignore-path .gitignore",
10-
"lint": "npm run lint:eslint && npm run lint:prettier",
11-
"test": "npm run lint",
12-
"prepare": "cross-env NODE_ENV=production npm run build",
13-
"validate": "npm run lint",
14-
"ci:validate": "rm -rf node_modules && npm ci && npm run validate",
15-
"prepublishOnly": "npm run ci:validate && npm run build"
10+
"lint": "yarn lint:eslint && yarn lint:prettier",
11+
"test": "yarn lint",
12+
"prepare": "cross-env NODE_ENV=production yarn build",
13+
"validate": "yarn lint",
14+
"ci:validate": "rm -rf node_modules && yarn install --frozen-lockfile && yarn validate",
15+
"prepublishOnly": "yarn ci:validate && yarn build"
1616
},
1717
"homepage": "https://github.com/Epic-Design-Labs/gatsby-source-optimizely/blob/master/README.md",
1818
"repository": {
@@ -37,11 +37,11 @@
3737
"main": "index.js",
3838
"dependencies": {
3939
"axios": "^0.27.2",
40+
"flatted": "^3.2.7",
4041
"gatsby-source-filesystem": "^4.24.0",
42+
"lodash": "^4.17.21",
4143
"micro": "^9.4.1",
42-
"qs": "^6.11.0",
43-
"sleep-promise": "^9.1.0",
44-
"winston": "^3.8.2"
44+
"qs": "^6.11.0"
4545
},
4646
"devDependencies": {
4747
"@babel/cli": "^7.19.3",
@@ -69,7 +69,7 @@
6969
"react": "^18.2.0"
7070
},
7171
"peerDependencies": {
72-
"gatsby": ">3.0.0"
72+
"gatsby": ">4.0.0"
7373
},
7474
"bugs": {
7575
"url": "https://github.com/Epic-Design-Labs/gatsby-source-optimizely/issues"
@@ -92,15 +92,16 @@
9292
},
9393
"lint-staged": {
9494
"**/*.{js,jsx,md,mdx,json}": [
95-
"npm run lint",
95+
"yarn lint",
9696
"git add"
9797
]
9898
},
9999
"engines": {
100100
"node": ">=16.15.1"
101101
},
102102
"volta": {
103-
"node": "18.11.0",
104-
"npm": "8.19.2"
105-
}
103+
"node": "16.18.0",
104+
"yarn": "3.2.4"
105+
},
106+
"packageManager": "yarn@3.2.4"
106107
}

0 commit comments

Comments
 (0)