@platformos/platformos-common 0.0.11 → 0.0.12

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 (39) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/documents-locator/DocumentsLocator.d.ts +35 -2
  3. package/dist/documents-locator/DocumentsLocator.js +126 -1
  4. package/dist/documents-locator/DocumentsLocator.js.map +1 -1
  5. package/dist/index.d.ts +1 -0
  6. package/dist/index.js +1 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/route-table/RouteTable.d.ts +45 -0
  9. package/dist/route-table/RouteTable.js +384 -0
  10. package/dist/route-table/RouteTable.js.map +1 -0
  11. package/dist/route-table/index.d.ts +5 -0
  12. package/dist/route-table/index.js +13 -0
  13. package/dist/route-table/index.js.map +1 -0
  14. package/dist/route-table/parseSlug.d.ts +31 -0
  15. package/dist/route-table/parseSlug.js +124 -0
  16. package/dist/route-table/parseSlug.js.map +1 -0
  17. package/dist/route-table/slugFromFilePath.d.ts +23 -0
  18. package/dist/route-table/slugFromFilePath.js +81 -0
  19. package/dist/route-table/slugFromFilePath.js.map +1 -0
  20. package/dist/route-table/types.d.ts +30 -0
  21. package/dist/route-table/types.js +3 -0
  22. package/dist/route-table/types.js.map +1 -0
  23. package/dist/translation-provider/TranslationProvider.d.ts +1 -1
  24. package/dist/translation-provider/TranslationProvider.js +2 -2
  25. package/dist/translation-provider/TranslationProvider.js.map +1 -1
  26. package/dist/tsconfig.tsbuildinfo +1 -1
  27. package/package.json +1 -1
  28. package/src/documents-locator/DocumentsLocator.spec.ts +299 -5
  29. package/src/documents-locator/DocumentsLocator.ts +144 -1
  30. package/src/index.ts +1 -0
  31. package/src/route-table/RouteTable.spec.ts +708 -0
  32. package/src/route-table/RouteTable.ts +437 -0
  33. package/src/route-table/index.ts +5 -0
  34. package/src/route-table/parseSlug.spec.ts +177 -0
  35. package/src/route-table/parseSlug.ts +136 -0
  36. package/src/route-table/slugFromFilePath.spec.ts +84 -0
  37. package/src/route-table/slugFromFilePath.ts +84 -0
  38. package/src/route-table/types.ts +25 -0
  39. package/src/translation-provider/TranslationProvider.ts +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @platformos/platformos-common
2
2
 
