You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-126Lines changed: 1 addition & 126 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Check out all of the components [in action](https://www.mongodb.design/)!
52
52
53
53
## Developer Setup
54
54
55
-
1. Node >= 14.0.0 required.
55
+
1. Node >= 14.0.0 and Node < 17.0.0 required.
56
56
57
57
via [homebrew](https://brew.sh/) with `brew install node`
58
58
@@ -71,9 +71,6 @@ Check out all of the components [in action](https://www.mongodb.design/)!
71
71
# Clone the repository.
72
72
73
73
# 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.
@@ -93,128 +90,6 @@ Additionally, pass in the `--watch` flag to rebuild packages on change.
93
90
94
91
`yarn start`
95
92
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)
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?
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:
# 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
-
218
93
## Development within an Application
219
94
220
95
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