-
Notifications
You must be signed in to change notification settings - Fork 131
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
Convenience command for local package override #731
Comments
Clone from where?
And eventually, it also should bring back changes it made? What is the full workflow? |
From the same location that
Are you referring to upstreaming local modifications?
For example: # Initial project creation and development
spago init
spago install simple-json
spago build
# Decide you wish to add a feature to simple-json
spago dev simple-json
# In second terminal
cd .spago-local/simple-json
# Make whatever changes you need. Could optionally build and run tests for that modified package.
# (first terminal) Rebuild with your edits to the local dependency
spago install # seems necessary to pick-up new local changes
spago build
# Once you're satisfied with your local edits, make a commit and push to your local branch.
# Fork repo on github (or other)
# (in second terminal) Add your branch as a remote
git remote add mine [email protected]:my-user-name/simple-json.git
# Upload your changes as a feature branch
git checkout -b new-feature
git commit -am "Added a feature"
git push mine new-feature
# Make the PR
# Once the new feature is upstreamed, you can delete the `simple-json` entry from `packages.dhall`.
# You can either do this manually, or we could add another convenience function, such as:
spago reset simple-json
# Julia uses the `free` command for this purpose If you create another project where you want to use your customization that still hasn't been merged into upstream yet (or into the package set), you can follow these steps to override https://github.com/purescript/spago/#override-a-package-in-the-package-set-with-a-remote-one.
|
Thinking of adding a command such as
spago dev
that automates many of the steps listed in https://github.com/purescript/spago#override-a-package-in-the-package-set-with-a-local-one . For example,spago dev simple-json
would:simple-json
to a local directory, such as./spago-local
overrides
inpackages.dhall
to point to this local copy.This is inspired by Julia's workflow, which is really nice for lowering the friction of fixing dependencies. They use a global location for all overridden packages (by default, but can be changed), which is convenient if you tend to use the same overrides across projects, but I think a per-project copy would be more appropriate for PS projects.
The text was updated successfully, but these errors were encountered: