@serwist/next 8.3.0 → 8.4.1
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/README.md +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.js +6 -5
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
This module's documentation can be found at https://serwist.
|
|
1
|
+
This module's documentation can be found at https://serwist.pages.dev/docs/next
|
package/dist/index.cjs
CHANGED
|
@@ -750,7 +750,7 @@ const prefixedLog = (prefixType, ...message)=>{
|
|
|
750
750
|
if (message.length === 0) {
|
|
751
751
|
console[consoleMethod]("");
|
|
752
752
|
} else {
|
|
753
|
-
console[consoleMethod](
|
|
753
|
+
console[consoleMethod](` ${prefix}`, ...message);
|
|
754
754
|
}
|
|
755
755
|
};
|
|
756
756
|
const info = (...message)=>{
|
|
@@ -774,7 +774,7 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
774
774
|
config = nextConfig.webpack(config, options);
|
|
775
775
|
}
|
|
776
776
|
if (disable) {
|
|
777
|
-
options.isServer && info("
|
|
777
|
+
options.isServer && info("Serwist is disabled.");
|
|
778
778
|
return config;
|
|
779
779
|
}
|
|
780
780
|
if (!config.plugins) {
|
|
@@ -818,13 +818,14 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
818
818
|
if (!options.isServer) {
|
|
819
819
|
if (!register) {
|
|
820
820
|
info("Service worker won't be automatically registered as per the config, please call the following code in componentDidMount or useEffect:");
|
|
821
|
-
info(
|
|
821
|
+
info(" window.serwist.register()");
|
|
822
822
|
if (!tsConfigJson?.compilerOptions?.types?.includes("@serwist/next/typings")) {
|
|
823
823
|
info("You may also want to add @serwist/next/typings to compilerOptions.types in your tsconfig.json/jsconfig.json.");
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
826
|
const { swSrc: providedSwSrc, swDest: providedSwDest, additionalPrecacheEntries, exclude = [], modifyURLPrefix = {}, manifestTransforms = [], ...otherBuildOptions } = buildOptions;
|
|
827
|
-
let swSrc = providedSwSrc
|
|
827
|
+
let swSrc = providedSwSrc;
|
|
828
|
+
let swDest = providedSwDest;
|
|
828
829
|
if (!path.isAbsolute(swSrc)) {
|
|
829
830
|
swSrc = path.join(options.dir, swSrc);
|
|
830
831
|
}
|
|
@@ -835,7 +836,7 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
835
836
|
const shouldBuildSWEntryWorker = cacheOnFrontEndNav;
|
|
836
837
|
let swEntryPublicPath = undefined;
|
|
837
838
|
if (shouldBuildSWEntryWorker) {
|
|
838
|
-
const swEntryWorkerSrc = path.join(__dirname$1,
|
|
839
|
+
const swEntryWorkerSrc = path.join(__dirname$1, "sw-entry-worker.js");
|
|
839
840
|
const swEntryName = `swe-worker-${getContentHash(swEntryWorkerSrc, dev)}.js`;
|
|
840
841
|
swEntryPublicPath = path.posix.join(basePath, swEntryName);
|
|
841
842
|
const swEntryWorkerDest = path.join(destDir, swEntryName);
|
package/dist/index.js
CHANGED
|
@@ -745,7 +745,7 @@ const prefixedLog = (prefixType, ...message)=>{
|
|
|
745
745
|
if (message.length === 0) {
|
|
746
746
|
console[consoleMethod]("");
|
|
747
747
|
} else {
|
|
748
|
-
console[consoleMethod](
|
|
748
|
+
console[consoleMethod](` ${prefix}`, ...message);
|
|
749
749
|
}
|
|
750
750
|
};
|
|
751
751
|
const info = (...message)=>{
|
|
@@ -769,7 +769,7 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
769
769
|
config = nextConfig.webpack(config, options);
|
|
770
770
|
}
|
|
771
771
|
if (disable) {
|
|
772
|
-
options.isServer && info("
|
|
772
|
+
options.isServer && info("Serwist is disabled.");
|
|
773
773
|
return config;
|
|
774
774
|
}
|
|
775
775
|
if (!config.plugins) {
|
|
@@ -813,13 +813,14 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
813
813
|
if (!options.isServer) {
|
|
814
814
|
if (!register) {
|
|
815
815
|
info("Service worker won't be automatically registered as per the config, please call the following code in componentDidMount or useEffect:");
|
|
816
|
-
info(
|
|
816
|
+
info(" window.serwist.register()");
|
|
817
817
|
if (!tsConfigJson?.compilerOptions?.types?.includes("@serwist/next/typings")) {
|
|
818
818
|
info("You may also want to add @serwist/next/typings to compilerOptions.types in your tsconfig.json/jsconfig.json.");
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
821
|
const { swSrc: providedSwSrc, swDest: providedSwDest, additionalPrecacheEntries, exclude = [], modifyURLPrefix = {}, manifestTransforms = [], ...otherBuildOptions } = buildOptions;
|
|
822
|
-
let swSrc = providedSwSrc
|
|
822
|
+
let swSrc = providedSwSrc;
|
|
823
|
+
let swDest = providedSwDest;
|
|
823
824
|
if (!path.isAbsolute(swSrc)) {
|
|
824
825
|
swSrc = path.join(options.dir, swSrc);
|
|
825
826
|
}
|
|
@@ -830,7 +831,7 @@ const withPWAInit = (pluginOptions)=>{
|
|
|
830
831
|
const shouldBuildSWEntryWorker = cacheOnFrontEndNav;
|
|
831
832
|
let swEntryPublicPath = undefined;
|
|
832
833
|
if (shouldBuildSWEntryWorker) {
|
|
833
|
-
const swEntryWorkerSrc = path.join(__dirname,
|
|
834
|
+
const swEntryWorkerSrc = path.join(__dirname, "sw-entry-worker.js");
|
|
834
835
|
const swEntryName = `swe-worker-${getContentHash(swEntryWorkerSrc, dev)}.js`;
|
|
835
836
|
swEntryPublicPath = path.posix.join(basePath, swEntryName);
|
|
836
837
|
const swEntryWorkerDest = path.join(destDir, swEntryName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"repository": "serwist/serwist",
|
|
21
21
|
"bugs": "https://github.com/serwist/serwist/issues",
|
|
22
|
-
"homepage": "https://serwist.
|
|
22
|
+
"homepage": "https://serwist.pages.dev",
|
|
23
23
|
"module": "./dist/index.js",
|
|
24
24
|
"main": "./dist/index.cjs",
|
|
25
25
|
"types": "./dist/index.d.ts",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"clean-webpack-plugin": "4.0.0",
|
|
69
69
|
"fast-glob": "3.3.2",
|
|
70
|
-
"@serwist/build": "8.
|
|
71
|
-
"@serwist/webpack-plugin": "8.
|
|
72
|
-
"@serwist/window": "8.
|
|
70
|
+
"@serwist/build": "8.4.1",
|
|
71
|
+
"@serwist/webpack-plugin": "8.4.1",
|
|
72
|
+
"@serwist/window": "8.4.1"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "20.10.5",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"type-fest": "4.8.3",
|
|
82
82
|
"typescript": "5.4.0-dev.20231226",
|
|
83
83
|
"webpack": "5.89.0",
|
|
84
|
-
"@serwist/constants": "8.
|
|
84
|
+
"@serwist/constants": "8.4.1"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"next": ">=14.0.0",
|
|
@@ -89,7 +89,8 @@
|
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"build": "rimraf dist && cross-env NODE_ENV=production rollup --config rollup.config.js",
|
|
92
|
-
"
|
|
92
|
+
"dev": "rollup --config rollup.config.js --watch",
|
|
93
|
+
"lint": "biome lint ./src",
|
|
93
94
|
"typecheck": "tsc"
|
|
94
95
|
}
|
|
95
96
|
}
|