Skip to content

Commit 2998a1d

Browse files
committed
refactor(docsite): split swizzled-components-upgrade into multiple recipes
Allowing to run them separatly
1 parent 47aba1c commit 2998a1d

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

docs/website/Makefile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.PHONY: clean install build serve dev lint format upgrade update-current swizzled-components-upgrade
1+
.PHONY: clean install build serve dev lint format upgrade update-current \
2+
swizzled-components-upgrade swizzled-components-clean reswizzle-components swizzled-components-apply-patches
23

34
package-lock.json:
45
npm install
@@ -56,10 +57,14 @@ update-current:
5657
# Remove the entry for the temporary version in the versions.json file
5758
sed -i '/updated/d' versions.json
5859

59-
swizzled-components-upgrade:
60+
swizzled-components-upgrade: swizzled-components-clean reswizzle-components swizzled-components-apply-patches
61+
62+
swizzled-components-clean:
6063
@echo "\033[1mRemoving swizzled components\033[0m"
6164
rm -rf ./src/theme/Footer ./src/theme/Navbar
65+
@echo
6266

67+
reswizzle-components:
6368
@echo "\033[1mRe-swizzling Docusaurus components\033[0m"
6469
npm run swizzle @docusaurus/theme-classic Footer/Layout -- --eject --typescript
6570
npm run swizzle @docusaurus/theme-classic Footer/LinkItem -- --eject --typescript
@@ -73,6 +78,13 @@ swizzled-components-upgrade:
7378

7479
@echo "\033[1mApplying prettier\033[0m"
7580
prettier --write ./src/theme/Footer ./src/theme/Navbar
81+
@echo
82+
83+
swizzled-components-apply-patches:
84+
@echo "\033[1mTrying to apply custom changes ...\033[33m conflicts must be handled manually\033[0m"
85+
$(MAKE) $(wildcard ./upgrade/*.patch)
7686

77-
@echo "\033[1mTrying to apply custom changes ...\033[0m conflicts must be handled manually"
78-
git apply ./upgrade/*.patch
87+
upgrade/%.patch: src/theme
88+
@echo "git apply --verbose --reject ${@}"
89+
@git apply --verbose --reject $@ || echo "\033[31mPatch '${@}' failed, check '.rej' files\033[0m"
90+
@echo

0 commit comments

Comments
 (0)