@chrisdudek/yg 5.0.0-alpha.3 → 5.0.0-alpha.5
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/ast.d.ts +7 -2
- package/dist/ast.js +7 -2
- package/dist/bin.js +12160 -13596
- package/dist/structure.d.ts +40 -18
- package/dist/structure.js +399 -88
- package/graph-schemas/yg-architecture.yaml +9 -4
- package/graph-schemas/yg-aspect.yaml +54 -0
- package/graph-schemas/yg-config.yaml +7 -5
- package/graph-schemas/yg-node.yaml +0 -6
- package/package.json +1 -1
package/dist/ast.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ interface SourceFile {
|
|
|
6
6
|
path: string;
|
|
7
7
|
/** Raw source code */
|
|
8
8
|
content: string;
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Parsed tree-sitter Tree, or `undefined` for a file whose extension has no
|
|
11
|
+
* registered grammar (e.g. `.md`, `.sh`, `.json`). Such files are still
|
|
12
|
+
* delivered to `check()` so content/regex rules can iterate them; rules that
|
|
13
|
+
* touch `file.ast` must guard with `if (!file.ast) continue;`.
|
|
14
|
+
*/
|
|
15
|
+
ast?: Tree;
|
|
11
16
|
}
|
|
12
17
|
interface CheckContext {
|
|
13
18
|
files: SourceFile[];
|
package/dist/ast.js
CHANGED
|
@@ -8,10 +8,15 @@ function report(file, node, message) {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
// src/
|
|
11
|
+
// src/utils/mapping-path.ts
|
|
12
12
|
import { minimatch } from "minimatch";
|
|
13
|
+
function globMatch(file, pattern) {
|
|
14
|
+
return minimatch(file, pattern, { dot: true });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/ast/file-path.ts
|
|
13
18
|
function inFile(file, pattern) {
|
|
14
|
-
if ("glob" in pattern) return
|
|
19
|
+
if ("glob" in pattern) return globMatch(file.path, pattern.glob);
|
|
15
20
|
if ("regex" in pattern) return pattern.regex.test(file.path);
|
|
16
21
|
if ("contains" in pattern) return file.path.includes(pattern.contains);
|
|
17
22
|
return false;
|