Skip to content

Commit 8c0db8e

Browse files
authored
removed submodules and updated node version in readme (#1075)
1 parent 90265b0 commit 8c0db8e

File tree

1 file changed

+1
-126
lines changed

1 file changed

+1
-126
lines changed

README.md

Lines changed: 1 addition & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Check out all of the components [in action](https://www.mongodb.design/)!
5252

5353
## Developer Setup
5454

55-
1. Node >= 14.0.0 required.
55+
1. Node >= 14.0.0 and Node < 17.0.0 required.
5656

5757
via [homebrew](https://brew.sh/) with `brew install node`
5858

@@ -71,9 +71,6 @@ Check out all of the components [in action](https://www.mongodb.design/)!
7171
# Clone the repository.
7272

7373
# We recommend installing using the SSH address rather than the HTTPS one to make authentication easier for you. To set up SSH authentication with GitHub, see their guide: https://docs.github.com/en/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account
74-
75-
# NOTE: The `--recurse-submodules` option is important here for initializing private submodules. If you forget to do this, you can run `git submodule update --init` from within the repository's root directory to initialize them instead.
76-
$ git clone --recurse-submodules [email protected]:mongodb/leafygreen-ui.git
7774
```
7875

7976
4. Install dependencies and link packages.
@@ -93,128 +90,6 @@ Additionally, pass in the `--watch` flag to rebuild packages on change.
9390

9491
`yarn start`
9592

96-
## Working with Git Submodules
97-
98-
Working with Git Submodules is a bit different. For a comprehensive overview of the git submodules API, see the [official documentation](https://git-scm.com/docs/git-submodule).
99-
100-
Any changes within a submodule will be represented by a change in a pointer to a commit SHA. Running `git status` when a submodule has been updated will look something like this:
101-
102-
```bash
103-
$ git status
104-
Changes not staged for commit:
105-
(use "git add <file>..." to update what will be committed)
106-
(use "git restore <file>..." to discard changes in working directory)
107-
(commit or discard the untracked or modified content in submodules)
108-
modified: privatePackages/mongo-nav (modified content)
109-
```
110-
111-
Diving in further, running `git diff` when a change has been made will look something like this:
112-
113-
```bash
114-
$ git diff
115-
diff --git a/privatePackages/mongo-nav b/privatePackages/mongo-nav
116-
--- a/privatePackages/mongo-nav
117-
+++ b/privatePackages/mongo-nav
118-
@@ -1 +1 @@
119-
-Subproject commit d3414189c57141e7f7193d7ad214b2a91b0a9db5
120-
+Subproject commit d3414189c57141e7f7193d7ad214b2a91b0a9db5-dirty
121-
```
122-
123-
Note the lack of a description of any changes within the module. The only thing that git sees from outside the module is this pointer change.
124-
125-
### Viewing changes/status of a submodule
126-
127-
Viewing what's changed in a submodule is actually very simple.
128-
129-
```bash
130-
# First, navigate to within the submodule within the repository
131-
$ cd ./privatePackages/mongo-nav
132-
133-
# Then, you can run git commands to see the status
134-
$ git status
135-
136-
On branch main
137-
Your branch is up to date with 'origin/main'.
138-
139-
Changes not staged for commit:
140-
(use "git add <file>..." to update what will be committed)
141-
(use "git restore <file>..." to discard changes in working directory)
142-
modified: README.md
143-
144-
no changes added to commit (use "git add" and/or "git commit -a")
145-
```
146-
147-
Note that it's behaving as its own repository. The branch you're on can be changed within the submodule, and doing so can change the pointer to the commit within the overall leafygreen-ui repository.
148-
149-
### Making a change to a submodule
150-
151-
Let's say you're in a branch of the leafygreen-ui-mongo-nav repository.
152-
153-
```bash
154-
# From within the submodule directory
155-
$ git status
156-
157-
On branch my-change
158-
Changes not staged for commit:
159-
(use "git add <file>..." to update what will be committed)
160-
(use "git restore <file>..." to discard changes in working directory)
161-
modified: README.md
162-
163-
no changes added to commit (use "git add" and/or "git commit -a")
164-
165-
$ git add .
166-
$ git commit -m "my change"
167-
$ git status
168-
169-
$ git status
170-
On branch my-change
171-
nothing to commit, working tree clean
172-
173-
# After commiting something, git status shows a clean working tree. So how does this change make it into the repository? Let's see what the parent repository's working tree looks like now.
174-
175-
# Navigate to the main repository's root directory
176-
$ cd ../..
177-
$ git status
178-
On branch PD-1289-private-mongo-nav
179-
Changes not staged for commit:
180-
(use "git add <file>..." to update what will be committed)
181-
(use "git restore <file>..." to discard changes in working directory)
182-
modified: privatePackages/mongo-nav (new commits)
183-
184-
# We now see that git recognizes the submodule has new commits! What does that look like?
185-
$ git diff
186-
187-
diff --git a/privatePackages/mongo-nav b/privatePackages/mongo-nav
188-
index d3414189..cd5f0653 160000
189-
--- a/privatePackages/mongo-nav
190-
+++ b/privatePackages/mongo-nav
191-
@@ -1 +1 @@
192-
-Subproject commit d3414189c57141e7f7193d7ad214b2a91b0a9db5
193-
+Subproject commit cd5f06537309dbc6dcc350154d038087a0e381f8
194-
```
195-
196-
Once the pointer is updated, you can now commit this change in the main repository! Note that when creating a pull request, it's important that the change has already been merged into the `main` branch of the submodule so that the pointer is referencing a commit that's production-ready.
197-
198-
### Getting the latest code for all submodules in the repository
199-
200-
The pointer we were talking about earlier is important also for making sure you're working with the latest! To update a submodule's code to reflect the commit being referenced:
201-
202-
```bash
203-
# For your convenience, we wrapped the recommended update command in a yarn script:
204-
$ yarn submodules:update
205-
206-
# Under the hood, it runs the following command:
207-
$ git submodule update --init --recursive --remote
208-
209-
# The `update` command updates submodules to match what the parent repo expects by cloning missing submodules, fetching missing commits and updating the working tree.
210-
211-
# --init initializes all submodules where "git submodule init" has not been run before updating.
212-
213-
# --recursive makes the update command traverse submodules recursively, bringing submodules of submodules up-to-date. So far, we don't have this case in our repository, so it's not strictly necessary yet.
214-
215-
# --remote makes the update command pull from the remote tracking branch instead of what you have locally.
216-
```
217-
21893
## Development within an Application
21994

22095
To actively develop `leafygreen-ui` components within an application, the following script will link all `leafygreen-ui` components within your application to the local `leafygreen-ui` repository.

0 commit comments

Comments
 (0)