@c-time/frelio-data-json-generator 1.3.17 → 1.3.18
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/cli.js +11 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1091,6 +1091,15 @@ function createLogger(level) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
1093
|
// src/generator.ts
|
|
1094
|
+
function stripContentRootPrefix(gitDiff, contentRootPath) {
|
|
1095
|
+
const prefix = contentRootPath.endsWith("/") ? contentRootPath : `${contentRootPath}/`;
|
|
1096
|
+
const strip = (paths) => paths.map((p) => p.startsWith(prefix) ? p.slice(prefix.length) : p);
|
|
1097
|
+
return {
|
|
1098
|
+
added: strip(gitDiff.added),
|
|
1099
|
+
modified: strip(gitDiff.modified),
|
|
1100
|
+
deleted: strip(gitDiff.deleted)
|
|
1101
|
+
};
|
|
1102
|
+
}
|
|
1094
1103
|
async function generateDataJson(input) {
|
|
1095
1104
|
const {
|
|
1096
1105
|
recipe,
|
|
@@ -1120,7 +1129,8 @@ ${formatZodErrors(recipeValidation.errors)}`);
|
|
|
1120
1129
|
targets = getAllOutputPaths(dependencyMap);
|
|
1121
1130
|
logger.info(`Full rebuild: ${targets.length} outputs`);
|
|
1122
1131
|
} else {
|
|
1123
|
-
const
|
|
1132
|
+
const normalizedDiff = stripContentRootPrefix(gitDiff, contentRootPath);
|
|
1133
|
+
const changes = classifyChangedFiles(normalizedDiff);
|
|
1124
1134
|
targets = calculateRegenerationScope(changes, dependencyMap, recipe);
|
|
1125
1135
|
logger.info(`Incremental build: ${targets.length} outputs affected`);
|
|
1126
1136
|
if (logLevel === "debug") {
|