@ui5/cli 3.0.0-alpha.0 → 3.0.0-alpha.11
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/CHANGELOG.md +102 -1
- package/lib/cli/commands/add.js +4 -4
- package/lib/cli/commands/base.js +9 -5
- package/lib/cli/commands/build.js +61 -61
- package/lib/cli/commands/remove.js +4 -4
- package/lib/cli/commands/serve.js +16 -14
- package/lib/cli/commands/tree.js +80 -45
- package/lib/cli/commands/use.js +4 -4
- package/lib/framework/add.js +27 -20
- package/lib/framework/remove.js +14 -13
- package/lib/framework/updateYaml.js +14 -4
- package/lib/framework/use.js +10 -12
- package/lib/framework/utils.js +14 -10
- package/npm-shrinkwrap.json +6037 -846
- package/package.json +18 -17
- package/lib/utils/buildHelper.js +0 -216
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,97 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.11...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v3.0.0-alpha.11"></a>
|
|
8
|
+
## [v3.0.0-alpha.11] - 2022-07-27
|
|
9
|
+
### Dependency Updates
|
|
10
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.6 to 3.0.0-alpha.7 [`cac5ae4`](https://github.com/SAP/ui5-cli/commit/cac5ae40a4dbb879e6cd982776ace26340ee8f60)
|
|
11
|
+
- Bump [@ui5](https://github.com/ui5)/server from 3.0.0-alpha.2 to 3.0.0-alpha.3 [`95fd053`](https://github.com/SAP/ui5-cli/commit/95fd0538f7ad23be18a7dd10cc49b37af554eb65)
|
|
12
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.8 to 3.0.0-alpha.9 [`4363588`](https://github.com/SAP/ui5-cli/commit/4363588b138812797ed8c53c18771284b1c38b7a)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<a name="v3.0.0-alpha.10"></a>
|
|
16
|
+
## [v3.0.0-alpha.10] - 2022-07-26
|
|
17
|
+
### Dependency Updates
|
|
18
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.4 to 3.0.0-alpha.5 [`8d43873`](https://github.com/SAP/ui5-cli/commit/8d438736375debb54853b61b01696e6fbf3cbbc2)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
<a name="v3.0.0-alpha.9"></a>
|
|
22
|
+
## [v3.0.0-alpha.9] - 2022-07-15
|
|
23
|
+
### Dependency Updates
|
|
24
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.8 to 3.0.0-alpha.8 [`fa048a3`](https://github.com/SAP/ui5-cli/commit/fa048a3ea063374d886724e582a5162a9f450a83)
|
|
25
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.3 to 3.0.0-alpha.4 [`a1aa75a`](https://github.com/SAP/ui5-cli/commit/a1aa75a4d79770d265822ef136390cc38898d4bd)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
<a name="v3.0.0-alpha.8"></a>
|
|
29
|
+
## [v3.0.0-alpha.8] - 2022-06-14
|
|
30
|
+
### Breaking Changes
|
|
31
|
+
- Adapt to Project Graph APIs ([#413](https://github.com/SAP/ui5-cli/issues/413)) [`945b82b`](https://github.com/SAP/ui5-cli/commit/945b82bc775dc0a711529057908e9f36d8fadb62)
|
|
32
|
+
|
|
33
|
+
### Dependency Updates
|
|
34
|
+
- Bump [@ui5](https://github.com/ui5)/server from 3.0.0-alpha.1 to 3.0.0-alpha.2 [`5b959b3`](https://github.com/SAP/ui5-cli/commit/5b959b3903b93b0c7c693f2785d26532c8e78d53)
|
|
35
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.2 to 3.0.0-alpha.3 [`780b1c1`](https://github.com/SAP/ui5-cli/commit/780b1c17b9a6b23397b74ef52fbe707aabf21edb)
|
|
36
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.6 to 3.0.0-alpha.7 [`37a7062`](https://github.com/SAP/ui5-cli/commit/37a7062521e08085560ea96a27d15e5f4c5d5574)
|
|
37
|
+
- Bump [@ui5](https://github.com/ui5)/fs from 3.0.0-alpha.3 to 3.0.0-alpha.4 [`ae07607`](https://github.com/SAP/ui5-cli/commit/ae076071ccf4dd9d6a58933d7d6aa0a1fdb9d283)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<a name="v3.0.0-alpha.7"></a>
|
|
41
|
+
## [v3.0.0-alpha.7] - 2022-04-26
|
|
42
|
+
### Dependency Updates
|
|
43
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.1 to 3.0.0-alpha.2 [`aac8f7f`](https://github.com/SAP/ui5-cli/commit/aac8f7f5f204660010c42ed428542e01a988d5c6)
|
|
44
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.5 to 3.0.0-alpha.6 [`027e4df`](https://github.com/SAP/ui5-cli/commit/027e4dfba2bbbb9bcf209d82d85ecff7a2acb6a9)
|
|
45
|
+
- Bump [@ui5](https://github.com/ui5)/fs from 3.0.0-alpha.2 to 3.0.0-alpha.3 [`1f43c4e`](https://github.com/SAP/ui5-cli/commit/1f43c4ed2699e66b0d6c50ca3738a6f61c060734)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
<a name="v3.0.0-alpha.6"></a>
|
|
49
|
+
## [v3.0.0-alpha.6] - 2022-04-14
|
|
50
|
+
### Dependency Updates
|
|
51
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.4 to 3.0.0-alpha.5 [`87c4136`](https://github.com/SAP/ui5-cli/commit/87c413627696365eb94de9fccdd7798a05543933)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
<a name="v3.0.0-alpha.5"></a>
|
|
55
|
+
## [v3.0.0-alpha.5] - 2022-04-05
|
|
56
|
+
### Dependency Updates
|
|
57
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.3 to 3.0.0-alpha.4 [`91d3bbd`](https://github.com/SAP/ui5-cli/commit/91d3bbdd01ec1cc80f21094434fa0f7da37ca242)
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
- Add build flag "--experimental-css-variables" ([#501](https://github.com/SAP/ui5-cli/issues/501)) [`0b099db`](https://github.com/SAP/ui5-cli/commit/0b099db193ee94aa0bde8373e883fbc54098cd89)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<a name="v3.0.0-alpha.4"></a>
|
|
64
|
+
## [v3.0.0-alpha.4] - 2022-03-10
|
|
65
|
+
### Dependency Updates
|
|
66
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.2 to 3.0.0-alpha.3 [`7f836aa`](https://github.com/SAP/ui5-cli/commit/7f836aad558b16eaf05dde2c2a5aa409b1ba7111)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
<a name="v3.0.0-alpha.3"></a>
|
|
70
|
+
## [v3.0.0-alpha.3] - 2022-02-25
|
|
71
|
+
### Dependency Updates
|
|
72
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.1 to 3.0.0-alpha.2 [`617f0f0`](https://github.com/SAP/ui5-cli/commit/617f0f06b29e81f384186c88c07da85be55d2970)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
<a name="v3.0.0-alpha.2"></a>
|
|
76
|
+
## [v3.0.0-alpha.2] - 2022-01-31
|
|
77
|
+
|
|
78
|
+
<a name="v3.0.0-alpha.1"></a>
|
|
79
|
+
## [v3.0.0-alpha.1] - 2022-01-25
|
|
80
|
+
### Breaking Changes
|
|
81
|
+
- Require Node.js >= 16.13.2 / npm >= 8 [`71a2696`](https://github.com/SAP/ui5-cli/commit/71a2696ecc056ccfa695bd560d59bb31c7dbeb65)
|
|
82
|
+
|
|
83
|
+
### Dependency Updates
|
|
84
|
+
- Bump [@ui5](https://github.com/ui5)/project from 3.0.0-alpha.0 to 3.0.0-alpha.1 [`23601ce`](https://github.com/SAP/ui5-cli/commit/23601ce6330f5427960ae40316a8569e641cdf55)
|
|
85
|
+
- Bump [@ui5](https://github.com/ui5)/server from 3.0.0-alpha.0 to 3.0.0-alpha.1 [`61a8714`](https://github.com/SAP/ui5-cli/commit/61a8714a55cb18ba384feee50ddd52f91810f4d0)
|
|
86
|
+
- Bump [@ui5](https://github.com/ui5)/builder from 3.0.0-alpha.0 to 3.0.0-alpha.1 [`e7fcc14`](https://github.com/SAP/ui5-cli/commit/e7fcc14a97d9b89e5b8e958e41e74d0300e45771)
|
|
87
|
+
- Bump [@ui5](https://github.com/ui5)/fs from 3.0.0-alpha.1 to 3.0.0-alpha.2 [`511f3c8`](https://github.com/SAP/ui5-cli/commit/511f3c8044b1f41840c15fcbdca95da5d159d207)
|
|
88
|
+
- Bump [@ui5](https://github.com/ui5)/logger from 3.0.1-alpha.0 to 3.0.1-alpha.1 [`85f5657`](https://github.com/SAP/ui5-cli/commit/85f565781ebe0286ba61601c744c6239e26df6a7)
|
|
89
|
+
- Bump [@ui5](https://github.com/ui5)/fs from 3.0.0-alpha.0 to 3.0.0-alpha.1 [`f629e31`](https://github.com/SAP/ui5-cli/commit/f629e31c22ca375ddf4282bafcd38ff45ea5a4bc)
|
|
90
|
+
|
|
91
|
+
### BREAKING CHANGE
|
|
92
|
+
|
|
93
|
+
Support for older Node.js and npm releases has been dropped.
|
|
94
|
+
Only Node.js v16.13.2 and npm v8 or higher are supported.
|
|
95
|
+
|
|
6
96
|
|
|
7
97
|
<a name="v3.0.0-alpha.0"></a>
|
|
8
98
|
## [v3.0.0-alpha.0] - 2021-12-14
|
|
@@ -714,6 +804,17 @@ Only Node.js v10 or higher is supported.
|
|
|
714
804
|
<a name="v0.0.1"></a>
|
|
715
805
|
## v0.0.1 - 2018-06-06
|
|
716
806
|
|
|
807
|
+
[v3.0.0-alpha.11]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.10...v3.0.0-alpha.11
|
|
808
|
+
[v3.0.0-alpha.10]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.9...v3.0.0-alpha.10
|
|
809
|
+
[v3.0.0-alpha.9]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.8...v3.0.0-alpha.9
|
|
810
|
+
[v3.0.0-alpha.8]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.7...v3.0.0-alpha.8
|
|
811
|
+
[v3.0.0-alpha.7]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.6...v3.0.0-alpha.7
|
|
812
|
+
[v3.0.0-alpha.6]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.5...v3.0.0-alpha.6
|
|
813
|
+
[v3.0.0-alpha.5]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.4...v3.0.0-alpha.5
|
|
814
|
+
[v3.0.0-alpha.4]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.3...v3.0.0-alpha.4
|
|
815
|
+
[v3.0.0-alpha.3]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.2...v3.0.0-alpha.3
|
|
816
|
+
[v3.0.0-alpha.2]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.1...v3.0.0-alpha.2
|
|
817
|
+
[v3.0.0-alpha.1]: https://github.com/SAP/ui5-cli/compare/v3.0.0-alpha.0...v3.0.0-alpha.1
|
|
717
818
|
[v3.0.0-alpha.0]: https://github.com/SAP/ui5-cli/compare/v2.14.1...v3.0.0-alpha.0
|
|
718
819
|
[v2.14.1]: https://github.com/SAP/ui5-cli/compare/v2.14.0...v2.14.1
|
|
719
820
|
[v2.14.0]: https://github.com/SAP/ui5-cli/compare/v2.13.0...v2.14.0
|
package/lib/cli/commands/add.js
CHANGED
|
@@ -41,9 +41,9 @@ addCommand.handler = async function(argv) {
|
|
|
41
41
|
throw new Error("Options 'development' and 'optional' cannot be combined");
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const projectGraphOptions = {
|
|
45
|
+
dependencyDefinition: argv.dependencyDefinition,
|
|
46
|
+
config: argv.config
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const libraries = libraryNames.map((name) => {
|
|
@@ -57,7 +57,7 @@ addCommand.handler = async function(argv) {
|
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
const {yamlUpdated} = await require("../../framework/add")({
|
|
60
|
-
|
|
60
|
+
projectGraphOptions,
|
|
61
61
|
libraries
|
|
62
62
|
});
|
|
63
63
|
|
package/lib/cli/commands/base.js
CHANGED
|
@@ -3,13 +3,12 @@ const cli = require("yargs");
|
|
|
3
3
|
cli.usage("Usage: ui5 <command> [options]")
|
|
4
4
|
.demandCommand(1, "Command required! Please have a look at the help documentation above.")
|
|
5
5
|
.option("config", {
|
|
6
|
-
describe: "Path to configuration file",
|
|
6
|
+
describe: "Path to project configuration file in YAML format",
|
|
7
7
|
type: "string"
|
|
8
8
|
})
|
|
9
|
-
.option("
|
|
10
|
-
describe: "
|
|
11
|
-
|
|
12
|
-
default: "npm",
|
|
9
|
+
.option("dependency-definition", {
|
|
10
|
+
describe: "Path to a YAML file containing the project's dependency tree. " +
|
|
11
|
+
"This option will disable resolution of node package dependencies.",
|
|
13
12
|
type: "string"
|
|
14
13
|
})
|
|
15
14
|
.option("verbose", {
|
|
@@ -22,6 +21,11 @@ cli.usage("Usage: ui5 <command> [options]")
|
|
|
22
21
|
default: "info",
|
|
23
22
|
type: "string"
|
|
24
23
|
})
|
|
24
|
+
.option("x-perf", {
|
|
25
|
+
describe: "Outputs performance measurements",
|
|
26
|
+
default: false,
|
|
27
|
+
type: "boolean"
|
|
28
|
+
})
|
|
25
29
|
.showHelpOnFail(true)
|
|
26
30
|
.strict(true)
|
|
27
31
|
.alias("help", "h")
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Build
|
|
2
2
|
|
|
3
3
|
const baseMiddleware = require("../middlewares/base.js");
|
|
4
|
-
const buildHelper = require("../../utils/buildHelper");
|
|
5
4
|
|
|
6
5
|
const build = {
|
|
7
6
|
command: "build",
|
|
@@ -12,11 +11,6 @@ const build = {
|
|
|
12
11
|
|
|
13
12
|
build.builder = function(cli) {
|
|
14
13
|
return cli
|
|
15
|
-
.command("dev", "Dev build: Skips non-essential and time-intensive tasks during build", {
|
|
16
|
-
handler: handleBuild,
|
|
17
|
-
builder: noop,
|
|
18
|
-
middlewares: [baseMiddleware]
|
|
19
|
-
})
|
|
20
14
|
.command("jsdoc", "Build JSDoc resources", {
|
|
21
15
|
handler: handleBuild,
|
|
22
16
|
builder: noop,
|
|
@@ -29,46 +23,46 @@ build.builder = function(cli) {
|
|
|
29
23
|
})
|
|
30
24
|
.command("self-contained",
|
|
31
25
|
"Build project and create self-contained bundle. " +
|
|
32
|
-
"Recommended to be used in conjunction with --
|
|
26
|
+
"Recommended to be used in conjunction with --include-dependencies", {
|
|
33
27
|
handler: handleBuild,
|
|
34
28
|
builder: noop,
|
|
35
29
|
middlewares: [baseMiddleware]
|
|
36
30
|
})
|
|
37
|
-
.option("all", {
|
|
38
|
-
describe: "Include all
|
|
39
|
-
alias: "a",
|
|
31
|
+
.option("include-all-dependencies", {
|
|
32
|
+
describe: "Include all dependencies in the build result",
|
|
33
|
+
alias: ["all", "a"],
|
|
40
34
|
default: false,
|
|
41
35
|
type: "boolean"
|
|
42
36
|
})
|
|
43
37
|
.option("include-dependency", {
|
|
44
|
-
describe: "A list of dependencies to be included
|
|
45
|
-
" an alias for including all dependencies
|
|
38
|
+
describe: "A list of dependencies to be included in the build result. You can use the asterisk '*' as" +
|
|
39
|
+
" an alias for including all dependencies in the build result. The listed dependencies cannot be" +
|
|
46
40
|
" overruled by dependencies defined in 'exclude-dependency'.",
|
|
47
41
|
type: "array"
|
|
48
42
|
})
|
|
49
43
|
.option("include-dependency-regexp", {
|
|
50
|
-
describe: "A list of regular expressions defining dependencies to be included
|
|
44
|
+
describe: "A list of regular expressions defining dependencies to be included in the build result." +
|
|
51
45
|
" This list is prioritized like 'include-dependency'.",
|
|
52
46
|
type: "array"
|
|
53
47
|
})
|
|
54
48
|
.option("include-dependency-tree", {
|
|
55
|
-
describe: "A list of dependencies to be included
|
|
49
|
+
describe: "A list of dependencies to be included in the build result. Transitive dependencies are" +
|
|
56
50
|
" implicitly included and do not need to be part of this list. These dependencies overrule" +
|
|
57
51
|
" the selection of 'exclude-dependency-tree' but can be overruled by 'exclude-dependency'.",
|
|
58
52
|
type: "array"
|
|
59
53
|
})
|
|
60
54
|
.option("exclude-dependency", {
|
|
61
|
-
describe: "A list of dependencies to be excluded from the build
|
|
55
|
+
describe: "A list of dependencies to be excluded from the build result. The listed dependencies can" +
|
|
62
56
|
" be overruled by dependencies defined in 'include-dependency'.",
|
|
63
57
|
type: "array"
|
|
64
58
|
})
|
|
65
59
|
.option("exclude-dependency-regexp", {
|
|
66
|
-
describe: "A list of regular expressions defining dependencies to be excluded from the build
|
|
60
|
+
describe: "A list of regular expressions defining dependencies to be excluded from the build result." +
|
|
67
61
|
" This list is prioritized like 'exclude-dependency'.",
|
|
68
62
|
type: "array"
|
|
69
63
|
})
|
|
70
64
|
.option("exclude-dependency-tree", {
|
|
71
|
-
describe: "A list of dependencies to be excluded from the build
|
|
65
|
+
describe: "A list of dependencies to be excluded from the build result. Transitive dependencies are" +
|
|
72
66
|
" implicitly included and do not need to be part of this list.",
|
|
73
67
|
type: "array"
|
|
74
68
|
})
|
|
@@ -82,25 +76,35 @@ build.builder = function(cli) {
|
|
|
82
76
|
default: false,
|
|
83
77
|
type: "boolean"
|
|
84
78
|
})
|
|
85
|
-
.option("
|
|
86
|
-
describe:
|
|
87
|
-
"
|
|
88
|
-
|
|
89
|
-
type: "
|
|
79
|
+
.option("create-build-manifest", {
|
|
80
|
+
describe: "Store build metadata in a '.ui5' directory in the build destination, " +
|
|
81
|
+
"allowing reuse of the build result in other builds",
|
|
82
|
+
default: false,
|
|
83
|
+
type: "boolean"
|
|
90
84
|
})
|
|
91
85
|
.option("include-task", {
|
|
92
|
-
describe: "A list of
|
|
86
|
+
describe: "A list of tasks to be added to the default execution set. " +
|
|
87
|
+
"This option takes precedence over any excludes.",
|
|
93
88
|
type: "array"
|
|
94
89
|
})
|
|
95
90
|
.option("exclude-task", {
|
|
96
|
-
describe: "A list of
|
|
91
|
+
describe: "A list of tasks to be excluded from the default task execution set",
|
|
97
92
|
type: "array"
|
|
98
93
|
})
|
|
99
94
|
.option("framework-version", {
|
|
100
95
|
describe: "Overrides the framework version defined by the project",
|
|
101
96
|
type: "string"
|
|
102
97
|
})
|
|
98
|
+
.option("experimental-css-variables", {
|
|
99
|
+
describe:
|
|
100
|
+
"Generate CSS variables (css-variables.css, css-variables.source.less)" +
|
|
101
|
+
" and skeleton (library-skeleton(-RTL).css) for all themes",
|
|
102
|
+
default: false,
|
|
103
|
+
type: "boolean"
|
|
104
|
+
})
|
|
103
105
|
.example("ui5 build", "Preload build for project without dependencies")
|
|
106
|
+
|
|
107
|
+
// TODO 3.0: Update examples
|
|
104
108
|
.example("ui5 build self-contained --all", "Self-contained build for project including dependencies")
|
|
105
109
|
.example("ui5 build --all --exclude-task=* --include-task=createDebugFiles generateAppPreload",
|
|
106
110
|
"Build project and dependencies but only apply the createDebugFiles- and generateAppPreload tasks")
|
|
@@ -111,58 +115,54 @@ build.builder = function(cli) {
|
|
|
111
115
|
"Build project and dependencies in dev mode, except \"sap.ui.core\" and \"sap.m\" " +
|
|
112
116
|
"(useful in combination with --include-task)")
|
|
113
117
|
.example("ui5 build dev",
|
|
114
|
-
"Build project and dependencies in dev mode. Only a set of essential tasks is executed.")
|
|
118
|
+
"Build project and dependencies in dev mode. Only a set of essential tasks is executed.")
|
|
119
|
+
.example("ui5 build --experimental-css-variables",
|
|
120
|
+
"Preload build for project without dependencies but with CSS variable artifacts");
|
|
115
121
|
};
|
|
116
122
|
|
|
117
123
|
async function handleBuild(argv) {
|
|
118
|
-
const normalizer = require("@ui5/project").normalizer;
|
|
119
|
-
const builder = require("@ui5/builder").builder;
|
|
120
124
|
const logger = require("@ui5/logger");
|
|
125
|
+
const {generateProjectGraph} = require("@ui5/project");
|
|
121
126
|
|
|
122
127
|
const command = argv._[argv._.length - 1];
|
|
123
128
|
logger.setShowProgress(true);
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
let graph;
|
|
131
|
+
if (argv.dependencyDefinition) {
|
|
132
|
+
graph = await generateProjectGraph.usingStaticFile({
|
|
133
|
+
filePath: argv.dependencyDefinition,
|
|
134
|
+
rootConfigPath: argv.config,
|
|
135
|
+
versionOverride: argv.frameworkVersion
|
|
136
|
+
});
|
|
137
|
+
} else {
|
|
138
|
+
graph = await generateProjectGraph.usingNodePackageDependencies({
|
|
139
|
+
rootConfigPath: argv.config,
|
|
132
140
|
versionOverride: argv.frameworkVersion
|
|
133
|
-
};
|
|
141
|
+
});
|
|
134
142
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const {includedDependencies, excludedDependencies} = buildHelper.createDependencyLists({
|
|
140
|
-
tree: tree,
|
|
141
|
-
includeDependency: argv["include-dependency"],
|
|
142
|
-
includeDependencyRegExp: argv["include-dependency-regexp"],
|
|
143
|
-
includeDependencyTree: argv["include-dependency-tree"],
|
|
144
|
-
excludeDependency: argv["exclude-dependency"],
|
|
145
|
-
excludeDependencyRegExp: argv["exclude-dependency-regexp"],
|
|
146
|
-
excludeDependencyTree: argv["exclude-dependency-tree"],
|
|
147
|
-
defaultIncludeDependency: buildSettings.includeDependency,
|
|
148
|
-
defaultIncludeDependencyRegExp: buildSettings.includeDependencyRegExp,
|
|
149
|
-
defaultIncludeDependencyTree: buildSettings.includeDependencyTree
|
|
150
|
-
});
|
|
151
|
-
const buildAll = buildHelper.alignWithBuilderApi(argv.all, includedDependencies, excludedDependencies);
|
|
152
|
-
|
|
153
|
-
await builder.build({
|
|
154
|
-
tree: tree,
|
|
143
|
+
const buildSettings = graph.getRoot().getBuilderSettings() || {};
|
|
144
|
+
await graph.build({
|
|
145
|
+
graph,
|
|
155
146
|
destPath: argv.dest,
|
|
156
147
|
cleanDest: argv["clean-dest"],
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
148
|
+
createBuildManifest: argv["create-build-manifest"],
|
|
149
|
+
complexDependencyIncludes: {
|
|
150
|
+
includeAllDependencies: argv["include-all-dependencies"],
|
|
151
|
+
includeDependency: argv["include-dependency"],
|
|
152
|
+
includeDependencyRegExp: argv["include-dependency-regexp"],
|
|
153
|
+
includeDependencyTree: argv["include-dependency-tree"],
|
|
154
|
+
excludeDependency: argv["exclude-dependency"],
|
|
155
|
+
excludeDependencyRegExp: argv["exclude-dependency-regexp"],
|
|
156
|
+
excludeDependencyTree: argv["exclude-dependency-tree"],
|
|
157
|
+
defaultIncludeDependency: buildSettings.includeDependency,
|
|
158
|
+
defaultIncludeDependencyRegExp: buildSettings.includeDependencyRegExp,
|
|
159
|
+
defaultIncludeDependencyTree: buildSettings.includeDependencyTree
|
|
160
|
+
},
|
|
161
161
|
selfContained: command === "self-contained",
|
|
162
162
|
jsdoc: command === "jsdoc",
|
|
163
|
-
devExcludeProject: argv["dev-exclude-project"],
|
|
164
163
|
includedTasks: argv["include-task"],
|
|
165
|
-
excludedTasks: argv["exclude-task"]
|
|
164
|
+
excludedTasks: argv["exclude-task"],
|
|
165
|
+
cssVariables: argv["experimental-css-variables"]
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -27,9 +27,9 @@ removeCommand.handler = async function(argv) {
|
|
|
27
27
|
return libraryNames.indexOf(libraryName) === index;
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const projectGraphOptions = {
|
|
31
|
+
dependencyDefinition: argv.dependencyDefinition,
|
|
32
|
+
config: argv.config
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const libraries = libraryNames.map((name) => {
|
|
@@ -38,7 +38,7 @@ removeCommand.handler = async function(argv) {
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
const {yamlUpdated} = await require("../../framework/remove")({
|
|
41
|
-
|
|
41
|
+
projectGraphOptions,
|
|
42
42
|
libraries
|
|
43
43
|
});
|
|
44
44
|
|
|
@@ -73,30 +73,32 @@ serve.builder = function(cli) {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
serve.handler = async function(argv) {
|
|
76
|
-
const
|
|
76
|
+
const {generateProjectGraph} = require("@ui5/project");
|
|
77
77
|
const ui5Server = require("@ui5/server");
|
|
78
78
|
const server = ui5Server.server;
|
|
79
79
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
let graph;
|
|
81
|
+
if (argv.dependencyDefinition) {
|
|
82
|
+
graph = await generateProjectGraph.usingStaticFile({
|
|
83
|
+
filePath: argv.dependencyDefinition,
|
|
84
|
+
versionOverride: argv.frameworkVersion
|
|
85
|
+
});
|
|
86
|
+
} else {
|
|
87
|
+
graph = await generateProjectGraph.usingNodePackageDependencies({
|
|
88
|
+
rootConfigPath: argv.config,
|
|
87
89
|
versionOverride: argv.frameworkVersion
|
|
88
|
-
};
|
|
90
|
+
});
|
|
89
91
|
}
|
|
90
92
|
|
|
91
|
-
const tree = await normalizer.generateProjectTree(normalizerOptions);
|
|
92
93
|
let port = argv.port;
|
|
93
94
|
let changePortIfInUse = false;
|
|
94
95
|
|
|
95
|
-
if (!port &&
|
|
96
|
+
if (!port && graph.getRoot().getServerSettings()) {
|
|
97
|
+
const serverSettings = graph.getRoot().getServerSettings();
|
|
96
98
|
if (argv.h2) {
|
|
97
|
-
port =
|
|
99
|
+
port = serverSettings.httpsPort;
|
|
98
100
|
} else {
|
|
99
|
-
port =
|
|
101
|
+
port = serverSettings.httpPort;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
@@ -127,7 +129,7 @@ serve.handler = async function(argv) {
|
|
|
127
129
|
serverConfig.cert = cert;
|
|
128
130
|
}
|
|
129
131
|
|
|
130
|
-
const {h2, port: actualPort} = await server.serve(
|
|
132
|
+
const {h2, port: actualPort} = await server.serve(graph, serverConfig);
|
|
131
133
|
|
|
132
134
|
const protocol = h2 ? "https" : "http";
|
|
133
135
|
let browserUrl = protocol + "://localhost:" + actualPort;
|
package/lib/cli/commands/tree.js
CHANGED
|
@@ -9,63 +9,98 @@ const tree = {
|
|
|
9
9
|
|
|
10
10
|
tree.builder = function(cli) {
|
|
11
11
|
return cli
|
|
12
|
-
.option("full", {
|
|
13
|
-
describe: "Include more information (currently the project configuration)",
|
|
14
|
-
default: false,
|
|
15
|
-
type: "boolean"
|
|
16
|
-
})
|
|
17
|
-
.option("json", {
|
|
18
|
-
describe: "Output tree as formatted JSON string",
|
|
19
|
-
default: false,
|
|
20
|
-
type: "boolean"
|
|
21
|
-
})
|
|
22
|
-
.option("dedupe", {
|
|
23
|
-
describe: "Remove duplicate projects from project tree",
|
|
24
|
-
default: false,
|
|
25
|
-
type: "boolean"
|
|
26
|
-
})
|
|
27
12
|
.option("framework-version", {
|
|
28
13
|
describe:
|
|
29
|
-
"Overrides the framework version defined by the project
|
|
14
|
+
"Overrides the framework version defined by the project",
|
|
30
15
|
type: "string"
|
|
31
|
-
})
|
|
32
|
-
if (argv.frameworkVersion && !argv.full) {
|
|
33
|
-
throw new Error(`"framework-version" can only be used in combination with option "--full"`);
|
|
34
|
-
} else {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
.example("ui5 tree > tree.txt", "Pipes the dependency tree into a new file \"tree.txt\"")
|
|
39
|
-
.example("ui5 tree --json > tree.json", "Pipes the dependency tree into a new file \"tree.json\"");
|
|
16
|
+
});
|
|
40
17
|
};
|
|
41
18
|
|
|
42
19
|
tree.handler = async function(argv) {
|
|
43
|
-
const
|
|
44
|
-
const treeify = require("treeify");
|
|
45
|
-
|
|
46
|
-
const options = {
|
|
47
|
-
translatorName: argv.translator,
|
|
48
|
-
translatorOptions: {
|
|
49
|
-
includeDeduped: !argv.dedupe
|
|
50
|
-
},
|
|
51
|
-
configPath: argv.config
|
|
52
|
-
};
|
|
20
|
+
const chalk = require("chalk");
|
|
53
21
|
|
|
54
|
-
|
|
55
|
-
|
|
22
|
+
let startTime;
|
|
23
|
+
let elapsedTime;
|
|
24
|
+
if (argv.xPerf) {
|
|
25
|
+
startTime = process.hrtime();
|
|
26
|
+
}
|
|
27
|
+
const {generateProjectGraph} = require("@ui5/project");
|
|
28
|
+
let graph;
|
|
29
|
+
if (argv.dependencyDefinition) {
|
|
30
|
+
graph = await generateProjectGraph.usingStaticFile({
|
|
31
|
+
filePath: argv.dependencyDefinition,
|
|
56
32
|
versionOverride: argv.frameworkVersion
|
|
57
|
-
};
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
graph = await generateProjectGraph.usingNodePackageDependencies({
|
|
36
|
+
rootConfigPath: argv.config,
|
|
37
|
+
versionOverride: argv.frameworkVersion
|
|
38
|
+
});
|
|
58
39
|
}
|
|
59
40
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
projectTree = await normalizer.generateProjectTree(options);
|
|
63
|
-
} else {
|
|
64
|
-
projectTree = await normalizer.generateDependencyTree(options);
|
|
41
|
+
if (argv.xPerf) {
|
|
42
|
+
elapsedTime = getElapsedTime(startTime);
|
|
65
43
|
}
|
|
66
44
|
|
|
67
|
-
const
|
|
68
|
-
|
|
45
|
+
const projects = {};
|
|
46
|
+
const indentWidth = 4;
|
|
47
|
+
await graph.traverseBreadthFirst(async ({project, getDependencies}) => {
|
|
48
|
+
const deps = getDependencies().map((dep) => {
|
|
49
|
+
return dep.getName();
|
|
50
|
+
});
|
|
51
|
+
projects[project.getName()] = {
|
|
52
|
+
render: function(indentation, connectorIndices, lastChild) {
|
|
53
|
+
let baseString = " ".repeat(indentation * indentWidth);
|
|
54
|
+
connectorIndices.forEach((idx) => {
|
|
55
|
+
baseString = `${baseString.slice(0, idx)}│${baseString.slice(idx + 1)}`;
|
|
56
|
+
});
|
|
57
|
+
const connectorString = lastChild ? "╰─" : "├─";
|
|
58
|
+
console.log(
|
|
59
|
+
`${baseString}${connectorString} ${chalk.bold(project.getName())} ` +
|
|
60
|
+
`${project.getNamespace ? chalk.inverse(project.getNamespace()) + " " : ""}` +
|
|
61
|
+
chalk.dim(`(${project.getVersion()}, ${project.getType()}) `) +
|
|
62
|
+
chalk.dim.italic(`${project.getPath()}`)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const lastIdx = deps.length -1;
|
|
66
|
+
const newConnectorIndices = [...connectorIndices];
|
|
67
|
+
if (!lastChild) {
|
|
68
|
+
newConnectorIndices.push(indentation * indentWidth);
|
|
69
|
+
}
|
|
70
|
+
deps.forEach((dep, i) => {
|
|
71
|
+
projects[dep].render(indentation + 1, newConnectorIndices, i === lastIdx);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const projectKeys = Object.keys(projects);
|
|
78
|
+
console.log(chalk.bold.underline(`Dependencies (${projectKeys.length}):`));
|
|
79
|
+
projects[projectKeys[0]].render(0, [], true);
|
|
80
|
+
console.log("");
|
|
81
|
+
|
|
82
|
+
const extensions = graph.getAllExtensions();
|
|
83
|
+
console.log(chalk.bold.underline(`Extensions (${extensions.length}):`));
|
|
84
|
+
if (extensions.length) {
|
|
85
|
+
extensions.forEach((extension) => {
|
|
86
|
+
console.log(
|
|
87
|
+
`├─ ${extension.getName()} ` +
|
|
88
|
+
chalk.dim(`(${extension.getVersion()}, ${extension.getType()}) `) +
|
|
89
|
+
chalk.dim.italic(`${extension.getPath()}`));
|
|
90
|
+
});
|
|
91
|
+
} else {
|
|
92
|
+
console.log(chalk.italic(`None`));
|
|
93
|
+
}
|
|
94
|
+
if (argv.xPerf) {
|
|
95
|
+
console.log("");
|
|
96
|
+
console.log(chalk.blue(
|
|
97
|
+
`Dependency graph generation took ${chalk.bold(elapsedTime)}`));
|
|
98
|
+
}
|
|
69
99
|
};
|
|
70
100
|
|
|
101
|
+
function getElapsedTime(startTime) {
|
|
102
|
+
const timeDiff = process.hrtime(startTime);
|
|
103
|
+
const prettyHrtime = require("pretty-hrtime");
|
|
104
|
+
return prettyHrtime(timeDiff);
|
|
105
|
+
}
|
|
71
106
|
module.exports = tree;
|
package/lib/cli/commands/use.js
CHANGED
|
@@ -55,13 +55,13 @@ function parseFrameworkInfo(frameworkInfo) {
|
|
|
55
55
|
useCommand.handler = async function(argv) {
|
|
56
56
|
const frameworkOptions = parseFrameworkInfo(argv["framework-info"]);
|
|
57
57
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const projectGraphOptions = {
|
|
59
|
+
dependencyDefinition: argv.dependencyDefinition,
|
|
60
|
+
config: argv.config
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
const {usedFramework, usedVersion, yamlUpdated} = await require("../../framework/use")({
|
|
64
|
-
|
|
64
|
+
projectGraphOptions,
|
|
65
65
|
frameworkOptions
|
|
66
66
|
});
|
|
67
67
|
|