@platformos/platformos-graph 0.0.20 → 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.
Files changed (120) hide show
  1. package/CHANGELOG.md +511 -8
  2. package/dist/cache-probes.spec.d.ts +1 -0
  3. package/dist/cache-probes.spec.js +62 -0
  4. package/dist/cache-probes.spec.js.map +1 -0
  5. package/dist/cli.js +18 -13
  6. package/dist/cli.js.map +1 -1
  7. package/dist/cli.spec.d.ts +1 -0
  8. package/dist/cli.spec.js +235 -0
  9. package/dist/cli.spec.js.map +1 -0
  10. package/dist/graph/app-index-resolution.spec.d.ts +1 -0
  11. package/dist/graph/app-index-resolution.spec.js +167 -0
  12. package/dist/graph/app-index-resolution.spec.js.map +1 -0
  13. package/dist/graph/asset-resolution.spec.d.ts +1 -0
  14. package/dist/graph/asset-resolution.spec.js +64 -0
  15. package/dist/graph/asset-resolution.spec.js.map +1 -0
  16. package/dist/graph/augment.js +3 -0
  17. package/dist/graph/augment.js.map +1 -1
  18. package/dist/graph/build.d.ts +15 -2
  19. package/dist/graph/build.js +54 -12
  20. package/dist/graph/build.js.map +1 -1
  21. package/dist/graph/build.spec.d.ts +1 -0
  22. package/dist/graph/build.spec.js +138 -0
  23. package/dist/graph/build.spec.js.map +1 -0
  24. package/dist/graph/edge-sources.d.ts +28 -0
  25. package/dist/graph/edge-sources.js +43 -0
  26. package/dist/graph/edge-sources.js.map +1 -0
  27. package/dist/graph/edge-sources.spec.d.ts +1 -0
  28. package/dist/graph/edge-sources.spec.js +125 -0
  29. package/dist/graph/edge-sources.spec.js.map +1 -0
  30. package/dist/graph/extract.spec.d.ts +1 -0
  31. package/dist/graph/extract.spec.js +163 -0
  32. package/dist/graph/extract.spec.js.map +1 -0
  33. package/dist/graph/module.d.ts +60 -7
  34. package/dist/graph/module.js +137 -41
  35. package/dist/graph/module.js.map +1 -1
  36. package/dist/graph/module.spec.d.ts +1 -0
  37. package/dist/graph/module.spec.js +74 -0
  38. package/dist/graph/module.spec.js.map +1 -0
  39. package/dist/graph/query.d.ts +72 -0
  40. package/dist/graph/query.js +140 -0
  41. package/dist/graph/query.js.map +1 -0
  42. package/dist/graph/query.spec.d.ts +1 -0
  43. package/dist/graph/query.spec.js +209 -0
  44. package/dist/graph/query.spec.js.map +1 -0
  45. package/dist/graph/serialize.spec.d.ts +1 -0
  46. package/dist/graph/serialize.spec.js +50 -0
  47. package/dist/graph/serialize.spec.js.map +1 -0
  48. package/dist/graph/structural.spec.d.ts +1 -0
  49. package/dist/graph/structural.spec.js +146 -0
  50. package/dist/graph/structural.spec.js.map +1 -0
  51. package/dist/graph/test-helpers.js +3 -3
  52. package/dist/graph/test-helpers.js.map +1 -1
  53. package/dist/graph/traverse-edges.spec.d.ts +1 -0
  54. package/dist/graph/traverse-edges.spec.js +337 -0
  55. package/dist/graph/traverse-edges.spec.js.map +1 -0
  56. package/dist/graph/traverse.d.ts +51 -20
  57. package/dist/graph/traverse.js +239 -29
  58. package/dist/graph/traverse.js.map +1 -1
  59. package/dist/index.d.ts +5 -1
  60. package/dist/index.js +19 -1
  61. package/dist/index.js.map +1 -1
  62. package/dist/parsers.d.ts +35 -0
  63. package/dist/parsers.js +72 -0
  64. package/dist/parsers.js.map +1 -0
  65. package/dist/parsers.spec.d.ts +1 -0
  66. package/dist/parsers.spec.js +70 -0
  67. package/dist/parsers.spec.js.map +1 -0
  68. package/dist/toSourceCode.d.ts +14 -2
  69. package/dist/toSourceCode.js +23 -19
  70. package/dist/toSourceCode.js.map +1 -1
  71. package/dist/tsconfig.tsbuildinfo +1 -1
  72. package/dist/types.d.ts +102 -3
  73. package/dist/types.js.map +1 -1
  74. package/dist/utils/index.d.ts +1 -1
  75. package/fixtures/asset-edges/app/assets/logo.css +1 -0
  76. package/fixtures/asset-edges/app/assets/site/app.js +1 -0
  77. package/fixtures/asset-edges/app/views/pages/index.liquid +3 -0
  78. package/fixtures/graphql-table/app/graphql/with_table.graphql +5 -0
  79. package/fixtures/graphql-table/app/graphql/without_table.graphql +3 -0
  80. package/fixtures/graphql-table/app/views/pages/index.liquid +4 -0
  81. package/fixtures/layout-edges/app/views/layouts/theme.liquid +4 -0
  82. package/fixtures/layout-edges/app/views/pages/broken.liquid +5 -0
  83. package/fixtures/layout-edges/app/views/pages/index.liquid +5 -0
  84. package/fixtures/schema-nodes/app/schema/blog_post.yml +6 -0
  85. package/fixtures/schema-nodes/app/schema/no_name.yml +3 -0
  86. package/fixtures/schema-nodes/app/views/pages/index.liquid +1 -0
  87. package/fixtures/structural/app/views/pages/about.liquid +1 -0
  88. package/fixtures/structural/app/views/pages/blog/show.liquid +4 -0
  89. package/fixtures/structural/app/views/pages/index.liquid +6 -0
  90. package/fixtures/structural/app/views/pages/rich.liquid +8 -0
  91. package/fixtures/structural/app/views/partials/card.liquid +1 -0
  92. package/fixtures/structural/app/views/partials/documented.liquid +5 -0
  93. package/package.json +7 -5
  94. package/src/cli.spec.ts +37 -31
  95. package/src/cli.ts +31 -15
  96. package/src/graph/augment.ts +4 -0
  97. package/src/graph/build.spec.ts +871 -6
  98. package/src/graph/build.ts +68 -17
  99. package/src/graph/edge-sources.spec.ts +125 -0
  100. package/src/graph/edge-sources.ts +49 -0
  101. package/src/graph/module.spec.ts +168 -0
  102. package/src/graph/module.ts +139 -45
  103. package/src/graph/query.spec.ts +260 -0
  104. package/src/graph/query.ts +154 -0
  105. package/src/graph/serialize.spec.ts +4 -4
  106. package/src/graph/test-helpers.ts +3 -3
  107. package/src/graph/{extract.spec.ts → traverse.spec.ts} +125 -2
  108. package/src/graph/traverse.ts +278 -37
  109. package/src/index.ts +16 -1
  110. package/src/parsers.spec.ts +85 -0
  111. package/src/parsers.ts +75 -0
  112. package/src/toSourceCode.ts +26 -26
  113. package/src/types.ts +106 -7
  114. package/src/utils/index.ts +1 -1
  115. package/dist/getWebComponentMap.d.ts +0 -10
  116. package/dist/getWebComponentMap.js +0 -66
  117. package/dist/getWebComponentMap.js.map +0 -1
  118. package/src/graph/traverse-edges.spec.ts +0 -278
  119. /package/fixtures/skeleton/{assets → app/assets}/app.css +0 -0
  120. /package/fixtures/skeleton/{assets → app/assets}/app.js +0 -0
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const platformos_check_common_1 = require("@platformos/platformos-check-common");
4
+ const vitest_1 = require("vitest");
5
+ const index_1 = require("../index");
6
+ const toSourceCode_1 = require("../toSourceCode");
7
+ const test_helpers_1 = require("./test-helpers");
8
+ /**
9
+ * `extractFileReferences` is the per-file primitive a `validate_code`-style
10
+ * consumer uses: parse an in-flight buffer with `toSourceCode`, then resolve its
11
+ * outgoing dependency edges against the on-disk project — WITHOUT building the
12
+ * whole app graph. The buffer is never read from disk, so these specs pass the
13
+ * content inline (and even use a `sourceUri` for a file that does not exist).
14
+ */
15
+ const { fs } = (0, test_helpers_1.getDependencies)();
16
+ /** The exact source range of `snippet` within `source`. */
17
+ function rangeOf(source, snippet) {
18
+ const start = source.indexOf(snippet);
19
+ if (start < 0)
20
+ throw new Error(`snippet not found: ${snippet}`);
21
+ return [start, start + snippet.length];
22
+ }
23
+ function directRef(sourceUri, sourceRange, targetUri, kind, args) {
24
+ return {
25
+ source: { uri: sourceUri, range: sourceRange },
26
+ target: { uri: targetUri },
27
+ type: 'direct',
28
+ kind,
29
+ ...(args ? { args } : {}),
30
+ };
31
+ }
32
+ async function extract(rootUri, sourceUri, content) {
33
+ return (0, index_1.extractFileReferences)(rootUri, sourceUri, await (0, toSourceCode_1.toSourceCode)(sourceUri, content), { fs });
34
+ }
35
+ (0, vitest_1.describe)('extractFileReferences: resolves a single buffer against the project', () => {
36
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'function-edges');
37
+ const p = (part) => platformos_check_common_1.path.join(rootUri, ...part.split('/'));
38
+ (0, vitest_1.it)('resolves a {% function %} edge to the canonical lib URI', async () => {
39
+ const sourceUri = p('app/views/pages/draft.liquid'); // not on disk — in-flight buffer
40
+ const content = `{% liquid
41
+ function items = 'queries/list'
42
+ %}`;
43
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
44
+ directRef(sourceUri, rangeOf(content, "function items = 'queries/list'"), p('app/lib/queries/list.liquid'), 'function'),
45
+ ]);
46
+ });
47
+ (0, vitest_1.it)('resolves a target that does not exist on disk (path-based resolution)', async () => {
48
+ const sourceUri = p('app/views/pages/draft.liquid');
49
+ const content = `{% liquid
50
+ function ghost = 'queries/missing'
51
+ %}`;
52
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
53
+ directRef(sourceUri, rangeOf(content, "function ghost = 'queries/missing'"), p('app/lib/queries/missing.liquid'), 'function'),
54
+ ]);
55
+ });
56
+ (0, vitest_1.it)('captures the named-argument names at a render call site', async () => {
57
+ const sourceUri = p('app/views/pages/draft.liquid');
58
+ const content = "{% render 'card', title: page.title, count: 3 %}";
59
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
60
+ directRef(sourceUri, rangeOf(content, "{% render 'card', title: page.title, count: 3 %}"), p('app/views/partials/card.liquid'), 'render', ['title', 'count']),
61
+ ]);
62
+ });
63
+ });
64
+ (0, vitest_1.describe)('extractFileReferences: kinds and resolution match the full graph build', () => {
65
+ (0, vitest_1.it)('tags include edges with kind "include"', async () => {
66
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'include-edges');
67
+ const p = (part) => platformos_check_common_1.path.join(rootUri, ...part.split('/'));
68
+ const sourceUri = p('app/views/pages/draft.liquid');
69
+ const content = "{% include 'shared/header' %}";
70
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
71
+ directRef(sourceUri, rangeOf(content, "{% include 'shared/header' %}"), p('app/views/partials/shared/header.liquid'), 'include'),
72
+ ]);
73
+ });
74
+ (0, vitest_1.it)('resolves a {% graphql %} edge to the .graphql operation file', async () => {
75
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'graphql-edges');
76
+ const p = (part) => platformos_check_common_1.path.join(rootUri, ...part.split('/'));
77
+ const sourceUri = p('app/views/pages/draft.liquid');
78
+ const content = `{% liquid
79
+ graphql posts = 'blog_posts/find', id: '1'
80
+ %}`;
81
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
82
+ directRef(sourceUri, rangeOf(content, "graphql posts = 'blog_posts/find', id: '1'"), p('app/graphql/blog_posts/find.graphql'), 'graphql', ['id']),
83
+ ]);
84
+ });
85
+ (0, vitest_1.it)('resolves module-namespaced render + function targets in declaration order', async () => {
86
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'module-edges');
87
+ const p = (part) => platformos_check_common_1.path.join(rootUri, ...part.split('/'));
88
+ const sourceUri = p('app/views/pages/draft.liquid');
89
+ const content = `{% liquid
90
+ function items = 'modules/my_module/queries/get'
91
+ %}
92
+ {% render 'modules/my_module/card' %}`;
93
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
94
+ directRef(sourceUri, rangeOf(content, "function items = 'modules/my_module/queries/get'"), p('modules/my_module/public/lib/queries/get.liquid'), 'function'),
95
+ directRef(sourceUri, rangeOf(content, "{% render 'modules/my_module/card' %}"), p('modules/my_module/public/views/partials/card.liquid'), 'render'),
96
+ ]);
97
+ });
98
+ });
99
+ (0, vitest_1.describe)('extractFileReferences: only statically resolvable edges', () => {
100
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'function-edges');
101
+ const sourceUri = platformos_check_common_1.path.join(rootUri, 'app/views/pages/draft.liquid');
102
+ (0, vitest_1.it)('skips dynamic render targets', async () => {
103
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, '{% render partial_name %}')).toEqual([]);
104
+ });
105
+ (0, vitest_1.it)('returns nothing for an unparseable buffer instead of throwing', async () => {
106
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, '{% render %}{% endif %}')).toEqual([]);
107
+ });
108
+ (0, vitest_1.it)('returns nothing for a buffer with no references', async () => {
109
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, '<h1>{{ page.title }}</h1>')).toEqual([]);
110
+ });
111
+ });
112
+ (0, vitest_1.describe)('extractFileReferences: layout-association edges (frontmatter `layout:`)', () => {
113
+ const rootUri = platformos_check_common_1.path.join(test_helpers_1.fixturesRoot, 'function-edges'); // no layouts here → default path
114
+ const p = (part) => platformos_check_common_1.path.join(rootUri, ...part.split('/'));
115
+ const sourceUri = p('app/views/pages/draft.liquid');
116
+ // The whole frontmatter block: start through the closing `---` line + newline.
117
+ const fmRange = (content) => [
118
+ 0,
119
+ content.indexOf('\n', content.indexOf('---', 3)) + 1,
120
+ ];
121
+ (0, vitest_1.it)('emits a layout edge for an explicit frontmatter layout', async () => {
122
+ const content = `---
123
+ slug: draft
124
+ layout: theme
125
+ ---
126
+ <h1>x</h1>`;
127
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
128
+ directRef(sourceUri, fmRange(content), p('app/views/layouts/theme.liquid'), 'layout'),
129
+ ]);
130
+ });
131
+ (0, vitest_1.it)('resolves a module-prefixed layout', async () => {
132
+ const content = `---
133
+ layout: modules/core/admin
134
+ ---
135
+ <h1>x</h1>`;
136
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([
137
+ directRef(sourceUri, fmRange(content), p('modules/core/public/views/layouts/admin.liquid'), 'layout'),
138
+ ]);
139
+ });
140
+ (0, vitest_1.it)('emits no edge for an explicitly empty layout', async () => {
141
+ const content = `---
142
+ slug: draft
143
+ layout: ''
144
+ ---
145
+ <h1>x</h1>`;
146
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([]);
147
+ });
148
+ (0, vitest_1.it)('emits no edge when layout is omitted (no implicit default)', async () => {
149
+ const content = `---
150
+ slug: draft
151
+ ---
152
+ <h1>x</h1>`;
153
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([]);
154
+ });
155
+ (0, vitest_1.it)('emits no edge for a dynamic layout value', async () => {
156
+ const content = `---
157
+ layout: "{{ context.constants.LAYOUT }}"
158
+ ---
159
+ <h1>x</h1>`;
160
+ (0, vitest_1.expect)(await extract(rootUri, sourceUri, content)).toEqual([]);
161
+ });
162
+ });
163
+ //# sourceMappingURL=extract.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.spec.js","sourceRoot":"","sources":["../../src/graph/extract.spec.ts"],"names":[],"mappings":";;AAAA,iFAAwE;AACxE,mCAA8C;AAC9C,oCAAiD;AACjD,kDAA+C;AAE/C,iDAA+D;AAE/D;;;;;;GAMG;AACH,MAAM,EAAE,EAAE,EAAE,GAAG,IAAA,8BAAe,GAAE,CAAC;AAEjC,2DAA2D;AAC3D,SAAS,OAAO,CAAC,MAAc,EAAE,OAAe;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,OAAO,EAAE,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,SAAS,CAChB,SAAiB,EACjB,WAA6B,EAC7B,SAAiB,EACjB,IAAuB,EACvB,IAAe;IAEf,OAAO;QACL,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE;QAC9C,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE;QAC1B,IAAI,EAAE,QAAQ;QACd,IAAI;QACJ,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1B,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,OAAe,EAAE,SAAiB,EAAE,OAAe;IACxE,OAAO,IAAA,6BAAqB,EAAC,OAAO,EAAE,SAAS,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,IAAA,WAAE,EAAC,4DAA4D,EAAE,KAAK,IAAI,EAAE;QAC1E,MAAM,OAAO,GAAG;;;WAGT,CAAC;QAER,IAAA,eAAM,EAAC,MAAM,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,OAAO,GAAG;;;WAGT,CAAC;QAER,IAAA,eAAM,EAAC,MAAM,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,15 +1,53 @@
1
1
  import { UriString } from '@platformos/platformos-check-common';
