@joystick.js/cli-canary 0.0.0-canary.1313 → 0.0.0-canary.1315
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"./read_file_dependency_map.js";import l from"../../path_exists.js";import c from"../../get_platform_safe_path.js";const _=(r="",o={})=>Object.entries(o).filter(([a,t])=>{const i=t&&t.imports&&t.imports.some(s=>s.absolute_path.includes(r)||s.absolute_path?.toLowerCase()?.includes(r)),m=t&&t.requires&&t.requires.some(s=>s.absolute_path.includes(r)||s.absolute_path?.toLowerCase()?.includes(r));return i||m}).map(([a])=>a.replace(c(`${process.cwd()}/`),"")),p=async(r="")=>{const o=await u(),e=_(r,o);return Promise.all(e.filter(a=>l(a)))};var g=p;export{g as default};
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@joystick.js/cli-canary",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.0-canary.
|
|
5
|
-
"canary_version": "0.0.0-canary.
|
|
4
|
+
"version": "0.0.0-canary.1315",
|
|
5
|
+
"canary_version": "0.0.0-canary.1314",
|
|
6
6
|
"description": "The CLI for Joystick.",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"bin": {
|
|
@@ -3,14 +3,6 @@ import path_exists from '../../path_exists.js';
|
|
|
3
3
|
import get_platform_safe_path from '../../get_platform_safe_path.js';
|
|
4
4
|
|
|
5
5
|
const find_codependencies_in_map = (path_to_find = '', map = {}) => {
|
|
6
|
-
// TODO: I don't care about path variations anymore because I have the absolute paths
|
|
7
|
-
// of the child dependencies in the map. Basically I just need to ask, can I find an absolute
|
|
8
|
-
// path that matches the current path being rebuilt? If I do, give me the codependent_path name
|
|
9
|
-
// as that is a codependency of the file being rebuilt.
|
|
10
|
-
console.log({
|
|
11
|
-
path_to_find,
|
|
12
|
-
});
|
|
13
|
-
|
|
14
6
|
const matching_codependents = Object.entries(map)
|
|
15
7
|
.filter(([_codependent_path, codependent_dependencies]) => {
|
|
16
8
|
const has_matching_imports =
|
|
@@ -31,15 +23,13 @@ const find_codependencies_in_map = (path_to_find = '', map = {}) => {
|
|
|
31
23
|
// NOTE: If a file is renamed to use lowercase (or vice versa), the dependent file
|
|
32
24
|
// should respect that change, even if the developer forgets to update the import
|
|
33
25
|
// path's casing.
|
|
34
|
-
|
|
26
|
+
|
|
35
27
|
return codependent_dependency.absolute_path.includes(path_to_find) || codependent_dependency.absolute_path?.toLowerCase()?.includes(path_to_find);
|
|
36
28
|
});
|
|
37
29
|
|
|
38
30
|
return has_matching_imports || has_matching_requires;
|
|
39
31
|
});
|
|
40
32
|
|
|
41
|
-
console.log(matching_codependents);
|
|
42
|
-
|
|
43
33
|
return matching_codependents.map(([matching_codependent_path]) => {
|
|
44
34
|
return matching_codependent_path.replace(
|
|
45
35
|
get_platform_safe_path(`${process.cwd()}/`),
|