foresthouse 1.0.1-dev.5 → 1.0.1-dev.6
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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as printReactUsageTree, c as printPackageDependencyTree, f as analyzeReactUsage, g as analyzePackageDependencies, h as analyzePackageDependencyDiff, i as graphToSerializablePackageTree, m as isSourceCodeFile, n as graphToSerializableTree, o as printDependencyTree, p as analyzeDependencies, r as diffGraphToSerializablePackageTree, s as printPackageDependencyDiffTree, t as graphToSerializableReactTree } from "./react-
|
|
2
|
+
import { a as printReactUsageTree, c as printPackageDependencyTree, f as analyzeReactUsage, g as analyzePackageDependencies, h as analyzePackageDependencyDiff, i as graphToSerializablePackageTree, m as isSourceCodeFile, n as graphToSerializableTree, o as printDependencyTree, p as analyzeDependencies, r as diffGraphToSerializablePackageTree, s as printPackageDependencyDiffTree, t as graphToSerializableReactTree } from "./react-CE91R4Q1.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as printReactUsageTree, c as printPackageDependencyTree, d as getReactUsageRoots, f as analyzeReactUsage, g as analyzePackageDependencies, h as analyzePackageDependencyDiff, i as graphToSerializablePackageTree, l as getFilteredUsages, n as graphToSerializableTree, o as printDependencyTree, p as analyzeDependencies, r as diffGraphToSerializablePackageTree, s as printPackageDependencyDiffTree, t as graphToSerializableReactTree, u as getReactUsageEntries } from "./react-
|
|
1
|
+
import { a as printReactUsageTree, c as printPackageDependencyTree, d as getReactUsageRoots, f as analyzeReactUsage, g as analyzePackageDependencies, h as analyzePackageDependencyDiff, i as graphToSerializablePackageTree, l as getFilteredUsages, n as graphToSerializableTree, o as printDependencyTree, p as analyzeDependencies, r as diffGraphToSerializablePackageTree, s as printPackageDependencyDiffTree, t as graphToSerializableReactTree, u as getReactUsageEntries } from "./react-CE91R4Q1.mjs";
|
|
2
2
|
export { analyzeDependencies, analyzePackageDependencies, analyzePackageDependencyDiff, analyzeReactUsage, diffGraphToSerializablePackageTree, getFilteredUsages, getReactUsageEntries, getReactUsageRoots, graphToSerializablePackageTree, graphToSerializableReactTree, graphToSerializableTree, printDependencyTree, printPackageDependencyDiffTree, printPackageDependencyTree, printReactUsageTree };
|
|
@@ -1345,15 +1345,18 @@ var DependencyGraphBuilder = class {
|
|
|
1345
1345
|
const normalizedPath = normalizeFilePath(filePath);
|
|
1346
1346
|
if (this.nodes.has(normalizedPath)) return;
|
|
1347
1347
|
const config = this.getConfigForFile(normalizedPath);
|
|
1348
|
-
const program = this.getProgramForFile(normalizedPath, config);
|
|
1349
1348
|
const checker = this.options.trackUnusedImports ? this.getCheckerForFile(normalizedPath, config) : void 0;
|
|
1350
|
-
const dependencies = collectModuleReferences(
|
|
1349
|
+
const dependencies = collectModuleReferences(this.getSourceFileForFile(normalizedPath, config), checker).map((reference) => this.resolveDependencyWithCache(reference, normalizedPath, config, entryConfigPath));
|
|
1351
1350
|
this.nodes.set(normalizedPath, {
|
|
1352
1351
|
id: normalizedPath,
|
|
1353
1352
|
dependencies
|
|
1354
1353
|
});
|
|
1355
1354
|
for (const dependency of dependencies) if (dependency.kind === "source") this.visitFile(dependency.target, entryConfigPath);
|
|
1356
1355
|
}
|
|
1356
|
+
getSourceFileForFile(filePath, config) {
|
|
1357
|
+
if (!this.options.trackUnusedImports) return createSourceFile(filePath);
|
|
1358
|
+
return this.getProgramForFile(filePath, config).getSourceFile(filePath) ?? createSourceFile(filePath);
|
|
1359
|
+
}
|
|
1357
1360
|
getConfigForFile(filePath) {
|
|
1358
1361
|
const directory = path.dirname(filePath);
|
|
1359
1362
|
const cached = this.configCache.get(directory);
|
|
@@ -2858,4 +2861,4 @@ function formatReactNodeFilePath(filePath, kind, cwd) {
|
|
|
2858
2861
|
//#endregion
|
|
2859
2862
|
export { printReactUsageTree as a, printPackageDependencyTree as c, getReactUsageRoots as d, analyzeReactUsage as f, analyzePackageDependencies as g, analyzePackageDependencyDiff as h, graphToSerializablePackageTree as i, getFilteredUsages as l, isSourceCodeFile as m, graphToSerializableTree as n, printDependencyTree as o, analyzeDependencies as p, diffGraphToSerializablePackageTree as r, printPackageDependencyDiffTree as s, graphToSerializableReactTree as t, getReactUsageEntries as u };
|
|
2860
2863
|
|
|
2861
|
-
//# sourceMappingURL=react-
|
|
2864
|
+
//# sourceMappingURL=react-CE91R4Q1.mjs.map
|