3
+ ## 0.0.12
4
+
5
+ ### Patch Changes
6
+
7
+ - **MissingRenderPartialArguments**: Reports an error when required `@param` arguments declared in a partial's LiquidDoc are not provided at the `{% render %}` call site.
8
+ - **NestedGraphQLQuery**: Detects N+1 query patterns — `{% graphql %}` tags inside `{% for %}`/`{% tablerow %}` loops. Also follows `{% function %}` and `{% render %}` calls transitively to detect indirect GraphQL queries. Skips loops wrapped in `{% cache %}` or `{% background %}`.
9
+ - Added **GraphQLFieldCompletionProvider**: Provides completions for GraphQL field names.
10
+ - Added **GraphQLFieldHoverProvider**: Shows hover documentation for GraphQL fields.
11
+ - Added `theme_render_rc` as a new document type, enabling the `{% theme_render_rc %}` tag to resolve partials through configurable `theme_search_paths` defined in `app/config.yml`.
12
+ - **DocumentsLocator**: New `locateWithSearchPaths()` method resolves partials using prioritized search paths, including dynamic paths with `{{ }}` Liquid expressions that expand by enumerating subdirectories.
13
+ - **loadSearchPaths()**: New utility to read and parse `theme_search_paths` from `app/config.yml`.
14
+ - **TranslationKeyExists**: Refactored to load all defined keys (app-level and module-level) in a single pass. Now suggests nearest matching keys using Levenshtein distance when a translation key is not found.
15
+ - Extracted shared translation utilities into `translation-utils.ts` for module discovery and key loading.
16
+ - Added `levenshtein.ts` utility for fuzzy key matching.
17
+ - Added support for `{% try %}...{% catch error %}` — the error variable in catch branches is now correctly registered as defined, preventing false-positive "undefined object" warnings.
18
+ - `null`/`nil` literals are now treated as compatible with any `@param` type, preventing false type-mismatch errors when passing null values to partials.
19
+ - `recursiveReadDirectory` now gracefully handles `ENOENT` errors instead of crashing when a directory doesn't exist.
20
+ - **MissingPartial** check updated to support `theme_render_rc` tag resolution through search paths.
21
+ - Extracted `tryExtractAssignUrl()` helper to deduplicate assign-to-URL resolution logic shared between `MissingPage` check and `buildVariableMap`.
22
+ - Fixed `buildVariableMap` to correctly recurse into block tags (`{% if %}`, `{% for %}`) whose position spans beyond the cursor offset — previously assigns inside such blocks could be missed.
23
+ - **SearchPathsLoader**: Now caches `theme_search_paths` per root URI to avoid re-reading `app/config.yml` on every request. Invalidated when file watchers detect config changes.
24
+ - Immediate cache invalidation on `app/config.yml` save (via `onDidSaveTextDocument`) so go-to-definition doesn't see stale data.
25
+ - Bulk file-watcher threshold extracted to `BULK_PAGE_CHANGE_THRESHOLD` constant.
26
+ - **RouteTable**: Added `routeCount()` method returning total number of route entries.
27
+ - Route table build errors are now properly handled — a failed build resets the cached promise so subsequent attempts can retry.
28
+ - `MissingPartial` check simplified with a shared `reportIfMissing()` helper, reducing code duplication across `RenderMarkup`, `FunctionMarkup`, and `GraphQLMarkup` visitors.
29
+ - AST traversal helpers (`getTraversableChildren`, `getTraversableMarkup`) extracted in `url-helpers.ts`.
30
+ - `MissingPage` check front-loads route table building in `onCodePathStart` instead of lazy-loading per element visit.
31
+
3
32
  ## 0.0.11
4
33
 
5
34
  ### Patch Changes
@@ -1,6 +1,14 @@
1
1
  import { AbstractFileSystem } from '../AbstractFileSystem';
2
2
  import { URI } from 'vscode-uri';
