@ebay/muse-runner 1.0.21

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 (55) hide show
  1. package/.muserc +1 -0
  2. package/README.md +8 -0
  3. package/bin/muse-runner.js +19 -0
  4. package/lib/AppRunner.js +54 -0
  5. package/lib/Command.js +55 -0
  6. package/lib/MuseRunner.js +135 -0
  7. package/lib/PluginRunner.js +67 -0
  8. package/lib/apis/checkUpdate.js +25 -0
  9. package/lib/apis/gitStatus.js +89 -0
  10. package/lib/apis/settings.js +9 -0
  11. package/lib/apis/startPlugin.js +22 -0
  12. package/lib/apis/stopPlugin.js +8 -0
  13. package/lib/apis/terminals.js +118 -0
  14. package/lib/appWorker.js +325 -0
  15. package/lib/reactFastRefresh.js +452 -0
  16. package/lib/server.js +463 -0
  17. package/lib/test.js +20 -0
  18. package/lib/upgrades/up_240102.js +25 -0
  19. package/lib/utils.js +79 -0
  20. package/package.json +49 -0
  21. package/public/index.html +14 -0
  22. package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/asset-manifest.json +10 -0
  23. package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/boot.js +2 -0
  24. package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/static/media/logo.0629cb217459ef0a31a2.png +0 -0
  25. package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/assets/index-BeGfgbtf.css +1 -0
  26. package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/assets/muse-V3RbDVED.png +0 -0
  27. package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/deps-manifest.json +19 -0
  28. package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/main.js +16 -0
  29. package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/readme.txt +1 -0
  30. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/asset-manifest.json +12 -0
  31. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/deps-manifest.json +26 -0
  32. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/info.json +3 -0
  33. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/lib-manifest.json +32768 -0
  34. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/main.js +3 -0
  35. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/main.js.LICENSE.txt +30 -0
  36. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/readme.txt +1 -0
  37. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/report.html +39 -0
  38. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/static/js/205.bfaa7a71.chunk.js +2 -0
  39. package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/static/media/lightOn.f95be1d2e4156b9a7459.svg +1 -0
  40. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/asset-manifest.json +11 -0
  41. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/favicon.png +0 -0
  42. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/info.json +3 -0
  43. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/lib-manifest.json +3821 -0
  44. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/main.js +3 -0
  45. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/main.js.LICENSE.txt +136 -0
  46. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/static/media/logo.b23b880b0dac2229042c.png +0 -0
  47. package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/static/media/subAppLoading2.bf08007b83457287ade1cedb71bc70f7.svg +7 -0
  48. package/public/muse-assets/p/app-icon.muserunner/v0.0.1/dist/icon.png +0 -0
  49. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/asset-manifest.json +10 -0
  50. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/deps-manifest.json +43 -0
  51. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/main.js +3 -0
  52. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/main.js.LICENSE.txt +43 -0
  53. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/readme.txt +2 -0
  54. package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/static/media/vscode.e44746dcd601802dfb4fe3374cfab5b0.svg +18 -0
  55. package/public/muse-sw.js +111 -0
