@merkur/integration 0.32.0 → 0.34.0
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/lib/index.cjs +4 -4
- package/lib/index.js +4 -4
- package/lib/index.mjs +4 -4
- package/package.json +3 -3
- package/server/__tests__/indexSpec.js +1 -1
- package/server/index.js +6 -6
package/lib/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ function isES9Supported() {
|
|
|
7
7
|
if (_isES9Supported === undefined) {
|
|
8
8
|
_isES9Supported =
|
|
9
9
|
exported.test(
|
|
10
|
-
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()'
|
|
10
|
+
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()',
|
|
11
11
|
) && !!Object.values;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ function isES11Supported() {
|
|
|
18
18
|
if (_isES11Supported === undefined) {
|
|
19
19
|
_isES11Supported =
|
|
20
20
|
exported.test(
|
|
21
|
-
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()'
|
|
21
|
+
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()',
|
|
22
22
|
) &&
|
|
23
23
|
exported.test('return typeof Promise.allSettled === "function"') &&
|
|
24
24
|
exported.test('return typeof globalThis !== "undefined"') &&
|
|
@@ -57,7 +57,7 @@ function _loadScript(asset, root) {
|
|
|
57
57
|
scriptElement.addEventListener('load', resolve);
|
|
58
58
|
scriptElement.addEventListener(
|
|
59
59
|
'error',
|
|
60
|
-
asset.optional ? resolve : reject
|
|
60
|
+
asset.optional ? resolve : reject,
|
|
61
61
|
);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -133,7 +133,7 @@ function loadStyleAssets(assets, root = document.head) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
return acc;
|
|
136
|
-
}, true)))
|
|
136
|
+
}, true))),
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
return Promise.all(stylesToRender.map((asset) => _loadStyle(asset, root)));
|
package/lib/index.js
CHANGED
|
@@ -7,7 +7,7 @@ function isES9Supported() {
|
|
|
7
7
|
if (_isES9Supported === undefined) {
|
|
8
8
|
_isES9Supported =
|
|
9
9
|
exported.test(
|
|
10
|
-
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()'
|
|
10
|
+
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()',
|
|
11
11
|
) && !!Object.values;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ function isES11Supported() {
|
|
|
18
18
|
if (_isES11Supported === undefined) {
|
|
19
19
|
_isES11Supported =
|
|
20
20
|
exported.test(
|
|
21
|
-
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()'
|
|
21
|
+
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()',
|
|
22
22
|
) &&
|
|
23
23
|
exported.test('return typeof Promise.allSettled === "function"') &&
|
|
24
24
|
exported.test('return typeof globalThis !== "undefined"') &&
|
|
@@ -57,7 +57,7 @@ function _loadScript(asset, root) {
|
|
|
57
57
|
scriptElement.addEventListener('load', resolve);
|
|
58
58
|
scriptElement.addEventListener(
|
|
59
59
|
'error',
|
|
60
|
-
asset.optional ? resolve : reject
|
|
60
|
+
asset.optional ? resolve : reject,
|
|
61
61
|
);
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -133,7 +133,7 @@ function loadStyleAssets(assets, root = document.head) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
return acc;
|
|
136
|
-
}, true)))
|
|
136
|
+
}, true))),
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
return Promise.all(stylesToRender.map((asset) => _loadStyle(asset, root)));
|
package/lib/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ function isES9Supported() {
|
|
|
5
5
|
if (_isES9Supported === undefined) {
|
|
6
6
|
_isES9Supported =
|
|
7
7
|
exported.test(
|
|
8
|
-
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()'
|
|
8
|
+
'return (() => { const o = { t: 1 }; return { ...o }; })() && (async () => ({}))()',
|
|
9
9
|
) && !!Object.values;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -16,7 +16,7 @@ function isES11Supported() {
|
|
|
16
16
|
if (_isES11Supported === undefined) {
|
|
17
17
|
_isES11Supported =
|
|
18
18
|
exported.test(
|
|
19
|
-
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()'
|
|
19
|
+
'return (() => { const o = { t: { q: true } }; return o?.t?.q && (o?.a?.q ?? true); })()',
|
|
20
20
|
) &&
|
|
21
21
|
exported.test('return typeof Promise.allSettled === "function"') &&
|
|
22
22
|
exported.test('return typeof globalThis !== "undefined"') &&
|
|
@@ -55,7 +55,7 @@ function _loadScript(asset, root) {
|
|
|
55
55
|
scriptElement.addEventListener('load', resolve);
|
|
56
56
|
scriptElement.addEventListener(
|
|
57
57
|
'error',
|
|
58
|
-
asset.optional ? resolve : reject
|
|
58
|
+
asset.optional ? resolve : reject,
|
|
59
59
|
);
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
@@ -131,7 +131,7 @@ function loadStyleAssets(assets, root = document.head) {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return acc;
|
|
134
|
-
}, true)))
|
|
134
|
+
}, true))),
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
return Promise.all(stylesToRender.map((asset) => _loadStyle(asset, root)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkur/integration",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Merkur module for easy integration with other apps.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"module": "lib/index",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://merkur.js.org/",
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@merkur/core": "^0.
|
|
52
|
+
"@merkur/core": "^0.34.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@merkur/core": "*"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "3bc4a1efb8f8d5cee6bcf5f1454809747904153c"
|
|
58
58
|
}
|
package/server/index.js
CHANGED
|
@@ -30,7 +30,7 @@ async function processAssetInFolder({
|
|
|
30
30
|
if (asset.type.includes('inline')) {
|
|
31
31
|
asset.source = await fsp.readFile(
|
|
32
32
|
path.join(staticFolder, folder, fileName),
|
|
33
|
-
{ encoding: 'utf-8' }
|
|
33
|
+
{ encoding: 'utf-8' },
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
return asset;
|
|
@@ -60,7 +60,7 @@ async function createAssets({ assets, staticFolder, folders, staticBaseUrl }) {
|
|
|
60
60
|
|
|
61
61
|
const manifestFile = await fsp.readFile(
|
|
62
62
|
path.join(folderPath, 'manifest.json'),
|
|
63
|
-
{ encoding: 'utf-8' }
|
|
63
|
+
{ encoding: 'utf-8' },
|
|
64
64
|
);
|
|
65
65
|
const manifest = JSON.parse(manifestFile);
|
|
66
66
|
|
|
@@ -72,17 +72,17 @@ async function createAssets({ assets, staticFolder, folders, staticBaseUrl }) {
|
|
|
72
72
|
fileName: manifest[asset.name],
|
|
73
73
|
staticBaseUrl,
|
|
74
74
|
staticFolder,
|
|
75
|
-
})
|
|
76
|
-
)
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
77
77
|
);
|
|
78
78
|
},
|
|
79
|
-
[...assets]
|
|
79
|
+
[...assets],
|
|
80
80
|
);
|
|
81
81
|
|
|
82
82
|
return processedAssets.filter((asset) => {
|
|
83
83
|
if (!asset.source) {
|
|
84
84
|
console.warn(
|
|
85
|
-
`Asset '${asset.name}' has been excluded because it doesn't have valid source
|
|
85
|
+
`Asset '${asset.name}' has been excluded because it doesn't have valid source.`,
|
|
86
86
|
);
|
|
87
87
|
return false;
|
|
88
88
|
}
|