@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.
- package/.muserc +1 -0
- package/README.md +8 -0
- package/bin/muse-runner.js +19 -0
- package/lib/AppRunner.js +54 -0
- package/lib/Command.js +55 -0
- package/lib/MuseRunner.js +135 -0
- package/lib/PluginRunner.js +67 -0
- package/lib/apis/checkUpdate.js +25 -0
- package/lib/apis/gitStatus.js +89 -0
- package/lib/apis/settings.js +9 -0
- package/lib/apis/startPlugin.js +22 -0
- package/lib/apis/stopPlugin.js +8 -0
- package/lib/apis/terminals.js +118 -0
- package/lib/appWorker.js +325 -0
- package/lib/reactFastRefresh.js +452 -0
- package/lib/server.js +463 -0
- package/lib/test.js +20 -0
- package/lib/upgrades/up_240102.js +25 -0
- package/lib/utils.js +79 -0
- package/package.json +49 -0
- package/public/index.html +14 -0
- package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/asset-manifest.json +10 -0
- package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/boot.js +2 -0
- package/public/muse-assets/p/@ebay.muse-boot-default/v1.0.25/dist/static/media/logo.0629cb217459ef0a31a2.png +0 -0
- package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/assets/index-BeGfgbtf.css +1 -0
- package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/assets/muse-V3RbDVED.png +0 -0
- package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/deps-manifest.json +19 -0
- package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/main.js +16 -0
- package/public/muse-assets/p/@ebay.muse-layout-antd/v1.1.26/dist/readme.txt +1 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/asset-manifest.json +12 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/deps-manifest.json +26 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/info.json +3 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/lib-manifest.json +32768 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/main.js +3 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/main.js.LICENSE.txt +30 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/readme.txt +1 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/report.html +39 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/static/js/205.bfaa7a71.chunk.js +2 -0
- package/public/muse-assets/p/@ebay.muse-lib-antd/v1.2.22/dist/static/media/lightOn.f95be1d2e4156b9a7459.svg +1 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/asset-manifest.json +11 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/favicon.png +0 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/info.json +3 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/lib-manifest.json +3821 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/main.js +3 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/main.js.LICENSE.txt +136 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/static/media/logo.b23b880b0dac2229042c.png +0 -0
- package/public/muse-assets/p/@ebay.muse-lib-react/v1.2.20/dist/static/media/subAppLoading2.bf08007b83457287ade1cedb71bc70f7.svg +7 -0
- package/public/muse-assets/p/app-icon.muserunner/v0.0.1/dist/icon.png +0 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/asset-manifest.json +10 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/deps-manifest.json +43 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/main.js +3 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/main.js.LICENSE.txt +43 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/readme.txt +2 -0
- package/public/muse-assets/p/muse-runner-ui/v1.0.26/dist/static/media/vscode.e44746dcd601802dfb4fe3374cfab5b0.svg +18 -0
- package/public/muse-sw.js +111 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* __ ___
|
|
3
|
+
* _____/ /___ __/ (_)____
|
|
4
|
+
* / ___/ __/ / / / / / ___/
|
|
5
|
+
* (__ ) /_/ /_/ / / (__ )
|
|
6
|
+
* /____/\__/\__, /_/_/____/
|
|
7
|
+
* /____/
|
|
8
|
+
*
|
|
9
|
+
* light - weight css preprocessor @licence MIT
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/*
|
|
13
|
+
object-assign
|
|
14
|
+
(c) Sindre Sorhus
|
|
15
|
+
@license MIT
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/*!
|
|
19
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
22
|
+
* Released under the MIT License.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/*!
|
|
26
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
27
|
+
*
|
|
28
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
29
|
+
* Released under the MIT License.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
|
|
33
|
+
|
|
34
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
35
|
+
|
|
36
|
+
/** @license React v16.14.0
|
|
37
|
+
* react.production.min.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
+
<svg t="1693392892011" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg" p-id="1495" xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
5
|
+
width="200" height="200">
|
|
6
|
+
<path
|
|
7
|
+
d="M0 0m184.32 0l655.36 0q184.32 0 184.32 184.32l0 655.36q0 184.32-184.32 184.32l-655.36 0q-184.32 0-184.32-184.32l0-655.36q0-184.32 184.32-184.32Z"
|
|
8
|
+
fill="transparent" p-id="1496"></path>
|
|
9
|
+
<path
|
|
10
|
+
d="M708.82304 161.9968l137.46176 67.24608c20.81792 10.62912 23.7056 18.28864 23.7056 29.29664l0.60416 506.23488c0 13.50656-7.30112 18.82112-27.42272 30.1568l-133.8368 67.08224c-5.5808 2.60096-10.04544 5.76512-43.47904 5.76512 0 0 28.93824 0.24576 28.93824-22.87616v-662.87616a25.15968 25.15968 0 0 0-24.13568-25.76384c29.6448 0 38.16448 5.7344 38.16448 5.7344z"
|
|
11
|
+
fill="#4B9AE9" p-id="1497"></path>
|
|
12
|
+
<path
|
|
13
|
+
d="M163.34848 613.02784a29.21472 29.21472 0 0 0 0 38.98368s35.11296 32.62464 45.4656 41.984 25.7024 5.12 35.64544-2.37568 450.29376-343.64416 450.29376-343.64416v-165.94944a25.06752 25.06752 0 0 0-24.13568-25.76384 18.11456 18.11456 0 0 0-12.3392 5.376z"
|
|
14
|
+
fill="#2A63A4" p-id="1498"></path>
|
|
15
|
+
<path
|
|
16
|
+
d="M208.92672 331.74528a23.17312 23.17312 0 0 1 32.45056 0l453.4272 343.61344v169.55392c0 23.25504-28.9792 22.8352-28.9792 22.8352a17.00864 17.00864 0 0 1-10.11712-5.53984l-495.77984-454.13376a22.31296 22.31296 0 0 1 0-31.54944z"
|
|
17
|
+
fill="#3478C6" p-id="1499"></path>
|
|
18
|
+
</svg>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
const cacheName = 'muse_assets';
|
|
3
|
+
const assetsHost = 'static.muse.ebay.com'; // /muse-assets, static.muse.ebay.com
|
|
4
|
+
self.addEventListener('install', function(e) {
|
|
5
|
+
console.log('Muse service worker installed.');
|
|
6
|
+
const cacheOpenPromise = caches.open(cacheName);
|
|
7
|
+
e.waitUntil(cacheOpenPromise);
|
|
8
|
+
self.skipWaiting();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
self.addEventListener('activate', function(e) {
|
|
12
|
+
console.log('Muse service Worker activated.');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
self.addEventListener('fetch', function(e) {
|
|
16
|
+
const reqInfo = parseUrl(e.request.url);
|
|
17
|
+
// only cache cdn resource without query string
|
|
18
|
+
if (!reqInfo.isAsset || e.request.url.includes('?')) return false;
|
|
19
|
+
e.respondWith(cacheFirst(e.request, reqInfo));
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
function cacheFirst(request, reqInfo) {
|
|
23
|
+
// only cache cdn resource without query string
|
|
24
|
+
return caches
|
|
25
|
+
.open(cacheName)
|
|
26
|
+
.then((cache) => {
|
|
27
|
+
return cache.match(request).then((res) => {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
if (res) {
|
|
30
|
+
cleanCache(cache, reqInfo);
|
|
31
|
+
resolve(res);
|
|
32
|
+
} else {
|
|
33
|
+
const corsRequest = new Request(request.url, { mode: 'cors' });
|
|
34
|
+
fetch(corsRequest)
|
|
35
|
+
.then((realRes) => {
|
|
36
|
+
if (realRes.status === 200) {
|
|
37
|
+
console.log('Updating cache: ', request.url);
|
|
38
|
+
cache
|
|
39
|
+
.put(request, realRes.clone())
|
|
40
|
+
.then(() => {
|
|
41
|
+
resolve(realRes);
|
|
42
|
+
})
|
|
43
|
+
.catch((err) => {
|
|
44
|
+
console.log('Failed to update cache: ', request.url);
|
|
45
|
+
console.log(err);
|
|
46
|
+
resolve(realRes);
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
reject(realRes);
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
.catch((err) => {
|
|
53
|
+
console.log('Failed to fetch', err);
|
|
54
|
+
resolve(fetch(request));
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
console.log(err);
|
|
62
|
+
console.log('Failed to using cache, fallback to network: ', request.url);
|
|
63
|
+
return Promise.resolve(fetch(request));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const urlCache = {};
|
|
68
|
+
function parseUrl(url) {
|
|
69
|
+
if (urlCache[url]) return urlCache[url];
|
|
70
|
+
|
|
71
|
+
// https://static.muse.ebay.com/p/@ebay.muse-lib-react/v1.0.3/dist/main.js
|
|
72
|
+
const m = url.match(/\/p\/([\w@\.\-_]+)\/v(\d+\.\d+\.\d+[\w@\.\-_]*)\/[\w@\.\-_]+\/.*/);
|
|
73
|
+
let result = null;
|
|
74
|
+
if (m) {
|
|
75
|
+
result = {
|
|
76
|
+
isAsset: true,
|
|
77
|
+
filepath: m[0],
|
|
78
|
+
plugin: m[1],
|
|
79
|
+
version: m[2],
|
|
80
|
+
};
|
|
81
|
+
} else {
|
|
82
|
+
result = {
|
|
83
|
+
isAsset: false,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
urlCache[url] = result;
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function cleanCache(cache, reqInfo) {
|
|
91
|
+
// Clean old cache if a different version is deployed
|
|
92
|
+
cache.keys().then((list) => {
|
|
93
|
+
list.forEach((req) => {
|
|
94
|
+
const info = parseUrl(req.url);
|
|
95
|
+
if (info && info.plugin === reqInfo.plugin && info.version !== reqInfo.version) {
|
|
96
|
+
cache
|
|
97
|
+
.delete(req)
|
|
98
|
+
.then((response) => {
|
|
99
|
+
if (response) {
|
|
100
|
+
console.log('Cache cleaned: ' + req.url);
|
|
101
|
+
} else {
|
|
102
|
+
console.log('Failed to delete cache: ' + req.url);
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
.catch((err) => {
|
|
106
|
+
console.log('Failed to delete cache: ' + req.url);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
}
|