@platformos/platformos-graph 0.0.19 → 0.1.0
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/CHANGELOG.md +516 -0
- package/bin/platformos-graph +21 -81
- package/dist/cache-probes.spec.d.ts +1 -0
- package/dist/cache-probes.spec.js +62 -0
- package/dist/cache-probes.spec.js.map +1 -0
- package/dist/cli.d.ts +46 -0
- package/dist/cli.js +131 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.spec.d.ts +1 -0
- package/dist/cli.spec.js +235 -0
- package/dist/cli.spec.js.map +1 -0
- package/dist/graph/app-index-resolution.spec.d.ts +1 -0
- package/dist/graph/app-index-resolution.spec.js +167 -0
- package/dist/graph/app-index-resolution.spec.js.map +1 -0
- package/dist/graph/asset-resolution.spec.d.ts +1 -0
- package/dist/graph/asset-resolution.spec.js +64 -0
- package/dist/graph/asset-resolution.spec.js.map +1 -0
- package/dist/graph/augment.js +3 -1
- package/dist/graph/augment.js.map +1 -1
- package/dist/graph/build.d.ts +15 -2
- package/dist/graph/build.js +54 -12
- package/dist/graph/build.js.map +1 -1
- package/dist/graph/build.spec.d.ts +1 -0
- package/dist/graph/build.spec.js +138 -0
- package/dist/graph/build.spec.js.map +1 -0
- package/dist/graph/edge-sources.d.ts +28 -0
- package/dist/graph/edge-sources.js +43 -0
- package/dist/graph/edge-sources.js.map +1 -0
- package/dist/graph/edge-sources.spec.d.ts +1 -0
- package/dist/graph/edge-sources.spec.js +125 -0
- package/dist/graph/edge-sources.spec.js.map +1 -0
- package/dist/graph/extract.spec.d.ts +1 -0
- package/dist/graph/extract.spec.js +163 -0
- package/dist/graph/extract.spec.js.map +1 -0
- package/dist/graph/module.d.ts +70 -2
- package/dist/graph/module.js +164 -29
- package/dist/graph/module.js.map +1 -1
- package/dist/graph/module.spec.d.ts +1 -0
- package/dist/graph/module.spec.js +74 -0
- package/dist/graph/module.spec.js.map +1 -0
- package/dist/graph/query.d.ts +72 -0
- package/dist/graph/query.js +140 -0
- package/dist/graph/query.js.map +1 -0
- package/dist/graph/query.spec.d.ts +1 -0
- package/dist/graph/query.spec.js +209 -0
- package/dist/graph/query.spec.js.map +1 -0
- package/dist/graph/serialize.spec.d.ts +1 -0
- package/dist/graph/serialize.spec.js +50 -0
- package/dist/graph/serialize.spec.js.map +1 -0
- package/dist/graph/structural.spec.d.ts +1 -0
- package/dist/graph/structural.spec.js +146 -0
- package/dist/graph/structural.spec.js.map +1 -0
- package/dist/graph/test-helpers.d.ts +2 -3
- package/dist/graph/test-helpers.js +5 -9
- package/dist/graph/test-helpers.js.map +1 -1
- package/dist/graph/traverse-edges.spec.d.ts +1 -0
- package/dist/graph/traverse-edges.spec.js +337 -0
- package/dist/graph/traverse-edges.spec.js.map +1 -0
- package/dist/graph/traverse.d.ts +63 -4
- package/dist/graph/traverse.js +364 -49
- package/dist/graph/traverse.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +21 -4
- package/dist/index.js.map +1 -1
- package/dist/parsers.d.ts +35 -0
- package/dist/parsers.js +72 -0
- package/dist/parsers.js.map +1 -0
- package/dist/parsers.spec.d.ts +1 -0
- package/dist/parsers.spec.js +70 -0
- package/dist/parsers.spec.js.map +1 -0
- package/dist/toSourceCode.d.ts +14 -2
- package/dist/toSourceCode.js +23 -19
- package/dist/toSourceCode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +114 -20
- package/dist/types.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/fixtures/asset-edges/app/assets/logo.css +1 -0
- package/fixtures/asset-edges/app/assets/site/app.js +1 -0
- package/fixtures/asset-edges/app/views/pages/index.liquid +3 -0
- package/fixtures/background-edges/app/views/pages/broken.liquid +3 -0
- package/fixtures/background-edges/app/views/pages/index.liquid +3 -0
- package/fixtures/background-edges/app/views/partials/jobs/notify.liquid +3 -0
- package/fixtures/function-edges/app/lib/queries/list.liquid +3 -0
- package/fixtures/function-edges/app/views/pages/broken.liquid +3 -0
- package/fixtures/function-edges/app/views/pages/index.liquid +3 -0
- package/fixtures/graphql-edges/app/graphql/blog_posts/find.graphql +10 -0
- package/fixtures/graphql-edges/app/views/pages/broken.liquid +3 -0
- package/fixtures/graphql-edges/app/views/pages/index.liquid +3 -0
- package/fixtures/graphql-table/app/graphql/with_table.graphql +5 -0
- package/fixtures/graphql-table/app/graphql/without_table.graphql +3 -0
- package/fixtures/graphql-table/app/views/pages/index.liquid +4 -0
- package/fixtures/include-edges/app/views/pages/index.liquid +1 -0
- package/fixtures/include-edges/app/views/partials/shared/header.liquid +1 -0
- package/fixtures/layout-edges/app/views/layouts/theme.liquid +4 -0
- package/fixtures/layout-edges/app/views/pages/broken.liquid +5 -0
- package/fixtures/layout-edges/app/views/pages/index.liquid +5 -0
- package/fixtures/module-edges/app/views/pages/index.liquid +4 -0
- package/fixtures/module-edges/modules/my_module/public/lib/queries/get.liquid +3 -0
- package/fixtures/module-edges/modules/my_module/public/views/partials/card.liquid +1 -0
- package/fixtures/schema-nodes/app/schema/blog_post.yml +6 -0
- package/fixtures/schema-nodes/app/schema/no_name.yml +3 -0
- package/fixtures/schema-nodes/app/views/pages/index.liquid +1 -0
- package/fixtures/skeleton/app/assets/app.js +1 -0
- package/fixtures/skeleton/app/views/partials/child.liquid +2 -4
- package/fixtures/skeleton/app/views/partials/parent.liquid +2 -4
- package/fixtures/structural/app/views/pages/about.liquid +1 -0
- package/fixtures/structural/app/views/pages/blog/show.liquid +4 -0
- package/fixtures/structural/app/views/pages/index.liquid +6 -0
- package/fixtures/structural/app/views/pages/rich.liquid +8 -0
- package/fixtures/structural/app/views/partials/card.liquid +1 -0
- package/fixtures/structural/app/views/partials/documented.liquid +5 -0
- package/package.json +7 -5
- package/src/cli.spec.ts +271 -0
- package/src/cli.ts +167 -0
- package/src/graph/augment.ts +4 -2
- package/src/graph/build.spec.ts +888 -9
- package/src/graph/build.ts +68 -17
- package/src/graph/edge-sources.spec.ts +125 -0
- package/src/graph/edge-sources.ts +49 -0
- package/src/graph/module.spec.ts +168 -0
- package/src/graph/module.ts +167 -33
- package/src/graph/query.spec.ts +260 -0
- package/src/graph/query.ts +154 -0
- package/src/graph/serialize.spec.ts +4 -4
- package/src/graph/test-helpers.ts +5 -12
- package/src/graph/traverse.spec.ts +278 -0
- package/src/graph/traverse.ts +423 -54
- package/src/index.ts +16 -1
- package/src/parsers.spec.ts +85 -0
- package/src/parsers.ts +75 -0
- package/src/toSourceCode.ts +26 -26
- package/src/types.ts +120 -23
- package/src/utils/index.ts +1 -1
- package/bin/jsconfig.json +0 -18
- package/dist/getWebComponentMap.d.ts +0 -10
- package/dist/getWebComponentMap.js +0 -66
- package/dist/getWebComponentMap.js.map +0 -1
- package/fixtures/skeleton/assets/app.js +0 -7
- package/src/getWebComponentMap.ts +0 -81
- /package/fixtures/skeleton/{assets → app/assets}/app.css +0 -0
package/dist/graph/traverse.d.ts
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { UriString } from '@platformos/platformos-check-common';
|
|
2
|
+
import { AugmentedDependencies, AppGraph, AppModule, FileSourceCode, GraphBuildOptions, ModuleStructural, Range, Reference, ReferenceKind, Void } from '../types';
|
|
3
|
+
/** A resolved outgoing reference: the target graph node + its call-site range + kind (+ named-arg names). */
|
|
4
|
+
export interface ResolvedReference {
|
|
5
|
+
target: AppModule;
|
|
6
|
+
sourceRange: Range;
|
|
7
|
+
kind: ReferenceKind;
|
|
8
|
+
/** Names of the named arguments at the call site, in source order; omitted when none. */
|
|
9
|
+
args?: string[];
|
|
10
|
+
}
|
|
11
|
+
/** The dependency surface the reference resolver needs: what `DocumentsLocator` takes. */
|
|
12
|
+
type ResolverDependencies = Pick<AugmentedDependencies, 'fs' | 'app'>;
|
|
13
|
+
export declare function traverseModule(module: AppModule, appGraph: AppGraph, deps: AugmentedDependencies, options?: GraphBuildOptions): Promise<Void>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve a single parsed Liquid file's outgoing references — the one place that
|
|
16
|
+
* knows how each Liquid construct (`render`/`include`, `function`, `background`,
|
|
17
|
+
* `graphql`, asset filters) maps to a target module + {@link ReferenceKind}.
|
|
18
|
+
*
|
|
19
|
+
* Both the full-project traversal ({@link traverseLiquidModule}) and the
|
|
20
|
+
* standalone per-file primitive ({@link extractFileReferences}) go through this,
|
|
21
|
+
* so resolution can never drift between "graph build" and "validate one buffer".
|
|
22
|
+
*
|
|
23
|
+
* Targets are produced via the module factories (which normalize URIs), so keys
|
|
24
|
+
* match the rest of the graph on every platform. Unparseable input yields no
|
|
25
|
+
* references rather than throwing.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveLiquidReferences(appGraph: AppGraph, sourceCode: FileSourceCode, deps: ResolverDependencies): Promise<ResolvedReference[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Extract one Liquid file's outgoing dependency references, resolved against the project at
|
|
30
|
+
* `rootUri`, WITHOUT building the whole app graph.
|
|
31
|
+
*
|
|
32
|
+
* The per-file primitive for consumers holding a single (possibly in-flight, not-yet-on-disk)
|
|
33
|
+
* buffer. Resolution uses the same `DocumentsLocator`-backed logic as the full graph build, so
|
|
34
|
+
* a target's URI is identical to the key it would have as a graph node.
|
|
35
|
+
*
|
|
36
|
+
* Notes for consumers:
|
|
37
|
+
* - Targets are returned whether or not they exist on disk (resolution is path-based). To
|
|
38
|
+
* distinguish missing targets, `stat` `target.uri` via the same `fs`.
|
|
39
|
+
* - Only statically resolvable references are returned; dynamic targets
|
|
40
|
+
* (`{% render some_var %}`) and inline forms are skipped.
|
|
41
|
+
* - `sourceCode` is parsed by the caller; nothing but target resolution happens here.
|
|
42
|
+
*/
|
|
43
|
+
export declare function extractFileReferences(rootUri: UriString, sourceUri: UriString, sourceCode: FileSourceCode, deps: ResolverDependencies): Promise<Reference[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Extract a Liquid file's own structural declarations from an already-parsed source — the
|
|
46
|
+
* per-file primitive, sibling to {@link extractFileReferences}. Reuses the shared `js-yaml`
|
|
47
|
+
* frontmatter parse, platformos-common's slug helpers, and check-common's liquid-doc and
|
|
48
|
+
* translation detection — never a second parser.
|
|
49
|
+
*
|
|
50
|
+
* Usage facts come from one walk of the parsed AST and are always present (sorted,
|
|
51
|
+
* de-duplicated); `doc_params` is in source order. Routing facts come from frontmatter: `slug`
|
|
52
|
+
* is the frontmatter override else the path-derived slug, for page files only, and
|
|
53
|
+
* `layout`/`method` when declared.
|
|
54
|
+
*
|
|
55
|
+
* Returns `undefined` for a non-Liquid source or one that could not be parsed.
|
|
56
|
+
*/
|
|
57
|
+
export declare function extractStructural(sourceCode: FileSourceCode, uri: UriString): Promise<ModuleStructural | undefined>;
|
|
3
58
|
/**
|
|
4
59
|
* The bind method is the method that links two modules together.
|
|
5
60
|
*
|
|
@@ -7,8 +62,12 @@ export declare function traverseModule(module: AppModule, appGraph: AppGraph, de
|
|
|
7
62
|
*
|
|
8
63
|
* This function mutates the source and target modules.
|
|
9
64
|
*/
|
|
10
|
-
export declare function bind(source: AppModule, target: AppModule, { sourceRange,
|
|
65
|
+
export declare function bind(source: AppModule, target: AppModule, { sourceRange, type, // the type of dependency, can be 'direct' or 'indirect'
|
|
66
|
+
kind, // the semantic Liquid construct that created the edge
|
|
67
|
+
args, }?: {
|
|
11
68
|
sourceRange?: Range;
|
|
12
|
-
targetRange?: Range;
|
|
13
69
|
type?: Reference['type'];
|
|
70
|
+
kind?: ReferenceKind;
|
|
71
|
+
args?: string[];
|
|
14
72
|
}): void;
|
|
73
|
+
export {};
|
package/dist/graph/traverse.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.traverseModule = traverseModule;
|
|
7
|
+
exports.resolveLiquidReferences = resolveLiquidReferences;
|
|
8
|
+
exports.extractFileReferences = extractFileReferences;
|
|
9
|
+
exports.extractStructural = extractStructural;
|
|
4
10
|
exports.bind = bind;
|
|
11
|
+
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
5
12
|
const liquid_html_parser_1 = require("@platformos/liquid-html-parser");
|
|
6
13
|
const platformos_check_common_1 = require("@platformos/platformos-check-common");
|
|
14
|
+
const platformos_common_1 = require("@platformos/platformos-common");
|
|
15
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
7
16
|
const utils_1 = require("../utils");
|
|
8
17
|
const module_1 = require("./module");
|
|
9
|
-
async function traverseModule(module, appGraph, deps) {
|
|
18
|
+
async function traverseModule(module, appGraph, deps, options = {}) {
|
|
10
19
|
// If the module is already traversed, skip it
|
|
11
20
|
if (appGraph.modules[module.uri]) {
|
|
12
21
|
return;
|
|
@@ -22,26 +31,88 @@ async function traverseModule(module, appGraph, deps) {
|
|
|
22
31
|
}
|
|
23
32
|
switch (module.type) {
|
|
24
33
|
case "Liquid" /* ModuleType.Liquid */: {
|
|
25
|
-
return traverseLiquidModule(module, appGraph, deps);
|
|
34
|
+
return traverseLiquidModule(module, appGraph, deps, options);
|
|
26
35
|
}
|
|
27
36
|
case "Asset" /* ModuleType.Asset */: {
|
|
28
37
|
return; // Nothing to traverse in assets
|
|
29
38
|
}
|
|
39
|
+
case "GraphQL" /* ModuleType.GraphQL */: {
|
|
40
|
+
// Leaf node — GraphQL documents have no platformOS dependencies. We do read the
|
|
41
|
+
// file once to record the model tables it targets (a neutral platform fact),
|
|
42
|
+
// from the parse the source code already carries: when the graph reads through
|
|
43
|
+
// an `App` that is the SAME parse the lint used, not a second one.
|
|
44
|
+
const sourceCode = await deps.getSourceCode(module.uri);
|
|
45
|
+
module.tables = (0, platformos_common_1.isGraphqlDocument)(sourceCode.ast) ? (0, platformos_common_1.extractGraphqlTables)(sourceCode.ast) : [];
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
case "Schema" /* ModuleType.Schema */: {
|
|
49
|
+
// Leaf node — a custom model type / schema file. Read the source once to
|
|
50
|
+
// record its model table name (the YAML `name:`), a neutral platform fact.
|
|
51
|
+
const sourceCode = await deps.getSourceCode(module.uri);
|
|
52
|
+
module.table = (0, platformos_common_1.extractSchemaTable)(sourceCode.source);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
30
55
|
default: {
|
|
31
56
|
return (0, utils_1.assertNever)(module);
|
|
32
57
|
}
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
|
-
async function traverseLiquidModule(module, appGraph, deps) {
|
|
60
|
+
async function traverseLiquidModule(module, appGraph, deps, options) {
|
|
36
61
|
const sourceCode = await deps.getSourceCode(module.uri);
|
|
62
|
+
// Surface the file's own structural declarations as a by-product of the parse
|
|
63
|
+
// — only when the caller opted in (see GraphBuildOptions). Absent
|
|
64
|
+
// otherwise, and when the file could not be parsed.
|
|
65
|
+
if (options.includeStructural) {
|
|
66
|
+
module.structural = await extractStructural(sourceCode, module.uri);
|
|
67
|
+
}
|
|
68
|
+
const references = await resolveLiquidReferences(appGraph, sourceCode, deps);
|
|
69
|
+
for (const reference of references) {
|
|
70
|
+
bind(module, reference.target, {
|
|
71
|
+
sourceRange: reference.sourceRange,
|
|
72
|
+
kind: reference.kind,
|
|
73
|
+
args: reference.args,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
const modules = (0, utils_1.unique)(references.map((ref) => ref.target));
|
|
77
|
+
const promises = modules.map((mod) => traverseModule(mod, appGraph, deps, options));
|
|
78
|
+
return Promise.all(promises);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Resolve a single parsed Liquid file's outgoing references — the one place that
|
|
82
|
+
* knows how each Liquid construct (`render`/`include`, `function`, `background`,
|
|
83
|
+
* `graphql`, asset filters) maps to a target module + {@link ReferenceKind}.
|
|
84
|
+
*
|
|
85
|
+
* Both the full-project traversal ({@link traverseLiquidModule}) and the
|
|
86
|
+
* standalone per-file primitive ({@link extractFileReferences}) go through this,
|
|
87
|
+
* so resolution can never drift between "graph build" and "validate one buffer".
|
|
88
|
+
*
|
|
89
|
+
* Targets are produced via the module factories (which normalize URIs), so keys
|
|
90
|
+
* match the rest of the graph on every platform. Unparseable input yields no
|
|
91
|
+
* references rather than throwing.
|
|
92
|
+
*/
|
|
93
|
+
async function resolveLiquidReferences(appGraph, sourceCode, deps) {
|
|
37
94
|
if (sourceCode.ast instanceof Error)
|
|
38
|
-
return; // can't visit what you can't parse
|
|
95
|
+
return []; // can't visit what you can't parse
|
|
96
|
+
// Canonical target resolution (lib paths, module prefixes, extensions) is owned by
|
|
97
|
+
// platformos-common's DocumentsLocator — never re-derived here.
|
|
98
|
+
//
|
|
99
|
+
// `deps.app` is the caller's App, so a name is answered by the index it already holds
|
|
100
|
+
// (O(1), no I/O) and only an index MISS walks candidate directories. Without one the
|
|
101
|
+
// locator builds a walk-only stand-in and every reference lists a directory per
|
|
102
|
+
// candidate path — same answers, thousands of extra listings on a project the language
|
|
103
|
+
// server had already indexed. See `IDependencies.app`.
|
|
104
|
+
const documentsLocator = new platformos_common_1.DocumentsLocator(deps.fs, deps.app);
|
|
105
|
+
const rootUri = vscode_uri_1.URI.parse(appGraph.rootUri);
|
|
39
106
|
const visitor = {
|
|
40
107
|
// {{ 'app.js' | asset_url }}
|
|
41
|
-
//
|
|
42
|
-
//
|
|
108
|
+
//
|
|
109
|
+
// `asset_url` is the ONLY filter that names an asset. `asset_img_url` and
|
|
110
|
+
// `inline_asset_content` stood beside it here and are Shopify's, inherited with the fork:
|
|
111
|
+
// neither is in `filters.json`, so no platformOS template can call one, and the four sample
|
|
112
|
+
// projects contain zero uses against 1142 of `asset_url`. A dead name in an edge rule is not
|
|
113
|
+
// harmless — it is a claim about the platform that the next reader has no reason to doubt.
|
|
43
114
|
LiquidFilter: async (node, ancestors) => {
|
|
44
|
-
if (
|
|
115
|
+
if (node.name === 'asset_url') {
|
|
45
116
|
const parentNode = ancestors[ancestors.length - 1];
|
|
46
117
|
if (parentNode.type !== liquid_html_parser_1.NodeTypes.LiquidVariable)
|
|
47
118
|
return;
|
|
@@ -50,63 +121,303 @@ async function traverseLiquidModule(module, appGraph, deps) {
|
|
|
50
121
|
if (parentNode.filters[0] !== node)
|
|
51
122
|
return;
|
|
52
123
|
const asset = parentNode.expression.value;
|
|
53
|
-
|
|
54
|
-
|
|
124
|
+
// Skip a non-asset value before paying for the filesystem probe below.
|
|
125
|
+
// Not the only gate: `getAssetModuleByUri` applies the same predicate, so
|
|
126
|
+
// neither layer relies on the other remembering.
|
|
127
|
+
if (!(0, module_1.isSupportedAsset)(asset))
|
|
128
|
+
return;
|
|
129
|
+
// Resolve through DocumentsLocator (`'asset'`: app/assets, module
|
|
130
|
+
// public/assets) — not a hard-coded base — so the target matches the
|
|
131
|
+
// real on-disk location, with the canonical `app/assets/<name>` as the
|
|
132
|
+
// fallback for an unresolved asset.
|
|
133
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, 'asset', asset);
|
|
134
|
+
if (!uri)
|
|
55
135
|
return;
|
|
136
|
+
const target = (0, module_1.getAssetModuleByUri)(appGraph, uri);
|
|
137
|
+
if (!target)
|
|
138
|
+
return; // resolution changed the extension — no asset node
|
|
56
139
|
return {
|
|
57
|
-
target
|
|
140
|
+
target,
|
|
58
141
|
sourceRange: [parentNode.position.start, parentNode.position.end],
|
|
142
|
+
kind: 'asset',
|
|
59
143
|
};
|
|
60
144
|
}
|
|
61
145
|
},
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
146
|
+
// {% render 'partial' %} / {% include 'partial' %}
|
|
147
|
+
// Both resolve through DocumentsLocator (like function/graphql), so module
|
|
148
|
+
// prefixes (`modules/<m>/...`), the lib search path, and `.liquid` /
|
|
149
|
+
// `.html.liquid` extensions are handled uniformly — not hard-coded to
|
|
150
|
+
// `app/views/partials`.
|
|
151
|
+
RenderMarkup: async (node, ancestors) => {
|
|
152
|
+
const partial = node.partial;
|
|
153
|
+
const tag = ancestors.at(-1);
|
|
154
|
+
if (!isStringLiteral(partial))
|
|
155
|
+
return; // dynamic target — skip
|
|
156
|
+
const isInclude = tag.type === liquid_html_parser_1.NodeTypes.LiquidTag && tag.name === liquid_html_parser_1.NamedTags.include;
|
|
157
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, isInclude ? 'include' : 'render', partial.value);
|
|
158
|
+
if (!uri)
|
|
67
159
|
return;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
160
|
+
return {
|
|
161
|
+
target: (0, module_1.getPartialModuleByUri)(appGraph, uri),
|
|
162
|
+
sourceRange: [tag.position.start, tag.position.end],
|
|
163
|
+
kind: isInclude ? 'include' : 'render',
|
|
164
|
+
args: argNames(node.args),
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
// {% function result = 'queries/...' %} / {% function res = 'commands/...' %}
|
|
168
|
+
FunctionMarkup: async (node, ancestors) => {
|
|
169
|
+
const target = node.partial;
|
|
170
|
+
const tag = ancestors.at(-1);
|
|
171
|
+
if (!isStringLiteral(target))
|
|
172
|
+
return; // dynamic target — skip
|
|
173
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, 'function', target.value);
|
|
174
|
+
if (!uri)
|
|
74
175
|
return;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
176
|
+
return {
|
|
177
|
+
target: (0, module_1.getPartialModuleByUri)(appGraph, uri),
|
|
178
|
+
sourceRange: [tag.position.start, tag.position.end],
|
|
179
|
+
kind: 'function',
|
|
180
|
+
args: argNames(node.args),
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
// {% background job_id = 'partial', ... %} (file-based form)
|
|
184
|
+
// Runs a partial asynchronously; `node.partial` is the partial reference,
|
|
185
|
+
// resolved against the same search paths as {% function %}. The inline form
|
|
186
|
+
// ({% background %}...{% endbackground %}) parses to BackgroundInlineMarkup,
|
|
187
|
+
// has no file target, and is intentionally not matched here.
|
|
188
|
+
BackgroundMarkup: async (node, ancestors) => {
|
|
189
|
+
const target = node.partial;
|
|
190
|
+
const tag = ancestors.at(-1);
|
|
191
|
+
if (!isStringLiteral(target))
|
|
192
|
+
return; // dynamic target — skip
|
|
193
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, 'function', target.value);
|
|
194
|
+
if (!uri)
|
|
78
195
|
return;
|
|
79
196
|
return {
|
|
80
|
-
target:
|
|
81
|
-
sourceRange: [
|
|
82
|
-
|
|
197
|
+
target: (0, module_1.getPartialModuleByUri)(appGraph, uri),
|
|
198
|
+
sourceRange: [tag.position.start, tag.position.end],
|
|
199
|
+
kind: 'background',
|
|
200
|
+
args: argNames(node.args),
|
|
83
201
|
};
|
|
84
202
|
},
|
|
85
|
-
// {%
|
|
86
|
-
|
|
87
|
-
|
|
203
|
+
// {% graphql result = 'path/to/operation' %}
|
|
204
|
+
// `node.name` is the RESULT variable; the operation-file path is `node.graphql`.
|
|
205
|
+
GraphQLMarkup: async (node, ancestors) => {
|
|
206
|
+
const op = node.graphql;
|
|
88
207
|
const tag = ancestors.at(-1);
|
|
89
|
-
if (!(
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
208
|
+
if (!isStringLiteral(op))
|
|
209
|
+
return; // dynamic/inline — no static file
|
|
210
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, 'graphql', op.value);
|
|
211
|
+
if (!uri)
|
|
212
|
+
return;
|
|
213
|
+
return {
|
|
214
|
+
target: (0, module_1.getGraphQLModuleByUri)(appGraph, uri),
|
|
215
|
+
sourceRange: [tag.position.start, tag.position.end],
|
|
216
|
+
kind: 'graphql',
|
|
217
|
+
args: argNames(node.args),
|
|
218
|
+
};
|
|
219
|
+
},
|
|
220
|
+
// Frontmatter `layout: name` → page/email → its wrapper layout.
|
|
221
|
+
// Resolved through DocumentsLocator (`'layout'`: app/views/layouts, module
|
|
222
|
+
// prefixes, `.html.liquid`/`.liquid`). Only an EXPLICIT, static, non-empty
|
|
223
|
+
// string layout produces an edge:
|
|
224
|
+
// - `layout: ''` → explicitly no layout (no edge)
|
|
225
|
+
// - layout omitted → no edge (we never synthesize the implicit default)
|
|
226
|
+
// - dynamic `{{ ... }}` → no edge (not statically resolvable)
|
|
227
|
+
// - non-string value → no edge
|
|
228
|
+
// The source range is the whole frontmatter block (tag-level granularity,
|
|
229
|
+
// like the other edges).
|
|
230
|
+
YAMLFrontmatter: async (node) => {
|
|
231
|
+
const data = loadFrontmatter(node.body);
|
|
232
|
+
if (!data)
|
|
233
|
+
return; // malformed/empty frontmatter — nothing to resolve
|
|
234
|
+
const layout = data.layout;
|
|
235
|
+
if (typeof layout !== 'string' || layout === '' || (0, platformos_common_1.containsLiquid)(layout))
|
|
236
|
+
return;
|
|
237
|
+
const uri = await documentsLocator.locateOrDefault(rootUri, 'layout', layout);
|
|
238
|
+
if (!uri)
|
|
239
|
+
return;
|
|
240
|
+
return {
|
|
241
|
+
target: (0, module_1.getLayoutModuleByUri)(appGraph, uri),
|
|
242
|
+
sourceRange: [node.position.start, node.position.end],
|
|
243
|
+
kind: 'layout',
|
|
244
|
+
};
|
|
95
245
|
},
|
|
96
246
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
247
|
+
return (0, platformos_check_common_1.visit)(sourceCode.ast, visitor);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Extract one Liquid file's outgoing dependency references, resolved against the project at
|
|
251
|
+
* `rootUri`, WITHOUT building the whole app graph.
|
|
252
|
+
*
|
|
253
|
+
* The per-file primitive for consumers holding a single (possibly in-flight, not-yet-on-disk)
|
|
254
|
+
* buffer. Resolution uses the same `DocumentsLocator`-backed logic as the full graph build, so
|
|
255
|
+
* a target's URI is identical to the key it would have as a graph node.
|
|
256
|
+
*
|
|
257
|
+
* Notes for consumers:
|
|
258
|
+
* - Targets are returned whether or not they exist on disk (resolution is path-based). To
|
|
259
|
+
* distinguish missing targets, `stat` `target.uri` via the same `fs`.
|
|
260
|
+
* - Only statically resolvable references are returned; dynamic targets
|
|
261
|
+
* (`{% render some_var %}`) and inline forms are skipped.
|
|
262
|
+
* - `sourceCode` is parsed by the caller; nothing but target resolution happens here.
|
|
263
|
+
*/
|
|
264
|
+
async function extractFileReferences(rootUri, sourceUri, sourceCode, deps) {
|
|
265
|
+
// A throwaway graph so the URI-normalizing module factories can be reused; it
|
|
266
|
+
// is never traversed and is discarded with this call.
|
|
267
|
+
const scratchGraph = { rootUri, entryPoints: [], modules: {} };
|
|
268
|
+
const references = await resolveLiquidReferences(scratchGraph, sourceCode, deps);
|
|
269
|
+
return references.map((reference) => ({
|
|
270
|
+
source: { uri: sourceUri, range: reference.sourceRange },
|
|
271
|
+
target: { uri: reference.target.uri },
|
|
272
|
+
type: 'direct',
|
|
273
|
+
kind: reference.kind,
|
|
274
|
+
...argsField(reference.args),
|
|
275
|
+
}));
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* A render/function/graphql target that is a static string literal (e.g.
|
|
279
|
+
* `{% render 'partial' %}`), narrowed to its `NodeTypes.String` member so the
|
|
280
|
+
* `.value` is accessible. Dynamic targets (`{% render var %}`) return false and
|
|
281
|
+
* are skipped — the graph only records statically resolvable edges.
|
|
282
|
+
*/
|
|
283
|
+
function isStringLiteral(node) {
|
|
284
|
+
return !(0, utils_1.isString)(node) && node.type === liquid_html_parser_1.NodeTypes.String;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Parse a YAML block (frontmatter body or a schema file) into an object, or
|
|
288
|
+
* `undefined` for unparseable / non-object YAML. The single `js-yaml` entry
|
|
289
|
+
* point shared by the layout-edge resolver, schema-table extraction, and
|
|
290
|
+
* self-structural extraction — so there is one frontmatter/YAML parse path.
|
|
291
|
+
*/
|
|
292
|
+
function loadFrontmatter(body) {
|
|
293
|
+
let data;
|
|
294
|
+
try {
|
|
295
|
+
// A duplicated key must not cost this file its edges — see
|
|
296
|
+
// PLATFORM_YAML_LOAD_OPTIONS. js-yaml's default throws, and the `catch` below
|
|
297
|
+
// then reports the file as having no frontmatter and no schema at all, which is
|
|
298
|
+
// how one repeated key silently removes a layout or partial from the graph.
|
|
299
|
+
data = js_yaml_1.default.load(body, platformos_common_1.PLATFORM_YAML_LOAD_OPTIONS);
|
|
103
300
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
301
|
+
catch {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
return typeof data === 'object' && data !== null ? data : undefined;
|
|
107
305
|
}
|
|
108
|
-
|
|
109
|
-
|
|
306
|
+
/**
|
|
307
|
+
* Extract a Liquid file's own structural declarations from an already-parsed source — the
|
|
308
|
+
* per-file primitive, sibling to {@link extractFileReferences}. Reuses the shared `js-yaml`
|
|
309
|
+
* frontmatter parse, platformos-common's slug helpers, and check-common's liquid-doc and
|
|
310
|
+
* translation detection — never a second parser.
|
|
311
|
+
*
|
|
312
|
+
* Usage facts come from one walk of the parsed AST and are always present (sorted,
|
|
313
|
+
* de-duplicated); `doc_params` is in source order. Routing facts come from frontmatter: `slug`
|
|
314
|
+
* is the frontmatter override else the path-derived slug, for page files only, and
|
|
315
|
+
* `layout`/`method` when declared.
|
|
316
|
+
*
|
|
317
|
+
* Returns `undefined` for a non-Liquid source or one that could not be parsed.
|
|
318
|
+
*/
|
|
319
|
+
async function extractStructural(sourceCode, uri) {
|
|
320
|
+
// Only a parsed Liquid AST has the structure this analyzes; a `.graphql`/`.yml`
|
|
321
|
+
// buffer (or an unparseable one) yields no structural facts.
|
|
322
|
+
if (sourceCode.type !== platformos_check_common_1.SourceCodeType.LiquidHtml || sourceCode.ast instanceof Error) {
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
325
|
+
const renders = new Set();
|
|
326
|
+
const graphqlQueries = new Set();
|
|
327
|
+
const filters = new Set();
|
|
328
|
+
const tags = new Set();
|
|
329
|
+
const translationKeys = new Set();
|
|
330
|
+
// `{% doc %}` @param names, in source (signature) order — not sorted/de-duped.
|
|
331
|
+
const docParams = [];
|
|
332
|
+
// A single walk of the already-parsed AST collects every usage fact — no
|
|
333
|
+
// second traversal (the doc `@param` names are read from the parser-produced
|
|
334
|
+
// `LiquidDocParamNode`s in this same pass, as `extractDocDefinition` would).
|
|
335
|
+
await (0, platformos_check_common_1.visit)(sourceCode.ast, {
|
|
336
|
+
RenderMarkup: async (node) => {
|
|
337
|
+
if (isStringLiteral(node.partial))
|
|
338
|
+
renders.add(node.partial.value);
|
|
339
|
+
},
|
|
340
|
+
GraphQLMarkup: async (node) => {
|
|
341
|
+
if (isStringLiteral(node.graphql))
|
|
342
|
+
graphqlQueries.add(node.graphql.value);
|
|
343
|
+
},
|
|
344
|
+
LiquidFilter: async (node) => {
|
|
345
|
+
filters.add(node.name);
|
|
346
|
+
},
|
|
347
|
+
LiquidTag: async (node) => {
|
|
348
|
+
if (typeof node.name === 'string')
|
|
349
|
+
tags.add(node.name);
|
|
350
|
+
},
|
|
351
|
+
// A translation-key usage is a string literal piped through `t`/`translate`,
|
|
352
|
+
// e.g. `{{ 'greeting.hello' | t }}` — detected via check-common's shared
|
|
353
|
+
// `isTranslationKeyUsage` so it cannot drift from the translation check.
|
|
354
|
+
LiquidVariable: async (node) => {
|
|
355
|
+
if ((0, platformos_check_common_1.isTranslationKeyUsage)(node))
|
|
356
|
+
translationKeys.add(node.expression.value);
|
|
357
|
+
},
|
|
358
|
+
LiquidDocParamNode: async (node) => {
|
|
359
|
+
docParams.push(node.paramName.value);
|
|
360
|
+
},
|
|
361
|
+
});
|
|
362
|
+
const frontmatter = loadFrontmatterOf(sourceCode);
|
|
363
|
+
const layout = typeof frontmatter?.layout === 'string' ? frontmatter.layout : undefined;
|
|
364
|
+
const method = typeof frontmatter?.method === 'string' ? frontmatter.method : undefined;
|
|
365
|
+
const slug = effectiveSlug(uri, frontmatter);
|
|
366
|
+
const sorted = (set) => [...set].sort((a, b) => a.localeCompare(b));
|
|
367
|
+
return {
|
|
368
|
+
renders_used: sorted(renders),
|
|
369
|
+
graphql_queries_used: sorted(graphqlQueries),
|
|
370
|
+
filters_used: sorted(filters),
|
|
371
|
+
tags_used: sorted(tags),
|
|
372
|
+
translation_keys: sorted(translationKeys),
|
|
373
|
+
doc_params: docParams,
|
|
374
|
+
...(slug !== undefined ? { slug } : {}),
|
|
375
|
+
...(layout !== undefined ? { layout } : {}),
|
|
376
|
+
...(method !== undefined ? { method } : {}),
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
/** The parsed frontmatter object of a Liquid file, if it has parseable frontmatter. */
|
|
380
|
+
function loadFrontmatterOf(sourceCode) {
|
|
381
|
+
if (sourceCode.type !== platformos_check_common_1.SourceCodeType.LiquidHtml)
|
|
382
|
+
return undefined;
|
|
383
|
+
const ast = sourceCode.ast;
|
|
384
|
+
if (ast instanceof Error || ast.type !== liquid_html_parser_1.NodeTypes.Document)
|
|
385
|
+
return undefined;
|
|
386
|
+
const node = ast.children.find((child) => child.type === liquid_html_parser_1.NodeTypes.YAMLFrontmatter);
|
|
387
|
+
return node?.type === liquid_html_parser_1.NodeTypes.YAMLFrontmatter ? loadFrontmatter(node.body) : undefined;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* The effective URL slug for `uri`, delegating to `effectivePageSlug` — the
|
|
391
|
+
* single slug-derivation shared with `RouteTable`, so the graph's routing fact
|
|
392
|
+
* can never drift from the platform's actual routing (override-wins, coerced to
|
|
393
|
+
* a string; else path-derived using the effective format). Returns `undefined`
|
|
394
|
+
* for a non-page file unless it declares an explicit `slug` override.
|
|
395
|
+
*/
|
|
396
|
+
function effectiveSlug(uri, frontmatter) {
|
|
397
|
+
const relativePath = (0, platformos_common_1.extractRelativePagePath)(uri);
|
|
398
|
+
if (relativePath !== null)
|
|
399
|
+
return (0, platformos_common_1.effectivePageSlug)(relativePath, frontmatter);
|
|
400
|
+
// Non-page file: only an explicit `slug` override is meaningful.
|
|
401
|
+
const slug = frontmatter?.slug;
|
|
402
|
+
return slug !== undefined && slug !== null ? String(slug) : undefined;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* The names of a call site's named arguments, in source order, or `undefined`
|
|
406
|
+
* when there are none (so an argument-less edge carries no `args` field). Values
|
|
407
|
+
* are intentionally not captured — names are what cross-checking against a
|
|
408
|
+
* partial's `@param` signature needs. Every `LiquidNamedArgument` has a string
|
|
409
|
+
* `name` by construction, so no per-element guard is required.
|
|
410
|
+
*/
|
|
411
|
+
function argNames(args) {
|
|
412
|
+
return args.length > 0 ? args.map((arg) => arg.name) : undefined;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* The spreadable `args` field for an edge: present only for a non-empty
|
|
416
|
+
* argument-name list, absent otherwise. The single place the "omit when none"
|
|
417
|
+
* rule lives, so {@link bind} and {@link extractFileReferences} cannot diverge.
|
|
418
|
+
*/
|
|
419
|
+
function argsField(args) {
|
|
420
|
+
return args && args.length > 0 ? { args } : {};
|
|
110
421
|
}
|
|
111
422
|
/**
|
|
112
423
|
* The bind method is the method that links two modules together.
|
|
@@ -115,12 +426,16 @@ function unique(arr) {
|
|
|
115
426
|
*
|
|
116
427
|
* This function mutates the source and target modules.
|
|
117
428
|
*/
|
|
118
|
-
function bind(source, target, { sourceRange,
|
|
429
|
+
function bind(source, target, { sourceRange, type = 'direct', // the type of dependency, can be 'direct' or 'indirect'
|
|
430
|
+
kind, // the semantic Liquid construct that created the edge
|
|
431
|
+
args, // names of the named arguments at the call site (omitted when none)
|
|
119
432
|
} = {}) {
|
|
120
433
|
const dependency = {
|
|
121
434
|
source: { uri: source.uri, range: sourceRange },
|
|
122
|
-
target: { uri: target.uri
|
|
435
|
+
target: { uri: target.uri },
|
|
123
436
|
type: type,
|
|
437
|
+
kind: kind,
|
|
438
|
+
...argsField(args),
|
|
124
439
|
};
|
|
125
440
|
source.dependencies.push(dependency);
|
|
126
441
|
target.references.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AAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACxE,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,IAA2B;IAC3C,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAAC,IAA0B;IAC3C,OAAO,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,IAAI,CAClB,MAAiB,EACjB,MAAiB,EACjB,EACE,WAAW,EACX,IAAI,GAAG,QAAQ,EAAE,wDAAwD;AACzE,IAAI,EAAE,sDAAsD;AAC5D,IAAI,EAAE,oEAAoE;KAMxE,EAAE;IAEN,MAAM,UAAU,GAAc;QAC5B,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE;QAC/C,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE;QAC3B,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,GAAG,SAAS,CAAC,IAAI,CAAC;KACnB,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { buildAppGraph } from './graph/build';
|
|
2
|
+
export { enumerateEdgeSources, isEdgeSource } from './graph/edge-sources';
|
|
3
|
+
export { extractFileReferences, extractStructural } from './graph/traverse';
|
|
4
|
+
export { dependenciesOf, dependentsOf, exists, isEntryPoint, isOrphan, orphans, reachableFrom, missingDependencies, missingTargets, nearestModules, } from './graph/query';
|
|
5
|
+
export type { NearestModulesOptions } from './graph/query';
|
|
2
6
|
export { serializeAppGraph } from './graph/serialize';
|
|
3
|
-
export { getWebComponentMap, findWebComponentReferences } from './getWebComponentMap';
|
|
4
7
|
export { parseJs, toSourceCode } from './toSourceCode';
|
|
8
|
+
export { appBackedGetSourceCode, graphParsers } from './parsers';
|
|
5
9
|
export * from './types';
|