@@ -0,0 +1,452 @@
1
+ /*! Copyright (c) Meta Platforms, Inc. and affiliates. **/
2
+ const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
3
+ const REACT_MEMO_TYPE = Symbol.for('react.memo');
4
+ let allFamiliesByID = /* @__PURE__ */ new Map();
5
+ let allFamiliesByType = /* @__PURE__ */ new WeakMap();
6
+ let allSignaturesByType = /* @__PURE__ */ new WeakMap();
7
+ const updatedFamiliesByType = /* @__PURE__ */ new WeakMap();
8
+ let pendingUpdates = [];
9
+ const helpersByRendererID = /* @__PURE__ */ new Map();
10
+ const helpersByRoot = /* @__PURE__ */ new Map();
11
+ const mountedRoots = /* @__PURE__ */ new Set();
12
+ const failedRoots = /* @__PURE__ */ new Set();
13
+ let rootElements = /* @__PURE__ */ new WeakMap();
14
+ let isPerformingRefresh = false;
15
+ function computeFullKey(signature) {
16
+ if (signature.fullKey !== null) {
17
+ return signature.fullKey;
18
+ }
19
+ let fullKey = signature.ownKey;
20
+ let hooks2;
21
+ try {
22
+ hooks2 = signature.getCustomHooks();
23
+ } catch (err) {
24
+ signature.forceReset = true;
25
+ signature.fullKey = fullKey;
26
+ return fullKey;
27
+ }
28
+ for (let i = 0; i < hooks2.length; i++) {
29
+ const hook = hooks2[i];
30
+ if (typeof hook !== 'function') {
31
+ signature.forceReset = true;
32
+ signature.fullKey = fullKey;
33
+ return fullKey;
34
+ }
35
+ const nestedHookSignature = allSignaturesByType.get(hook);
36
+ if (nestedHookSignature === void 0) {
37
+ continue;
38
+ }
39
+ const nestedHookKey = computeFullKey(nestedHookSignature);
40
+ if (nestedHookSignature.forceReset) {
41
+ signature.forceReset = true;
42
+ }
43
+ fullKey += '\n---\n' + nestedHookKey;
44
+ }
45
+ signature.fullKey = fullKey;
46
+ return fullKey;
47
+ }
48
+ function haveEqualSignatures(prevType, nextType) {
49
+ const prevSignature = allSignaturesByType.get(prevType);
50
+ const nextSignature = allSignaturesByType.get(nextType);
51
+ if (prevSignature === void 0 && nextSignature === void 0) {
52
+ return true;
53
+ }
54
+ if (prevSignature === void 0 || nextSignature === void 0) {
55
+ return false;
56
+ }
57
+ if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {
58
+ return false;
59
+ }
60
+ if (nextSignature.forceReset) {
61
+ return false;
62
+ }
63
+ return true;
64
+ }
65
+ function isReactClass(type) {
66
+ return type.prototype && type.prototype.isReactComponent;
67
+ }
68
+ function canPreserveStateBetween(prevType, nextType) {
69
+ if (isReactClass(prevType) || isReactClass(nextType)) {
70
+ return false;
71
+ }
72
+ if (haveEqualSignatures(prevType, nextType)) {
73
+ return true;
74
+ }
75
+ return false;
76
+ }
77
+ function resolveFamily(type) {
78
+ return updatedFamiliesByType.get(type);
79
+ }
80
+ function getProperty(object, property) {
81
+ try {
82
+ return object[property];
83
+ } catch (err) {
84
+ return void 0;
85
+ }
86
+ }
87
+ function performReactRefresh() {
88
+ if (pendingUpdates.length === 0) {
89
+ return null;
90
+ }
91
+ if (isPerformingRefresh) {
92
+ return null;
93
+ }
94
+ isPerformingRefresh = true;
95
+ try {
96
+ const staleFamilies = /* @__PURE__ */ new Set();
97
+ const updatedFamilies = /* @__PURE__ */ new Set();
98
+ const updates = pendingUpdates;
99
+ pendingUpdates = [];
100
+ updates.forEach(([family, nextType]) => {
101
+ const prevType = family.current;
102
+ updatedFamiliesByType.set(prevType, family);
103
+ updatedFamiliesByType.set(nextType, family);
104
+ family.current = nextType;
105
+ if (canPreserveStateBetween(prevType, nextType)) {
106
+ updatedFamilies.add(family);
107
+ } else {
108
+ staleFamilies.add(family);
109
+ }
110
+ });
111
+ const update = {
112
+ updatedFamilies,
113
+ // Families that will re-render preserving state
114
+ staleFamilies,
115
+ // Families that will be remounted
116
+ };
117
+ helpersByRendererID.forEach((helpers) => {
118
+ helpers.setRefreshHandler(resolveFamily);
119
+ });
120
+ let didError = false;
121
+ let firstError = null;
122
+ const failedRootsSnapshot = new Set(failedRoots);
123
+ const mountedRootsSnapshot = new Set(mountedRoots);
124
+ const helpersByRootSnapshot = new Map(helpersByRoot);
125
+ failedRootsSnapshot.forEach((root) => {
126
+ const helpers = helpersByRootSnapshot.get(root);
127
+ if (helpers === void 0) {
128
+ throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');
129
+ }
130
+ if (!failedRoots.has(root)) {
131
+ }
132
+ if (rootElements === null) {
133
+ return;
134
+ }
135
+ if (!rootElements.has(root)) {
136
+ return;
137
+ }
138
+ const element = rootElements.get(root);
139
+ try {
140
+ helpers.scheduleRoot(root, element);
141
+ } catch (err) {
142
+ if (!didError) {
143
+ didError = true;
144
+ firstError = err;
145
+ }
146
+ }
147
+ });
148
+ mountedRootsSnapshot.forEach((root) => {
149
+ const helpers = helpersByRootSnapshot.get(root);
150
+ if (helpers === void 0) {
151
+ throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');
152
+ }
153
+ if (!mountedRoots.has(root)) {
154
+ }
155
+ try {
156
+ helpers.scheduleRefresh(root, update);
157
+ } catch (err) {
158
+ if (!didError) {
159
+ didError = true;
160
+ firstError = err;
161
+ }
162
+ }
163
+ });
164
+ if (didError) {
165
+ throw firstError;
166
+ }
167
+ return update;
168
+ } finally {
169
+ isPerformingRefresh = false;
170
+ }
171
+ }
172
+ function register(type, id) {
173
+ if (type === null) {
174
+ return;
175
+ }
176
+ if (typeof type !== 'function' && typeof type !== 'object') {
177
+ return;
178
+ }
179
+ if (allFamiliesByType.has(type)) {
180
+ return;
181
+ }
182
+ let family = allFamiliesByID.get(id);
183
+ if (family === void 0) {
184
+ family = { current: type };
185
+ allFamiliesByID.set(id, family);
186
+ } else {
187
+ pendingUpdates.push([family, type]);
188
+ }
189
+ allFamiliesByType.set(type, family);
190
+ if (typeof type === 'object' && type !== null) {
191
+ switch (getProperty(type, '$$typeof')) {
192
+ case REACT_FORWARD_REF_TYPE:
193
+ register(type.render, id + '$render');
194
+ break;
195
+ case REACT_MEMO_TYPE:
196
+ register(type.type, id + '$type');
197
+ break;
198
+ }
199
+ }
200
+ }
201
+ function setSignature(type, key, forceReset, getCustomHooks) {
202
+ if (!allSignaturesByType.has(type)) {
203
+ allSignaturesByType.set(type, {
204
+ forceReset,
205
+ ownKey: key,
206
+ fullKey: null,
207
+ getCustomHooks: getCustomHooks || (() => []),
208
+ });
209
+ }
210
+ if (typeof type === 'object' && type !== null) {
211
+ switch (getProperty(type, '$$typeof')) {
212
+ case REACT_FORWARD_REF_TYPE:
213
+ setSignature(type.render, key, forceReset, getCustomHooks);
214
+ break;
215
+ case REACT_MEMO_TYPE:
216
+ setSignature(type.type, key, forceReset, getCustomHooks);
217
+ break;
218
+ }
219
+ }
220
+ }
221
+ function collectCustomHooksForSignature(type) {
222
+ const signature = allSignaturesByType.get(type);
223
+ if (signature !== void 0) {
224
+ computeFullKey(signature);
225
+ }
226
+ }
227
+ function injectIntoGlobalHook(globalObject) {
228
+ let hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;
229
+ if (hook === void 0) {
230
+ let nextID = 0;
231
+ globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
232
+ renderers: /* @__PURE__ */ new Map(),
233
+ supportsFiber: true,
234
+ inject: (injected) => nextID++,
235
+ onScheduleFiberRoot: (id, root, children) => {},
236
+ onCommitFiberRoot: (id, root, maybePriorityLevel, didError) => {},
237
+ onCommitFiberUnmount() {},
238
+ };
239
+ }
240
+ if (hook.isDisabled) {
241
+ console['warn'](
242
+ 'Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.',
243
+ );
244
+ return;
245
+ }
246
+ const oldInject = hook.inject;
247
+ hook.inject = function(injected) {
248
+ const id = oldInject.apply(this, arguments);
249
+ if (
250
+ typeof injected.scheduleRefresh === 'function' &&
251
+ typeof injected.setRefreshHandler === 'function'
252
+ ) {
253
+ helpersByRendererID.set(id, injected);
254
+ }
255
+ return id;
256
+ };
257
+ hook.renderers.forEach((injected, id) => {
258
+ if (
259
+ typeof injected.scheduleRefresh === 'function' &&
260
+ typeof injected.setRefreshHandler === 'function'
261
+ ) {
262
+ helpersByRendererID.set(id, injected);
263
+ }
264
+ });
265
+ const oldOnCommitFiberRoot = hook.onCommitFiberRoot;
266
+ const oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || (() => {});
267
+ hook.onScheduleFiberRoot = function(id, root, children) {
268
+ if (!isPerformingRefresh) {
269
+ failedRoots.delete(root);
270
+ if (rootElements !== null) {
271
+ rootElements.set(root, children);
272
+ }
273
+ }
274
+ return oldOnScheduleFiberRoot.apply(this, arguments);
275
+ };
276
+ hook.onCommitFiberRoot = function(id, root, maybePriorityLevel, didError) {
277
+ const helpers = helpersByRendererID.get(id);
278
+ if (helpers !== void 0) {
279
+ helpersByRoot.set(root, helpers);
280
+ const current = root.current;
281
+ const alternate = current.alternate;
282
+ if (alternate !== null) {
283
+ const wasMounted =
284
+ alternate.memoizedState != null &&
285
+ alternate.memoizedState.element != null &&
286
+ mountedRoots.has(root);
287
+ const isMounted = current.memoizedState != null && current.memoizedState.element != null;
288
+ if (!wasMounted && isMounted) {
289
+ mountedRoots.add(root);
290
+ failedRoots.delete(root);
291
+ } else if (wasMounted && isMounted) {
292
+ } else if (wasMounted && !isMounted) {
293
+ mountedRoots.delete(root);
294
+ if (didError) {
295
+ failedRoots.add(root);
296
+ } else {
297
+ helpersByRoot.delete(root);
298
+ }
299
+ } else if (!wasMounted && !isMounted) {
300
+ if (didError) {
301
+ failedRoots.add(root);
302
+ }
303
+ }
304
+ } else {
305
+ mountedRoots.add(root);
306
+ }
307
+ }
308
+ return oldOnCommitFiberRoot.apply(this, arguments);
309
+ };
310
+ }
311
+ function createSignatureFunctionForTransform() {
312
+ let savedType;
313
+ let hasCustomHooks;
314
+ let didCollectHooks = false;
315
+ return function(type, key, forceReset, getCustomHooks) {
316
+ if (typeof key === 'string') {
317
+ if (!savedType) {
318
+ savedType = type;
319
+ hasCustomHooks = typeof getCustomHooks === 'function';
320
+ }
321
+ if (type != null && (typeof type === 'function' || typeof type === 'object')) {
322
+ setSignature(type, key, forceReset, getCustomHooks);
323
+ }
324
+ return type;
325
+ } else {
326
+ if (!didCollectHooks && hasCustomHooks) {
327
+ didCollectHooks = true;
328
+ collectCustomHooksForSignature(savedType);
329
+ }
330
+ }
331
+ };
332
+ }
333
+ function isLikelyComponentType(type) {
334
+ switch (typeof type) {
335
+ case 'function': {
336
+ if (type.prototype != null) {
337
+ if (type.prototype.isReactComponent) {
338
+ return true;
339
+ }
340
+ const ownNames = Object.getOwnPropertyNames(type.prototype);
341
+ if (ownNames.length > 1 || ownNames[0] !== 'constructor') {
342
+ return false;
343
+ }
344
+ if (type.prototype.__proto__ !== Object.prototype) {
345
+ return false;
346
+ }
347
+ }
348
+ const name = type.name || type.displayName;
349
+ return typeof name === 'string' && /^[A-Z]/.test(name);
350
+ }
351
+ case 'object': {
352
+ if (type != null) {
353
+ switch (getProperty(type, '$$typeof')) {
354
+ case REACT_FORWARD_REF_TYPE:
355
+ case REACT_MEMO_TYPE:
356
+ return true;
357
+ default:
358
+ return false;
359
+ }
360
+ }
361
+ return false;
362
+ }
363
+ default: {
364
+ return false;
365
+ }
366
+ }
367
+ }
368
+ if (window.$RefreshReg$) {
369
+ throw new Error('React refresh runtime was loaded twice. Maybe you forgot the base path?');
370
+ }
371
+ function getRefreshReg(filename) {
372
+ return (type, id) => register(type, filename + ' ' + id);
373
+ }
374
+ function registerExportsForReactRefresh(filename, moduleExports) {
375
+ for (const key in moduleExports) {
376
+ if (key === '__esModule') continue;
377
+ const exportValue = moduleExports[key];
378
+ if (isLikelyComponentType(exportValue)) {
379
+ register(exportValue, filename + ' export ' + key);
380
+ }
381
+ }
382
+ }
383
+ function debounce(fn, delay) {
384
+ let handle;
385
+ return () => {
386
+ clearTimeout(handle);
387
+ handle = setTimeout(fn, delay);
388
+ };
389
+ }
390
+ const hooks = [];
391
+ window.__registerBeforePerformReactRefresh = (cb) => {
392
+ hooks.push(cb);
393
+ };
394
+ const enqueueUpdate = debounce(async () => {
395
+ if (hooks.length) await Promise.all(hooks.map((cb) => cb()));
396
+ performReactRefresh();
397
+ }, 16);
398
+ function validateRefreshBoundaryAndEnqueueUpdate(id, prevExports, nextExports) {
399
+ var _a, _b;
400
+ const ignoredExports =
401
+ (_b =
402
+ (_a = window.__getReactRefreshIgnoredExports) == null ? void 0 : _a.call(window, { id })) !=
403
+ null
404
+ ? _b
405
+ : [];
406
+ if (predicateOnExport(ignoredExports, prevExports, (key) => key in nextExports) !== true) {
407
+ return 'Could not Fast Refresh (export removed)';
408
+ }
409
+ if (predicateOnExport(ignoredExports, nextExports, (key) => key in prevExports) !== true) {
410
+ return 'Could not Fast Refresh (new export)';
411
+ }
412
+ let hasExports = false;
413
+ const allExportsAreComponentsOrUnchanged = predicateOnExport(
414
+ ignoredExports,
415
+ nextExports,
416
+ (key, value) => {
417
+ hasExports = true;
418
+ if (isLikelyComponentType(value)) return true;
419
+ return prevExports[key] === nextExports[key];
420
+ },
421
+ );
422
+ if (hasExports && allExportsAreComponentsOrUnchanged === true) {
423
+ enqueueUpdate();
424
+ } else {
425
+ return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at https://github.com/vitejs/vite-plugin-react-swc#consistent-components-exports`;
426
+ }
427
+ }
428
+ function predicateOnExport(ignoredExports, moduleExports, predicate) {
429
+ for (const key in moduleExports) {
430
+ if (key === '__esModule') continue;
431
+ if (ignoredExports.includes(key)) continue;
432
+ const desc = Object.getOwnPropertyDescriptor(moduleExports, key);
433
+ if (desc && desc.get) return key;
434
+ if (!predicate(key, moduleExports[key])) return key;
435
+ }
436
+ return true;
437
+ }
438
+ const __hmr_import = (module) =>
439
+ import(
440
+ /* @vite-ignore */
441
+ module
442
+ );
443
+ var refresh_runtime_default = { injectIntoGlobalHook };
444
+ export {
445
+ __hmr_import,
446
+ createSignatureFunctionForTransform,
447
+ refresh_runtime_default as default,
448
+ getRefreshReg,
449
+ injectIntoGlobalHook,
450
+ registerExportsForReactRefresh,
451
+ validateRefreshBoundaryAndEnqueueUpdate,
452
+ };