@shgysk8zer0/importmap 1.4.1 → 1.4.2
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/CHANGELOG.md +8 -0
- package/firebase.js +24 -0
- package/importmap.json +19 -8
- package/index.cjs +23 -7
- package/index.mjs +23 -7
- package/package.json +1 -1
- package/unpkg.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [v1.4.2] - 2024-08-04
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Add specifiers for `firebase/*`
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- More version updates
|
|
16
|
+
|
|
9
17
|
## [v1.4.1] - 2024-07-14
|
|
10
18
|
|
|
11
19
|
### Changed
|
package/firebase.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const VERSION_PATTERN = /^[0-9]+\.[0-9]+\.[0-9]+$/;
|
|
2
|
+
const FIREBASE = /^https:\/www\.gstatic.com\/firebasejs\/\d+\.\d+\.\d+\//;
|
|
3
|
+
|
|
4
|
+
export async function getLatestVersion() {
|
|
5
|
+
const { versions } = await fetch('https://registry.npmjs.org/firebase').then(resp => resp.json());
|
|
6
|
+
|
|
7
|
+
return Object.keys(versions)
|
|
8
|
+
.filter(v => VERSION_PATTERN.test(v))
|
|
9
|
+
.sort((a, b) => parseFloat(a) > parseFloat(b)).at(-1);
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function updateFirebase(importmap) {
|
|
14
|
+
const version = await getLatestVersion();
|
|
15
|
+
const { imports = {}, scope = {}, ...rest } = importmap;
|
|
16
|
+
|
|
17
|
+
const firebase = Object.fromEntries(
|
|
18
|
+
Object.entries(importmap.imports)
|
|
19
|
+
.filter(([key]) => key.startsWith('firebase/'))
|
|
20
|
+
.map(([key, value]) => [key, value.replace(FIREBASE, `https://www.gstatic.com/firebasejs/${version}/`)])
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return { imports: { ...imports, ...firebase }, scope, ...rest };
|
|
24
|
+
}
|
package/importmap.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"imports": {
|
|
3
|
-
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.
|
|
3
|
+
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.7/",
|
|
4
4
|
"@shgysk8zer0/konami": "https://unpkg.com/@shgysk8zer0/konami@1.1.1/konami.js",
|
|
5
|
-
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
6
|
-
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
5
|
+
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/all.min.js",
|
|
6
|
+
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/",
|
|
7
7
|
"@shgysk8zer0/jswaggersheets": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/swagger.js",
|
|
8
8
|
"@shgysk8zer0/jswaggersheets/": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/",
|
|
9
9
|
"@shgysk8zer0/jss/": "https://unpkg.com/@shgysk8zer0/jss@1.0.1/",
|
|
@@ -35,11 +35,22 @@
|
|
|
35
35
|
"highlight.js/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
36
36
|
"@highlightjs/cdn-assets": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/core.min.js",
|
|
37
37
|
"@highlightjs/cdn-assets/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
38
|
-
"marked": "https://unpkg.com/marked@13.0.
|
|
38
|
+
"marked": "https://unpkg.com/marked@13.0.3/lib/marked.esm.js",
|
|
39
39
|
"marked-highlight": "https://unpkg.com/marked-highlight@2.1.3/src/index.js",
|
|
40
|
-
"yaml": "https://unpkg.com/yaml@2.
|
|
41
|
-
"yaml/": "https://unpkg.com/yaml@2.
|
|
42
|
-
"firebase/": "https://www.gstatic.com/firebasejs/
|
|
40
|
+
"yaml": "https://unpkg.com/yaml@2.5.0/browser/dist/index.js",
|
|
41
|
+
"yaml/": "https://unpkg.com/yaml@2.5.0/browser/dist/",
|
|
42
|
+
"firebase/": "https://www.gstatic.com/firebasejs/10.12.1/",
|
|
43
|
+
"firebase/app": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js",
|
|
44
|
+
"firebase/app-check": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app-check.js",
|
|
45
|
+
"firebase/auth": "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js",
|
|
46
|
+
"firebase/database": "https://www.gstatic.com/firebasejs/10.12.1/firebase-database.js",
|
|
47
|
+
"firebase/firestore": "https://www.gstatic.com/firebasejs/10.12.1/firebase-firestore.js",
|
|
48
|
+
"firebase/functions": "https://www.gstatic.com/firebasejs/10.12.1/firebase-functions.js",
|
|
49
|
+
"firebase/messaging": "https://www.gstatic.com/firebasejs/10.12.1/firebase-messaging.js",
|
|
50
|
+
"firebase/performance": "https://www.gstatic.com/firebasejs/10.12.1/firebase-performance.js",
|
|
51
|
+
"firebase/remote-config": "https://www.gstatic.com/firebasejs/10.12.1/firebase-remote-config.js",
|
|
52
|
+
"firebase/storage": "https://www.gstatic.com/firebasejs/10.12.1/firebase-storage.js",
|
|
53
|
+
"firebase/analytics": "https://www.gstatic.com/firebasejs/10.12.1/firebase-analytics.js"
|
|
43
54
|
},
|
|
44
55
|
"scope": {}
|
|
45
|
-
}
|
|
56
|
+
}
|
package/index.cjs
CHANGED
|
@@ -6,10 +6,10 @@ var json_js = require('@shgysk8zer0/npm-utils/json.js');
|
|
|
6
6
|
var path_js = require('@shgysk8zer0/npm-utils/path.js');
|
|
7
7
|
|
|
8
8
|
const imports$1 = {
|
|
9
|
-
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.
|
|
9
|
+
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.7/",
|
|
10
10
|
"@shgysk8zer0/konami": "https://unpkg.com/@shgysk8zer0/konami@1.1.1/konami.js",
|
|
11
|
-
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
12
|
-
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
11
|
+
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/all.min.js",
|
|
12
|
+
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/",
|
|
13
13
|
"@shgysk8zer0/jswaggersheets": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/swagger.js",
|
|
14
14
|
"@shgysk8zer0/jswaggersheets/": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/",
|
|
15
15
|
"@shgysk8zer0/jss/": "https://unpkg.com/@shgysk8zer0/jss@1.0.1/",
|
|
@@ -41,11 +41,22 @@ const imports$1 = {
|
|
|
41
41
|
"highlight.js/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
42
42
|
"@highlightjs/cdn-assets": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/core.min.js",
|
|
43
43
|
"@highlightjs/cdn-assets/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
44
|
-
marked: "https://unpkg.com/marked@13.0.
|
|
44
|
+
marked: "https://unpkg.com/marked@13.0.3/lib/marked.esm.js",
|
|
45
45
|
"marked-highlight": "https://unpkg.com/marked-highlight@2.1.3/src/index.js",
|
|
46
|
-
yaml: "https://unpkg.com/yaml@2.
|
|
47
|
-
"yaml/": "https://unpkg.com/yaml@2.
|
|
48
|
-
"firebase/": "https://www.gstatic.com/firebasejs/
|
|
46
|
+
yaml: "https://unpkg.com/yaml@2.5.0/browser/dist/index.js",
|
|
47
|
+
"yaml/": "https://unpkg.com/yaml@2.5.0/browser/dist/",
|
|
48
|
+
"firebase/": "https://www.gstatic.com/firebasejs/10.12.1/",
|
|
49
|
+
"firebase/app": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js",
|
|
50
|
+
"firebase/app-check": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app-check.js",
|
|
51
|
+
"firebase/auth": "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js",
|
|
52
|
+
"firebase/database": "https://www.gstatic.com/firebasejs/10.12.1/firebase-database.js",
|
|
53
|
+
"firebase/firestore": "https://www.gstatic.com/firebasejs/10.12.1/firebase-firestore.js",
|
|
54
|
+
"firebase/functions": "https://www.gstatic.com/firebasejs/10.12.1/firebase-functions.js",
|
|
55
|
+
"firebase/messaging": "https://www.gstatic.com/firebasejs/10.12.1/firebase-messaging.js",
|
|
56
|
+
"firebase/performance": "https://www.gstatic.com/firebasejs/10.12.1/firebase-performance.js",
|
|
57
|
+
"firebase/remote-config": "https://www.gstatic.com/firebasejs/10.12.1/firebase-remote-config.js",
|
|
58
|
+
"firebase/storage": "https://www.gstatic.com/firebasejs/10.12.1/firebase-storage.js",
|
|
59
|
+
"firebase/analytics": "https://www.gstatic.com/firebasejs/10.12.1/firebase-analytics.js"
|
|
49
60
|
};
|
|
50
61
|
const scope$1 = {
|
|
51
62
|
};
|
|
@@ -169,6 +180,10 @@ async function update(imports) {
|
|
|
169
180
|
return { imports: Object.fromEntries(entries), updated };
|
|
170
181
|
}
|
|
171
182
|
|
|
183
|
+
async function updateUnpkg(imports) {
|
|
184
|
+
return update(imports);
|
|
185
|
+
}
|
|
186
|
+
|
|
172
187
|
async function updateYAML(file) {
|
|
173
188
|
if (typeof file === 'string') {
|
|
174
189
|
return await updateJSON(path_js.getFileURL(file));
|
|
@@ -210,6 +225,7 @@ var unpkg = /*#__PURE__*/Object.freeze({
|
|
|
210
225
|
__proto__: null,
|
|
211
226
|
update: update,
|
|
212
227
|
updateJSON: updateJSON,
|
|
228
|
+
updateUnpkg: updateUnpkg,
|
|
213
229
|
updateYAML: updateYAML
|
|
214
230
|
});
|
|
215
231
|
|
package/index.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import { readJSONFile, writeJSONFile } from '@shgysk8zer0/npm-utils/json.js';
|
|
|
4
4
|
import { getFileURL } from '@shgysk8zer0/npm-utils/path.js';
|
|
5
5
|
|
|
6
6
|
const imports$1 = {
|
|
7
|
-
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.
|
|
7
|
+
"@shgysk8zer0/kazoo/": "https://unpkg.com/@shgysk8zer0/kazoo@1.0.7/",
|
|
8
8
|
"@shgysk8zer0/konami": "https://unpkg.com/@shgysk8zer0/konami@1.1.1/konami.js",
|
|
9
|
-
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
10
|
-
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.
|
|
9
|
+
"@shgysk8zer0/polyfills": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/all.min.js",
|
|
10
|
+
"@shgysk8zer0/polyfills/": "https://unpkg.com/@shgysk8zer0/polyfills@0.3.14/",
|
|
11
11
|
"@shgysk8zer0/jswaggersheets": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/swagger.js",
|
|
12
12
|
"@shgysk8zer0/jswaggersheets/": "https://unpkg.com/@shgysk8zer0/jswaggersheets@1.1.0/",
|
|
13
13
|
"@shgysk8zer0/jss/": "https://unpkg.com/@shgysk8zer0/jss@1.0.1/",
|
|
@@ -39,11 +39,22 @@ const imports$1 = {
|
|
|
39
39
|
"highlight.js/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
40
40
|
"@highlightjs/cdn-assets": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/core.min.js",
|
|
41
41
|
"@highlightjs/cdn-assets/": "https://unpkg.com/@highlightjs/cdn-assets@11.10.0/es/",
|
|
42
|
-
marked: "https://unpkg.com/marked@13.0.
|
|
42
|
+
marked: "https://unpkg.com/marked@13.0.3/lib/marked.esm.js",
|
|
43
43
|
"marked-highlight": "https://unpkg.com/marked-highlight@2.1.3/src/index.js",
|
|
44
|
-
yaml: "https://unpkg.com/yaml@2.
|
|
45
|
-
"yaml/": "https://unpkg.com/yaml@2.
|
|
46
|
-
"firebase/": "https://www.gstatic.com/firebasejs/
|
|
44
|
+
yaml: "https://unpkg.com/yaml@2.5.0/browser/dist/index.js",
|
|
45
|
+
"yaml/": "https://unpkg.com/yaml@2.5.0/browser/dist/",
|
|
46
|
+
"firebase/": "https://www.gstatic.com/firebasejs/10.12.1/",
|
|
47
|
+
"firebase/app": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js",
|
|
48
|
+
"firebase/app-check": "https://www.gstatic.com/firebasejs/10.12.1/firebase-app-check.js",
|
|
49
|
+
"firebase/auth": "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js",
|
|
50
|
+
"firebase/database": "https://www.gstatic.com/firebasejs/10.12.1/firebase-database.js",
|
|
51
|
+
"firebase/firestore": "https://www.gstatic.com/firebasejs/10.12.1/firebase-firestore.js",
|
|
52
|
+
"firebase/functions": "https://www.gstatic.com/firebasejs/10.12.1/firebase-functions.js",
|
|
53
|
+
"firebase/messaging": "https://www.gstatic.com/firebasejs/10.12.1/firebase-messaging.js",
|
|
54
|
+
"firebase/performance": "https://www.gstatic.com/firebasejs/10.12.1/firebase-performance.js",
|
|
55
|
+
"firebase/remote-config": "https://www.gstatic.com/firebasejs/10.12.1/firebase-remote-config.js",
|
|
56
|
+
"firebase/storage": "https://www.gstatic.com/firebasejs/10.12.1/firebase-storage.js",
|
|
57
|
+
"firebase/analytics": "https://www.gstatic.com/firebasejs/10.12.1/firebase-analytics.js"
|
|
47
58
|
};
|
|
48
59
|
const scope$1 = {
|
|
49
60
|
};
|
|
@@ -167,6 +178,10 @@ async function update(imports) {
|
|
|
167
178
|
return { imports: Object.fromEntries(entries), updated };
|
|
168
179
|
}
|
|
169
180
|
|
|
181
|
+
async function updateUnpkg(imports) {
|
|
182
|
+
return update(imports);
|
|
183
|
+
}
|
|
184
|
+
|
|
170
185
|
async function updateYAML(file) {
|
|
171
186
|
if (typeof file === 'string') {
|
|
172
187
|
return await updateJSON(getFileURL(file));
|
|
@@ -208,6 +223,7 @@ var unpkg = /*#__PURE__*/Object.freeze({
|
|
|
208
223
|
__proto__: null,
|
|
209
224
|
update: update,
|
|
210
225
|
updateJSON: updateJSON,
|
|
226
|
+
updateUnpkg: updateUnpkg,
|
|
211
227
|
updateYAML: updateYAML
|
|
212
228
|
});
|
|
213
229
|
|
package/package.json
CHANGED
package/unpkg.js
CHANGED
|
@@ -23,6 +23,10 @@ export async function update(imports) {
|
|
|
23
23
|
return { imports: Object.fromEntries(entries), updated };
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
export async function updateUnpkg(imports) {
|
|
27
|
+
return update(imports);
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
export async function updateYAML(file) {
|
|
27
31
|
if (typeof file === 'string') {
|
|
28
32
|
return await updateJSON(getFileURL(file));
|