@platformos/platformos-common 0.0.10 → 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 (45) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/CLAUDE.md +70 -0
  3. package/dist/documents-locator/DocumentsLocator.d.ts +35 -2
  4. package/dist/documents-locator/DocumentsLocator.js +126 -1
  5. package/dist/documents-locator/DocumentsLocator.js.map +1 -1
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/path-utils.d.ts +59 -15
  10. package/dist/path-utils.js +100 -28
  11. package/dist/path-utils.js.map +1 -1
  12. package/dist/route-table/RouteTable.d.ts +45 -0
  13. package/dist/route-table/RouteTable.js +384 -0
  14. package/dist/route-table/RouteTable.js.map +1 -0
  15. package/dist/route-table/index.d.ts +5 -0
  16. package/dist/route-table/index.js +13 -0
  17. package/dist/route-table/index.js.map +1 -0
  18. package/dist/route-table/parseSlug.d.ts +31 -0
  19. package/dist/route-table/parseSlug.js +124 -0
  20. package/dist/route-table/parseSlug.js.map +1 -0
  21. package/dist/route-table/slugFromFilePath.d.ts +23 -0
  22. package/dist/route-table/slugFromFilePath.js +81 -0
  23. package/dist/route-table/slugFromFilePath.js.map +1 -0
  24. package/dist/route-table/types.d.ts +30 -0
  25. package/dist/route-table/types.js +3 -0
  26. package/dist/route-table/types.js.map +1 -0
  27. package/dist/translation-provider/TranslationProvider.d.ts +1 -1
  28. package/dist/translation-provider/TranslationProvider.js +2 -2
  29. package/dist/translation-provider/TranslationProvider.js.map +1 -1
  30. package/dist/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +1 -1
  32. package/src/documents-locator/DocumentsLocator.spec.ts +299 -5
  33. package/src/documents-locator/DocumentsLocator.ts +144 -1
  34. package/src/index.ts +1 -0
  35. package/src/path-utils.spec.ts +320 -33
  36. package/src/path-utils.ts +103 -28
  37. package/src/route-table/RouteTable.spec.ts +708 -0
  38. package/src/route-table/RouteTable.ts +437 -0
  39. package/src/route-table/index.ts +5 -0
  40. package/src/route-table/parseSlug.spec.ts +177 -0
  41. package/src/route-table/parseSlug.ts +136 -0
  42. package/src/route-table/slugFromFilePath.spec.ts +84 -0
  43. package/src/route-table/slugFromFilePath.ts +84 -0
  44. package/src/route-table/types.ts +25 -0
  45. package/src/translation-provider/TranslationProvider.ts +4 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,40 @@
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
+
32
+ ## 0.0.11
33
+
34
+ ### Patch Changes
35
+
36
+ - Beta release
37
+
3
38
  ## 0.0.10
4
39
 
5
40
  ### Patch Changes
