generator-easy-ui5 3.1.2 → 3.1.3
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.
- package/generators/app/index.js +23 -1
- package/package.json +2 -1
package/generators/app/index.js
CHANGED
|
@@ -10,6 +10,8 @@ const fs = require("fs");
|
|
|
10
10
|
const { rmdir } = require("fs").promises;
|
|
11
11
|
|
|
12
12
|
const { Octokit } = require("@octokit/rest");
|
|
13
|
+
const { throttling } = require("@octokit/plugin-throttling");
|
|
14
|
+
const MyOctokit = Octokit.plugin(throttling);
|
|
13
15
|
const AdmZip = require("adm-zip");
|
|
14
16
|
|
|
15
17
|
const generatorOptions = {
|
|
@@ -125,9 +127,29 @@ module.exports = class extends Generator {
|
|
|
125
127
|
this.log(yosay(`Welcome to the ${chalk.red("easy-ui5")} generator!`));
|
|
126
128
|
|
|
127
129
|
// create the octokit client to retrieve the generators from GH org
|
|
128
|
-
const octokit = new
|
|
130
|
+
const octokit = new MyOctokit({
|
|
129
131
|
userAgent: `${this.rootGeneratorName()}:${this.rootGeneratorVersion()}`,
|
|
130
132
|
auth: this.options.ghAuthToken,
|
|
133
|
+
throttle: {
|
|
134
|
+
onRateLimit: (retryAfter, options) => {
|
|
135
|
+
this.log(
|
|
136
|
+
`${chalk.yellow("Hit the GitHub API limit!")} Request quota exhausted for this request.`
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
if (options.request.retryCount === 0) {
|
|
140
|
+
// only retries once
|
|
141
|
+
this.log(`Retrying after ${retryAfter} seconds. Alternatively, you can cancel this operation and supply an auth token with the \`--ghAuthToken\` option. For more details, run \`yo easy-ui5 --help\`. `);
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
onAbuseLimit: (_, options) => {
|
|
146
|
+
// does not retry, only logs a warning
|
|
147
|
+
this.log(
|
|
148
|
+
`${chalk.red("Hit the GitHub API limit again!")} Please supply an auth token with the \`--ghAuthToken\` option. For more details, run \`yo easy-ui5 --help\` `
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
},
|
|
152
|
+
}
|
|
131
153
|
});
|
|
132
154
|
|
|
133
155
|
// retrieve the available repositories
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-easy-ui5",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Generator for UI5-based project",
|
|
5
5
|
"main": "generators/app/index.js",
|
|
6
6
|
"files": [
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://github.com/SAP/generator-easy-ui5#readme",
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@octokit/plugin-throttling": "^3.5.2",
|
|
39
40
|
"@octokit/rest": "^18.12.0",
|
|
40
41
|
"adm-zip": "^0.5.9",
|
|
41
42
|
"chalk": "^4.1.2",
|