@mongosh/browser-repl 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/.depcheckrc +8 -2
  2. package/config/webpack.config.base.js +46 -61
  3. package/config/webpack.config.test.js +1 -17
  4. package/config/webpack.config.watch.js +27 -0
  5. package/lib/components/ace-autocompleter-adapter.d.ts +15 -0
  6. package/lib/components/ace-autocompleter-adapter.js +26 -0
  7. package/lib/components/ace-autocompleter-adapter.js.map +1 -0
  8. package/lib/components/editor.d.ts +41 -0
  9. package/lib/components/editor.js +140 -0
  10. package/lib/components/editor.js.map +1 -0
  11. package/lib/components/password-prompt.d.ts +12 -0
  12. package/lib/components/password-prompt.js +67 -0
  13. package/lib/components/password-prompt.js.map +1 -0
  14. package/lib/components/shell-input.d.ts +33 -0
  15. package/lib/components/shell-input.js +127 -0
  16. package/lib/components/shell-input.js.map +1 -0
  17. package/lib/components/shell-loader.d.ts +11 -0
  18. package/lib/components/shell-loader.js +42 -0
  19. package/lib/components/shell-loader.js.map +1 -0
  20. package/lib/components/shell-output-line.d.ts +23 -0
  21. package/lib/components/shell-output-line.js +135 -0
  22. package/lib/components/shell-output-line.js.map +1 -0
  23. package/lib/components/shell-output.d.ts +14 -0
  24. package/lib/components/shell-output.js +48 -0
  25. package/lib/components/shell-output.js.map +1 -0
  26. package/lib/components/shell.d.ts +61 -0
  27. package/lib/components/shell.js +283 -0
  28. package/lib/components/shell.js.map +1 -0
  29. package/lib/components/types/cursor-iteration-result-output.d.ts +19 -0
  30. package/lib/components/types/cursor-iteration-result-output.js +57 -0
  31. package/lib/components/types/cursor-iteration-result-output.js.map +1 -0
  32. package/lib/components/types/cursor-output.d.ts +16 -0
  33. package/lib/components/types/cursor-output.js +45 -0
  34. package/lib/components/types/cursor-output.js.map +1 -0
  35. package/lib/components/types/error-output.d.ts +18 -0
  36. package/lib/components/types/error-output.js +92 -0
  37. package/lib/components/types/error-output.js.map +1 -0
  38. package/lib/components/types/help-output.d.ts +25 -0
  39. package/lib/components/types/help-output.js +102 -0
  40. package/lib/components/types/help-output.js.map +1 -0
  41. package/lib/components/types/object-output.d.ts +12 -0
  42. package/lib/components/types/object-output.js +43 -0
  43. package/lib/components/types/object-output.js.map +1 -0
  44. package/lib/components/types/show-banner-result-output.d.ts +15 -0
  45. package/lib/components/types/show-banner-result-output.js +45 -0
  46. package/lib/components/types/show-banner-result-output.js.map +1 -0
  47. package/lib/components/types/show-collections-output.d.ts +17 -0
  48. package/lib/components/types/show-collections-output.js +81 -0
  49. package/lib/components/types/show-collections-output.js.map +1 -0
  50. package/lib/components/types/show-dbs-output.d.ts +17 -0
  51. package/lib/components/types/show-dbs-output.js +54 -0
  52. package/lib/components/types/show-dbs-output.js.map +1 -0
  53. package/lib/components/types/show-profile-output.d.ts +16 -0
  54. package/lib/components/types/show-profile-output.js +67 -0
  55. package/lib/components/types/show-profile-output.js.map +1 -0
  56. package/lib/components/types/simple-type-output.d.ts +14 -0
  57. package/lib/components/types/simple-type-output.js +45 -0
  58. package/lib/components/types/simple-type-output.js.map +1 -0
  59. package/lib/components/types/stats-result-output.d.ts +12 -0
  60. package/lib/components/types/stats-result-output.js +51 -0
  61. package/lib/components/types/stats-result-output.js.map +1 -0
  62. package/lib/components/utils/expandable.d.ts +12 -0
  63. package/lib/components/utils/expandable.js +53 -0
  64. package/lib/components/utils/expandable.js.map +1 -0
  65. package/lib/components/utils/inspect.d.ts +1 -0
  66. package/lib/components/utils/inspect.js +75 -0
  67. package/lib/components/utils/inspect.js.map +1 -0
  68. package/lib/components/utils/line-with-icon.d.ts +14 -0
  69. package/lib/components/utils/line-with-icon.js +59 -0
  70. package/lib/components/utils/line-with-icon.js.map +1 -0
  71. package/lib/components/utils/syntax-highlight.d.ts +12 -0
  72. package/lib/components/utils/syntax-highlight.js +53 -0
  73. package/lib/components/utils/syntax-highlight.js.map +1 -0
  74. package/lib/iframe-runtime/iframe-interpreter-environment.d.ts +7 -0
  75. package/lib/iframe-runtime/iframe-interpreter-environment.js +17 -0
  76. package/lib/iframe-runtime/iframe-interpreter-environment.js.map +1 -0
  77. package/lib/iframe-runtime/iframe-runtime.d.ts +17 -0
  78. package/lib/iframe-runtime/iframe-runtime.js +68 -0
  79. package/lib/iframe-runtime/iframe-runtime.js.map +1 -0
  80. package/lib/iframe-runtime/index.d.ts +1 -0
  81. package/lib/iframe-runtime/index.js +18 -0
  82. package/lib/iframe-runtime/index.js.map +1 -0
  83. package/lib/index.d.ts +2 -0
  84. package/lib/index.js +8 -0
  85. package/lib/index.js.map +1 -0
  86. package/lib/sandbox.d.ts +1 -0
  87. package/lib/sandbox.js +212 -0
  88. package/lib/sandbox.js.map +1 -0
  89. package/package.json +49 -52
  90. package/.babelrc +0 -11
  91. package/.storybook/main.js +0 -4
  92. package/.storybook/webpack.config.js +0 -12
  93. package/config/plain-url.js +0 -1
  94. package/config/webpack.config.prod.js +0 -21
  95. package/config/webpack.config.stats.js +0 -9
  96. package/lib/mongosh-browser-repl.js +0 -1991
  97. package/lib/mongosh-browser-repl.js.map +0 -1
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IframeRuntime = void 0;
4
+ const iframe_interpreter_environment_1 = require("./iframe-interpreter-environment");
5
+ const browser_runtime_core_1 = require("@mongosh/browser-runtime-core");
6
+ class IframeRuntime {
7
+ constructor(serviceProvider) {
8
+ this.openContextRuntime = null;
9
+ this.readyPromise = null;
10
+ this.iframe = null;
11
+ this.container = null;
12
+ this.evaluationListener = null;
13
+ this.serviceProvider = serviceProvider;
14
+ }
15
+ setEvaluationListener(listener) {
16
+ const prev = this.evaluationListener;
17
+ this.evaluationListener = listener;
18
+ if (this.openContextRuntime) {
19
+ this.openContextRuntime.setEvaluationListener(listener);
20
+ }
21
+ return prev;
22
+ }
23
+ async evaluate(code) {
24
+ const runtime = await this.initialize();
25
+ return await runtime.evaluate(code);
26
+ }
27
+ async getCompletions(code) {
28
+ const runtime = await this.initialize();
29
+ return await runtime.getCompletions(code);
30
+ }
31
+ async getShellPrompt() {
32
+ const runtime = await this.initialize();
33
+ return await runtime.getShellPrompt();
34
+ }
35
+ async initialize() {
36
+ if (this.readyPromise !== null) {
37
+ await this.readyPromise;
38
+ return this.openContextRuntime;
39
+ }
40
+ this.container = document.createElement('div');
41
+ this.container.style.display = 'none';
42
+ this.container.insertAdjacentHTML('beforeend', '<iframe src="about:blank" style="display: none" sandbox="allow-same-origin" />');
43
+ const iframe = this.container.firstElementChild;
44
+ this.iframe = iframe;
45
+ this.readyPromise = new Promise((resolve) => {
46
+ iframe.onload = () => resolve();
47
+ });
48
+ document.body.appendChild(this.container);
49
+ const environment = new iframe_interpreter_environment_1.IframeInterpreterEnvironment(iframe.contentWindow);
50
+ this.openContextRuntime = new browser_runtime_core_1.OpenContextRuntime(this.serviceProvider, environment);
51
+ if (this.evaluationListener) {
52
+ this.openContextRuntime.setEvaluationListener(this.evaluationListener);
53
+ }
54
+ return this.initialize();
55
+ }
56
+ async destroy() {
57
+ if (!this.iframe) {
58
+ return;
59
+ }
60
+ const parent = this.iframe.parentNode;
61
+ if (!parent) {
62
+ return;
63
+ }
64
+ parent.removeChild(this.iframe);
65
+ }
66
+ }
67
+ exports.IframeRuntime = IframeRuntime;
68
+ //# sourceMappingURL=iframe-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iframe-runtime.js","sourceRoot":"","sources":["../../src/iframe-runtime/iframe-runtime.ts"],"names":[],"mappings":";;;AAAA,qFAE0C;AAE1C,wEAMuC;AAIvC,MAAa,aAAa;IAQxB,YAAY,eAAgC;QAPpC,uBAAkB,GAA8B,IAAI,CAAC;QACrD,iBAAY,GAAyB,IAAI,CAAC;QAC1C,WAAM,GAA6B,IAAI,CAAC;QACxC,cAAS,GAA0B,IAAI,CAAC;QAExC,uBAAkB,GAAqC,IAAI,CAAC;QAGlE,IAAI,CAAC,eAAe,GAAG,eAAe,CA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AM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,MAAM,CAAC,MAAM,GAAG,GAAS,EAAE,CAAC,OAAO,EAAE,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1C,MAAM,WAAW,GAAG,IAAI,6DAA4B,CAAC,MAAM,CAAC,aAAuB,CAAC,CAAC;QACrF,IAAI,CAAC,kBAAkB,GAAG,IAAI,yCAAkB,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;QACpF,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;SACxE;QAED,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAGD,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO;SACR;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QAEtC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO;SACR;QAED,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF;AAjFD,sCAiFC"}
@@ -0,0 +1 @@
1
+ export * from './iframe-runtime';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./iframe-runtime"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iframe-runtime/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { Shell } from './components/shell';
2
+ export { IframeRuntime } from './iframe-runtime';
package/lib/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IframeRuntime = exports.Shell = void 0;
4
+ var shell_1 = require("./components/shell");
5
+ Object.defineProperty(exports, "Shell", { enumerable: true, get: function () { return shell_1.Shell; } });
6
+ var iframe_runtime_1 = require("./iframe-runtime");
7
+ Object.defineProperty(exports, "IframeRuntime", { enumerable: true, get: function () { return iframe_runtime_1.IframeRuntime; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";;;AAAA,4CAA2C;AAAlC,8FAAA,KAAK,OAAA;AACd,mDAAiD;AAAxC,+GAAA,aAAa,OAAA"}
@@ -0,0 +1 @@
1
+ export {};
package/lib/sandbox.js ADDED
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const react_dom_1 = __importDefault(require("react-dom"));
30
+ const react_1 = __importStar(require("react"));
31
+ const compass_components_1 = require("@mongodb-js/compass-components");
32
+ const iframe_runtime_1 = require("./iframe-runtime");
33
+ const index_1 = require("./index");
34
+ (0, compass_components_1.injectGlobal)({
35
+ body: {
36
+ margin: 0
37
+ },
38
+ '*': {
39
+ boxSizing: 'border-box'
40
+ },
41
+ 'input[type=number]': {
42
+ WebkitAppearance: 'none',
43
+ MozAppearance: 'textfield'
44
+ }
45
+ });
46
+ const sandboxContainer = (0, compass_components_1.css)({
47
+ width: '100vw',
48
+ height: '100vh',
49
+ overflowX: 'hidden',
50
+ overflowY: 'auto',
51
+ maxHeight: '100vh'
52
+ });
53
+ const shellContainer = (0, compass_components_1.css)({
54
+ height: '50vh',
55
+ maxHeight: 320
56
+ });
57
+ const controlsContainer = (0, compass_components_1.css)({
58
+ padding: '24px',
59
+ paddingTop: 0,
60
+ paddingBottom: 0
61
+ });
62
+ const textarea = (0, compass_components_1.css)({
63
+ textarea: {
64
+ resize: 'vertical',
65
+ minHeight: '100px'
66
+ }
67
+ });
68
+ const textInput = (0, compass_components_1.css)({
69
+ minWidth: 250
70
+ });
71
+ const formField = (0, compass_components_1.css)({
72
+ display: 'grid',
73
+ gridTemplateAreas: `
74
+ "label input"
75
+ "description input"
76
+ `,
77
+ gridTemplateColumns: '2fr 1fr',
78
+ columnGap: 16,
79
+ justifyItems: 'start',
80
+ alignItems: 'start',
81
+ '& :nth-child(1)': {
82
+ gridArea: 'label'
83
+ },
84
+ '& :nth-child(2)': {
85
+ gridArea: 'description'
86
+ },
87
+ '& :nth-child(3)': {
88
+ gridArea: 'input',
89
+ justifySelf: 'end'
90
+ }
91
+ });
92
+ const delay = (msecs = 0) => new Promise((resolve) => {
93
+ setTimeout(resolve, msecs);
94
+ });
95
+ class DemoServiceProvider {
96
+ async buildInfo() {
97
+ await delay();
98
+ return {
99
+ version: '4.0.0',
100
+ modules: ['other', 'enterprise']
101
+ };
102
+ }
103
+ async getConnectionInfo() {
104
+ return {
105
+ buildInfo: await this.buildInfo(),
106
+ extraInfo: {
107
+ uri: 'mongodb://localhost/'
108
+ }
109
+ };
110
+ }
111
+ getTopology() {
112
+ return {
113
+ description: {
114
+ type: 'ReplicaSetWithPrimary',
115
+ setName: 'replset'
116
+ }
117
+ };
118
+ }
119
+ async listDatabases() {
120
+ await delay(2000);
121
+ return {
122
+ databases: [
123
+ { name: 'db1', sizeOnDisk: 10000, empty: false },
124
+ { name: 'db2', sizeOnDisk: 20000, empty: false },
125
+ { name: 'db-with-long-name', sizeOnDisk: 30000, empty: false },
126
+ { name: '500mb', sizeOnDisk: 500000000, empty: false }
127
+ ],
128
+ totalSize: 50000,
129
+ ok: 1
130
+ };
131
+ }
132
+ async listCollections() {
133
+ await delay(2000);
134
+ return [
135
+ { name: 'nested_documents', type: 'collection' },
136
+ { name: 'decimal128', type: 'collection' },
137
+ { name: 'coll', type: 'collection' },
138
+ { name: 'people_imported', type: 'timeseries' },
139
+ { name: 'cats', type: 'view' },
140
+ { name: 'system.views', type: '' }
141
+ ];
142
+ }
143
+ async stats() {
144
+ await delay();
145
+ return { size: 1000 };
146
+ }
147
+ }
148
+ const runtime = new iframe_runtime_1.IframeRuntime(new DemoServiceProvider());
149
+ const IframeRuntimeExample = () => {
150
+ const [redactInfo, setRedactInfo] = (0, react_1.useState)(false);
151
+ const [maxOutputLength, setMaxOutputLength] = (0, react_1.useState)(1000);
152
+ const [maxHistoryLength, setMaxHistoryLength] = (0, react_1.useState)(1000);
153
+ const [initialOutput] = (0, react_1.useState)([
154
+ { format: 'output', value: { foo: 1, bar: true, buz: function () { } } }
155
+ ]);
156
+ const [initialHistory, setInitialHistory] = (0, react_1.useState)([
157
+ 'show dbs',
158
+ 'db.coll.stats()',
159
+ '{x: 1, y: {z: 2}, k: [1, 2, 3]}'
160
+ ]);
161
+ (0, react_1.useEffect)(() => {
162
+ void runtime.initialize();
163
+ return () => {
164
+ void runtime.destroy();
165
+ };
166
+ }, []);
167
+ const key = (0, react_1.useMemo)(() => {
168
+ return initialHistory.join('');
169
+ }, [initialHistory]);
170
+ return (react_1.default.createElement("div", { className: sandboxContainer },
171
+ react_1.default.createElement("div", { className: shellContainer },
172
+ react_1.default.createElement(index_1.Shell, { key: key, runtime: runtime, redactInfo: redactInfo, maxOutputLength: maxOutputLength, maxHistoryLength: maxHistoryLength, initialOutput: initialOutput, initialHistory: initialHistory.filter(Boolean) })),
173
+ react_1.default.createElement("div", { className: controlsContainer },
174
+ react_1.default.createElement(compass_components_1.FormFieldContainer, { className: formField },
175
+ react_1.default.createElement(compass_components_1.Label, { id: "redactInfoLabel", htmlFor: "redactInfo" }, "redactInfo"),
176
+ react_1.default.createElement(compass_components_1.Description, null,
177
+ "If set, the shell will omit or redact entries containing sensitive info from history. Defaults to ",
178
+ react_1.default.createElement("code", null, "false"),
179
+ "."),
180
+ react_1.default.createElement(compass_components_1.Toggle, { "aria-labelledby": "redactInfoLabel", id: "redactInfo", size: "small", checked: redactInfo, onChange: setRedactInfo })),
181
+ react_1.default.createElement(compass_components_1.FormFieldContainer, { className: formField },
182
+ react_1.default.createElement(compass_components_1.Label, { id: "maxOutputLengthLabel", htmlFor: "maxOutputLength" }, "maxOutputLength"),
183
+ react_1.default.createElement(compass_components_1.Description, null,
184
+ "The maxiumum number of lines to keep in the output. Defaults to",
185
+ ' ',
186
+ react_1.default.createElement("code", null, "1000"),
187
+ "."),
188
+ react_1.default.createElement(compass_components_1.TextInput, { className: textInput, "aria-labelledby": "maxOutputLengthLabel", type: "number", value: String(maxOutputLength), onChange: (evt) => {
189
+ setMaxOutputLength(Number(evt.currentTarget.value));
190
+ } })),
191
+ react_1.default.createElement(compass_components_1.FormFieldContainer, { className: formField },
192
+ react_1.default.createElement(compass_components_1.Label, { id: "maxHistoryLengthLabel", htmlFor: "maxHistoryLength" }, "maxHistoryLength"),
193
+ react_1.default.createElement(compass_components_1.Description, null,
194
+ "The maxiumum number of lines to keep in the history. Defaults to",
195
+ ' ',
196
+ react_1.default.createElement("code", null, "1000"),
197
+ "."),
198
+ react_1.default.createElement(compass_components_1.TextInput, { className: textInput, "aria-labelledby": "maxHistoryLengthLabel", type: "number", value: String(maxHistoryLength), onChange: (evt) => {
199
+ setMaxHistoryLength(Number(evt.currentTarget.value));
200
+ } })),
201
+ react_1.default.createElement(compass_components_1.FormFieldContainer, { className: formField },
202
+ react_1.default.createElement(compass_components_1.Label, { id: "initialHistoryLabel", htmlFor: "initialHistory" }, "initialHistory"),
203
+ react_1.default.createElement(compass_components_1.Description, null,
204
+ "An array of history entries to prepopulate the history. Can be used to restore the history between sessions. Entries must be ordered from the most recent to the oldest.",
205
+ react_1.default.createElement("br", null),
206
+ "Note: new entries will not be appended to the array"),
207
+ react_1.default.createElement(compass_components_1.TextArea, { "aria-labelledby": "initialHistory", value: initialHistory.join('\n'), onChange: (evt) => {
208
+ setInitialHistory(evt.currentTarget.value.split('\n'));
209
+ }, className: (0, compass_components_1.cx)(textarea, textInput) })))));
210
+ };
211
+ react_dom_1.default.render(react_1.default.createElement(IframeRuntimeExample, null), document.body);
212
+ //# sourceMappingURL=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wBAChB,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzD,CAAC,EACD,SAAS,EAAE,IAAA,uBAAE,EAAC,QAAQ,EAAE,SAAS,CAAC,GAClC,CACiB,CACjB,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,mBAAQ,CAAC,MAAM,CAAC,8BAAC,oBAAoB,OAAG,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,24 +1,36 @@
1
1
  {
2
2
  "name": "@mongosh/browser-repl",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Browser presentation component for Mongo Shell",
5
5
  "engines": {
6
6
  "node": ">=14.15.1"
7
7
  },
8
- "main": "lib/mongosh-browser-repl.js",
8
+ "main": "lib/index.js",
9
+ "types": "lib/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./lib/index.d.ts",
13
+ "require": "./lib/index.js"
14
+ },
15
+ "./shell": {
16
+ "types": "./lib/components/shell.d.ts",
17
+ "require": "./lib/components/shell.js"
18
+ },
19
+ "./package.json": {
20
+ "require": "./package.json"
21
+ }
22
+ },
9
23
  "scripts": {
10
- "build": "webpack --config ./config/webpack.config.prod.js",
11
- "build:stats": "webpack --config ./config/webpack.config.stats.js",
24
+ "start": "webpack serve --config ./config/webpack.config.watch.js",
12
25
  "clean": "rimraf ./lib",
13
26
  "preprepublish": "rimraf ./lib",
14
- "prepublish": "npm run build",
15
- "start": "npm run storybook",
16
- "storybook": "start-storybook -p 6006",
27
+ "prepublish": "npm run compile-ts",
17
28
  "test": "karma start ./config/karma.conf.js --colors",
18
29
  "test-ci": "node ../../scripts/run-if-package-requested.js npm test",
19
30
  "lint": "eslint --report-unused-disable-directives \"./{src,test}/**/*.{js,ts,tsx}\"",
20
- "check": "npm run lint && depcheck",
21
- "compile-ts": "npm run build"
31
+ "check": "npm run lint && npm run depcheck",
32
+ "depcheck": "depcheck",
33
+ "compile-ts": "tsc -p tsconfig.json"
22
34
  },
23
35
  "config": {
24
36
  "unsafe-perm": true
@@ -38,71 +50,56 @@
38
50
  ]
39
51
  },
