pruny 1.32.0 → 1.33.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/dist/index.js +15 -1
- package/package.json +1 -1
- package/bin/pruny.js +0 -2
package/dist/index.js
CHANGED
|
@@ -14990,7 +14990,14 @@ var import_fast_glob5 = __toESM(require_out4(), 1);
|
|
|
14990
14990
|
// src/scanners/missing-assets.ts
|
|
14991
14991
|
var import_fast_glob6 = __toESM(require_out4(), 1);
|
|
14992
14992
|
import { readFileSync as readFileSync5, existsSync as existsSync4 } from "node:fs";
|
|
14993
|
-
import { join as join5 } from "node:path";
|
|
14993
|
+
import { basename, join as join5 } from "node:path";
|
|
14994
|
+
var NEXTJS_METADATA_PREFIXES = [
|
|
14995
|
+
"icon",
|
|
14996
|
+
"apple-icon",
|
|
14997
|
+
"favicon",
|
|
14998
|
+
"opengraph-image",
|
|
14999
|
+
"twitter-image"
|
|
15000
|
+
];
|
|
14994
15001
|
async function scanMissingAssets(config) {
|
|
14995
15002
|
const cwd = config.appSpecificScan ? config.appSpecificScan.appDir : config.dir;
|
|
14996
15003
|
const publicDir = join5(cwd, "public");
|
|
@@ -15020,6 +15027,13 @@ async function scanMissingAssets(config) {
|
|
|
15020
15027
|
const lineNumber = linesUpToMatch.length;
|
|
15021
15028
|
const fullPath = join5(publicDir, assetPath.substring(1));
|
|
15022
15029
|
if (!existsSync4(fullPath)) {
|
|
15030
|
+
const fileName = basename(assetPath);
|
|
15031
|
+
const isNextjsMetadata = NEXTJS_METADATA_PREFIXES.some((prefix) => fileName === prefix || fileName.startsWith(`${prefix}.`) || fileName.match(new RegExp(`^${prefix}\\d+\\.`)));
|
|
15032
|
+
if (isNextjsMetadata) {
|
|
15033
|
+
const appPath = join5(cwd, "app", fileName);
|
|
15034
|
+
if (existsSync4(appPath))
|
|
15035
|
+
continue;
|
|
15036
|
+
}
|
|
15023
15037
|
const assetKey = assetPath;
|
|
15024
15038
|
if (!missingMap.has(assetKey)) {
|
|
15025
15039
|
missingMap.set(assetKey, new Set);
|
package/package.json
CHANGED
package/bin/pruny.js
DELETED