2
- import { AssetModule, AppGraph, AppModule, GraphQLModule, LiquidModule } from '../types';
2
+ import { AssetModule, AppGraph, AppModule, GraphQLModule, LiquidModule, SchemaModule } from '../types';
3
3
  export declare function getModule(appGraph: AppGraph, uri: UriString): AppModule | undefined;
4
+ /**
5
+ * Create (or fetch the cached) asset module for an already-resolved URI.
6
+ *
7
+ * Preferred over {@link getAssetModule} whenever the file is known, for the same
8
+ * reason as {@link getPartialModuleByUri}: it does not reconstruct a path from a
9
+ * name, so a nested or module asset keeps the location it actually has.
10
+ *
11
+ * Gated on {@link isSupportedAsset} HERE rather than at each call site, so a new
12
+ * caller cannot forget the gate and mint an Asset node for a value that is not an
13
+ * asset file.
14
+ */
15
+ export declare function getAssetModuleByUri(appGraph: AppGraph, uri: string): AssetModule | undefined;
16
+ /**
17
+ * Whether `nameOrUri` refers to a supported asset file (by extension).
18
+ *
19
+ * The single gate for admitting an asset, whether the subject is a reference (the
20
+ * string inside `{{ 'app.js' | asset_url }}`) or a resolved URI. It preserves the
21
+ * graph's historical behavior of ignoring an `asset_url`-family filter applied to
22
+ * a value that is not an asset file. Exported so the traversal can skip the
23
+ * filesystem probe for a non-asset value BEFORE resolving it; the module
24
+ * factories gate on it again, so neither layer depends on the other remembering.
25
+ */
26
+ export declare function isSupportedAsset(nameOrUri: string): boolean;
27
+ /**
28
+ * Create (or fetch the cached) asset module for an asset REFERENCE — the string
29
+ * inside `{{ 'app.js' | asset_url }}`, which may carry a `modules/<name>/` prefix.
30
+ *
31
+ * Assets live under the same roots as every other file type: `app/assets/` or
32
+ * `modules/<name>/{public,private}/assets/`. Those come from platformos-common, so the
33
+ * graph resolves a reference to the same place the linter and the platform do.
34
+ *
35
+ * The FIRST candidate is used as the canonical location: this is sync and has no
36
+ * filesystem, so it cannot tell which candidate exists. Prefer
37
+ * {@link getAssetModuleByUri} — the traversal resolves through `DocumentsLocator`,
38
+ * which can.
39
+ */
4
40
  export declare function getAssetModule(appGraph: AppGraph, asset: string): AssetModule | undefined;
