Skip to content
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

docs(contributing): explain how to import a new project #5168

Merged
merged 3 commits into from
Nov 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ If this guide does not contain what you are looking for and thus prevents you fr
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Reporting an issue](#reporting-an-issue)
- [The code contribution process](#the-code-contribution-process)
- [Commit conventions](#commit-conventions)
Expand Down Expand Up @@ -153,6 +152,20 @@ Here are the main files and folders of the project.
▸ widgets/ << The source of the widgets
```

## Importing existing projects

This monorepo has as goal to be used for all InstantSearch flavors and tools. To do so, we need to import existing projects into this repository. The process is as follows:

1. clone your project into a new clean folder (/tmp/myproject)
2. install [`git-filter-repo`](https://github.com/newren/git-filter-repo)
3. run `git filter-repo --to-subdirectory-filter packages/myproject`
4. add your temporary clone as a remote in the instantsearch repository: `git remote add myproject /tmp/myproject`
5. fetch the remote: `git fetch myproject`
6. check out to a new branch: `git checkout -b feat/import-myproject`
7. merge the remote into the monorepo: `git merge --allow-unrelated-histories myproject/mybranch`
8. make any changes necessary to make the project work in the monorepo and commit those
9. make a pull request and _merge using rebase or merge_ (if you merge using squash the history will be lost)

## Tests

### Unit tests
Expand Down Expand Up @@ -252,4 +265,3 @@ yarn run release
```

The script will ask you a question about the next version. If it's wrong, you can say "No" and specify the version (e.g. "7.0.0-beta.0"). Then, it will open a pull request for that release. When the pull request is merged, CircleCI will publish it to npm with a `--tag beta` argument.