@ultimat3/pwa 5.0.0 → 6.0.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/package.json +3 -3
- package/src/icons.ts +4 -3
- package/src/strategies.ts +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/pwa",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Generated service worker, web manifest, icons, push and version-skew handling.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test": "bun test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ultimat3/core": "
|
|
35
|
-
"@ultimat3/seo": "
|
|
34
|
+
"@ultimat3/core": "6.0.0",
|
|
35
|
+
"@ultimat3/seo": "6.0.0"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/src/icons.ts
CHANGED
|
@@ -87,12 +87,13 @@ export interface ImagePipeline {
|
|
|
87
87
|
* Always square PNG: `toManifestIcon` declares `type: 'image/png'`, so any other format
|
|
88
88
|
* would make the manifest lie about bytes the browser then refuses.
|
|
89
89
|
*
|
|
90
|
-
* `
|
|
91
|
-
*
|
|
90
|
+
* `await` inside, not a returned promise: core's own refusals (a named colour, a padding out of
|
|
91
|
+
* range) are thrown before the first `await` in it, and re-raising them here is what keeps every
|
|
92
|
+
* failure of this method a rejection rather than a synchronous throw past a caller's `.catch()`.
|
|
92
93
|
*/
|
|
93
94
|
export class BuiltinImagePipeline implements ImagePipeline {
|
|
94
95
|
async resize(source: Uint8Array, transform: ImageTransform): Promise<Uint8Array> {
|
|
95
|
-
return transformImageBytes(source, {
|
|
96
|
+
return await transformImageBytes(source, {
|
|
96
97
|
width: transform.size,
|
|
97
98
|
height: transform.size,
|
|
98
99
|
fit: 'contain',
|
package/src/strategies.ts
CHANGED
|
@@ -19,7 +19,7 @@ export const STRATEGY_NAMES: readonly StrategyName[] = [
|
|
|
19
19
|
'network-only',
|
|
20
20
|
];
|
|
21
21
|
|
|
22
|
-
export type PwaRenderMode = 'static' | 'isr' | 'ssr' | 'stream'
|
|
22
|
+
export type PwaRenderMode = 'static' | 'isr' | 'ssr' | 'stream';
|
|
23
23
|
export type PwaOfflineStrategy = 'precache' | 'runtime' | 'network-only';
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -47,7 +47,6 @@ export const MODE_STRATEGY: Readonly<Record<PwaRenderMode, StrategyName>> = Obje
|
|
|
47
47
|
isr: 'stale-while-revalidate',
|
|
48
48
|
ssr: 'network-first',
|
|
49
49
|
stream: 'stale-while-revalidate',
|
|
50
|
-
spa: 'cache-first',
|
|
51
50
|
});
|
|
52
51
|
|
|
53
52
|
export function strategyFor(route: PwaRoute): StrategyName {
|