Skip to content

Commit 4e32656

Browse files
authored
refactor: Integrate @ui5/cli into the monorepo (#1128)
2 parents b18ba3e + c2567ac commit 4e32656

File tree

114 files changed

+26909
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+26909
-0
lines changed

packages/cli/.chglog/CHANGELOG.tpl.md

Lines changed: 1389 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{ range .Versions }}
2+
{{ range .CommitGroups -}}
3+
### {{ .Title }}
4+
{{ range .Commits -}}
5+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }} [`{{ .Hash.Short }}`]({{ $.Info.RepositoryURL }}/commit/{{ .Hash.Long }})
6+
{{ end }}
7+
{{ end -}}
8+
9+
{{- if .RevertCommits -}}
10+
### Reverts
11+
{{ range .RevertCommits -}}
12+
- {{ .Revert.Header }}
13+
{{ end }}
14+
{{ end -}}
15+
16+
{{- if .NoteGroups -}}
17+
{{ range .NoteGroups -}}
18+
### {{ .Title }}
19+
{{ range .Notes }}
20+
{{ .Body }}
21+
{{ end }}
22+
{{ end -}}
23+
{{ end -}}
24+
25+
{{ if .Tag.Previous }}
26+
### All changes
27+
[`{{ .Tag.Previous.Name }}...{{ .Tag.Name }}`]
28+
{{ end }}
29+
30+
{{ if .Tag.Previous -}}
31+
[`{{ .Tag.Previous.Name }}...{{ .Tag.Name }}`]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
32+
{{ end -}}
33+
{{ end -}}