40
52
  "dependencies": {
41
- "@mongosh/browser-runtime-core": "1.6.0",
42
- "@mongosh/errors": "1.6.0",
43
- "@mongosh/history": "1.6.0",
44
- "@mongosh/i18n": "1.6.0",
45
- "@mongosh/node-runtime-worker-thread": "1.6.0",
46
- "@mongosh/service-provider-core": "1.6.0",
47
- "karma": "^6.3.9",
53
+ "@mongosh/browser-runtime-core": "1.6.1",
54
+ "@mongosh/errors": "1.6.1",
55
+ "@mongosh/history": "1.6.1",
56
+ "@mongosh/i18n": "1.6.1",
57
+ "@mongosh/node-runtime-worker-thread": "1.6.1",
58
+ "@mongosh/service-provider-core": "1.6.1",
48
59
  "numeral": "^2.0.6",
49
60
  "text-table": "^0.2.0"
50
61
  },
51
62
  "devDependencies": {
52
- "@babel/core": "^7.9.0",
63
+ "@babel/core": "^7.19.6",
53
64
  "@babel/plugin-proposal-class-properties": "^7.8.3",
54
- "@babel/plugin-transform-runtime": "^7.9.0",
55
- "@babel/preset-env": "^7.9.5",
56
- "@babel/preset-react": "^7.9.4",
57
- "@babel/preset-typescript": "^7.9.0",
58
- "@leafygreen-ui/code": "^9.4.0",
59
- "@leafygreen-ui/icon": "^11.6.1",
60
- "@leafygreen-ui/palette": "^3.3.1",
61
- "@leafygreen-ui/typography": "^8.1.0",
62
- "@storybook/addon-knobs": "^5.3.10",
63
- "@storybook/react": "^5.3.1",
64
- "@types/classnames": "^2.2.11",
65
+ "@babel/preset-react": "^7.18.6",
66
+ "@babel/preset-typescript": "^7.18.6",
67
+ "@mongodb-js/compass-components": "*",
68
+ "@mongodb-js/compass-editor": "*",
69
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
65
70
  "@types/enzyme-adapter-react-16": "^1.0.5",
66
71
  "@types/numeral": "^2.0.2",
67
72
  "@types/react": "^16.9.17",
73
+ "@types/react-dom": "^18.0.8",
68
74
  "@types/sinon": "^7.5.1",
69
75
  "@types/sinon-chai": "^3.2.3",
70
76
  "@types/text-table": "^0.2.1",
71
- "babel-loader": "^8.1.0",
72
- "css-loader": "^3.4.1",
77
+ "babel-loader": "^8.3.0",
78
+ "buffer": "^6.0.3",
73
79
  "enzyme": "^3.11.0",
74
80
  "enzyme-adapter-react-16": "^1.15.2",
75
- "file-loader": "^5.1.0",
76
- "karma-webpack": "^4.0.2",
77
- "less": "^3.11.1",
78
- "less-loader": "^5.0.0",
79
- "mongodb-ace-theme": "^0.0.1",
81
+ "html-webpack-plugin": "^5.5.0",
82
+ "karma": "^6.3.9",
83
+ "karma-webpack": "^5.0.0",
84
+ "path-browserify": "^1.0.1",
80
85
  "prop-types": "^15.7.2",
81
86
  "puppeteer": "^2.0.0",
82
87
  "react": "^16.14.0",
83
- "react-ace": "^9.5.0",
84
88
  "react-dom": "^16.14.0",
89
+ "react-refresh": "^0.14.0",
85
90
  "rimraf": "^3.0.2",
86
- "style-loader": "^1.1.2",
87
- "ts-loader": "^7.0.2",
88
- "webpack": "^4.41.5",
89
- "webpack-cli": "^4.3.1",
90
- "webpack-visualizer-plugin": "^0.1.11"
91
+ "stream-browserify": "^3.0.0",
92
+ "util": "^0.12.5",
93
+ "webpack": "^5.0.0",
94
+ "webpack-cli": "^4.0.0",
95
+ "webpack-dev-server": "^4.11.1"
91
96
  },
