@serwist/next 10.0.0-preview.2 → 10.0.0-preview.4
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.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/lib/get-content-hash.d.ts.map +1 -1
- package/dist/lib/index.d.ts +0 -1
- package/dist/lib/index.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/index.ts +2 -1
- package/src/lib/get-content-hash.ts +1 -2
- package/src/lib/index.ts +0 -1
- package/dist/lib/get-file-hash.d.ts +0 -3
- package/dist/lib/get-file-hash.d.ts.map +0 -1
- package/dist/utils.d.ts +0 -4
- package/dist/utils.d.ts.map +0 -1
- package/src/lib/get-file-hash.ts +0 -4
- package/src/utils.ts +0 -11
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAIvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAMnE;;;;GAIG;AACH,QAAA,MAAM,eAAe,GAAI,aAAa,qBAAqB,KAAG,CAAC,CAAC,UAAU,CAAC,EAAE,UAAU,KAAK,UAAU,CA8NrG,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,CAAC;AACzC,YAAY,EAAE,qBAAqB,IAAI,aAAa,EAAE,6BAA6B,IAAI,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { InjectManifest } from '@serwist/webpack-plugin';
|
|
5
5
|
import { ChildCompilationPlugin, relativeToOutputPath } from '@serwist/webpack-plugin/internal';
|
|
6
|
+
import { getFileHash } from '@serwist/utils/node';
|
|
6
7
|
import { globSync } from 'glob';
|
|
7
|
-
import crypto from 'node:crypto';
|
|
8
8
|
import { createRequire } from 'node:module';
|
|
9
9
|
import chalk from 'chalk';
|
|
10
10
|
import { validationErrorMap, SerwistConfigError } from '@serwist/build/schema';
|
|
@@ -22,8 +22,6 @@ const findFirstTruthy = (arr, fn)=>{
|
|
|
22
22
|
return undefined;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
const getFileHash = (file)=>crypto.createHash("md5").update(fs.readFileSync(file)).digest("hex");
|
|
26
|
-
|
|
27
25
|
const getContentHash = (file, isDev)=>{
|
|
28
26
|
if (isDev) {
|
|
29
27
|
return "development";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"get-content-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAG9B,eAAO,MAAM,cAAc,GAAI,MAAM,EAAE,CAAC,oBAAoB,EAAE,OAAO,OAAO,WAK3E,CAAC"}
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { findFirstTruthy } from "./find-first-truthy.js";
|
|
2
2
|
export { getContentHash } from "./get-content-hash.js";
|
|
3
|
-
export { getFileHash } from "./get-file-hash.js";
|
|
4
3
|
export { getPackageVersion } from "./get-package-version.js";
|
|
5
4
|
export { loadTSConfig } from "./load-tsconfig.js";
|
|
6
5
|
export * as logger from "./logger.js";
|
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serwist/next",
|
|
3
|
-
"version": "10.0.0-preview.
|
|
3
|
+
"version": "10.0.0-preview.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A module that integrates Serwist into your Next.js application.",
|
|
6
6
|
"files": [
|
|
@@ -65,11 +65,11 @@
|
|
|
65
65
|
"chalk": "5.4.1",
|
|
66
66
|
"glob": "11.0.1",
|
|
67
67
|
"zod": "3.24.3",
|
|
68
|
-
"@serwist/build": "10.0.0-preview.
|
|
69
|
-
"@serwist/utils": "10.0.0-preview.
|
|
70
|
-
"@serwist/webpack-plugin": "10.0.0-preview.
|
|
71
|
-
"@serwist/window": "10.0.0-preview.
|
|
72
|
-
"serwist": "10.0.0-preview.
|
|
68
|
+
"@serwist/build": "10.0.0-preview.4",
|
|
69
|
+
"@serwist/utils": "10.0.0-preview.4",
|
|
70
|
+
"@serwist/webpack-plugin": "10.0.0-preview.4",
|
|
71
|
+
"@serwist/window": "10.0.0-preview.4",
|
|
72
|
+
"serwist": "10.0.0-preview.4"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@types/node": "22.14.1",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"type-fest": "4.40.0",
|
|
81
81
|
"typescript": "5.8.3",
|
|
82
82
|
"webpack": "5.99.6",
|
|
83
|
-
"@serwist/configs": "10.0.0-preview.
|
|
83
|
+
"@serwist/configs": "10.0.0-preview.4"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"next": ">=14.0.0",
|
package/src/index.ts
CHANGED
|
@@ -3,11 +3,12 @@ import path from "node:path";
|
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { InjectManifest } from "@serwist/webpack-plugin";
|
|
5
5
|
import { ChildCompilationPlugin, relativeToOutputPath } from "@serwist/webpack-plugin/internal";
|
|
6
|
+
import { getFileHash } from "@serwist/utils/node";
|
|
6
7
|
import { globSync } from "glob";
|
|
7
8
|
import type { NextConfig } from "next";
|
|
8
9
|
import type { Compilation, Configuration, default as Webpack } from "webpack";
|
|
9
10
|
import type { ExcludeParams, SerwistNextOptions, SerwistNextOptionsKey } from "./internal-types.js";
|
|
10
|
-
import { getContentHash,
|
|
11
|
+
import { getContentHash, loadTSConfig, logger } from "./lib/index.js";
|
|
11
12
|
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./lib/types.js";
|
|
12
13
|
import { validateInjectManifestOptions } from "./lib/validator.js";
|
|
13
14
|
|
package/src/lib/index.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { findFirstTruthy } from "./find-first-truthy.js";
|
|
2
2
|
export { getContentHash } from "./get-content-hash.js";
|
|
3
|
-
export { getFileHash } from "./get-file-hash.js";
|
|
4
3
|
export { getPackageVersion } from "./get-package-version.js";
|
|
5
4
|
export { loadTSConfig } from "./load-tsconfig.js";
|
|
6
5
|
export * as logger from "./logger.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-file-hash.d.ts","sourceRoot":"","sources":["../../src/lib/get-file-hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,GAAI,MAAM,EAAE,CAAC,oBAAoB,WAAyE,CAAC"}
|
package/dist/utils.d.ts
DELETED
package/dist/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB,eAAO,MAAM,WAAW,GAAI,MAAM,EAAE,CAAC,oBAAoB,WAAyE,CAAC;AAEnI,eAAO,MAAM,cAAc,GAAI,MAAM,EAAE,CAAC,oBAAoB,EAAE,OAAO,OAAO,WAK3E,CAAC"}
|
package/src/lib/get-file-hash.ts
DELETED
package/src/utils.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import crypto from "node:crypto";
|
|
2
|
-
import fs from "node:fs";
|
|
3
|
-
|
|
4
|
-
export const getFileHash = (file: fs.PathOrFileDescriptor) => crypto.createHash("md5").update(fs.readFileSync(file)).digest("hex");
|
|
5
|
-
|
|
6
|
-
export const getContentHash = (file: fs.PathOrFileDescriptor, isDev: boolean) => {
|
|
7
|
-
if (isDev) {
|
|
8
|
-
return "development";
|
|
9
|
-
}
|
|
10
|
-
return getFileHash(file).slice(0, 16);
|
|
11
|
-
};
|