package/CLAUDE.md ADDED
@@ -0,0 +1,70 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Package Overview
6
+
7
+ `@platformos/platformos-common` is a shared library providing utilities used across the platformOS tools monorepo: file type classification, document/partial location resolution, translation loading, and the `AbstractFileSystem` interface for environment portability.
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ # Build
13
+ yarn build
14
+
15
+ # Run tests (vitest)
16
+ yarn test
17
+
18
+ # Run a single test file
19
+ yarn test src/path-utils.spec.ts
20
+
21
+ # Type-check without emitting
22
+ yarn type-check
23
+ ```
24
+
25
+ ## Architecture
26
+
27
+ ### `AbstractFileSystem` (`AbstractFileSystem.ts`)
28
+
29
+ Interface that abstracts filesystem operations (`stat`, `readFile`, `readDirectory`) so the same logic runs in Node.js, the browser, and VS Code. All classes in this package depend on it rather than any concrete `fs` module. Consumers provide an implementation at construction time.
30
+
31
+ ### `path-utils.ts` — File type classification
32
+
33
+ `FILE_TYPE_DIRS` is the **single source of truth** for all platformOS directory names, mapping each `PlatformOSFileType` enum value to its canonical directory names (including legacy aliases from the server's `converters_config.rb`).
34
+
35
+ `TYPE_MATCHERS` pre-compiles one regex per type from `FILE_TYPE_DIRS`, matching both app-level paths (`/(app|marketplace_builder)/{dir}/`) and module paths (`/(public|private)/{dir}/`). This design prevents false positives — e.g. `app/lib/smses/file.liquid` resolves to `Partial`, not `Sms`, because `/(app|marketplace_builder)/lib/` matches `Partial` first.
36
+
37
+ Key exported functions:
38
+ - `getFileType(uri)` — returns `PlatformOSFileType | undefined`
39
+ - `getAppPaths(type)` — returns `app/`-prefixed search paths for a file type
40
+ - `getModulePaths(type, moduleName)` — returns all `{app/,}modules/{name}/{public,private}/` search paths
41
+ - `isKnownLiquidFile`, `isKnownGraphQLFile`, `isPartial`, `isPage`, `isLayout`, etc. — convenience predicates
42
+
43
+ When adding a new file type or directory alias, update only `FILE_TYPE_DIRS`. The regex matchers, `getAppPaths`, and `getModulePaths` all derive from it automatically.
44
+
45
+ ### `DocumentsLocator` (`documents-locator/DocumentsLocator.ts`)
46
+
47
+ Resolves a document reference (from Liquid tags like `render`, `function`, `include`, `graphql`, `asset`) to a concrete filesystem URI, and lists matching completions.
48
+
49
+ - `locate(rootUri, nodeType, fileName)` — tries all candidate search paths in order, returns the first URI that `stat()`s as a file. Handles the `modules/{name}/...` prefix convention by routing to module paths instead of app paths.
50
+ - `list(rootUri, nodeType, filePrefix)` — walks all candidate directories and returns sorted, de-duplicated relative names matching the prefix.
51
+
52
+ File suffixes are added automatically: `.liquid` for partials, `.graphql` for graphql. Assets have no extension filtering.
53
+
54
+ ### `TranslationProvider` (`translation-provider/TranslationProvider.ts`)
55
+
56
+ Loads and searches platformOS YAML translation files.
57
+
58
+ Two file layouts are supported for each locale and translation base directory:
59
+ - **Single file**: `{base}/{locale}.yml`
60
+ - **Split files**: `{base}/{locale}/*.yml`
61
+
62
+ Both are checked in every method. `loadAllTranslationsForBase` deep-merges all files for a locale and accepts an optional `contentOverride` callback (used by editor integrations to honour unsaved buffer content). `findTranslationFile` returns the URI + stripped key for a given translation key. `translate` resolves a key to its string value.
63
+
64
+ Module translation keys use the prefix `modules/{name}/...`; these are routed to the module translation directories (`app/modules/{name}/public/translations`, etc.).
65
+
66
+ ## Key Invariants
67
+
68
+ - **URIs, not filesystem paths**: all public APIs use `UriString` (a `vscode-uri`-compatible `file://...` string), never raw OS paths.
69
+ - **Do not add environment-specific imports** (`fs`, `path`, etc.) — this package must remain browser-safe.
70
+ - `FILE_TYPE_DIRS` drives both classification and search path generation. Keep it in sync with the server's `converters_config.rb`.
@@ -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,CAAC,U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AAE,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"}
@@ -8,57 +8,96 @@
8
8
  * - getFileType() classifies any URI to a PlatformOSFileType
9
9
  * - isPage(), isLayout(), isPartial() etc. are convenience wrappers around getFileType()
10
10
  *
11
- * Pattern precision: each type uses exact path segment patterns (/app/{dir}/ or
12
- * /(public|private)/{dir}/) so that nested paths don't produce false positives.
13
- * For example, app/lib/smses/file.liquid is correctly identified as Partial
14
- * (matches /app/lib/), not Sms (does not match /app/smses/).
11
+ * Source of truth: app/services/app_builder/services/converters_config.rb and
12
+ * app/models/concerns/deployable.rb in the platformOS server codebase.
13
+ *
14
+ * DIR_PREFIX (Ruby): ^/?((marketplace_builder|app)/|modules/(.+)(private|public)/)?
15
+ * This means files can live under:
16
+ * - app/{dir}/
17
+ * - marketplace_builder/{dir}/ (legacy alias for app/)
18
+ * - modules/{name}/(public|private)/{dir}/
19
+ * - app/modules/{name}/(public|private)/{dir}/
15
20
  */
