Commit bed2029
authored
chore(shell-bson): split shell BSON logic into separate package (#2537)
This is admittedly a large refactor, but one that I would believe is generally
worth it:
- Moving the BSON print handling out of `service-provider-core` makes sense,
as `service-provider-core` is generally intended to be a library
providing an *interface*, not partial implementations.
- Moving the BSON classes out of `shell-api` is less architecturally important,
but it does provide a little bit of additional encapsulation.
It does, for example, force us to separate mongosh-specific `.help` property
from core BSON constructor logic.
- A number of files in other packages were using `@mongosh/service-provider-core`
only as a convenient way of getting the current `bson` package,
which works but is really more of a hack and there's no good reason
not to just use the `bson` package that the driver team ships
directly.
This is also convenient on a broader basis, though, because it makes
mongosh's BSON constructors generally available for other projects with
similar needs to use. In Compass, we are avoiding this by using a Babel-based
"manual JavaScript evaluator", but not all projects have the same
technical requirements as Compass, and some may prefer the flexibility
of a full-fledged JS execution environment like mongosh does.1 parent 7bdcb31 commit bed2029
File tree
72 files changed
+959
-504
lines changed- packages
- arg-parser
- browser-repl
- src
- components/utils
- iframe-runtime
- browser-runtime-electron
- src
- cli-repl
- src
- e2e-tests/test
- editor
- src
- history
- service-provider-core
- src
- service-provider-node-driver
- shell-api
- src
- test
- shell-bson
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
72 files changed
+959
-504
lines changedLarge diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
| 157 | + | |
157 | 158 | | |
158 | 159 | | |
159 | 160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments