Skip to content

Commit f6b6fb0

Browse files
Merge pull request #482 from che-incubator/keytar
fix: Allow to build che-code using cachito system
2 parents bdcceb5 + b3ce1db commit f6b6fb0

6 files changed

Lines changed: 52 additions & 6 deletions

File tree

.rebase/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The file to keep a list of changed files which will potentionaly help to resolve rebase conflicts.
44

5+
#### @RomanNikitenko
6+
https://github.com/che-incubator/che-code/pull/482
7+
8+
- code/extensions/microsoft-authentication/package.json
9+
---
10+
511
#### @RomanNikitenko
612
https://github.com/che-incubator/che-code/pull/476
713

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"workspaces": [
3+
"packageMocks/keytar"
4+
]
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"keytar": "workspace:*"
4+
}
5+
}

code/extensions/microsoft-authentication/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

code/extensions/microsoft-authentication/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,14 @@
143143
"@azure/msal-node": "^2.16.2",
144144
"@azure/msal-node-extensions": "^1.5.0",
145145
"@vscode/extension-telemetry": "^0.9.0",
146-
"keytar": "file:./packageMocks/keytar",
146+
"keytar": "workspace:*",
147147
"vscode-tas-client": "^0.1.84"
148148
},
149149
"repository": {
150150
"type": "git",
151151
"url": "https://github.com/microsoft/vscode.git"
152-
}
152+
},
153+
"workspaces": [
154+
"packageMocks/keytar"
155+
]
153156
}

rebase.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,29 @@ apply_code_extensions_package_lock_changes() {
153153
git add code/extensions/package-lock.json > /dev/null 2>&1
154154
}
155155

156+
# Apply changes on code/extensions/microsoft-authentication/package-lock.json file
157+
apply_code_extensions_microsoft_authentication_package_lock_changes() {
158+
159+
echo " ⚙️ reworking code/extensions/microsoft-authentication/package-lock.json..."
160+
161+
conflicted_files=$(git diff --name-only --diff-filter=U)
162+
163+
# Check if code/extensions/microsoft-authentication/package.json is in the list
164+
if echo "$conflicted_files" | grep -q "^code/extensions/microsoft-authentication/package.json$"; then
165+
echo "Conflict for the code/extensions/microsoft-authentication/package.json should be fixed first!"
166+
apply_package_changes_by_path "code/extensions/microsoft-authentication/package.json"
167+
fi
168+
169+
# reset the file from what is upstream
170+
git checkout --ours code/extensions/microsoft-authentication/package-lock.json > /dev/null 2>&1
171+
172+
# update package-lock.json
173+
npm install --ignore-scripts --prefix code/extensions/microsoft-authentication
174+
175+
# resolve the change
176+
git add code/extensions/microsoft-authentication/package-lock.json > /dev/null 2>&1
177+
}
178+
156179
# Apply changes on code/remote/package-lock.json file
157180
apply_code_remote_package_lock_changes() {
158181

@@ -378,6 +401,10 @@ resolve_conflicts() {
378401
apply_code_extensions_package_lock_changes
379402
elif [[ "$conflictingFile" == "code/product.json" ]]; then
380403
apply_code_product_changes
404+
elif [[ "$conflictingFile" == "code/extensions/microsoft-authentication/package.json" ]]; then
405+
apply_package_changes_by_path "$conflictingFile"
406+
elif [[ "$conflictingFile" == "code/extensions/microsoft-authentication/package-lock.json" ]]; then
407+
apply_code_extensions_microsoft_authentication_package_lock_changes
381408
elif [[ "$conflictingFile" == "code/build/lib/mangle/index.js" ]]; then
382409
apply_mangle_index_js_changes
383410
elif [[ "$conflictingFile" == "code/build/lib/mangle/index.ts" ]]; then

0 commit comments

Comments
 (0)