@serwist/nuxt 9.0.12 → 9.0.14

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/module.d.mts CHANGED
@@ -31,4 +31,5 @@ interface ModuleOptions extends Optional<PluginOptions, "swSrc" | "swDest" | "gl
31
31
 
32
32
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
33
33
 
34
- export { type ClientOptions, type ModuleOptions, _default as default };
34
+ export { _default as default };
35
+ export type { ClientOptions, ModuleOptions };
package/dist/module.json CHANGED
@@ -5,9 +5,9 @@
5
5
  "nuxt": "^3.8.0",
6
6
  "bridge": false
7
7
  },
8
- "version": "9.0.12",
8
+ "version": "9.0.14",
9
9
  "builder": {
10
- "@nuxt/module-builder": "0.8.4",
10
+ "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "unknown"
12
12
  }
13
13
  }
package/dist/module.mjs CHANGED
@@ -1,18 +1,16 @@
1
1
  import path from 'node:path';
2
2
  import { defineNuxtModule, createResolver, addPlugin, extendWebpackConfig } from '@nuxt/kit';
3
- import { resolveEntry, createContext, createApi, main, dev } from '@serwist/vite';
3
+ import { createContext, createApi, main, dev, resolveEntry } from '@serwist/vite';
4
4
  import { createHash } from 'node:crypto';
5
5
  import { createReadStream } from 'node:fs';
6
6
  import fsp from 'node:fs/promises';
7
7
 
8
- const version = "9.0.12";
8
+ const version = "9.0.14";
9
9
 
10
10
  function configurePwaOptions(options, nuxt, nitroConfig) {
11
11
  let buildAssetsDir = nuxt.options.app.buildAssetsDir ?? "_nuxt/";
12
- if (buildAssetsDir[0] === "/")
13
- buildAssetsDir = buildAssetsDir.slice(1);
14
- if (buildAssetsDir[buildAssetsDir.length - 1] !== "/")
15
- buildAssetsDir += "/";
12
+ if (buildAssetsDir[0] === "/") buildAssetsDir = buildAssetsDir.slice(1);
13
+ if (buildAssetsDir[buildAssetsDir.length - 1] !== "/") buildAssetsDir += "/";
16
14
  if (!("dontCacheBustURLsMatching" in options)) {
17
15
  options.dontCacheBustURLsMatching = new RegExp(buildAssetsDir);
18
16
  }
@@ -68,10 +66,8 @@ function createManifestTransform(base, publicDir, appManifestFolder) {
68
66
  });
69
67
  });
70
68
  const latestEntry = entries.find((e) => e.url === latest);
71
- if (latestEntry)
72
- latestEntry.revision = revision;
73
- else
74
- entries.push({ url: latest, revision, size: data.size });
69
+ if (latestEntry) latestEntry.revision = revision;
70
+ else entries.push({ url: latest, revision, size: data.size });
75
71
  } else {
76
72
  entries = entries.filter((e) => e.url !== latest);
77
73
  }