5
- export declare function getPartialModule(appGraph: AppGraph, partial: string): LiquidModule;
6
41
  /**
7
42
  * Create (or fetch the cached) Liquid Partial module for an ALREADY-RESOLVED
8
- * full URI — used for `{% function %}` / `{% include %}` targets whose URI is
9
- * resolved canonically by `DocumentsLocator` (which handles lib paths, module
10
- * prefixes, and extensions). Unlike {@link getPartialModule}, it does not
11
- * reconstruct the path from a name. Commands/queries/lib helpers are all
12
- * `Partial` kind, consistent with check-common's file-type classification.
43
+ * full URI — used for `{% render %}` / `{% include %}` / `{% function %}` /
44
+ * `{% background %}` targets whose URI is resolved canonically by
45
+ * `DocumentsLocator` (which handles lib paths, module prefixes, and extensions).
46
+ * It keys the node by that URI verbatim (normalized), never reconstructing a path
47
+ * from a name: partials have two search roots (`views/partials`, `lib`) and two
48
+ * extensions, so a name-derived path is a guess, and guessing split a `lib/`
49
+ * partial into two nodes. Commands/queries/lib helpers are all `Partial` kind,
50
+ * consistent with check-common's file-type classification.
13
51
  */
14
52
  export declare function getPartialModuleByUri(appGraph: AppGraph, uri: string): LiquidModule;