packages/cli/.chglog/config.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/SAP/ui5-cli
6+
options:
7+
commits:
8+
filters:
9+
Type:
10+
- FEATURE
11+
- FIX
12+
- PERF
13+
- DEPENDENCY
14+
- BREAKING
15+
commit_groups:
16+
title_maps:
17+
FEATURE: Features
18+
FIX: Bug Fixes
19+
PERF: Performance Improvements
20+
DEPENDENCY: Dependency Updates
21+
BREAKING: Breaking Changes
22+
header:
23+
pattern: "^\\[(\\w*)\\]\\s(?:([^\\:]*)\\:\\s)?(.*)$"
24+
pattern_maps:
25+
- Type
26+
- Scope
27+
- Subject
28+
issues:
29+
prefix:
30+
- "#"
31+
notes:
32+
keywords:
33+
- BREAKING CHANGE
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import readline from "node:readline";
2+
import fs from "node:fs";
3+
import {fileURLToPath} from "node:url";
4+
5+
function handleDependencyBump(line) {
6+
line = line.replace("[@ui5](https://github.com/ui5)", "@ui5");
7+
const moduleMatch = line.match(/Bump (@ui5\/[^\s]+).*to ([^ ]+)/);
8+
if (moduleMatch) {
9+
const [, moduleName, moduleVersion] = moduleMatch;
10+
const changelogPath = fileURLToPath(
11+
new URL(`./CHANGELOG.md`, import.meta.resolve(`${moduleName}/package.json`)));
12+
const changelog = fs.readFileSync(changelogPath, {
13+
encoding: "utf8"
14+
});
15+
const sectionRegExp =
16+
new RegExp(`^## \\[v${moduleVersion.replace(".", "\\.")}\\].+\\n((?:.|\\n)+?)(?=^<a )`, "m");
17+
const changelogMatch = changelog.match(sectionRegExp);
18+
if (!changelogMatch) {
19+
throw new Error(`Failed to find relevant changelog for ${moduleName}@${moduleVersion}`);
20+
}
21+
let versionChangelog = changelogMatch[1];
22+
// In case of an empty changelog, we still match the newline with a length of 1
23+
if (versionChangelog.length > 1) {
24+
versionChangelog = versionChangelog.replace(/^### /gm, "#### ");
25+
versionChangelog = versionChangelog.replace(/^./gm, " $&");
26+
const repoUrl = `https://github.com/SAP/${moduleName.replace("@ui5/", "ui5-")}/tree/v${moduleVersion}`;
27+
line += `
28+
- Changes contained in [${moduleName}@${moduleVersion}](${repoUrl}):
29+
30+
${versionChangelog}`;
31+
} else {
32+
// In case of an empty changelog: Only add the required newline
33+
line += "\n";
34+
}
35+
}
36+
return line;
37+
}
38+
39+
function readStdin() {
40+
return new Promise((resolve, reject) => {
41+
const rl = readline.createInterface({
42+
input: process.stdin,
43+
});
44+
45+
let buffer = "";
46+
rl.on("line", (line) => {
47+
try {
48+
if (line.startsWith("- Bump")) {
49+
buffer += `${handleDependencyBump(line)}`;
50+
} else {
51+
buffer += `${line}\n`;
52+
}
53+
} catch (err) {
54+
reject(err);
55+
}
56+
});
57+
58+
rl.on("pause", () => {
59+
resolve(buffer);
60+
});
61+
});
62+
}
63+
64+
readStdin().then((result) => {
65+
process.stdout.write(result); // Don't use console.log since one new line at the end is already enough
66+
});
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
style: github
2+
template: RELEASE.tpl.md
3+
info:
4+
repository_url: https://github.com/SAP/ui5-cli
5+
options:
6+
tag_filter_pattern: '^v[^0123]' # For release notes ignore versions below v4 to that we always compare the _last v4+_ tag with the current release
7+
commits:
8+
filters:
9+
Type:
10+
- FEATURE
11+
- FIX
12+
- PERF
13+
- DEPENDENCY
14+
- BREAKING
15+
commit_groups:
16+
title_maps:
17+
FEATURE: Features
18+
FIX: Bug Fixes
19+
PERF: Performance Improvements
20+
DEPENDENCY: Dependency Updates
21+
BREAKING: Breaking Changes
22+
header:
23+
pattern: "^\\[(\\w*)\\]\\s(?:([^\\:]*)\\:\\s)?(.*)$"
24+
pattern_maps:
25+
- Type
26+
- Scope
27+
- Subject
28+
issues:
29+
prefix:
30+
- "#"
31+
notes:
32+
keywords:
33+
- BREAKING CHANGE

packages/cli/.dockerignore

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
17+
# nyc test coverage
18+
.nyc_output
19+
20+
# CI (Azure Pipelines) xUnit test results
21+
test-results.xml
22+
23+
# IDEs
24+
.vscode/
25+
*.~vsdx
26+
.idea/
27+
28+
# node-waf configuration
29+
.lock-wscript
30+
31+
# Compiled binary addons (http://nodejs.org/api/addons.html)
32+
build/Release
33+
34+
# Dependency directories
35+
node_modules
36+
jspm_packages
37+
38+
# Optional npm cache directory
39+
.npm
40+
41+
# Optional eslint cache
42+
.eslintcache
43+
44+
# Optional REPL history
45+
.node_repl_history
46+
47+
# Output of 'npm pack'
48+
*.tgz
49+
50+
# Yarn Integrity file
51+
.yarn-integrity
52+
53+
# Misc
54+
yarn.lock
55+
.DS_Store
56+
57+
# Don't include private SSH key for deployment via Travis CI
58+
deploy_key
59+
60+
# Custom directories
61+
test/tmp/
62+
jsdocs/

packages/cli/.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# see http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = tab
8+
9+
[*.{css,html,js,cjs,mjs,jsx,ts,tsx,less,txt,json,yml,md}]
10+
trim_trailing_whitespace = true
11+
end_of_line = lf
12+
indent_size = 4
13+
insert_final_newline = true
14+
15+
[*.{yml,yaml}]
16+
indent_style = space
17+
indent_size = 2
18+
19+
[*.md]
20+
trim_trailing_whitespace = false

packages/cli/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 🚨 Issues Have Been Transferred to UI5 CLI Repository
2+
3+
Please create new issues in the UI5 CLI repository: https://github.com/UI5/cli/issues/new/choose
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Report UI5 CLI Issues or Request a Feature
4+
url: https://github.com/UI5/cli/issues/new/choose
5+
about: Please create new issues in the UI5 CLI repository

0 commit comments

Comments
 (0)