generator-easy-ui5 3.8.0 → 3.8.2
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/README.md +58 -34
- package/generators/app/index.js +30 -17
- package/package.json +13 -11
- package/plugins/generator-ui5-project.zip +0 -0
package/README.md
CHANGED
|
@@ -12,23 +12,25 @@ Easy UI5 (`easy-ui5`) 💙 is a [Yeoman](http://yeoman.io/) generator which enab
|
|
|
12
12
|
|
|
13
13
|
This generator has been created to simplify the creation of your UI5 prototypes. Now you can scaffold simple UI5 projects from the shell/terminal of your choice. The current best practices (such as [async](https://blogs.sap.com/2018/12/18/ui5ers-buzz-41-best-practices-for-async-loading-in-ui5/)) are already baked into our templates so you don't have to worry about the definition of the metadata files.
|
|
14
14
|
|
|
15
|
-
The purpose of the `project`
|
|
15
|
+
The purpose of the (preinstalled) `project generator` is to guide you on your first steps with [SAPUI5](https://sapui5.hana.ondemand.com/) and [SAP BTP](https://www.sap.com/products/business-technology-platform.html) deployments. Once you are familiar with those technologies, you might want to tweak the projects to adapt them for productive use-cases (such as continuous deployment pipelines and full i18n).
|
|
16
16
|
|
|
17
|
-
> :warning: Starting with
|
|
17
|
+
> :warning: Starting with easy-ui5 v3, all templates will be outsource to repositories in the [UI5 Community](https://github.com/ui5-community/). This project is from now on a shell that will offer all generators hosted on that GitHub org. easy-ui5 will download and install these repositories when needed.
|
|
18
18
|
>
|
|
19
|
-
> By default, it will download the repository [generator-ui5-project](https://github.com/ui5-community/generator-ui5-project/) which contains the templates that were previously integrated in
|
|
19
|
+
> By default, it will download the repository [generator-ui5-project](https://github.com/ui5-community/generator-ui5-project/) which contains the templates that were previously integrated in easy-ui5 < 3.
|
|
20
20
|
|
|
21
21
|
## Requirements
|
|
22
22
|
|
|
23
|
-
- Get [Node.js](https://nodejs.org/en/download/) (:warning: **version
|
|
23
|
+
- Get [Node.js](https://nodejs.org/en/download/) (:warning: **version 20 or higher**).
|
|
24
24
|
|
|
25
25
|
## Download and Installation
|
|
26
26
|
|
|
27
|
-
1. Install the generator
|
|
27
|
+
1. Install the generator:
|
|
28
|
+
|
|
28
29
|
```sh
|
|
29
30
|
npm install -g yo generator-easy-ui5
|
|
30
31
|
```
|
|
31
|
-
|
|
32
|
+
|
|
33
|
+
2. Verify your installation to see if Yeoman has been installed correctly:
|
|
32
34
|
```sh
|
|
33
35
|
yo
|
|
34
36
|
```
|
|
@@ -38,12 +40,15 @@ The purpose of the `project` subgenerator is to guide you on your first steps wi
|
|
|
38
40
|
|
|
39
41
|
> Create your first UI5 App within a few seconds!
|
|
40
42
|
|
|
41
|
-
1. Scaffold your UI5 project
|
|
43
|
+
1. Scaffold your UI5 project:
|
|
44
|
+
|
|
42
45
|
```
|
|
43
46
|
yo easy-ui5 project
|
|
44
47
|
```
|
|
45
|
-
|
|
46
|
-
|
|
48
|
+
|
|
49
|
+
2. Answer the prompts to create your new project.
|
|
50
|
+
|
|
51
|
+
3. Run it locally:
|
|
47
52
|
```
|
|
48
53
|
cd <your project directory>
|
|
49
54
|
npm start # or "yarn start"
|
|
@@ -51,69 +56,88 @@ The purpose of the `project` subgenerator is to guide you on your first steps wi
|
|
|
51
56
|
|
|
52
57
|
## Target platforms
|
|
53
58
|
|
|
54
|
-
During the prompting phase, the generator will ask on which target platform your app should run. Currently, the following options are available:
|
|
59
|
+
During the prompting phase, the project generator will ask on which target platform your app should run. Currently, the following options are available:
|
|
55
60
|
|
|
56
61
|
- Static webserver
|
|
57
|
-
-
|
|
58
|
-
-
|
|
62
|
+
- Application Router
|
|
63
|
+
- Application Frontend Service
|
|
64
|
+
- SAP HTML5 Application Repository
|
|
65
|
+
- SAP Build Work Zone, standard edition
|
|
59
66
|
- SAP NetWeaver
|
|
60
67
|
|
|
61
|
-
> Have a look at [
|
|
68
|
+
> Have a look at the [project generator](https://github.com/ui5-community/generator-ui5-project/) for more usage instruction and information about its available subgenerators.
|
|
62
69
|
|
|
63
70
|
## More generators
|
|
64
71
|
|
|
65
72
|
And this is just the start!
|
|
66
73
|
|
|
67
|
-
We made
|
|
74
|
+
We made easy-ui5 extensible, so that the entire [UI5 Community](https://github.com/ui5-community/) can build additional plugins to scaffold any UI5-related development activity.
|
|
68
75
|
|
|
69
|
-
By default, this generator comes with the [project
|
|
76
|
+
By default, this generator comes with the [project generator](https://github.com/ui5-community/generator-ui5-project) but there are many others as well:
|
|
70
77
|
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
78
|
+
- [[ui5-community/generator-ui5-ts-app]](https://github.com/ui5-community/generator-ui5-ts-app)
|
|
79
|
+
- [[ui5-community/generator-ui5-ts-app-fcl]](https://github.com/ui5-community/generator-ui5-ts-app-fcl)
|
|
80
|
+
- [[ui5-community/generator-ui5-app]](https://github.com/ui5-community/generator-ui5-app)
|
|
81
|
+
- [[ui5-community/generator-ui5-flp-plugin]](https://github.com/ui5-community/generator-ui5-flp-plugin)
|
|
82
|
+
- [[ui5-community/generator-ui5-library]](https://github.com/ui5-community/generator-ui5-library)
|
|
83
|
+
- [[ui5-community/generator-ui5-ts-library]](https://github.com/ui5-community/generator-ui5-ts-library)
|
|
84
|
+
- [[ui5-community/generator-ui5-wdi5]](https://github.com/ui5-community/generator-ui5-wdi5)
|
|
85
|
+
- [[ui5-community/generator-ui5-add-extension]](https://github.com/ui5-community/generator-ui5-add-extension)
|
|
86
|
+
- [[ui5-community/generator-ui5-library-webc]](https://github.com/ui5-community/generator-ui5-library-webc)
|
|
77
87
|
|
|
78
|
-
To download and use any of the plugins above, run the following command
|
|
88
|
+
To download and use any of the plugins above, run the following command:
|
|
79
89
|
|
|
80
90
|
```sh
|
|
81
|
-
yo easy-ui5 [project|
|
|
91
|
+
yo easy-ui5 [project|ts-app|...] # this is the name of the repository without the "generator-ui5-" prefix
|
|
82
92
|
```
|
|
83
93
|
|
|
84
|
-
<!-- Are you missing a generator in this list and are you willing to provide one to the entire UI5 community? Great! [This blog posts](TODO INSERT LINK HERE) contains everything you need to know to get started! -->
|
|
85
|
-
|
|
86
94
|
## Calling generators
|
|
87
95
|
|
|
88
|
-
Run the following command to see all subgenerators of a given
|
|
96
|
+
Run the following command to see all subgenerators of a given generator:
|
|
89
97
|
|
|
90
98
|
```sh
|
|
91
|
-
yo easy-ui5 [project|
|
|
99
|
+
yo easy-ui5 [project|ts-app|...] --list
|
|
92
100
|
```
|
|
93
101
|
|
|
94
|
-
Once you decided on the
|
|
95
|
-
|
|
96
|
-
Run the following command to see all subgenerators of a given plugin
|
|
102
|
+
Once you decided on the generator, run:
|
|
97
103
|
|
|
98
104
|
```sh
|
|
99
|
-
yo easy-ui5 [project|
|
|
105
|
+
yo easy-ui5 [project|ts-app|...]
|
|
100
106
|
```
|
|
101
107
|
|
|
102
108
|
## Proxy settings
|
|
103
109
|
|
|
104
|
-
If you are running
|
|
110
|
+
If you are running easy-ui5 behind a coporate proxy, just use the default proxy environment variables for Node.js to configure your corporate proxy:
|
|
105
111
|
|
|
106
112
|
- `HTTP_PROXY`: Specify the value to use as the HTTP proxy for all connections, e.g., `HTTP_PROXY="http://proxy.mycompany.com:8080/"`.
|
|
107
|
-
- `HTTPS_PROXY`: Specify the value to use as the HTTPS proxy for all connections, e.g., `HTTPS_PROXY="
|
|
113
|
+
- `HTTPS_PROXY`: Specify the value to use as the HTTPS proxy for all connections, e.g., `HTTPS_PROXY="http://proxy.mycompany.com:8080/"`.
|
|
108
114
|
- `NO_PROXY`: Define the hosts that should bypass the proxy, e.g., `NO_PROXY="localhost,.mycompany.com,192.168.6.254:80"`.
|
|
109
115
|
|
|
116
|
+
In addition, easy-ui5 also supports proxy configuration from the `.npmrc` configuration:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
http-proxy=http://proxy.mycompany.com:8080/
|
|
120
|
+
https-proxy=http://proxy.mycompany.com:8080/
|
|
121
|
+
proxy=http://proxy.mycompany.com:8080/
|
|
122
|
+
no-proxy=localhost,.mycompany.com,192.168.6.254:80
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This configuration is shared with npm itself since this proxy configuration is used to download the packages from npm.
|
|
126
|
+
|
|
127
|
+
Proxies can be passed as env variables or as npm config options. The highest precedence have the `GLOBAL_AGENT_*` env variables before the regular env variables followed by the npm configuration options, e.g.:
|
|
128
|
+
|
|
129
|
+
1. env: `GLOBAL_AGENT_HTTP_PROXY`
|
|
130
|
+
2. env: `HTTP_PROXY`
|
|
131
|
+
3. npm: `http-proxy`
|
|
132
|
+
4. npm: `proxy`
|
|
133
|
+
|
|
110
134
|
## How to obtain support
|
|
111
135
|
|
|
112
136
|
Please use the GitHub bug tracking system to post questions, bug reports or to create pull requests.
|
|
113
137
|
|
|
114
138
|
## Contributing
|
|
115
139
|
|
|
116
|
-
We welcome any type of contribution (code contributions, pull requests, issues) to this
|
|
140
|
+
We welcome any type of contribution (code contributions, pull requests, issues) to this project equally.
|
|
117
141
|
|
|
118
142
|
Please follow our instructions if you would like to [contribute](https://github.com/SAP/generator-easy-ui5/blob/master/CONTRIBUTING.md).
|
|
119
143
|
|
package/generators/app/index.js
CHANGED
|
@@ -15,29 +15,33 @@ import { Octokit } from "@octokit/rest";
|
|
|
15
15
|
import { throttling } from "@octokit/plugin-throttling";
|
|
16
16
|
const MyOctokit = Octokit.plugin(throttling);
|
|
17
17
|
import spawn from "cross-spawn";
|
|
18
|
+
import nodeFetch from "node-fetch";
|
|
18
19
|
|
|
19
20
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
20
21
|
|
|
21
|
-
// apply proxy settings to GLOBAL_AGENT to support the proxy configuration
|
|
22
|
-
// provided via the standard Node.js environment varibales (used for fetch API)
|
|
23
|
-
let HTTP_PROXY, HTTPS_PROXY, NO_PROXY;
|
|
24
|
-
if (global?.GLOBAL_AGENT) {
|
|
25
|
-
HTTP_PROXY = global.GLOBAL_AGENT.HTTP_PROXY = process.env.HTTP_PROXY || process.env.http_proxy;
|
|
26
|
-
HTTPS_PROXY = global.GLOBAL_AGENT.HTTPS_PROXY = process.env.HTTPS_PROXY || process.env.https_proxy;
|
|
27
|
-
NO_PROXY = global.GLOBAL_AGENT.NO_PROXY = process.env.NO_PROXY || process.env.no_proxy;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
22
|
// helper to retrieve config entries from npm
|
|
31
23
|
// --> npm config set easy-ui5_addGhOrg XYZ
|
|
32
|
-
const NPM_CONFIG_PREFIX = "easy-ui5_";
|
|
33
24
|
let npmConfig;
|
|
34
|
-
const getNPMConfig = (configName) => {
|
|
25
|
+
const getNPMConfig = (configName, prefix = "easy-ui5_") => {
|
|
35
26
|
if (!npmConfig) {
|
|
36
27
|
npmConfig = libnpmconfig.read();
|
|
37
28
|
}
|
|
38
|
-
return npmConfig && npmConfig[`${
|
|
29
|
+
return npmConfig && npmConfig[`${prefix}${configName}`];
|
|
39
30
|
};
|
|
40
31
|
|
|
32
|
+
// apply proxy settings to GLOBAL_AGENT to support the proxy configuration for node-fetch using the GLOBAL_AGENT
|
|
33
|
+
// ==> the configuration is derived from the environment variables ([GLOBAL_AGENT_](HTTP|HTTPS|NO)_PROXY) and the npm config ((http|https|no)-proxy)
|
|
34
|
+
// ==> empty values will allow to override the more general proxy settings and make the proxy value undefined
|
|
35
|
+
let HTTP_PROXY, HTTPS_PROXY, NO_PROXY;
|
|
36
|
+
if (global?.GLOBAL_AGENT) {
|
|
37
|
+
HTTP_PROXY = process.env.GLOBAL_AGENT_HTTP_PROXY ?? process.env.HTTP_PROXY ?? process.env.http_proxy ?? getNPMConfig("http-proxy", "") ?? getNPMConfig("proxy", "");
|
|
38
|
+
global.GLOBAL_AGENT.HTTP_PROXY = HTTP_PROXY = HTTP_PROXY || global.GLOBAL_AGENT.HTTP_PROXY;
|
|
39
|
+
HTTPS_PROXY = process.env.GLOBAL_AGENT_HTTPS_PROXY ?? process.env.HTTPS_PROXY ?? process.env.https_proxy ?? getNPMConfig("https-proxy", "") ?? getNPMConfig("proxy", "");
|
|
40
|
+
global.GLOBAL_AGENT.HTTPS_PROXY = HTTPS_PROXY = HTTPS_PROXY || global.GLOBAL_AGENT.HTTPS_PROXY;
|
|
41
|
+
NO_PROXY = process.env.GLOBAL_AGENT_NO_PROXY ?? process.env.NO_PROXY ?? process.env.no_proxy ?? getNPMConfig("no-proxy", "");
|
|
42
|
+
global.GLOBAL_AGENT.NO_PROXY = NO_PROXY = NO_PROXY || global.GLOBAL_AGENT.NO_PROXY;
|
|
43
|
+
}
|
|
44
|
+
|
|
41
45
|
// the command line options of the generator
|
|
42
46
|
const generatorOptions = {
|
|
43
47
|
pluginsHome: {
|
|
@@ -265,7 +269,7 @@ export default class extends Generator {
|
|
|
265
269
|
});
|
|
266
270
|
generator.branch = repoInfo.data.default_branch;
|
|
267
271
|
} catch (e) {
|
|
268
|
-
console.error(`Generator "${owner}/${repo}!${dir}${branch ? "#" + branch : ""}" not found! Run with --verbose for details
|
|
272
|
+
console.error(`Generator "${owner}/${repo}!${dir}${branch ? "#" + branch : ""}" not found! Run with --verbose for details!\n(Hint: ${e.message})`);
|
|
269
273
|
if (this.options.verbose) {
|
|
270
274
|
console.error(e);
|
|
271
275
|
}
|
|
@@ -283,7 +287,9 @@ export default class extends Generator {
|
|
|
283
287
|
});
|
|
284
288
|
commitSHA = reqBranch.data.commit.sha;
|
|
285
289
|
} catch (ex) {
|
|
286
|
-
console.error(
|
|
290
|
+
console.error(
|
|
291
|
+
chalk.red(`Failed to retrieve the branch "${generator.branch}" for repository "${generator.name}" for "${generator.org}" organization! Run with --verbose for details!\n(Hint: ${e.message})`)
|
|
292
|
+
);
|
|
287
293
|
if (this.options.verbose) {
|
|
288
294
|
console.error(chalk.red(ex.message));
|
|
289
295
|
}
|
|
@@ -405,6 +411,13 @@ export default class extends Generator {
|
|
|
405
411
|
// define the options for the Octokit API
|
|
406
412
|
const octokitOptions = {
|
|
407
413
|
userAgent: `${this.rootGeneratorName()}:${this.rootGeneratorVersion()}`,
|
|
414
|
+
request: {
|
|
415
|
+
fetch: (_url, _options) => {
|
|
416
|
+
return nodeFetch(_url, {
|
|
417
|
+
..._options,
|
|
418
|
+
});
|
|
419
|
+
},
|
|
420
|
+
},
|
|
408
421
|
auth: this.options.ghAuthToken,
|
|
409
422
|
baseUrl: this.options.ghBaseUrl,
|
|
410
423
|
throttle: {
|
|
@@ -555,7 +568,7 @@ export default class extends Generator {
|
|
|
555
568
|
};
|
|
556
569
|
});
|
|
557
570
|
} catch (e) {
|
|
558
|
-
console.error(
|
|
571
|
+
console.error(`Failed to connect to bestofui5.org to retrieve all available generators! Run with --verbose for details!\n(Hint: ${e.message})`);
|
|
559
572
|
if (this.options.verbose) {
|
|
560
573
|
console.error(e);
|
|
561
574
|
}
|
|
@@ -566,7 +579,7 @@ export default class extends Generator {
|
|
|
566
579
|
try {
|
|
567
580
|
availGenerators = await listGeneratorsForOrg(this.options.ghOrg, this.options.subGeneratorPrefix, this.options.ghThreshold);
|
|
568
581
|
} catch (e) {
|
|
569
|
-
console.error(`Failed to connect to GitHub to retrieve all available generators for "${this.options.ghOrg}" organization! Run with --verbose for details
|
|
582
|
+
console.error(`Failed to connect to GitHub to retrieve all available generators for "${this.options.ghOrg}" organization! Run with --verbose for details!\n(Hint: ${e.message})`);
|
|
570
583
|
if (this.options.verbose) {
|
|
571
584
|
console.error(e);
|
|
572
585
|
}
|
|
@@ -585,7 +598,7 @@ export default class extends Generator {
|
|
|
585
598
|
try {
|
|
586
599
|
availGenerators = availGenerators.concat(await listGeneratorsForUser(this.options.addGhOrg, this.options.addSubGeneratorPrefix, this.options.ghThreshold));
|
|
587
600
|
} catch (e1) {
|
|
588
|
-
console.error(`Failed to connect to GitHub to retrieve additional generators for organization or user "${this.options.addGhOrg}"! Run with --verbose for details
|
|
601
|
+
console.error(`Failed to connect to GitHub to retrieve additional generators for organization or user "${this.options.addGhOrg}"! Run with --verbose for details!\n(Hint: ${e.message})`);
|
|
589
602
|
if (this.options.verbose) {
|
|
590
603
|
console.error(e1);
|
|
591
604
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-easy-ui5",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"description": "Generator for UI5-based project",
|
|
5
5
|
"main": "generators/app/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"plugins"
|
|
10
10
|
],
|
|
11
11
|
"engines": {
|
|
12
|
-
"node": ">=
|
|
12
|
+
"node": ">=20"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
|
-
"prepublishOnly": "npx yo@
|
|
15
|
+
"prepublishOnly": "npx yo@5.1.0 ./generators/app/index.js project --embed",
|
|
16
16
|
"start": "yo easy-ui5 project",
|
|
17
17
|
"test": "mocha",
|
|
18
18
|
"test:subgen:list": "yo easy-ui5 project --list",
|
|
@@ -48,16 +48,17 @@
|
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://github.com/SAP/generator-easy-ui5#readme",
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@octokit/plugin-throttling": "^
|
|
52
|
-
"@octokit/rest": "^
|
|
53
|
-
"adm-zip": "^0.5.
|
|
54
|
-
"chalk": "^5.
|
|
51
|
+
"@octokit/plugin-throttling": "^11.0.1",
|
|
52
|
+
"@octokit/rest": "^22.0.0",
|
|
53
|
+
"adm-zip": "^0.5.16",
|
|
54
|
+
"chalk": "^5.4.1",
|
|
55
55
|
"colors": "^1.4.0",
|
|
56
|
-
"glob": "^
|
|
56
|
+
"glob": "^11.0.3",
|
|
57
57
|
"libnpmconfig": "^1.2.1",
|
|
58
|
+
"node-fetch": "^3.3.2",
|
|
58
59
|
"rimraf": "^5.0.5",
|
|
59
|
-
"yeoman-environment": "^
|
|
60
|
-
"yeoman-generator": "^5.
|
|
60
|
+
"yeoman-environment": "^4.4.3",
|
|
61
|
+
"yeoman-generator": "^7.5.1",
|
|
61
62
|
"yosay": "^2.0.2"
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
"conventional-changelog-cli": "^4.1.0",
|
|
67
68
|
"cz-conventional-changelog": "^3.3.0",
|
|
68
69
|
"eslint": "^8.54.0",
|
|
70
|
+
"fs-extra": "^11.3.0",
|
|
69
71
|
"husky": "^8.0.3",
|
|
70
72
|
"lint-staged": "^15.1.0",
|
|
71
73
|
"mocha": "^10.2.0",
|
|
@@ -73,7 +75,7 @@
|
|
|
73
75
|
"prettier": "^2.8.8",
|
|
74
76
|
"pretty-quick": "^3.1.3",
|
|
75
77
|
"yeoman-assert": "^3.1.1",
|
|
76
|
-
"yeoman-test": "^
|
|
78
|
+
"yeoman-test": "^10.1.1"
|
|
77
79
|
},
|
|
78
80
|
"config": {
|
|
79
81
|
"commitizen": {
|
|
Binary file
|