15
53
  /**
@@ -18,5 +56,20 @@ export declare function getPartialModuleByUri(appGraph: AppGraph, uri: string):
18
56
  * `DocumentsLocator`. A leaf node (no outgoing edges).
19
57
  */
20
58
  export declare function getGraphQLModuleByUri(appGraph: AppGraph, uri: string): GraphQLModule;
59
+ /**
60
+ * Create (or fetch the cached) Schema module for an already-resolved
61
+ * `custom_model_type`/schema URI — discovered during a full `buildAppGraph`.
62
+ * A leaf node; its `table` (the model `name:`) is populated during traversal.
63
+ */
64
+ export declare function getSchemaModule(appGraph: AppGraph, uri: string): SchemaModule;
21
65
  export declare function getLayoutModule(appGraph: AppGraph, layoutUri: string | false | undefined): LiquidModule | undefined;
66
+ /**
67
+ * Create (or fetch the cached) Layout module for an already-resolved layout URI
68
+ * — used for the frontmatter `layout:` association edge, whose target is
69
+ * resolved by `DocumentsLocator` (`'layout'` type: `app/views/layouts`, module
70
+ * prefixes, `.html.liquid`/`.liquid`). Distinct from {@link getLayoutModule} only
71
+ * in that the latter accepts the `string | false | undefined` a frontmatter read
72
+ * yields; both normalize, so both key the same node.
73
+ */
74
+ export declare function getLayoutModuleByUri(appGraph: AppGraph, uri: string): LiquidModule;
22
75
  export declare function getPageModule(appGraph: AppGraph, pageUri: string): LiquidModule;
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getModule = getModule;
4
+ exports.getAssetModuleByUri = getAssetModuleByUri;
5
+ exports.isSupportedAsset = isSupportedAsset;
4
6
  exports.getAssetModule = getAssetModule;
