From cff94081c32168cd122c21e556bbdfab1be55c2d Mon Sep 17 00:00:00 2001 From: Haroen Viaene Date: Wed, 23 Nov 2022 12:02:12 +0100 Subject: [PATCH] docs(contributing): explain how to import a new project --- CONTRIBUTING.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c1d65f0fd3..6aba925b5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,7 +11,6 @@ If this guide does not contain what you are looking for and thus prevents you fr - - [Reporting an issue](#reporting-an-issue) - [The code contribution process](#the-code-contribution-process) - [Commit conventions](#commit-conventions) @@ -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 @@ -232,4 +245,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. -