92
97
  "peerDependencies": {
93
- "@leafygreen-ui/code": "^9.4.0",
94
- "@leafygreen-ui/icon": "^11.6.1",
95
- "@leafygreen-ui/palette": "^3.3.1",
96
- "@leafygreen-ui/typography": "^8.1.0",
97
- "mongodb-ace-theme": "^0.0.1",
98
+ "@mongodb-js/compass-components": "*",
99
+ "@mongodb-js/compass-editor": "*",
98
100
  "prop-types": "^15.7.2",
99
- "react": "^16.12.0",
100
- "react-ace": "^9.5.0",
101
- "react-dom": "^16.12.0"
102
- },
103
- "overrides": {
104
101
  "react": "^16.14.0",
105
102
  "react-dom": "^16.14.0"
106
103
  },
107
- "gitHead": "fbbf54a08fb315ae5fde693a98d439b9aa3285f8"
104
+ "gitHead": "51c067456d3e0127156ef1722a44659151e01a12"
108
105
  }
package/.babelrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env",
4
- "@babel/preset-react",
5
- "@babel/preset-typescript"
6
- ],
7
- "plugins": [
8
- "@babel/plugin-transform-runtime",
9
- "@babel/plugin-proposal-class-properties"
10
- ]
11
- }
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- stories: ['../src/**/*.stories.tsx'],
3
- addons: ['@storybook/addon-knobs/register']
4
- };
@@ -1,12 +0,0 @@
1
- const webpackBaseConfig = require('../config/webpack.config.base');
2
-
3
- module.exports = ({ config }) => {
4
- config.module.rules = webpackBaseConfig.module.rules;
5
- config.resolve.extensions = webpackBaseConfig.resolve.extensions;
6
- config.resolve.alias = {
7
- ...webpackBaseConfig.resolve.alias,
8
- ...config.resolve.alias
9
- };
10
- config.externals = {...config.externals || {}, fs: 'none'};
11
- return config;
12
- };
@@ -1 +0,0 @@
1
- module.exports = { URL: window.URL, URLSearchParams: window.URLSearchParams, __from: __filename };
@@ -1,21 +0,0 @@
1
- const path = require('path');
2
- const webpackConfigBase = require('./webpack.config.base');
3
- const package = require('../package.json');
4
-
5
- const libraryName = 'mongosh-browser-repl';
6
-
7
- module.exports = {
8
- ...webpackConfigBase,
9
- mode: 'production',
10
- devtool: 'source-map',
11
- target: 'web',
12
- entry: path.resolve(__dirname, '..', 'src', 'index.tsx'),
13
- output: {
14
- filename: `${libraryName}.js`,
15
- library: libraryName,
16
- libraryTarget: 'commonjs2',
17
- path: path.resolve(__dirname, '..', 'lib'),
18
- umdNamedDefine: true
19
- },
20
- externals: [...Object.keys(package.peerDependencies), 'vm', 'fs']
21
- };
@@ -1,9 +0,0 @@
1
- const WebpackVisualizerPlugin = require('webpack-visualizer-plugin');
2
- const webpackConfigProd = require('./webpack.config.prod');
3
-
4
- module.exports = {
5
- ...webpackConfigProd,
6
- plugins: [
7
- new WebpackVisualizerPlugin()
8
- ]
9
- };