resolve-everything 0.1.2 → 0.1.3
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/.node-version +1 -1
- package/.npm-version +1 -1
- package/dist/cli.js +4 -4
- package/dist/default-resolver.js +1 -0
- package/dist/help-text.js +0 -1
- package/dist/module.js +21 -8
- package/dist/serialize.js +1 -2
- package/dist/test-helpers.js +4 -4
- package/dist/walk.js +19 -10
- package/dist/walker.d.ts +0 -1
- package/dist/walker.js +17 -7
- package/package.json +15 -14
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v24.14.0
|
package/.npm-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
9.
|
|
1
|
+
11.9.0
|
package/dist/cli.js
CHANGED
|
@@ -27,7 +27,7 @@ const _1 = require(".");
|
|
|
27
27
|
if (entrypoint == null) {
|
|
28
28
|
throw new Error(`You must specify an --entrypoint. Run with --help for more info.`);
|
|
29
29
|
}
|
|
30
|
-
if (!node_fs_1.default.existsSync(entrypoint)) {
|
|
30
|
+
if (!node_fs_1.default.existsSync(entrypoint.toString())) {
|
|
31
31
|
throw new Error("No such file: " + entrypoint);
|
|
32
32
|
}
|
|
33
33
|
const walkOptions = {
|
|
@@ -69,7 +69,7 @@ const _1 = require(".");
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
if (resolver) {
|
|
72
|
-
const exps = require(resolver);
|
|
72
|
+
const exps = require(resolver.toString());
|
|
73
73
|
if (typeof exps === "function") {
|
|
74
74
|
walkOptions.resolver = exps;
|
|
75
75
|
}
|
|
@@ -88,10 +88,10 @@ const _1 = require(".");
|
|
|
88
88
|
throw new Error(`Resolver at ${JSON.stringify(resolver)} didn't export a 'resolve' function.`);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
const result = await (0, _1.walkAsync)(entrypoint, walkOptions);
|
|
91
|
+
const result = await (0, _1.walkAsync)(entrypoint.toString(), walkOptions);
|
|
92
92
|
let toPrint = (0, _1.serialize)(result.modules);
|
|
93
93
|
if (onlyEntrypoint) {
|
|
94
|
-
toPrint = toPrint[entrypoint];
|
|
94
|
+
toPrint = toPrint[entrypoint.toString()];
|
|
95
95
|
}
|
|
96
96
|
if (json === undefined && !process.stdout.isTTY) {
|
|
97
97
|
json = true;
|
package/dist/default-resolver.js
CHANGED
package/dist/help-text.js
CHANGED
|
@@ -60,7 +60,6 @@ ${opt("--only-entrypoint")} (boolean):
|
|
|
60
60
|
If true, only the imports/requires in the entrypoint file will be resolved,
|
|
61
61
|
and no other files will be walked over.
|
|
62
62
|
|
|
63
|
-
|
|
64
63
|
${opt("--sort")} (boolean):
|
|
65
64
|
If true, results will be sorted lexicographically. If you want results to be
|
|
66
65
|
stable, you should enable this, as the order is non-deterministic otherwise
|
package/dist/module.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Module = void 0;
|
|
27
37
|
const fs = __importStar(require("node:fs"));
|
|
@@ -66,7 +76,10 @@ class Module {
|
|
|
66
76
|
parse(code) {
|
|
67
77
|
debug_logger_1.debugLogger.summary("Module.parse", this.id);
|
|
68
78
|
debug_logger_1.debugLogger.args("Module.parse", code);
|
|
69
|
-
const ast = ee.
|
|
79
|
+
const ast = ee.parse(code, {
|
|
80
|
+
fileName: this.id,
|
|
81
|
+
parseOptions: { skipRecast: true },
|
|
82
|
+
});
|
|
70
83
|
debug_logger_1.debugLogger.ast(formatAst(ast, { color: true }));
|
|
71
84
|
debug_logger_1.debugLogger.returns("Module.parse ->", ast);
|
|
72
85
|
return ast;
|
package/dist/serialize.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serialize =
|
|
3
|
+
exports.serialize = serialize;
|
|
4
4
|
function serialize(modules) {
|
|
5
5
|
const result = {};
|
|
6
6
|
for (const [id, mod] of modules) {
|
|
@@ -16,4 +16,3 @@ function serialize(modules) {
|
|
|
16
16
|
}
|
|
17
17
|
return result;
|
|
18
18
|
}
|
|
19
|
-
exports.serialize = serialize;
|
package/dist/test-helpers.js
CHANGED
|
@@ -3,7 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.cliPath = exports.rootDir = void 0;
|
|
7
|
+
exports.cleanString = cleanString;
|
|
8
|
+
exports.inspectAndClean = inspectAndClean;
|
|
9
|
+
exports.cleanRunResult = cleanRunResult;
|
|
7
10
|
const node_path_1 = __importDefault(require("node:path"));
|
|
8
11
|
const node_util_1 = __importDefault(require("node:util"));
|
|
9
12
|
const path_less_traveled_1 = require("path-less-traveled");
|
|
@@ -12,11 +15,9 @@ exports.cliPath = (0, exports.rootDir)("dist/cli.js");
|
|
|
12
15
|
function cleanString(str) {
|
|
13
16
|
return str.replaceAll((0, exports.rootDir)(), "<rootDir>");
|
|
14
17
|
}
|
|
15
|
-
exports.cleanString = cleanString;
|
|
16
18
|
function inspectAndClean(value) {
|
|
17
19
|
return cleanString(node_util_1.default.inspect(value, { depth: Infinity }));
|
|
18
20
|
}
|
|
19
|
-
exports.inspectAndClean = inspectAndClean;
|
|
20
21
|
function cleanRunResult(result) {
|
|
21
22
|
return {
|
|
22
23
|
...result,
|
|
@@ -24,4 +25,3 @@ function cleanRunResult(result) {
|
|
|
24
25
|
stderr: cleanString(result.stderr),
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
|
-
exports.cleanRunResult = cleanRunResult;
|
package/dist/walk.js
CHANGED
|
@@ -15,15 +15,26 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
36
|
+
exports.walk = walk;
|
|
37
|
+
exports.walkAsync = walkAsync;
|
|
27
38
|
const path = __importStar(require("node:path"));
|
|
28
39
|
const walker_1 = require("./walker");
|
|
29
40
|
const debug_logger_1 = require("./debug-logger");
|
|
@@ -61,7 +72,6 @@ function walk(entrypoint, options) {
|
|
|
61
72
|
debug_logger_1.debugLogger.returns("walk ->", ret);
|
|
62
73
|
return ret;
|
|
63
74
|
}
|
|
64
|
-
exports.walk = walk;
|
|
65
75
|
async function walkAsync(entrypoint, options) {
|
|
66
76
|
debug_logger_1.debugLogger.summary("walkAsync", entrypoint);
|
|
67
77
|
debug_logger_1.debugLogger.args("walkAsync", entrypoint, options);
|
|
@@ -78,4 +88,3 @@ async function walkAsync(entrypoint, options) {
|
|
|
78
88
|
debug_logger_1.debugLogger.returns("walkAsync ->", ret);
|
|
79
89
|
return ret;
|
|
80
90
|
}
|
|
81
|
-
exports.walkAsync = walkAsync;
|
package/dist/walker.d.ts
CHANGED
package/dist/walker.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.Walker = void 0;
|
|
27
37
|
const path = __importStar(require("node:path"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "resolve-everything",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "walk your project's import/require tree and print all the relationships",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"resolve-everything": "dist/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "rm -rf dist && bunx --bun tsc && chmod +x dist/cli.js",
|
|
11
|
+
"build": "rm -rf dist && bunx --bun tsc && chmod +x dist/cli.js && rm dist/*.test.*",
|
|
12
12
|
"test": "vitest",
|
|
13
13
|
"cli": "bun src/cli.ts"
|
|
14
14
|
},
|
|
@@ -23,23 +23,24 @@
|
|
|
23
23
|
"author": "Lily Skye <me@suchipi.com>",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/debug": "^4.1.
|
|
27
|
-
"@types/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
26
|
+
"@types/debug": "^4.1.13",
|
|
27
|
+
"@types/node": "^25.5.0",
|
|
28
|
+
"@types/resolve": "^1.20.6",
|
|
29
|
+
"first-base": "^1.6.1",
|
|
30
|
+
"path-less-traveled": "^2.2.1",
|
|
31
|
+
"prettier": "^3.8.1",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"vitest": "^4.1.0"
|
|
33
34
|
},
|
|
34
35
|
"prettier": {},
|
|
35
36
|
"dependencies": {
|
|
36
|
-
"clefairy": "^
|
|
37
|
-
"debug": "^4.3
|
|
38
|
-
"equivalent-exchange": "^
|
|
37
|
+
"clefairy": "^2.1.0",
|
|
38
|
+
"debug": "^4.4.3",
|
|
39
|
+
"equivalent-exchange": "^3.2.0",
|
|
39
40
|
"kleur": "^4.1.5",
|
|
40
|
-
"parallel-park": "^0.
|
|
41
|
+
"parallel-park": "^0.3.1",
|
|
41
42
|
"pretty-print-ast": "^1.0.1",
|
|
42
|
-
"resolve": "^1.22.
|
|
43
|
+
"resolve": "^1.22.11"
|
|
43
44
|
},
|
|
44
45
|
"repository": {
|
|
45
46
|
"type": "git",
|