16
21
  import { UriString } from './AbstractFileSystem';
17
22
  /**
18
- * File types that exist in a platformOS app, each mapping to one or more
19
- * canonical directory names relative to the app root or module access level.
23
+ * File types that exist in a platformOS app, each corresponding to a server-side
24
+ * converter that processes the file on deploy.
25
+ *
26
+ * Liquid types: Page, Layout, Partial, Authorization, Email, ApiCall, Sms, Migration, FormConfiguration
27
+ * YAML types: CustomModelType, InstanceProfileType, TransactableType, Translation
28
+ * GraphQL types: GraphQL
29
+ * Binary/other: Asset
20
30
  */
21
31
  export declare enum PlatformOSFileType {
32
+ /** views/pages/ or pages/ → PageConverter */
22
33
  Page = "Page",
34
+ /** views/layouts/ → LiquidViewConverter (layouts) */
23
35
  Layout = "Layout",
36
+ /** views/partials/ or lib/ → LiquidViewConverter (partials) */
24
37
  Partial = "Partial",
38
+ /** authorization_policies/ → AuthorizationPolicyConverter */
25
39
  Authorization = "Authorization",
40
+ /** emails/ or notifications/email_notifications/ → EmailNotificationConverter */
26
41
  Email = "Email",
42
+ /** api_calls/ or notifications/api_call_notifications/ → ApiCallNotificationConverter */
27
43
  ApiCall = "ApiCall",
44
+ /** smses/ or notifications/sms_notifications/ → SmsNotificationConverter */
28
45
  Sms = "Sms",
46
+ /** migrations/ → MigrationConverter */
29
47
  Migration = "Migration",
48
+ /** form_configurations/ or forms/ → FormConfigurationConverter */
49
+ FormConfiguration = "FormConfiguration",
50
+ /** custom_model_types/, model_schemas/, or schema/ → CustomModelTypeConverter */
51
+ CustomModelType = "CustomModelType",
52
+ /** instance_profile_types/, user_profile_types/, or user_profile_schemas/ → InstanceProfileTypeConverter */
53
+ InstanceProfileType = "InstanceProfileType",
54
+ /** transactable_types/ → TransactableTypeConverter */
55
+ TransactableType = "TransactableType",
56
+ /** translations/ → TranslationConverter */
57
+ Translation = "Translation",
58
+ /** graphql/ or graph_queries/ → GraphQueryConverter */
30
59
  GraphQL = "GraphQL",
60
+ /** assets/ → AssetConverter */
31
61
  Asset = "Asset"
32
62
  }
33
63
  /**
34
64
  * The single source of truth for the platformOS directory structure.
35
65
  *
36
66
  * Maps each file type to its canonical directory name(s) relative to:
37
- * - the app root: app/{dir}/
67
+ * - the app root: (app|marketplace_builder)/{dir}/
38
68
  * - a module access level: modules/{name}/(public|private)/{dir}/
39
69
  * - a nested module access level: app/modules/{name}/(public|private)/{dir}/
40
70
  *
71
+ * Multiple dirs per type represent canonical + legacy aliases from the server
72
+ * converters_config.rb FULL_PHYSICAL_PATH regexes.
73
+ *
41
74
  * Types with multiple dirs (e.g. Partial) will match any of their dirs.
42
- * The first matching type wins, so order of evaluation matters for overlapping
43
- * paths — but exact segment matching means dirs don't overlap in practice.
75
+ * Order within each array doesn't matter for matching. Across types,
76
+ * exact segment matching prevents false positives between overlapping paths
77
+ * (e.g. app/lib/smses/ → Partial, not Sms).
44
78
  */