5
- exports.getPartialModule = getPartialModule;
6
7
  exports.getPartialModuleByUri = getPartialModuleByUri;
7
8
  exports.getGraphQLModuleByUri = getGraphQLModuleByUri;
9
+ exports.getSchemaModule = getSchemaModule;
8
10
  exports.getLayoutModule = getLayoutModule;
11
+ exports.getLayoutModuleByUri = getLayoutModuleByUri;
9
12
  exports.getPageModule = getPageModule;
10
13
  const platformos_check_common_1 = require("@platformos/platformos-check-common");
14
+ const platformos_common_1 = require("@platformos/platformos-common");
11
15
  const types_1 = require("../types");
12
16
  const utils_1 = require("../utils");
13
17
  /**
@@ -30,69 +34,120 @@ function getModule(appGraph, uri) {
30
34
  if (cache.has(uri)) {
31
35
  return cache.get(uri);
32
36
  }
33
- const relativePath = platformos_check_common_1.path.relative(uri, appGraph.rootUri);
34
- switch (true) {
35
- case (0, platformos_check_common_1.isLayout)(uri):
37
+ // One anchored classification, not four unanchored ones: a file's type is its
38
+ // position relative to the project root, and the graph has that root.
39
+ switch ((0, platformos_common_1.getFileType)(uri, appGraph.rootUri)) {
40
+ case platformos_common_1.PlatformOSFileType.Layout:
36
41
  return getLayoutModule(appGraph, uri);
37
- case (0, platformos_check_common_1.isPage)(uri):
42
+ case platformos_common_1.PlatformOSFileType.Page:
38
43
  return getPageModule(appGraph, uri);
39
- case (0, platformos_check_common_1.isPartial)(uri):
40
- return getPartialModule(appGraph, platformos_check_common_1.path.basename(uri, '.liquid'));
41
- case relativePath.startsWith('assets') || relativePath.startsWith('modules'):
42
- return getAssetModule(appGraph, platformos_check_common_1.path.basename(uri));
44
+ case platformos_common_1.PlatformOSFileType.Partial:
45
+ // The URI is already resolved, so it is used as-is. Reducing it to a
46
+ // `basename` and rebuilding a path from that loses any subdirectory and any
47
+ // module prefix — `app/views/partials/ui/card.liquid` came back as
48
+ // `app/views/partials/card.liquid`, a node for a file that need not exist,
49
+ // and `app/lib/can/x.liquid` was split from the same file resolved as an
50
+ // edge target (which comes through getPartialModuleByUri).
51
+ return getPartialModuleByUri(appGraph, uri);
52
+ case platformos_common_1.PlatformOSFileType.Asset:
53
+ return getAssetModuleByUri(appGraph, uri);
43
54
  }
44
55
  }
45
- function getAssetModule(appGraph, asset) {
46
- const extension = (0, utils_1.extname)(asset);
47
- const SUPPORTED_ASSET_EXTENSIONS = [
48
- ...types_1.SUPPORTED_ASSET_IMAGE_EXTENSIONS,
49
- 'js',
50
- 'css',
51
- 'svg',
52
- 'pdf',
53
- 'woff',
54
- 'woff2',
55
- 'ttf',
56
- 'eot',
57
- ];
58
- if (!SUPPORTED_ASSET_EXTENSIONS.includes(extension)) {
56
+ /**
57
+ * Create (or fetch the cached) asset module for an already-resolved URI.
58
+ *
59
+ * Preferred over {@link getAssetModule} whenever the file is known, for the same
60
+ * reason as {@link getPartialModuleByUri}: it does not reconstruct a path from a
61
+ * name, so a nested or module asset keeps the location it actually has.
62
+ *
63
+ * Gated on {@link isSupportedAsset} HERE rather than at each call site, so a new
64
+ * caller cannot forget the gate and mint an Asset node for a value that is not an
65
+ * asset file.
66
+ */
67
+ function getAssetModuleByUri(appGraph, uri) {
68
+ if (!isSupportedAsset(uri))
59
69
  return undefined;
60
- }
61
70
  return module(appGraph, {
62
71
  type: "Asset" /* ModuleType.Asset */,
63
72
  kind: 'unused',
73
+ // Normalize to forward slashes — see getPartialModuleByUri.
74
+ uri: platformos_check_common_1.path.normalize(uri),
64
75
  dependencies: [],
65
76
  references: [],
66
- uri: platformos_check_common_1.path.join(appGraph.rootUri, 'assets', asset),
67
77
  });
