pruny 1.2.13 → 1.2.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/index.js +21 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9698,8 +9698,17 @@ function loadConfig(options) {
|
|
|
9698
9698
|
extraRoutePatterns.push(...config.extraRoutePatterns);
|
|
9699
9699
|
if (config.excludePublic !== undefined)
|
|
9700
9700
|
excludePublic = config.excludePublic;
|
|
9701
|
+
if (config.excludePublic !== undefined)
|
|
9702
|
+
excludePublic = config.excludePublic;
|
|
9701
9703
|
} catch {}
|
|
9702
9704
|
}
|
|
9705
|
+
const gitIgnorePatterns = parseGitIgnore(cwd);
|
|
9706
|
+
if (gitIgnorePatterns.length > 0) {
|
|
9707
|
+
mergedIgnore.folders.push(...gitIgnorePatterns);
|
|
9708
|
+
}
|
|
9709
|
+
mergedIgnore.routes = [...new Set(mergedIgnore.routes)];
|
|
9710
|
+
mergedIgnore.folders = [...new Set(mergedIgnore.folders)];
|
|
9711
|
+
mergedIgnore.files = [...new Set(mergedIgnore.files)];
|
|
9703
9712
|
return {
|
|
9704
9713
|
dir: cwd,
|
|
9705
9714
|
ignore: mergedIgnore,
|
|
@@ -9709,6 +9718,18 @@ function loadConfig(options) {
|
|
|
9709
9718
|
extraRoutePatterns
|
|
9710
9719
|
};
|
|
9711
9720
|
}
|
|
9721
|
+
function parseGitIgnore(dir) {
|
|
9722
|
+
const gitIgnorePath = join5(dir, ".gitignore");
|
|
9723
|
+
if (!existsSync4(gitIgnorePath))
|
|
9724
|
+
return [];
|
|
9725
|
+
try {
|
|
9726
|
+
const content = readFileSync5(gitIgnorePath, "utf-8");
|
|
9727
|
+
return content.split(`
|
|
9728
|
+
`).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
|
|
9729
|
+
} catch {
|
|
9730
|
+
return [];
|
|
9731
|
+
}
|
|
9732
|
+
}
|
|
9712
9733
|
function findConfigFile(dir) {
|
|
9713
9734
|
const candidates = ["pruny.config.json", ".prunyrc.json", ".prunyrc"];
|
|
9714
9735
|
for (const name of candidates) {
|
|
@@ -9779,9 +9800,6 @@ program2.action(async (options) => {
|
|
|
9779
9800
|
const absoluteDir = config.dir.startsWith("/") ? config.dir : join8(process.cwd(), config.dir);
|
|
9780
9801
|
config.dir = absoluteDir;
|
|
9781
9802
|
if (options.verbose) {
|
|
9782
|
-
console.log(source_default.dim(`
|
|
9783
|
-
Config:`));
|
|
9784
|
-
console.log(source_default.dim(JSON.stringify(config, null, 2)));
|
|
9785
9803
|
console.log("");
|
|
9786
9804
|
}
|
|
9787
9805
|
console.log(source_default.bold(`
|