Skip to content

Commit a783f78

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

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

docs/website/Makefile

Lines changed: 13 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 apply-swizzled-components-patches
23

34
package-lock.json:
45
npm install
@@ -56,10 +57,13 @@ 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 apply-swizzled-components-patches
61+
62+
swizzled-components-clean:
6063
@echo "\033[1mRemoving swizzled components\033[0m"
6164
rm -rf ./src/theme/Footer ./src/theme/Navbar
6265

66+
reswizzle-components:
6367
@echo "\033[1mRe-swizzling Docusaurus components\033[0m"
6468
npm run swizzle @docusaurus/theme-classic Footer/Layout -- --eject --typescript
6569
npm run swizzle @docusaurus/theme-classic Footer/LinkItem -- --eject --typescript
@@ -74,5 +78,10 @@ swizzled-components-upgrade:
7478
@echo "\033[1mApplying prettier\033[0m"
7579
prettier --write ./src/theme/Footer ./src/theme/Navbar
7680

77-
@echo "\033[1mTrying to apply custom changes ...\033[0m conflicts must be handled manually"
78-
git apply ./upgrade/*.patch
81+
apply-swizzled-components-patches:
82+
@echo "\033[1mTrying to apply custom changes ...\033[31m conflicts must be handled manually\033[0m"
83+
$(MAKE) $(wildcard ./upgrade/*.patch)
84+
85+
upgrade/%.patch: src/theme
86+
@echo "git apply --verbose --reject ${@}"
87+
@git apply --verbose --reject $@ || echo "\033[31mPatch '${@}' failed, check '.rej' files\033[0m"

0 commit comments

Comments
 (0)