68
78
  }
69
- function getPartialModule(appGraph, partial) {
70
- const uri = platformos_check_common_1.path.join(appGraph.rootUri, 'app/views/partials', `${partial}.liquid`);
79
+ /** File extensions the graph treats as assets (the `asset_url` edge gate). */
80
+ const SUPPORTED_ASSET_EXTENSIONS = [
81
+ ...types_1.SUPPORTED_ASSET_IMAGE_EXTENSIONS,
82
+ 'js',
83
+ 'css',
84
+ 'svg',
85
+ 'pdf',
86
+ 'woff',
87
+ 'woff2',
88
+ 'ttf',
89
+ 'eot',
90
+ ];
91
+ /**
92
+ * Whether `nameOrUri` refers to a supported asset file (by extension).
93
+ *
94
+ * The single gate for admitting an asset, whether the subject is a reference (the
95
+ * string inside `{{ 'app.js' | asset_url }}`) or a resolved URI. It preserves the
96
+ * graph's historical behavior of ignoring an `asset_url`-family filter applied to
97
+ * a value that is not an asset file. Exported so the traversal can skip the
98
+ * filesystem probe for a non-asset value BEFORE resolving it; the module
99
+ * factories gate on it again, so neither layer depends on the other remembering.
100
+ */
101
+ function isSupportedAsset(nameOrUri) {
102
+ return SUPPORTED_ASSET_EXTENSIONS.includes((0, utils_1.extname)(nameOrUri));
103
+ }
104
+ /**
105
+ * Create (or fetch the cached) asset module for an asset REFERENCE — the string
106
+ * inside `{{ 'app.js' | asset_url }}`, which may carry a `modules/<name>/` prefix.
107
+ *
108
+ * Assets live under the same roots as every other file type: `app/assets/` or
109
+ * `modules/<name>/{public,private}/assets/`. Those come from platformos-common, so the
110
+ * graph resolves a reference to the same place the linter and the platform do.
111
+ *
112
+ * The FIRST candidate is used as the canonical location: this is sync and has no
113
+ * filesystem, so it cannot tell which candidate exists. Prefer
114
+ * {@link getAssetModuleByUri} — the traversal resolves through `DocumentsLocator`,
115
+ * which can.
116
+ */
117
+ function getAssetModule(appGraph, asset) {
118
+ if (!isSupportedAsset(asset))
119
+ return undefined;
120
+ const [canonical] = (0, platformos_common_1.nameToPaths)(platformos_common_1.PlatformOSFileType.Asset, asset);
121
+ if (!canonical)
122
+ return undefined;
71
123
  return module(appGraph, {
72
- type: "Liquid" /* ModuleType.Liquid */,
73
- kind: "partial" /* LiquidModuleKind.Partial */,
74
- uri: uri,
124
+ type: "Asset" /* ModuleType.Asset */,
125
+ kind: 'unused',
126
+ uri: platformos_check_common_1.path.join(appGraph.rootUri, canonical),
75
127
  dependencies: [],
76
128
  references: [],
77
129
  });
78
130
  }
79
131
  /**
80
132
  * Create (or fetch the cached) Liquid Partial module for an ALREADY-RESOLVED
81
- * full URI — used for `{% function %}` / `{% include %}` targets whose URI is
82
- * resolved canonically by `DocumentsLocator` (which handles lib paths, module
83
- * prefixes, and extensions). Unlike {@link getPartialModule}, it does not
84
- * reconstruct the path from a name. Commands/queries/lib helpers are all
85
- * `Partial` kind, consistent with check-common's file-type classification.
133
+ * full URI — used for `{% render %}` / `{% include %}` / `{% function %}` /
134
+ * `{% background %}` targets whose URI is resolved canonically by
135
+ * `DocumentsLocator` (which handles lib paths, module prefixes, and extensions).
136
+ * It keys the node by that URI verbatim (normalized), never reconstructing a path
137
+ * from a name: partials have two search roots (`views/partials`, `lib`) and two
138
+ * extensions, so a name-derived path is a guess, and guessing split a `lib/`
139
+ * partial into two nodes. Commands/queries/lib helpers are all `Partial` kind,
140
+ * consistent with check-common's file-type classification.
86
141
  */
87
142
  function getPartialModuleByUri(appGraph, uri) {
88
143
  return module(appGraph, {
89
144
  type: "Liquid" /* ModuleType.Liquid */,
90
145
  kind: "partial" /* LiquidModuleKind.Partial */,
91
146
  // Normalize to forward slashes so module keys match the rest of the graph
92
- // (getPartialModule/getAssetModule build URIs via path.join, which
93
- // normalizes). DocumentsLocator returns `Utils.joinPath(...).toString()`
94
- // unnormalized, which on Windows keeps backslashes and breaks key/edge
95
- // matching against the normalized URIs everywhere else.
147
+ // (getAssetModule builds its URI via path.join, which normalizes).
148
+ // DocumentsLocator returns `Utils.joinPath(...).toString()` unnormalized,
149
+ // which on Windows keeps backslashes and breaks key/edge matching against the
150
+ // normalized URIs everywhere else.
96
151
  uri: platformos_check_common_1.path.normalize(uri),
97
152
  dependencies: [],
98
153
  references: [],
@@ -111,6 +166,23 @@ function getGraphQLModuleByUri(appGraph, uri) {
111
166
  uri: platformos_check_common_1.path.normalize(uri),
112
167
  dependencies: [],
113
168
  references: [],
169
+ // Always present (empty = no table declared); populated during traversal.
170
+ tables: [],
171
+ });
172
+ }
173
+ /**
174
+ * Create (or fetch the cached) Schema module for an already-resolved
175
+ * `custom_model_type`/schema URI — discovered during a full `buildAppGraph`.
176
+ * A leaf node; its `table` (the model `name:`) is populated during traversal.
177
+ */
178
+ function getSchemaModule(appGraph, uri) {
179
+ return module(appGraph, {
180
+ type: "Schema" /* ModuleType.Schema */,
181
+ kind: 'schema',
182
+ // Normalize to forward slashes — see getPartialModuleByUri.
183
+ uri: platformos_check_common_1.path.normalize(uri),
184
+ dependencies: [],
185
+ references: [],
114
186
  });
115
187
  }
116
188
  function getLayoutModule(appGraph, layoutUri) {
@@ -119,7 +191,29 @@ function getLayoutModule(appGraph, layoutUri) {
119
191
  return module(appGraph, {
120
192
  type: "Liquid" /* ModuleType.Liquid */,
121
193
  kind: "layout" /* LiquidModuleKind.Layout */,
122
- uri: layoutUri,
194
+ // Normalize so a layout discovered as an entry point keys identically to the
195
+ // same file resolved as a frontmatter `layout:` edge target (which comes
196
+ // through getLayoutModuleByUri, also normalized) — one node, never a split
197
+ // identity. See getPartialModuleByUri for why DocumentsLocator/fs URIs must
198
+ // be normalized.
199
+ uri: platformos_check_common_1.path.normalize(layoutUri),
200
+ dependencies: [],
201
+ references: [],
202
+ });
203
+ }
204
+ /**
205
+ * Create (or fetch the cached) Layout module for an already-resolved layout URI
206
+ * — used for the frontmatter `layout:` association edge, whose target is
207
+ * resolved by `DocumentsLocator` (`'layout'` type: `app/views/layouts`, module
208
+ * prefixes, `.html.liquid`/`.liquid`). Distinct from {@link getLayoutModule} only
209
+ * in that the latter accepts the `string | false | undefined` a frontmatter read
210
+ * yields; both normalize, so both key the same node.
211
+ */
212
+ function getLayoutModuleByUri(appGraph, uri) {
213
+ return module(appGraph, {
214
+ type: "Liquid" /* ModuleType.Liquid */,
215
+ kind: "layout" /* LiquidModuleKind.Layout */,
216
+ uri: platformos_check_common_1.path.normalize(uri),
123
217
  dependencies: [],
124
218
  references: [],
125
219
  });
@@ -128,7 +222,9 @@ function getPageModule(appGraph, pageUri) {
128
222
  return module(appGraph, {
129
223
  type: "Liquid" /* ModuleType.Liquid */,
130
224
  kind: "page" /* LiquidModuleKind.Page */,
131
- uri: pageUri,
225
+ // Normalize for the same node-identity reason as getLayoutModule / the other
226
+ // factories (see getPartialModuleByUri).
227
+ uri: platformos_check_common_1.path.normalize(pageUri),
132
228
  dependencies: [],
133
229
  references: [],
134
230
  });
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/graph/module.ts"],"names":[],"mappings":";;AA6BA,8BAqBC;AAED,wCA0BC;AAED,4CASC;AAUD,sDAaC;AAOD,sDASC;AAED,0CAYC;AAED,sCAQC;AAxJD,iF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ty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const module_1 = require("./module");
5
+ /**
6
+ * Node-identity invariant (code-review F10): a file must resolve to ONE module
7
+ * regardless of which producer creates it. Entry-point factories
8
+ * (getLayoutModule/getPageModule) take a URI straight from directory discovery,
9
+ * while edge-target factories (getLayoutModuleByUri/getPartialModuleByUri) take a
10
+ * DocumentsLocator-resolved URI; both normalize, so a Windows-style backslash
11
+ * URI from one and a forward-slash URI from the other key to the SAME cached
12
+ * node — never a split identity that would drop an incoming edge.
13
+ */
14
+ (0, vitest_1.describe)('module factories: normalized node identity', () => {
15
+ const newGraph = () => ({ rootUri: 'file:///project', entryPoints: [], modules: {} });
16
+ (0, vitest_1.it)('dedupes an entry-point layout with the same layout resolved as an edge target', () => {
17
+ const graph = newGraph();
18
+ // As if discovered by directory traversal on Windows (backslashes)…
19
+ const entry = (0, module_1.getLayoutModule)(graph, 'file:///project\\app\\views\\layouts\\theme.liquid');
20
+ // …and as if resolved from a page's frontmatter `layout:` (forward slashes).
21
+ const edgeTarget = (0, module_1.getLayoutModuleByUri)(graph, 'file:///project/app/views/layouts/theme.liquid');
22
+ (0, vitest_1.expect)(entry).toBe(edgeTarget); // same cached object — one node
23
+ (0, vitest_1.expect)(entry?.uri).toEqual('file:///project/app/views/layouts/theme.liquid');
24
+ });
25
+ (0, vitest_1.it)('dedupes an entry-point page regardless of separator style', () => {
26
+ const graph = newGraph();
27
+ const first = (0, module_1.getPageModule)(graph, 'file:///project\\app\\views\\pages\\index.liquid');
28
+ const second = (0, module_1.getPageModule)(graph, 'file:///project/app/views/pages/index.liquid');
29
+ (0, vitest_1.expect)(first).toBe(second);
30
+ (0, vitest_1.expect)(first.uri).toEqual('file:///project/app/views/pages/index.liquid');
31
+ });
32
+ (0, vitest_1.it)('dedupes a partial across separator styles too (regression guard for the shared contract)', () => {
33
+ const graph = newGraph();
34
+ const a = (0, module_1.getPartialModuleByUri)(graph, 'file:///project\\app\\views\\partials\\card.liquid');
35
+ const b = (0, module_1.getPartialModuleByUri)(graph, 'file:///project/app/views/partials/card.liquid');
36
+ (0, vitest_1.expect)(a).toBe(b);
37
+ (0, vitest_1.expect)(a.uri).toEqual('file:///project/app/views/partials/card.liquid');
38
+ });
39
+ });
40
+ /**
41
+ * `getModule` (the entry-point dispatcher) must key a partial by its OWN
42
+ * resolved URI — like it does for layouts/pages/assets — NOT by rebuilding the
43
+ * path from the basename. Rebuilding from the basename forced every partial into
44
+ * `app/views/partials/<basename>.liquid`, which mis-keyed any `lib/` or nested
45
+ * partial (e.g. `app/lib/can/payment_request.liquid` → the phantom
46
+ * `app/views/partials/payment_request.liquid`), splitting it from the same file
47
+ * resolved as an edge target and losing its edges in the full build.
48
+ */
49
+ (0, vitest_1.describe)('getModule: partial entry point keys by its own URI', () => {
50
+ const newGraph = () => ({ rootUri: 'file:///project', entryPoints: [], modules: {} });
51
+ (0, vitest_1.it)('keys a lib partial at its own URI, not app/views/partials/<basename>', () => {
52
+ const graph = newGraph();
53
+ const uri = 'file:///project/app/lib/can/payment_request.liquid';
54
+ (0, vitest_1.expect)((0, module_1.getModule)(graph, uri)?.uri).toEqual(uri);
55
+ });
56
+ (0, vitest_1.it)('keys a nested lib partial at its own URI', () => {
57
+ const graph = newGraph();
58
+ const uri = 'file:///project/app/lib/queries/v2/projects/find.liquid';
59
+ (0, vitest_1.expect)((0, module_1.getModule)(graph, uri)?.uri).toEqual(uri);
60
+ });
61
+ (0, vitest_1.it)('a lib partial entry point and the same file resolved as an edge target are ONE node', () => {
62
+ const graph = newGraph();
63
+ const uri = 'file:///project/app/lib/commands/create.liquid';
64
+ const entry = (0, module_1.getModule)(graph, uri);
65
+ const edgeTarget = (0, module_1.getPartialModuleByUri)(graph, uri);
66
+ (0, vitest_1.expect)(entry).toBe(edgeTarget);
67
+ });
68
+ (0, vitest_1.it)('a flat app/views/partials partial is unaffected', () => {
69
+ const graph = newGraph();
70
+ const uri = 'file:///project/app/views/partials/card.liquid';
71
+ (0, vitest_1.expect)((0, module_1.getModule)(graph, uri)?.uri).toEqual(uri);
72
+ });
73
+ });
74
+ //# sourceMappingURL=module.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.spec.js","sourceRoot":"","sources":["../../src/graph/module.spec.ts"],"names":[],"mappings":";;AAAA,mCAA8C;AAE9C,qCAMkB;AAElB;;;;;;;;GAQG;AACH,IAAA,iBAAQ,EAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,MAAM,QAAQ,GAAG,GAAa,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;IAEhG,IAAA,WAAE,EAAC,+EAA+E,EAAE,GAAG,EAAE;QACvF,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;QACzB,oEAAoE;QACpE,MAAM,KAAK,GAAG,IAAA,wBAAe,EAAC,KAAK,EAAE,oDAAoD,CAAC,CAAC;QAC3F,6EAA6E;QAC7E,MAAM,UAAU,GAAG,IAAA,6BAAoB,EACrC,KAAK,EACL,gDAAgD,CACjD,CAAC;QAEF,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,gCAAgC;QAChE,IAAA,eAAM,EAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,gDAAgD,CAAC,CAAC;IAC/E,CAAC,CAAC,CAAC;IAEH,IAAA,WAAE,EAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAA,sBAAa,EAAC,KAAK,EAAE,kDAAkD,CAAC,CAAC;QACvF,MAAM,MAAM,GAAG,IAAA,sBAAa,EAAC,KAAK,EAAE,8CAA8C,CAAC,CAAC;QAEpF,IAAA,eAAM,EAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3B,IA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