45
79
  export declare const FILE_TYPE_DIRS: Readonly<Record<PlatformOSFileType, readonly string[]>>;
46
80
  /**
47
81
  * Returns the PlatformOSFileType for the given URI, or undefined if the URI
48
82
  * does not belong to any recognized platformOS directory.
49
83
  *
84
+ * Supports both modern (app/) and legacy (marketplace_builder/) app roots,
85
+ * as well as module paths (modules/{name}/public|private/).
86
+ *
50
87
  * @example
51
- * getFileType('file:///root/app/lib/smses/notify.liquid') // → PlatformOSFileType.Partial
52
- * getFileType('file:///root/app/smses/notify.liquid') // → PlatformOSFileType.Sms
88
+ * getFileType('file:///root/app/lib/smses/notify.liquid') // → Partial
89
+ * getFileType('file:///root/app/smses/notify.liquid') // → Sms
90
+ * getFileType('file:///root/marketplace_builder/views/pages/home.liquid') // → Page
53
91
  * getFileType('file:///root/modules/core/generators/templates/lib/create.liquid') // → undefined
54
92
  */
55
93
  export declare function getFileType(uri: UriString): PlatformOSFileType | undefined;
56
94
  /**
57
95
  * Returns app-level search paths for a file type (relative to project root).
96
+ * Uses the modern `app/` root (not the legacy `marketplace_builder/` alias).
58
97
  *
59
98
  * @example
60
99
  * getAppPaths(PlatformOSFileType.Partial) // → ['app/views/partials', 'app/lib']
61
- * getAppPaths(PlatformOSFileType.GraphQL) // → ['app/graphql']
100
+ * getAppPaths(PlatformOSFileType.GraphQL) // → ['app/graphql', 'app/graph_queries']
62
101
  */
63
102
  export declare function getAppPaths(type: PlatformOSFileType): string[];
64
103
  /**
@@ -73,9 +112,7 @@ export declare function getAppPaths(type: PlatformOSFileType): string[];
73
112
  * 'modules/core/public/views/partials',
74
113
  * 'modules/core/private/views/partials',
75
114
  * 'app/modules/core/public/lib',
76
- * 'app/modules/core/private/lib',
77
- * 'modules/core/public/lib',
78
- * 'modules/core/private/lib',
115
+ * ...
79
116
  * ]
80
117
  */
81
118
  export declare function getModulePaths(type: PlatformOSFileType, moduleName: string): string[];
@@ -85,6 +122,12 @@ export declare function getModulePaths(type: PlatformOSFileType, moduleName: str
85
122
  * templates, build artifacts) return false and are excluded from linting.
86
123
  */
87
124
  export declare function isKnownLiquidFile(uri: UriString): boolean;
125
+ /**
126
+ * Returns true if the URI belongs to a recognized platformOS GraphQL directory
127
+ * and should be linted. Files outside known directories (e.g. generator
128
+ * templates, schema files, ERB templates) return false and are excluded.
129
+ */
130
+ export declare function isKnownGraphQLFile(uri: UriString): boolean;
88
131
  export declare function isPartial(uri: UriString): boolean;
89
132
  export declare function isPage(uri: UriString): boolean;
90
133
  export declare function isLayout(uri: UriString): boolean;
@@ -93,3 +136,4 @@ export declare function isEmail(uri: UriString): boolean;
93
136
  export declare function isApiCall(uri: UriString): boolean;
94
137
  export declare function isSms(uri: UriString): boolean;
95
138
  export declare function isMigration(uri: UriString): boolean;
139
+ export declare function isFormConfiguration(uri: UriString): boolean;