|
1 | 1 | # Code Crispies - Interactive CSS Learning Platform |
2 | 2 |
|
3 | | -.PHONY: help dev build test test-watch test-coverage format clean install deploy |
| 3 | +.PHONY: help dev build test test-watch test-coverage format clean install deploy mirror-public |
4 | 4 |
|
5 | 5 | # Default port |
6 | 6 | PORT = 1234 |
7 | 7 |
|
| 8 | +# Files stripped from github public mirror (libretech-internal) |
| 9 | +SCRUB_PATHS := .wave .gitea DEPLOY.md LESSON_EVALUATION.md compose.yaml Dockerfile .dockerignore supabase-setup.sql flake.nix flake.lock Makefile wave.yaml specs CLAUDE.md .claude |
| 10 | + |
8 | 11 | help: |
9 | 12 | @echo "Code Crispies - Development Commands" |
10 | 13 | @echo "" |
|
21 | 24 | @echo " make format - Format all source files" |
22 | 25 | @echo " make clean - Remove build artifacts" |
23 | 26 | @echo " make install - Install dependencies" |
| 27 | + @echo "" |
| 28 | + @echo "Publishing:" |
| 29 | + @echo " make mirror-public - Strip internal files + force-push to github mirror" |
24 | 30 |
|
25 | 31 | # Development |
26 | 32 | dev: |
@@ -52,3 +58,27 @@ clean: |
52 | 58 | # Install |
53 | 59 | install: |
54 | 60 | npm install |
| 61 | + |
| 62 | +# Mirror to public github with internal files stripped. |
| 63 | +# Run after merging to main on gitea (libretech/cc). |
| 64 | +# Force-pushes to github.com/nextlevelshit/code-crispies main. |
| 65 | +mirror-public: |
| 66 | + @if [ -n "$$(git status --porcelain)" ]; then \ |
| 67 | + echo "ERROR: working tree not clean. Commit or stash first."; exit 1; \ |
| 68 | + fi |
| 69 | + @current=$$(git symbolic-ref --short HEAD); \ |
| 70 | + if [ "$$current" != "main" ]; then \ |
| 71 | + echo "ERROR: must be on main (current: $$current)"; exit 1; \ |
| 72 | + fi |
| 73 | + git fetch origin main |
| 74 | + @if [ "$$(git rev-parse HEAD)" != "$$(git rev-parse origin/main)" ]; then \ |
| 75 | + echo "ERROR: local main not in sync with origin/main"; exit 1; \ |
| 76 | + fi |
| 77 | + git switch -c public-mirror main |
| 78 | + git rm -rf $(SCRUB_PATHS) |
| 79 | + git commit -m "scrub: strip internal infra for public mirror" |
| 80 | + git push --force github public-mirror:main |
| 81 | + git switch main |
| 82 | + git branch -D public-mirror |
| 83 | + @echo "" |
| 84 | + @echo "✓ pushed scrubbed tree to github.com/nextlevelshit/code-crispies main" |
0 commit comments