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
2
3
3
4
package-lock.json :
4
5
npm install
@@ -56,10 +57,14 @@ update-current:
56
57
# Remove the entry for the temporary version in the versions.json file
57
58
sed -i ' /updated/d' versions.json
58
59
59
- swizzled-components-upgrade :
60
+ swizzled-components-upgrade : swizzled-components-clean reswizzle-components swizzled-components-apply-patches
61
+
62
+ swizzled-components-clean :
60
63
@echo " \033[1mRemoving swizzled components\033[0m"
61
64
rm -rf ./src/theme/Footer ./src/theme/Navbar
65
+ @echo
62
66
67
+ reswizzle-components :
63
68
@echo " \033[1mRe-swizzling Docusaurus components\033[0m"
64
69
npm run swizzle @docusaurus/theme-classic Footer/Layout -- --eject --typescript
65
70
npm run swizzle @docusaurus/theme-classic Footer/LinkItem -- --eject --typescript
@@ -73,6 +78,13 @@ swizzled-components-upgrade:
73
78
74
79
@echo "\033[1mApplying prettier\033[0m"
75
80
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)
76
86
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