nuxt-skew-protection 0.1.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/LICENSE.md +51 -0
- package/README.md +88 -0
- package/dist/module.cjs +898 -0
- package/dist/module.d.cts +64 -0
- package/dist/module.d.mts +64 -0
- package/dist/module.d.ts +64 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +895 -0
- package/dist/runtime/app/components/SkewNotification.d.vue.ts +45 -0
- package/dist/runtime/app/components/SkewNotification.vue +62 -0
- package/dist/runtime/app/components/SkewNotification.vue.d.ts +45 -0
- package/dist/runtime/app/composables/useRuntimeConfigSkewProtection.d.ts +6 -0
- package/dist/runtime/app/composables/useRuntimeConfigSkewProtection.js +5 -0
- package/dist/runtime/app/composables/useSkewProtection.d.ts +12 -0
- package/dist/runtime/app/composables/useSkewProtection.js +48 -0
- package/dist/runtime/app/plugins/0.skew-protection.d.ts +27 -0
- package/dist/runtime/app/plugins/0.skew-protection.js +41 -0
- package/dist/runtime/app/plugins/check-updates-sse.client.d.ts +2 -0
- package/dist/runtime/app/plugins/check-updates-sse.client.js +36 -0
- package/dist/runtime/app/plugins/check-updates-websocket.client.d.ts +16 -0
- package/dist/runtime/app/plugins/check-updates-websocket.client.js +87 -0
- package/dist/runtime/app/plugins/sw-track-user-modules.client.d.ts +13 -0
- package/dist/runtime/app/plugins/sw-track-user-modules.client.js +102 -0
- package/dist/runtime/server/imports/cookie.d.ts +37 -0
- package/dist/runtime/server/imports/cookie.js +15 -0
- package/dist/runtime/server/imports/getRuntimeConfigSkewProtection.d.ts +7 -0
- package/dist/runtime/server/imports/getRuntimeConfigSkewProtection.js +5 -0
- package/dist/runtime/server/imports/utils.d.ts +6 -0
- package/dist/runtime/server/imports/utils.js +8 -0
- package/dist/runtime/server/index.d.ts +3 -0
- package/dist/runtime/server/index.js +3 -0
- package/dist/runtime/server/middleware/set-skew-protection-cookie.d.ts +6 -0
- package/dist/runtime/server/middleware/set-skew-protection-cookie.js +15 -0
- package/dist/runtime/server/middleware/vercel-skew.d.ts +2 -0
- package/dist/runtime/server/middleware/vercel-skew.js +17 -0
- package/dist/runtime/server/routes/_skew/sse.d.ts +2 -0
- package/dist/runtime/server/routes/_skew/sse.js +30 -0
- package/dist/runtime/server/routes/_skew/ws.d.ts +2 -0
- package/dist/runtime/server/routes/_skew/ws.js +17 -0
- package/dist/runtime/shared/logger.d.ts +1 -0
- package/dist/runtime/shared/logger.js +6 -0
- package/dist/runtime/types.d.ts +25 -0
- package/dist/runtime/types.js +0 -0
- package/dist/types.d.mts +9 -0
- package/package.json +116 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Dual License
|
|
2
|
+
|
|
3
|
+
This software is available under two different licenses:
|
|
4
|
+
|
|
5
|
+
1. MIT License (for open source and non-commercial projects)
|
|
6
|
+
2. Commercial License (for commercial projects)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## MIT License (Open Source & Non-Commercial Use)
|
|
11
|
+
|
|
12
|
+
Copyright (c) 2025 Harlan Wilton
|
|
13
|
+
|
|
14
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
15
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
16
|
+
in the Software without restriction, including without limitation the rights
|
|
17
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
18
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
19
|
+
furnished to do so, subject to the following conditions:
|
|
20
|
+
|
|
21
|
+
This license applies only to:
|
|
22
|
+
- Open source projects with source code publicly available under an OSI-approved license
|
|
23
|
+
- Non-commercial projects (personal projects, educational use, non-profit organizations)
|
|
24
|
+
|
|
25
|
+
The above copyright notice and this permission notice shall be included in all
|
|
26
|
+
copies or substantial portions of the Software.
|
|
27
|
+
|
|
28
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
29
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
30
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
31
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
32
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
33
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
34
|
+
SOFTWARE.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Commercial License
|
|
39
|
+
|
|
40
|
+
If you want to use this software for commercial projects, you must obtain a
|
|
41
|
+
Nuxt SEO Pro license.
|
|
42
|
+
|
|
43
|
+
Commercial use includes:
|
|
44
|
+
- Use in commercial products or services
|
|
45
|
+
- Use in projects generating revenue
|
|
46
|
+
- Use in closed-source commercial applications
|
|
47
|
+
|
|
48
|
+
For commercial licensing, please visit: https://nuxtseo.com/pricing
|
|
49
|
+
|
|
50
|
+
With a Nuxt SEO Pro license, your source code remains proprietary and you are
|
|
51
|
+
not required to open source your application.
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Nuxt Skew Protection
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
[![Nuxt][nuxt-src]][nuxt-href]
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<table>
|
|
10
|
+
<tbody>
|
|
11
|
+
<td align="center">
|
|
12
|
+
<sub>Made possible by my <a href="https://github.com/sponsors/harlan-zw">Sponsor Program 💖</a><br> Follow me <a href="https://twitter.com/harlan_zw">@harlan_zw</a> 🐦 • Join <a href="https://discord.gg/275MBUBvgP">Discord</a> for help</sub><br>
|
|
13
|
+
</td>
|
|
14
|
+
</tbody>
|
|
15
|
+
</table>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
## Why Nuxt Skew Protection?
|
|
19
|
+
|
|
20
|
+
Congrats on shipping that latest release! Unfortunately, many of your users are going to be using the previous version of your app
|
|
21
|
+
for hours to days afterwards until they refresh.
|
|
22
|
+
|
|
23
|
+
Finally fixed that SEO issue? Great, but crawlers will often hit your site and request build chunks that no longer exist, leading
|
|
24
|
+
to 500 errors and broken indexes.
|
|
25
|
+
|
|
26
|
+
You've just been "skewed"! Skew is the version difference between what your users are running and what is currently deployed.
|
|
27
|
+
|
|
28
|
+
While Nuxt helps us by hard-reloading on navigation when it detects a new release, it's often not enough to ensure a smooth experience for all users
|
|
29
|
+
and crawlers. Just check out one of Nuxt's top commented [issues](https://github.com/nuxt/nuxt/issues/29624).
|
|
30
|
+
|
|
31
|
+
Nuxt Skew Protection aims to solve skews by providing better UX on top of app updates as well as long-lived build assets to avoid breaking crawlers and old sessions.
|
|
32
|
+
|
|
33
|
+
## Features
|
|
34
|
+
|
|
35
|
+
- ⚡ **Instantly Adopted Releases** - Zero-config Real-time notifications to users when a new version is deployed.
|
|
36
|
+
- 🎯 **Intelligent User Notifications** - Avoid spamming your users by only sending update notifications when their chunks are outdated. No annoying popups for unrelated updates.
|
|
37
|
+
- 📦 **Long-lived Build Assets** - Avoid breaking crawlers or old sessions with previous build assets remain accessible.
|
|
38
|
+
- 🎨 **Headless UI** - Ship it quicker with a headless notification component that works perfectly with Nuxt UI.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install `nuxt-skew-protection` dependency to your project:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx nuxi@latest module add nuxt-skew-protection
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Documentation
|
|
49
|
+
|
|
50
|
+
[📖 Read the full documentation](https://nuxtseo.com/skew-protection) for more information.
|
|
51
|
+
|
|
52
|
+
## Sponsors
|
|
53
|
+
|
|
54
|
+
<p align="center">
|
|
55
|
+
<a href="https://raw.githubusercontent.com/harlan-zw/static/main/sponsors.svg">
|
|
56
|
+
<img src='https://raw.githubusercontent.com/harlan-zw/static/main/sponsors.svg'/>
|
|
57
|
+
</a>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
#### Commercial License
|
|
63
|
+
|
|
64
|
+
If you want to use Nuxt Skew Protection for commercial projects, you need a [Nuxt SEO Pro](https://nuxtseo.com/pricing) license. With this license, your source code remains proprietary.
|
|
65
|
+
|
|
66
|
+
Commercial use includes:
|
|
67
|
+
- Use in commercial products or services
|
|
68
|
+
- Use in projects generating revenue
|
|
69
|
+
- Use in closed-source commercial applications
|
|
70
|
+
|
|
71
|
+
#### Open Source & Non-Commercial License
|
|
72
|
+
|
|
73
|
+
If you are creating an open source project or using this for non-commercial purposes (personal projects, educational use, non-profit organizations), you may use this project under the terms of the MIT License.
|
|
74
|
+
|
|
75
|
+
See [LICENSE](https://github.com/harlan-zw/nuxt-skew-protection/blob/main/LICENSE) for full details.
|
|
76
|
+
|
|
77
|
+
<!-- Badges -->
|
|
78
|
+
[npm-version-src]: https://img.shields.io/npm/v/nuxt-skew-protection/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
79
|
+
[npm-version-href]: https://npmjs.com/package/nuxt-skew-protection
|
|
80
|
+
|
|
81
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-skew-protection.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
82
|
+
[npm-downloads-href]: https://npmjs.com/package/nuxt-skew-protection
|
|
83
|
+
|
|
84
|
+
[license-src]: https://img.shields.io/github/license/harlan-zw/nuxt-skew-protection.svg?style=flat&colorA=18181B&colorB=28CF8D
|
|
85
|
+
[license-href]: https://github.com/harlan-zw/nuxt-skew-protection/blob/main/LICENSE.md
|
|
86
|
+
|
|
87
|
+
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
|
|
88
|
+
[nuxt-href]: https://nuxt.com
|