@@ -114,8 +110,7 @@ const module = defineNuxtModule({
114
110
  const { client: _client, ...userOptions } = options;
115
111
  const client = { registerPlugin: true, ..._client };
116
112
  const runtimeDir = resolver.resolve("./runtime");
117
- if (!nuxt.options.ssr)
118
- nuxt.options.build.transpile.push(runtimeDir);
113
+ if (!nuxt.options.ssr) nuxt.options.build.transpile.push(runtimeDir);
119
114
  if (client.registerPlugin) {
120
115
  addPlugin({
121
116
  src: resolver.resolve(runtimeDir, "plugins/client"),
@@ -1,2 +1,6 @@
1
- declare const plugin: any;
1
+ import type { Serwist } from "@serwist/window";
2
+ import type { Plugin } from "#app";
3
+ declare const plugin: Plugin<{
4
+ serwist: Serwist | undefined;
5
+ }>;
2
6
  export default plugin;
package/dist/types.d.mts CHANGED
@@ -1 +1,3 @@
1
- export { type ClientOptions, type ModuleOptions, default } from './module.js'
1
+ export { default } from './module.mjs'
2
+
3
+ export { type ClientOptions, type ModuleOptions } from './module.mjs'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/nuxt",
3
- "version": "9.0.12",
3
+ "version": "9.0.14",
4
4
  "type": "module",
5
5
  "description": "A Nuxt module that integrates Serwist into your application.",
6
6
  "files": [
@@ -27,7 +27,6 @@
27
27
  "bugs": "https://github.com/serwist/serwist/issues",
28
28
  "homepage": "https://serwist.pages.dev",
29
29
  "main": "./dist/module.mjs",
30
- "types": "./dist/types.d.ts",
31
30
  "exports": {
32
31
  ".": {
33
32
  "types": "./dist/types.d.mts",
@@ -51,23 +50,23 @@
51
50
  ]
52
51
  },
53
52
  "dependencies": {
54
- "@nuxt/kit": "3.15.4",
55
- "@serwist/build": "9.0.12",
56
- "@serwist/vite": "9.0.12",
57
- "@serwist/window": "9.0.12"
53
+ "@nuxt/kit": "3.16.2",
54
+ "@serwist/build": "9.0.14",
55
+ "@serwist/vite": "9.0.14",
56
+ "@serwist/window": "9.0.14"
58
57
  },
59
58
  "devDependencies": {
60
- "@nuxt/module-builder": "0.8.4",
61
- "@nuxt/schema": "3.15.4",
62
- "@types/node": "22.13.5",
63
- "eslint": "9.21.0",
64
- "nuxt": "3.15.4",
59
+ "@nuxt/module-builder": "1.0.1",
60
+ "@nuxt/schema": "3.16.2",
61
+ "@types/node": "22.14.1",
62
+ "eslint": "9.25.0",
63
+ "nuxt": "3.16.2",
65
64
  "rimraf": "5.0.9",
66
65
  "serve": "14.2.4",
67
66
  "typescript": "5.6.3",
68
- "vite": "6.1.1",
69
- "vue-tsc": "2.2.2",
70
- "@serwist/configs": "9.0.12"
67
+ "vite": "6.3.2",
68
+ "vue-tsc": "2.2.8",
69
+ "@serwist/configs": "9.0.14"
71
70
  },
72
71
  "peerDependencies": {
73
72
  "typescript": ">=5.0.0",
package/dist/module.cjs DELETED
@@ -1,5 +0,0 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
3
- }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
package/dist/module.d.ts DELETED
@@ -1,34 +0,0 @@
1
- import * as _nuxt_schema from '@nuxt/schema';
2
- import { PluginOptions } from '@serwist/vite';
3
-
4
- /**
5
- * Make certain fields in a object type optional
6
- *
7
- * @example
8
- * interface A {
9
- * a: string;
10
- * b: string;
11
- * c: string;
12
- * }
13
- * type B = Optional<A, "b" | "c">;
14
- * const b: B = { a: "hehe" }; //valid
15
- * const b: B = {}; //invalid
16
- */
17
- type Optional<T, U extends keyof T> = Omit<T, U> & Partial<Pick<T, U>>;
18
-
19
- interface ClientOptions {
20
- /**
21
- * Whether this plugin should be registered.
22
- */
23
- registerPlugin?: boolean;
24
- }
25
- interface ModuleOptions extends Optional<PluginOptions, "swSrc" | "swDest" | "globDirectory"> {
26
- /**
27
- * Options for plugin.
28
- */
29
- client?: ClientOptions;
30
- }
31
-
32
- declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
33
-
34
- export { type ClientOptions, type ModuleOptions, _default as default };
package/dist/types.d.ts DELETED
@@ -1 +0,0 @@
1
- export { type ClientOptions, type ModuleOptions, default } from './module'