3
- export type DocumentType = 'function' | 'render' | 'include' | 'graphql' | 'asset';
3
+ export type DocumentType = 'function' | 'render' | 'include' | 'graphql' | 'asset' | 'theme_render_rc';
4
+ /**
5
+ * Load theme_search_paths from app/config.yml.
6
+ * Returns null if the file doesn't exist, is malformed, or has no valid theme_search_paths.
7
+ * Results should be cached per root URI.
8
+ */
9
+ export declare function loadSearchPaths(fs: {
10
+ readFile(uri: string): Promise<string>;
11
+ }, rootUri: URI): Promise<string[] | null>;
4
12
  export declare class DocumentsLocator {
5
13
  private readonly fs;
6
14
  constructor(fs: AbstractFileSystem);
@@ -9,6 +17,31 @@ export declare class DocumentsLocator {
9
17
  private getSearchPaths;
10
18
  private locateFile;
11
19
  private listFiles;
12
- locate(rootUri: URI, nodeName: DocumentType, fileName: string): Promise<string | undefined>;
20
+ private static readonly LIQUID_EXPRESSION_RE;
21
+ private listSubdirectoryNames;
22
+ private expandedPathsCache;
23
+ clearExpandedPathsCache(): void;
24
+ /**
25
+ * Expand a search path that may contain {{ ... }} Liquid expressions into
26
+ * concrete directory prefixes by enumerating subdirectories at each dynamic
27
+ * segment. Static segments pass through unchanged.
28
+ *
29
+ * Results are cached per (rootUri, searchPath) and capped at 100 entries.
30
+ */
31
+ private expandDynamicPath;
32
+ /**
33
+ * Resolve a search path (static, dynamic, or empty) into concrete prefix
34
+ * strings. Cached for dynamic paths.
35
+ */
36
+ private resolveSearchPath;
37
+ /**
38
+ * Locate a partial using theme search paths (for theme_render_rc).
39
+ *
40
+ * Tries each search path prefix in priority order, then falls back to the
41
+ * unprefixed name (unless '' was already in the list, meaning the default
42
+ * position was explicitly placed).
43
+ */
44
+ locateWithSearchPaths(rootUri: URI, fileName: string, themeSearchPaths: string[]): Promise<string | undefined>;
45
+ locate(rootUri: URI, nodeName: DocumentType, fileName: string, themeSearchPaths?: string[] | null): Promise<string | undefined>;
13
46
  list(rootUri: URI, nodeName: string | undefined, filePrefix: string): Promise<string[]>;
14
47
  }
@@ -1,12 +1,38 @@
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.DocumentsLocator = void 0;
7
+ exports.loadSearchPaths = loadSearchPaths;
8
+ const js_yaml_1 = __importDefault(require("js-yaml"));
4
9
  const AbstractFileSystem_1 = require("../AbstractFileSystem");
5
10
  const path_utils_1 = require("../path-utils");
6
11
  const vscode_uri_1 = require("vscode-uri");
12
+ /**
13
+ * Load theme_search_paths from app/config.yml.
14
+ * Returns null if the file doesn't exist, is malformed, or has no valid theme_search_paths.
15
+ * Results should be cached per root URI.
16
+ */
17
+ async function loadSearchPaths(fs, rootUri) {
18
+ try {
19
+ const configUri = vscode_uri_1.Utils.joinPath(rootUri, 'app/config.yml').toString();
20
+ const content = await fs.readFile(configUri);
21
+ const config = js_yaml_1.default.load(content);
22
+ const paths = config?.theme_search_paths;
23
+ if (Array.isArray(paths) && paths.length > 0) {
24
+ return paths.map(String);
25
+ }
26
+ return null;
27
+ }
28
+ catch {
29
+ return null;
30
+ }
31
+ }
7
32
  class DocumentsLocator {
8
33
  constructor(fs) {
9
34
  this.fs = fs;
35
+ this.expandedPathsCache = new Map();
10
36
  }
11
37
  async isFile(path) {
12
38
  try {
@@ -100,12 +126,109 @@ class DocumentsLocator {
100
126
  }
101
127
  return Array.from(results).sort((a, b) => a.localeCompare(b));
102
128
  }
103
- async locate(rootUri, nodeName, fileName) {
129
+ async listSubdirectoryNames(dirUri) {
130
+ try {
131
+ const entries = await this.fs.readDirectory(dirUri);
132
+ return entries
133
+ .filter(([, type]) => type === AbstractFileSystem_1.FileType.Directory)
134
+ .map(([name]) => {
135
+ const lastSlash = name.lastIndexOf('/');
136
+ return lastSlash === -1 ? name : name.slice(lastSlash + 1);
137
+ })
138
+ .filter((name) => name.length > 0);
139
+ }
140
+ catch {
141
+ return [];
142
+ }
143
+ }
144
+ clearExpandedPathsCache() {
145
+ this.expandedPathsCache.clear();
146
+ }
147
+ /**
148
+ * Expand a search path that may contain {{ ... }} Liquid expressions into
149
+ * concrete directory prefixes by enumerating subdirectories at each dynamic
150
+ * segment. Static segments pass through unchanged.
151
+ *
152
+ * Results are cached per (rootUri, searchPath) and capped at 100 entries.
153
+ */
154
+ async expandDynamicPath(rootUri, searchPath) {
155
+ const segments = searchPath.split('/');
156
+ const basePaths = this.getSearchPaths('partial');
157
+ let prefixes = [''];
158
+ for (const segment of segments) {
159
+ if (!DocumentsLocator.LIQUID_EXPRESSION_RE.test(segment)) {
160
+ prefixes = prefixes.map((p) => (p ? `${p}/${segment}` : segment));
161
+ continue;
162
+ }
163
+ const nextPrefixes = [];
164
+ for (const prefix of prefixes) {
165
+ const subdirs = new Set();
166
+ for (const base of basePaths) {
167
+ const dirUri = prefix
168
+ ? vscode_uri_1.Utils.joinPath(rootUri, base, prefix).toString()
169
+ : vscode_uri_1.Utils.joinPath(rootUri, base).toString();
170
+ for (const name of await this.listSubdirectoryNames(dirUri)) {
171
+ subdirs.add(name);
172
+ }
173
+ }
174
+ for (const sub of subdirs) {
175
+ nextPrefixes.push(prefix ? `${prefix}/${sub}` : sub);
176
+ if (nextPrefixes.length >= 100)
177
+ break;
178
+ }
179
+ if (nextPrefixes.length >= 100)
180
+ break;
181
+ }
182
+ prefixes = nextPrefixes;
183
+ }
184
+ return prefixes;
185
+ }
186
+ /**
187
+ * Resolve a search path (static, dynamic, or empty) into concrete prefix
188
+ * strings. Cached for dynamic paths.
189
+ */
190
+ async resolveSearchPath(rootUri, searchPath) {
191
+ if (searchPath === '')
192
+ return [''];
193
+ if (!DocumentsLocator.LIQUID_EXPRESSION_RE.test(searchPath))
194
+ return [searchPath];
195
+ const cacheKey = `${rootUri.toString()}:${searchPath}`;
196
+ if (!this.expandedPathsCache.has(cacheKey)) {
197
+ this.expandedPathsCache.set(cacheKey, this.expandDynamicPath(rootUri, searchPath));
198
+ }
199
+ return this.expandedPathsCache.get(cacheKey);
200
+ }
201
+ /**
202
+ * Locate a partial using theme search paths (for theme_render_rc).
203
+ *
204
+ * Tries each search path prefix in priority order, then falls back to the
205
+ * unprefixed name (unless '' was already in the list, meaning the default
206
+ * position was explicitly placed).
207
+ */
208
+ async locateWithSearchPaths(rootUri, fileName, themeSearchPaths) {
209
+ for (const searchPath of themeSearchPaths) {
210
+ for (const prefix of await this.resolveSearchPath(rootUri, searchPath)) {
211
+ const candidate = prefix ? `${prefix}/${fileName}` : fileName;
212
+ const result = await this.locateFile(rootUri, candidate, 'partial');
213
+ if (result)
214
+ return result;
215
+ }
216
+ }
217
+ if (!themeSearchPaths.includes('')) {
218
+ return this.locateFile(rootUri, fileName, 'partial');
219
+ }
220
+ return undefined;
221
+ }
222
+ async locate(rootUri, nodeName, fileName, themeSearchPaths) {
104
223
  switch (nodeName) {
105
224
  case 'render':
106
225
  case 'include':
107
226
  case 'function':
108
227
  return this.locateFile(rootUri, fileName, 'partial');
228
+ case 'theme_render_rc':
229
+ return themeSearchPaths
230
+ ? this.locateWithSearchPaths(rootUri, fileName, themeSearchPaths)
231
+ : this.locateFile(rootUri, fileName, 'partial');
109
232
  case 'graphql':
110
233
  return this.locateFile(rootUri, fileName, 'graphql');
111
234
  case 'asset':
@@ -119,6 +242,7 @@ class DocumentsLocator {
119
242
  case 'function':
120
243
  case 'render':
121
244
  case 'include':
245
+ case 'theme_render_rc':
122
246
  return this.listFiles(rootUri, filePrefix, 'partial');
123
247
  case 'graphql':
124
248
  return this.listFiles(rootUri, filePrefix, 'graphql');
@@ -130,4 +254,5 @@ class DocumentsLocator {
130
254
  }
131
255
  }
132
256
  exports.DocumentsLocator = DocumentsLocator;
257
+ DocumentsLocator.LIQUID_EXPRESSION_RE = /\{\{.*?\}\}/;
133
258
  //# sourceMappingURL=DocumentsLocator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentsLocator.js","sourceRoot":"","sources":["../../src/documents-locator/DocumentsLocator.ts"],"names":[],"mappings":";;;AAAA,8DAAqE;AACrE,8CAAgF;AAChF,2CAAwC;AAQxC,MAAa,gBAAgB;IAC3B,YAA6B,EAAsB;QAAtB,OAAE,GAAF,EAAE,CAAoB;IAAG,CAAC;IAE/C,KAAK,CAAC,MAAM,CAAC,IAAY;QAC/B,IAAI,CAAC;YACH,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,6BAAQ,CAAC,IAAI,CAAC;QAC3D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,eAAe,CAAC,QAAgB;QACtC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAA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,EAAE,OAAO,CAAC,CAAC;YAErD;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAAY,EAAE,QAA4B,EAAE,UAAkB;QACvE,QAAQ,QAAQ,EAAE,CAAC;YACjB,KAAK,UAAU,CAAC;YAChB,KAAK,QAAQ,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,iBAAiB;gBACpB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAExD,KAAK,SAAS;gBACZ,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;YAExD,KAAK,OAAO;gBACV,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;YAEtD;gBACE,OAAO,EAAE,CAAC;QACd,CAAC;IACH,CAAC;;AA9QH,4CA+QC;AAxJyB,qCAAoB,GAAG,aAAa,AAAhB,CAAiB"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './documents-locator/DocumentsLocator';
2
2
  export * from './translation-provider/TranslationProvider';
3
+ export * from './route-table';
3
4
  export * from './AbstractFileSystem';
4
5
  export * from './path-utils';
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./documents-locator/DocumentsLocator"), exports);
18
18
  __exportStar(require("./translation-provider/TranslationProvider"), exports);
19
+ __exportStar(require("./route-table"), exports);
19
20
  __exportStar(require("./AbstractFileSystem"), exports);
20
21
  __exportStar(require("./path-utils"), exports);
21
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAqD;AACrD,6EAA2D;AAC3D,uDAAqC;AACrC,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uEAAqD;AACrD,6EAA2D;AAC3D,gDAA8B;AAC9B,uDAAqC;AACrC,+CAA6B"}
@@ -0,0 +1,45 @@
1
+ import { URI } from 'vscode-uri';
2
+ import { AbstractFileSystem } from '../AbstractFileSystem';
3
+ import { RouteEntry } from './types';
4
+ export declare class RouteTable {
5
+ private fs;
6
+ private routes;
7
+ private _built;
8
+ constructor(fs: AbstractFileSystem);
9
+ /** Returns true if build() has completed at least once. */
10
+ isBuilt(): boolean;
11
+ build(rootUri: URI): Promise<void>;
12
+ updateFile(uri: string, content: string): void;
13
+ removeFile(uri: string): void;
14
+ /**
15
+ * Find all routes matching a URL pattern and optional method.
16
+ * The pattern can contain `:_liquid_` segments for Liquid interpolations.
17
+ * Results are sorted by precedence (highest priority first = lowest number).
18
+ *
19
+ * A known format extension on the last segment (e.g., `/api/data.json`)
20
+ * is stripped and used to filter routes by format. When no format extension
21
+ * is present (e.g., `/about`), only `html` routes match — following the
22
+ * platformOS/Rails convention where HTML is the default format and non-HTML
23
+ * formats require an explicit extension or Accept header.
24
+ */
25
+ match(urlPattern: string, method?: string): RouteEntry[];
26
+ hasMatch(urlPattern: string, method?: string): boolean;
27
+ /** Returns the total number of route entries (including index aliases). */
28
+ routeCount(): number;
29
+ allRoutes(): RouteEntry[];
30
+ private matchEntry;
31
+ /**
32
+ * Try optional groups left-to-right greedily — matching Rails' ActionDispatch::Journey
33
+ * semantics. Each group is tried in order; if it matches, its segments are consumed
34
+ * and the next group is attempted. If it doesn't match, it's skipped (optional).
35
+ *
36
+ * This greedy approach is correct because the platformOS backend converts slugs like
37
+ * `search(/:country)(/:city)` into Journey path strings and Journey matches
38
+ * left-to-right without backtracking.
39
+ */
40
+ private matchOptionalGroups;
41
+ private addPageFromContent;
42
+ private discoverPageFiles;
43
+ private discoverModuleNames;
44
+ private walkDirectory;
45
+ }