-
Notifications
You must be signed in to change notification settings - Fork 381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store epic-stack latest commit hash in the package.json #805
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kentcdodds
approved these changes
Aug 3, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is cool and I'm happy to merge. Thank you for working on it!
Thanks @jacobparis. I'm now using this process to pull the latest changes from epic-stack into my own project: # Clone the repo into a temporary directory and set up a branch for the update
TEMP_DIR=$(mktemp -d)
git clone --single-branch --branch main --depth 1 $(git remote get-url origin) "$TEMP_DIR/epic-stack-update"
cd "$TEMP_DIR/epic-stack-update"
git checkout -b epic-stack-update
# Add epic-stack as a remote and fetch the latest commits fom main branch
git remote add epic-stack [email protected]:epicweb-dev/epic-stack.git
git fetch epic-stack main
# Extract the last synced commit hash from package.json
LAST_SYNC_COMMIT=$(grep -o '"head": "[^"]*' package.json | sed 's/"head": "//')
# Cherry-pick new commits from Epic Stack
git cherry-pick -x --empty=drop ${LAST_SYNC_COMMIT}..epic-stack/main
# --------- Resolve conflicts (if needed) ---------
# NOTE: Epic Stack-specific files (including the `docs` directory) are not
# included in this repository and are safe to delete in case of conflicts.
# 1. Resolve conflicts in affected files
# 2. Stage resolved files: git add <resolved-file>
# 3. Continue: git cherry-pick --continue
# 4. To abort: git cherry-pick --abort
# -------------------------------------------------
# Switch back to main branch
git checkout main
# Merge epic-stack-update (no fast-forward)
git merge epic-stack-update --no-ff -m "chore: merge latest from epic-stack"
# Push merged changes
git push origin main
# Clean up: return to the original directory and remove the temporary one
cd -
rm -rf "$TEMP_DIR"
# Switch to the main branch and pull changes
git checkout main
git pull origin main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new Github Actions workflow that writes the current HEAD commit and the date to the package.json as a version tracking scheme. Epic Stack apps can use this to see when they detached from the original epic stack when trying to follow along with changes.
Anyone who clones the repo or uses
npx create remix --template
ornpx create epic-app
will have that hash automatically,During this setup step, the version action is removed so it won't affect consumers of the stack in an ongoing basis.
Future automated tooling 👀 👀 👀 could use this to apply a series of commits automatically
This only applies during pushes to main/dev, all the extra commits in this PR come from that I was pushing to main directly to test it.