@ui5/cli 3.0.0-alpha.13 → 3.0.0-alpha.15
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 +24 -1
- package/bin/ui5.js +18 -54
- package/jsdoc.json +4 -2
- package/lib/cli/base.js +78 -0
- package/lib/cli/cli.js +64 -0
- package/lib/cli/commands/add.js +5 -3
- package/lib/cli/commands/build.js +6 -8
- package/lib/cli/commands/init.js +11 -11
- package/lib/cli/commands/remove.js +7 -3
- package/lib/cli/commands/serve.js +14 -13
- package/lib/cli/commands/tree.js +11 -10
- package/lib/cli/commands/use.js +6 -3
- package/lib/cli/commands/versions.js +20 -17
- package/lib/cli/middlewares/base.js +4 -4
- package/lib/cli/middlewares/logger.js +5 -6
- package/lib/cli/version.js +7 -9
- package/lib/framework/add.js +5 -4
- package/lib/framework/remove.js +7 -5
- package/lib/framework/updateYaml.js +9 -11
- package/lib/framework/use.js +5 -4
- package/lib/framework/utils.js +34 -29
- package/lib/init/init.js +11 -10
- package/lib/utils/fsHelper.js +4 -12
- package/npm-shrinkwrap.json +1722 -1360
- package/package.json +27 -19
- package/index.js +0 -7
- package/lib/cli/commands/base.js +0 -76
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.15",
|
|
4
4
|
"description": "UI5 Tooling - CLI",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
"bin": {
|
|
20
20
|
"ui5": "./bin/ui5.js"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
23
26
|
"engines": {
|
|
24
27
|
"node": ">= 16.13.2",
|
|
25
28
|
"npm": ">= 8"
|
|
@@ -30,11 +33,11 @@
|
|
|
30
33
|
"lint": "eslint ./",
|
|
31
34
|
"unit": "rimraf test/tmp && ava",
|
|
32
35
|
"unit-verbose": "rimraf test/tmp && cross-env UI5_LOG_LVL=verbose ava --verbose --serial",
|
|
33
|
-
"unit-watch": "
|
|
34
|
-
"unit-nyan": "
|
|
35
|
-
"unit-xunit": "rimraf test/tmp && ava --tap | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
|
|
36
|
+
"unit-watch": "npm run unit -- --watch",
|
|
37
|
+
"unit-nyan": "npm run unit -- --tap | tnyan",
|
|
38
|
+
"unit-xunit": "rimraf test/tmp && ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\" --tap | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
|
|
36
39
|
"unit-inspect": "cross-env UI5_LOG_LVL=verbose ava debug --break",
|
|
37
|
-
"coverage": "nyc
|
|
40
|
+
"coverage": "rimraf test/tmp && nyc ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\"",
|
|
38
41
|
"coverage-xunit": "nyc --reporter=text --reporter=text-summary --reporter=cobertura npm run unit-xunit",
|
|
39
42
|
"jsdoc": "npm run jsdoc-generate && open-cli jsdocs/index.html",
|
|
40
43
|
"jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
|
|
@@ -43,12 +46,11 @@
|
|
|
43
46
|
"version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md && git add CHANGELOG.md",
|
|
44
47
|
"prepublishOnly": "git push --follow-tags",
|
|
45
48
|
"release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version | node .chglog/consolidate-changelogs.js",
|
|
46
|
-
"depcheck": "depcheck --ignores docdash,@ui5/fs,@ui5/builder"
|
|
49
|
+
"depcheck": "depcheck --ignores @ui5/cli,docdash,@istanbuljs/esm-loader-hook,@ui5/fs,@ui5/builder"
|
|
47
50
|
},
|
|
48
51
|
"files": [
|
|
49
52
|
"CHANGELOG.md",
|
|
50
53
|
"CONTRIBUTING.md",
|
|
51
|
-
"index.js",
|
|
52
54
|
"jsdoc.json",
|
|
53
55
|
"npm-shrinkwrap.json",
|
|
54
56
|
"bin/**",
|
|
@@ -60,6 +62,10 @@
|
|
|
60
62
|
"files": [
|
|
61
63
|
"test/bin/**/*.js",
|
|
62
64
|
"test/lib/**/*.js"
|
|
65
|
+
],
|
|
66
|
+
"nodeArguments": [
|
|
67
|
+
"--loader=esmock",
|
|
68
|
+
"--no-warnings"
|
|
63
69
|
]
|
|
64
70
|
},
|
|
65
71
|
"nyc": {
|
|
@@ -74,8 +80,8 @@
|
|
|
74
80
|
"jsdocs/**",
|
|
75
81
|
"coverage/**",
|
|
76
82
|
"test/**",
|
|
77
|
-
".eslintrc.
|
|
78
|
-
"jsdoc-plugin.
|
|
83
|
+
".eslintrc.cjs",
|
|
84
|
+
"jsdoc-plugin.cjs"
|
|
79
85
|
],
|
|
80
86
|
"check-coverage": true,
|
|
81
87
|
"statements": 80,
|
|
@@ -108,11 +114,11 @@
|
|
|
108
114
|
"url": "git@github.com:SAP/ui5-cli.git"
|
|
109
115
|
},
|
|
110
116
|
"dependencies": {
|
|
111
|
-
"@ui5/builder": "^3.0.0-alpha.
|
|
112
|
-
"@ui5/fs": "^3.0.0-alpha.
|
|
113
|
-
"@ui5/logger": "^3.0.1-alpha.
|
|
114
|
-
"@ui5/project": "^3.0.0-alpha.
|
|
115
|
-
"@ui5/server": "^3.0.0-alpha.
|
|
117
|
+
"@ui5/builder": "^3.0.0-alpha.12",
|
|
118
|
+
"@ui5/fs": "^3.0.0-alpha.7",
|
|
119
|
+
"@ui5/logger": "^3.0.1-alpha.3",
|
|
120
|
+
"@ui5/project": "^3.0.0-alpha.10",
|
|
121
|
+
"@ui5/server": "^3.0.0-alpha.4",
|
|
116
122
|
"chalk": "^4.1.2",
|
|
117
123
|
"data-with-position": "^0.5.0",
|
|
118
124
|
"import-local": "^3.1.0",
|
|
@@ -120,21 +126,23 @@
|
|
|
120
126
|
"open": "^7.4.2",
|
|
121
127
|
"pretty-hrtime": "^1.0.3",
|
|
122
128
|
"semver": "^7.3.5",
|
|
123
|
-
"update-notifier": "^
|
|
124
|
-
"yargs": "^
|
|
129
|
+
"update-notifier": "^6.0.2",
|
|
130
|
+
"yargs": "^17.5.1"
|
|
125
131
|
},
|
|
126
132
|
"devDependencies": {
|
|
127
|
-
"
|
|
133
|
+
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
134
|
+
"ava": "^4.3.3",
|
|
128
135
|
"chokidar-cli": "^3.0.0",
|
|
129
136
|
"cross-env": "^7.0.3",
|
|
130
137
|
"depcheck": "^1.4.3",
|
|
131
138
|
"docdash": "^1.2.0",
|
|
132
139
|
"eslint": "^8.7.0",
|
|
133
140
|
"eslint-config-google": "^0.14.0",
|
|
141
|
+
"eslint-plugin-ava": "^13.0.2",
|
|
134
142
|
"eslint-plugin-jsdoc": "^37.6.3",
|
|
143
|
+
"esmock": "^2.0.0",
|
|
135
144
|
"execa": "^5.1.1",
|
|
136
145
|
"jsdoc": "^3.6.7",
|
|
137
|
-
"mock-require": "^3.0.3",
|
|
138
146
|
"nyc": "^15.1.0",
|
|
139
147
|
"open-cli": "^6.0.1",
|
|
140
148
|
"rimraf": "^3.0.2",
|
package/index.js
DELETED
package/lib/cli/commands/base.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const cli = require("yargs");
|
|
2
|
-
|
|
3
|
-
cli.usage("Usage: ui5 <command> [options]")
|
|
4
|
-
.demandCommand(1, "Command required! Please have a look at the help documentation above.")
|
|
5
|
-
.option("config", {
|
|
6
|
-
describe: "Path to project configuration file in YAML format",
|
|
7
|
-
type: "string"
|
|
8
|
-
})
|
|
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.",
|
|
12
|
-
type: "string"
|
|
13
|
-
})
|
|
14
|
-
.option("verbose", {
|
|
15
|
-
describe: "Enable verbose logging.",
|
|
16
|
-
type: "boolean"
|
|
17
|
-
})
|
|
18
|
-
.option("loglevel", {
|
|
19
|
-
alias: "log-level",
|
|
20
|
-
describe: "Set the logging level (error|warn|info|verbose|silly).",
|
|
21
|
-
default: "info",
|
|
22
|
-
type: "string"
|
|
23
|
-
})
|
|
24
|
-
.option("x-perf", {
|
|
25
|
-
describe: "Outputs performance measurements",
|
|
26
|
-
default: false,
|
|
27
|
-
type: "boolean"
|
|
28
|
-
})
|
|
29
|
-
.showHelpOnFail(true)
|
|
30
|
-
.strict(true)
|
|
31
|
-
.alias("help", "h")
|
|
32
|
-
.alias("version", "v")
|
|
33
|
-
.example("ui5 <command> --translator static:/path/to/projectDependencies.yaml",
|
|
34
|
-
"Execute command using a \"static\" translator with translator parameters")
|
|
35
|
-
.example("ui5 <command> --config /path/to/ui5.yaml",
|
|
36
|
-
"Execute command using a project configuration from custom path")
|
|
37
|
-
.fail(function(msg, err, yargs) {
|
|
38
|
-
const chalk = require("chalk");
|
|
39
|
-
if (err) {
|
|
40
|
-
// Exception
|
|
41
|
-
const logger = require("@ui5/logger");
|
|
42
|
-
if (logger.isLevelEnabled("error")) {
|
|
43
|
-
console.log("");
|
|
44
|
-
console.log(chalk.bold.red("⚠️ Process Failed With Error"));
|
|
45
|
-
|
|
46
|
-
console.log("");
|
|
47
|
-
console.log(chalk.underline("Error Message:"));
|
|
48
|
-
console.log(err.message);
|
|
49
|
-
|
|
50
|
-
// Unexpected errors should always be logged with stack trace
|
|
51
|
-
const unexpectedErrors = ["SyntaxError", "ReferenceError", "TypeError"];
|
|
52
|
-
if (unexpectedErrors.includes(err.name) || logger.isLevelEnabled("verbose")) {
|
|
53
|
-
console.log("");
|
|
54
|
-
console.log(chalk.underline("Stack Trace:"));
|
|
55
|
-
console.log(err.stack);
|
|
56
|
-
console.log("");
|
|
57
|
-
console.log(
|
|
58
|
-
chalk.dim(
|
|
59
|
-
`If you think this is an issue of the UI5 Tooling, you might report it using the ` +
|
|
60
|
-
`following URL: `) +
|
|
61
|
-
chalk.dim.bold.underline(`https://github.com/SAP/ui5-tooling/issues/new/choose`));
|
|
62
|
-
} else {
|
|
63
|
-
console.log("");
|
|
64
|
-
console.log(chalk.dim(
|
|
65
|
-
`For details, execute the same command again with an additional '--verbose' parameter`));
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
// Yargs error
|
|
70
|
-
console.log(chalk.bold.yellow("Command Failed:"));
|
|
71
|
-
console.log(`${msg}`);
|
|
72
|
-
console.log("");
|
|
73
|
-
console.log(chalk.dim(`See 'ui5 --help' or 'ui5 build --help' for help`));
|
|
74
|
-
}
|
|
75
|
-
process.exit(1);
|
|
76
|
-
});
|