@serwist/vite 9.0.0-preview.13 → 9.0.0-preview.15
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/dist/index.js +1 -1
- package/dist/index.worker.d.ts.map +1 -1
- package/dist/index.worker.js +16 -8
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +13 -14
- package/src/index.worker.ts +8 -0
- package/src/lib/types.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
|
7
7
|
import { normalizePath } from 'vite';
|
|
8
8
|
import process from 'node:process';
|
|
9
9
|
|
|
10
|
-
var version = "9.0.0-preview.
|
|
10
|
+
var version = "9.0.0-preview.15";
|
|
11
11
|
|
|
12
12
|
const logSerwistResult = (buildResult, viteOptions)=>{
|
|
13
13
|
const { logLevel = "info" } = viteOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAGrF,eAAO,MAAM,YAAY;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.worker.d.ts","sourceRoot":"","sources":["../src/index.worker.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAwB,MAAM,qBAAqB,CAAC;AAGrF,eAAO,MAAM,YAAY;;;;;;;;IA4GG,CAAC"}
|
package/dist/index.worker.js
CHANGED
|
@@ -9,7 +9,8 @@ const defaultCache = [
|
|
|
9
9
|
plugins: [
|
|
10
10
|
new ExpirationPlugin({
|
|
11
11
|
maxEntries: 4,
|
|
12
|
-
maxAgeSeconds: 365 * 24 * 60 * 60
|
|
12
|
+
maxAgeSeconds: 365 * 24 * 60 * 60,
|
|
13
|
+
maxAgeFrom: "last-used"
|
|
13
14
|
})
|
|
14
15
|
]
|
|
15
16
|
})
|
|
@@ -21,7 +22,8 @@ const defaultCache = [
|
|
|
21
22
|
plugins: [
|
|
22
23
|
new ExpirationPlugin({
|
|
23
24
|
maxEntries: 4,
|
|
24
|
-
maxAgeSeconds: 7 * 24 * 60 * 60
|
|
25
|
+
maxAgeSeconds: 7 * 24 * 60 * 60,
|
|
26
|
+
maxAgeFrom: "last-used"
|
|
25
27
|
})
|
|
26
28
|
]
|
|
27
29
|
})
|
|
@@ -33,7 +35,8 @@ const defaultCache = [
|
|
|
33
35
|
plugins: [
|
|
34
36
|
new ExpirationPlugin({
|
|
35
37
|
maxEntries: 64,
|
|
36
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
38
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
39
|
+
maxAgeFrom: "last-used"
|
|
37
40
|
})
|
|
38
41
|
]
|
|
39
42
|
})
|
|
@@ -45,7 +48,8 @@ const defaultCache = [
|
|
|
45
48
|
plugins: [
|
|
46
49
|
new ExpirationPlugin({
|
|
47
50
|
maxEntries: 32,
|
|
48
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
51
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
52
|
+
maxAgeFrom: "last-used"
|
|
49
53
|
})
|
|
50
54
|
]
|
|
51
55
|
})
|
|
@@ -57,7 +61,8 @@ const defaultCache = [
|
|
|
57
61
|
plugins: [
|
|
58
62
|
new ExpirationPlugin({
|
|
59
63
|
maxEntries: 32,
|
|
60
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
64
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
65
|
+
maxAgeFrom: "last-used"
|
|
61
66
|
})
|
|
62
67
|
]
|
|
63
68
|
})
|
|
@@ -69,7 +74,8 @@ const defaultCache = [
|
|
|
69
74
|
plugins: [
|
|
70
75
|
new ExpirationPlugin({
|
|
71
76
|
maxEntries: 32,
|
|
72
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
77
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
78
|
+
maxAgeFrom: "last-used"
|
|
73
79
|
})
|
|
74
80
|
]
|
|
75
81
|
})
|
|
@@ -82,7 +88,8 @@ const defaultCache = [
|
|
|
82
88
|
plugins: [
|
|
83
89
|
new ExpirationPlugin({
|
|
84
90
|
maxEntries: 16,
|
|
85
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
91
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
92
|
+
maxAgeFrom: "last-used"
|
|
86
93
|
})
|
|
87
94
|
],
|
|
88
95
|
networkTimeoutSeconds: 10
|
|
@@ -95,7 +102,8 @@ const defaultCache = [
|
|
|
95
102
|
plugins: [
|
|
96
103
|
new ExpirationPlugin({
|
|
97
104
|
maxEntries: 32,
|
|
98
|
-
maxAgeSeconds: 24 * 60 * 60
|
|
105
|
+
maxAgeSeconds: 24 * 60 * 60,
|
|
106
|
+
maxAgeFrom: "last-used"
|
|
99
107
|
})
|
|
100
108
|
],
|
|
101
109
|
networkTimeoutSeconds: 10
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InjectPartial as BaseInjectPartial, InjectResolved as BaseInjectResolved, BasePartial, BaseResolved, GlobPartial, GlobResolved, ManifestEntry, RequiredGlobDirectoryPartial, RequiredGlobDirectoryResolved, RequiredSwDestPartial, RequiredSwDestResolved } from "@serwist/build";
|
|
2
2
|
import type { Require } from "@serwist/utils";
|
|
3
3
|
import type { RollupOptions } from "rollup";
|
|
4
4
|
import type { BuildOptions, Plugin, ResolvedConfig } from "vite";
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,
|
|
1
|
+
{"version":3,"file":"types.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AO,CAAC,CAAC;AAE5E,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAI3D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,MAAM,MAAM,yBAAyB,GAAG,CAAC,eAAe,EAAE,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,EAAE,GAAG,SAAS,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/vite",
|
|
3
|
-
"version": "9.0.0-preview.
|
|
3
|
+
"version": "9.0.0-preview.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Vite application.",
|
|
6
6
|
"files": [
|
|
@@ -72,25 +72,24 @@
|
|
|
72
72
|
"glob": "10.3.10",
|
|
73
73
|
"kolorist": "1.8.0",
|
|
74
74
|
"zod": "3.22.4",
|
|
75
|
-
"@serwist/build": "9.0.0-preview.
|
|
76
|
-
"@serwist/expiration": "9.0.0-preview.
|
|
77
|
-
"@serwist/strategies": "9.0.0-preview.
|
|
78
|
-
"@serwist/window": "9.0.0-preview.
|
|
75
|
+
"@serwist/build": "9.0.0-preview.15",
|
|
76
|
+
"@serwist/expiration": "9.0.0-preview.15",
|
|
77
|
+
"@serwist/strategies": "9.0.0-preview.15",
|
|
78
|
+
"@serwist/window": "9.0.0-preview.15"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@types/node": "20.11.
|
|
82
|
-
"rollup": "4.
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"@serwist/
|
|
87
|
-
"@serwist/
|
|
88
|
-
"@serwist/utils": "9.0.0-preview.13"
|
|
81
|
+
"@types/node": "20.11.30",
|
|
82
|
+
"rollup": "4.13.0",
|
|
83
|
+
"typescript": "5.5.0-dev.20240323",
|
|
84
|
+
"vite": "5.2.4",
|
|
85
|
+
"@serwist/constants": "9.0.0-preview.15",
|
|
86
|
+
"@serwist/sw": "9.0.0-preview.15",
|
|
87
|
+
"@serwist/utils": "9.0.0-preview.15"
|
|
89
88
|
},
|
|
90
89
|
"peerDependencies": {
|
|
91
90
|
"typescript": ">=5.0.0",
|
|
92
91
|
"vite": "^5.0.0",
|
|
93
|
-
"@serwist/sw": "9.0.0-preview.
|
|
92
|
+
"@serwist/sw": "9.0.0-preview.15"
|
|
94
93
|
},
|
|
95
94
|
"peerDependenciesMeta": {
|
|
96
95
|
"@serwist/sw": {
|
package/src/index.worker.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const defaultCache = [
|
|
|
11
11
|
new ExpirationPlugin({
|
|
12
12
|
maxEntries: 4,
|
|
13
13
|
maxAgeSeconds: 365 * 24 * 60 * 60, // 365 days
|
|
14
|
+
maxAgeFrom: "last-used",
|
|
14
15
|
}),
|
|
15
16
|
],
|
|
16
17
|
}),
|
|
@@ -23,6 +24,7 @@ export const defaultCache = [
|
|
|
23
24
|
new ExpirationPlugin({
|
|
24
25
|
maxEntries: 4,
|
|
25
26
|
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days
|
|
27
|
+
maxAgeFrom: "last-used",
|
|
26
28
|
}),
|
|
27
29
|
],
|
|
28
30
|
}),
|
|
@@ -35,6 +37,7 @@ export const defaultCache = [
|
|
|
35
37
|
new ExpirationPlugin({
|
|
36
38
|
maxEntries: 64,
|
|
37
39
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
40
|
+
maxAgeFrom: "last-used",
|
|
38
41
|
}),
|
|
39
42
|
],
|
|
40
43
|
}),
|
|
@@ -47,6 +50,7 @@ export const defaultCache = [
|
|
|
47
50
|
new ExpirationPlugin({
|
|
48
51
|
maxEntries: 32,
|
|
49
52
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
53
|
+
maxAgeFrom: "last-used",
|
|
50
54
|
}),
|
|
51
55
|
],
|
|
52
56
|
}),
|
|
@@ -59,6 +63,7 @@ export const defaultCache = [
|
|
|
59
63
|
new ExpirationPlugin({
|
|
60
64
|
maxEntries: 32,
|
|
61
65
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
66
|
+
maxAgeFrom: "last-used",
|
|
62
67
|
}),
|
|
63
68
|
],
|
|
64
69
|
}),
|
|
@@ -71,6 +76,7 @@ export const defaultCache = [
|
|
|
71
76
|
new ExpirationPlugin({
|
|
72
77
|
maxEntries: 32,
|
|
73
78
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
79
|
+
maxAgeFrom: "last-used",
|
|
74
80
|
}),
|
|
75
81
|
],
|
|
76
82
|
}),
|
|
@@ -84,6 +90,7 @@ export const defaultCache = [
|
|
|
84
90
|
new ExpirationPlugin({
|
|
85
91
|
maxEntries: 16,
|
|
86
92
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
93
|
+
maxAgeFrom: "last-used",
|
|
87
94
|
}),
|
|
88
95
|
],
|
|
89
96
|
networkTimeoutSeconds: 10, // fallback to cache if API does not response within 10 seconds
|
|
@@ -97,6 +104,7 @@ export const defaultCache = [
|
|
|
97
104
|
new ExpirationPlugin({
|
|
98
105
|
maxEntries: 32,
|
|
99
106
|
maxAgeSeconds: 24 * 60 * 60, // 24 hours
|
|
107
|
+
maxAgeFrom: "last-used",
|
|
100
108
|
}),
|
|
101
109
|
],
|
|
102
110
|
networkTimeoutSeconds: 10,
|
package/src/lib/types.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
InjectPartial as BaseInjectPartial,
|
|
3
|
+
InjectResolved as BaseInjectResolved,
|
|
2
4
|
BasePartial,
|
|
3
5
|
BaseResolved,
|
|
4
6
|
GlobPartial,
|
|
5
7
|
GlobResolved,
|
|
6
|
-
InjectPartial as BaseInjectPartial,
|
|
7
|
-
InjectResolved as BaseInjectResolved,
|
|
8
8
|
ManifestEntry,
|
|
9
9
|
RequiredGlobDirectoryPartial,
|
|
10
10
|
RequiredGlobDirectoryResolved,
|