Skip to content

Commit 908e1bb

Browse files
committed
Merge branch 'escape-html-in-comments' into jsdoc-to-markdow
# Conflicts: # internal/documentation/scripts/downloadPackages.sh
2 parents 8d9282a + 5e507a0 commit 908e1bb

File tree

40 files changed

+581
-272
lines changed

40 files changed

+581
-272
lines changed

.release-please-manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"packages/logger": "5.0.0-alpha.0",
3-
"packages/fs": "5.0.0-alpha.0",
4-
"packages/builder": "5.0.0-alpha.0",
5-
"packages/server": "5.0.0-alpha.0",
6-
"packages/project": "5.0.0-alpha.0",
7-
"packages/cli": "5.0.0-alpha.0"
2+
"packages/logger": "5.0.0-alpha.2",
3+
"packages/fs": "5.0.0-alpha.2",
4+
"packages/builder": "5.0.0-alpha.2",
5+
"packages/server": "5.0.0-alpha.2",
6+
"packages/project": "5.0.0-alpha.2",
7+
"packages/cli": "5.0.0-alpha.2"
88
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Note that previous versions (up to v4) are maintained in [dedicated repositories
2626
- [API Reference](https://ui5.github.io/cli/stable/api/)
2727
- [CLI Documentation](https://ui5.github.io/cli/stable/pages/CLI/)
2828
- [Project Configuration](https://ui5.github.io/cli/stable/pages/Configuration/)
29+
- 🎬 [UI5con@SAP 2025 Talk](https://www.youtube.com/live/0D0_M4RDiZY?si=tuOjd8s6S_FUvAaF&t=4948)
2930
- 🎬 [UI5con@SAP 2020 Talk](https://www.youtube.com/watch?v=8IHoVJLKN34)
3031
- 🎬 [UI5con@SAP 2018 Talk](https://www.youtube.com/watch?v=iQ07oe26y_k)
3132
- [Contribution Guidelines](https://github.com/UI5/cli/blob/main/CONTRIBUTING.md)

internal/documentation/scripts/downloadPackages.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ set -euo pipefail
33

44
# Constants
55
readonly UI5_CLI_PACKAGES_VERSION="next"
6-
readonly UI5_CLI_PACKAGES=($(find ../../packages/*/package.json -exec jq -r '.name' {} \;))
6+
UI5_CLI_PACKAGES=()
7+
while IFS= read -r pkg; do
8+
UI5_CLI_PACKAGES+=("$pkg")
9+
done < <(find ../../packages/*/package.json -exec jq -r '.name' {} \;)
710

811
# Directories
9-
readonly SCRIPT_DIR="$(dirname -- "$0")"
12+
SCRIPT_DIR="$(dirname -- "$0")"
13+
readonly SCRIPT_DIR
1014
readonly DOC_ROOT="${SCRIPT_DIR}/.."
1115
readonly TMP_PACKAGES_DIR="./tmp/packages"
1216

@@ -31,8 +35,9 @@ download_packages() {
3135
for package in "${UI5_CLI_PACKAGES[@]}"; do
3236
echo "Downloading and extracting $package..."
3337
npm pack "$package@$UI5_CLI_PACKAGES_VERSION" --workspaces false --quiet --pack-destination "$TMP_PACKAGES_DIR"
34-
local package_file_name="$(extract_package_file_name "$package")"
35-
rm -rf "$TMP_PACKAGES_DIR/${package}"
38+
local package_file_name
39+
package_file_name="$(extract_package_file_name "$package")"
40+
rm -rf "$TMP_PACKAGES_DIR/${package:?}"
3641
mkdir -p "$TMP_PACKAGES_DIR/${package}"
3742
tar -xzf "$TMP_PACKAGES_DIR/${package_file_name}"-*.tgz --strip-components=1 -C "$TMP_PACKAGES_DIR/${package}"
3843
rm "$TMP_PACKAGES_DIR/${package_file_name}"-*.tgz

internal/shrinkwrap-extractor/lib/convertPackageLockToShrinkwrap.js

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ export default async function convertPackageLockToShrinkwrap(workspaceRootDir, t
4848
path: workspaceRootDir,
4949
});
5050
const tree = await arb.loadVirtual();
51-
const cliNode = Array.from(tree.tops).find((node) => node.packageName === targetPackageName);
51+
const tops = Array.from(tree.tops.values());
52+
const cliNode = tops.find((node) => node.packageName === targetPackageName);
5253
if (!cliNode) {
5354
throw new Error(`Target package "${targetPackageName}" not found in workspace`);
5455
}
@@ -70,7 +71,10 @@ export default async function convertPackageLockToShrinkwrap(workspaceRootDir, t
7071
if (extractedPackages[packageLoc]) {
7172
throw new Error(`Duplicate root package entry for "${targetPackageName}"`);
7273
}
73-
} else if (!pkg.resolved) {
74+
} else {
75+
packageLoc = normalizePackageLocation(packageLoc, node, targetPackageName, tree.packageName);
76+
}
77+
if (packageLoc !== "" && !pkg.resolved) {
7478
// For all but the root package, ensure that "resolved" and "integrity" fields are present
7579
// These are always missing for locally linked packages, but sometimes also for others (e.g. if installed
7680
// from local cache)
@@ -100,6 +104,31 @@ export default async function convertPackageLockToShrinkwrap(workspaceRootDir, t
100104
return shrinkwrap;
101105
}
102106

107+
/**
108+
* Normalize package locations from workspace-specific paths to standard npm paths.
109+
* Examples (assuming @ui5/cli is the targetPackageName):
110+
* - packages/cli/node_modules/foo -> node_modules/foo
111+
* - packages/fs/node_modules/bar -> node_modules/@ui5/fs/node_modules/bar
112+
*
113+
* @param {string} location - Package location from arborist
114+
* @param {object} node - Package node from arborist
115+
* @param {string} targetPackageName - Target package name for shrinkwrap file
116+
* @param {string} rootPackageName - Root / workspace package name
117+
* @returns {string} - Normalized location for npm-shrinkwrap.json
118+
*/
119+
function normalizePackageLocation(location, node, targetPackageName, rootPackageName) {
120+
const topPackageName = node.top.packageName;
121+
if (topPackageName === targetPackageName) {
122+
// Remove location for packages within target package (e.g. @ui5/cli)
123+
return location.substring(node.top.location.length + 1);
124+
} else if (topPackageName !== rootPackageName) {
125+
// Add package within node_modules of actual package name (e.g. @ui5/fs)
126+
return `node_modules/${topPackageName}/${location.substring(node.top.location.length + 1)}`;
127+
}
128+
// If it's already within the root workspace package, keep as-is
129+
return location;
130+
}
131+
103132
function collectDependencies(node, relevantPackageLocations) {
104133
if (relevantPackageLocations.has(node.location)) {
105134
// Already processed

0 commit comments

Comments
 (0)