@travetto/model-query 5.0.0-rc.3 → 5.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-query",
3
- "version": "5.0.0-rc.3",
3
+ "version": "5.0.0-rc.5",
4
4
  "description": "Datastore abstraction for advanced query support.",
5
5
  "keywords": [
6
6
  "datastore",
@@ -27,12 +27,12 @@
27
27
  "directory": "module/model-query"
28
28
  },
29
29
  "dependencies": {
30
- "@travetto/di": "^5.0.0-rc.3",
31
- "@travetto/model": "^5.0.0-rc.3",
32
- "@travetto/schema": "^5.0.0-rc.3"
30
+ "@travetto/di": "^5.0.0-rc.5",
31
+ "@travetto/model": "^5.0.0-rc.5",
32
+ "@travetto/schema": "^5.0.0-rc.5"
33
33
  },
34
34
  "peerDependencies": {
35
- "@travetto/test": "^5.0.0-rc.3"
35
+ "@travetto/test": "^5.0.0-rc.5"
36
36
  },
37
37
  "peerDependenciesMeta": {
38
38
  "@travetto/test": {
@@ -1,5 +1,4 @@
1
- import { TimeSpan } from '@travetto/runtime';
2
- import { Primitive } from '@travetto/schema';
1
+ import type { Primitive, TimeSpan } from '@travetto/runtime';
3
2
 
4
3
  /**
5
4
  * Point as [number,number] with validation and binding support
@@ -1,8 +1,5 @@
1
1
  /** @jsxImportSource @travetto/doc */
2
- import { readFileSync } from 'node:fs';
3
-
4
- import { d, DocJSXElementByFn, DocJSXElement } from '@travetto/doc';
5
- import { Runtime } from '@travetto/runtime';
2
+ import { d, DocJSXElementByFn, DocJSXElement, DocFileUtil } from '@travetto/doc';
6
3
 
7
4
  export const Links = {
8
5
  QueryCrud: d.codeLink('Query Crud', '@travetto/model-query/src/service/crud.ts', /export interface/),
@@ -11,14 +8,11 @@ export const Links = {
11
8
  Query: d.codeLink('Query', '@travetto/model-query/src/service/query.ts', /export interface/),
12
9
  };
13
10
 
14
- export const ModelQueryTypes = (file: string | Function): DocJSXElement[] => {
15
- if (typeof file !== 'string') {
16
- file = Runtime.getSource(file);
17
- }
18
- const contents = readFileSync(file, 'utf8');
11
+ export const ModelQueryTypes = (fn: Function): DocJSXElement[] => {
12
+ const { content } = DocFileUtil.readSource(fn);
19
13
  const found: DocJSXElementByFn<'CodeLink'>[] = [];
20
14
  const seen = new Set();
21
- for (const [, key] of contents.matchAll(/Model(Query(Suggest|Facet|Crud)?)Support/g)) {
15
+ for (const [, key] of content.matchAll(/Model(Query(Suggest|Facet|Crud)?)Support/g)) {
22
16
  if (!seen.has(key)) {
23
17
  seen.add(key);
24
18
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions