@valbuild/core 0.13.8 → 0.15.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 (63) hide show
  1. package/dist/declarations/src/expr/eval.d.ts +6 -6
  2. package/dist/declarations/src/expr/index.d.ts +3 -3
  3. package/dist/declarations/src/expr/parser.d.ts +2 -2
  4. package/dist/declarations/src/fetchVal.d.ts +2 -2
  5. package/dist/declarations/src/fp/index.d.ts +3 -3
  6. package/dist/declarations/src/fp/result.d.ts +1 -1
  7. package/dist/declarations/src/index.d.ts +23 -22
  8. package/dist/declarations/src/initSchema.d.ts +25 -25
  9. package/dist/declarations/src/initVal.d.ts +7 -13
  10. package/dist/declarations/src/module.d.ts +10 -10
  11. package/dist/declarations/src/patch/deref.d.ts +3 -3
  12. package/dist/declarations/src/patch/index.d.ts +6 -6
  13. package/dist/declarations/src/patch/json.d.ts +2 -2
  14. package/dist/declarations/src/patch/operation.d.ts +2 -2
  15. package/dist/declarations/src/patch/ops.d.ts +1 -1
  16. package/dist/declarations/src/patch/parse.d.ts +3 -3
  17. package/dist/declarations/src/patch/patch.d.ts +3 -3
  18. package/dist/declarations/src/patch/util.d.ts +2 -2
  19. package/dist/declarations/src/schema/array.d.ts +3 -3
  20. package/dist/declarations/src/schema/boolean.d.ts +2 -2
  21. package/dist/declarations/src/schema/i18n.d.ts +3 -3
  22. package/dist/declarations/src/schema/image.d.ts +3 -3
  23. package/dist/declarations/src/schema/index.d.ts +14 -14
  24. package/dist/declarations/src/schema/literal.d.ts +2 -2
  25. package/dist/declarations/src/schema/number.d.ts +2 -2
  26. package/dist/declarations/src/schema/object.d.ts +3 -3
  27. package/dist/declarations/src/schema/oneOf.d.ts +5 -5
  28. package/dist/declarations/src/schema/richtext.d.ts +3 -3
  29. package/dist/declarations/src/schema/string.d.ts +2 -2
  30. package/dist/declarations/src/schema/union.d.ts +5 -5
  31. package/dist/declarations/src/selector/array.d.ts +5 -5
  32. package/dist/declarations/src/selector/boolean.d.ts +1 -1
  33. package/dist/declarations/src/selector/file.d.ts +1 -1
  34. package/dist/declarations/src/selector/i18n.d.ts +3 -3
  35. package/dist/declarations/src/selector/index.d.ts +17 -17
  36. package/dist/declarations/src/selector/number.d.ts +1 -1
  37. package/dist/declarations/src/selector/object.d.ts +2 -2
  38. package/dist/declarations/src/selector/primitive.d.ts +3 -3
  39. package/dist/declarations/src/selector/remote.d.ts +2 -2
  40. package/dist/declarations/src/selector/string.d.ts +1 -1
  41. package/dist/declarations/src/source/file.d.ts +2 -2
  42. package/dist/declarations/src/source/i18n.d.ts +2 -2
  43. package/dist/declarations/src/source/index.d.ts +4 -4
  44. package/dist/declarations/src/source/remote.d.ts +4 -4
  45. package/dist/declarations/src/source/richtext.d.ts +2 -2
  46. package/dist/declarations/src/val/array.d.ts +3 -3
  47. package/dist/declarations/src/val/index.d.ts +9 -9
  48. package/dist/declarations/src/val/object.d.ts +3 -3
  49. package/dist/declarations/src/val/primitive.d.ts +3 -3
  50. package/dist/{index-296cb2b6.esm.js → index-06df0a5b.esm.js} +1 -1
  51. package/dist/valbuild-core.cjs.dev.js +140 -144
  52. package/dist/valbuild-core.cjs.prod.js +140 -144
  53. package/dist/valbuild-core.esm.js +142 -146
  54. package/expr/dist/valbuild-core-expr.esm.js +1 -1
  55. package/package.json +1 -1
  56. package/src/expr/eval.test.ts +2 -3
  57. package/src/expr/parser.test.ts +1 -1
  58. package/src/expr/repl.ts +1 -2
  59. package/src/index.ts +3 -2
  60. package/src/initVal.ts +1 -21
  61. package/src/selector/selector.test.ts +1 -1
  62. package/dist/declarations/src/expr/tokenizer.d.ts +0 -7
  63. package/dist/declarations/src/selector/SelectorProxy.d.ts +0 -7
package/src/index.ts CHANGED
@@ -22,10 +22,11 @@ export {
22
22
  type SourcePath,
23
23
  type JsonOfSource,
24
24
  } from "./val";
25
- export { type Json } from "./Json";
25
+ export type { Json, JsonPrimitive } from "./Json";
26
26
  export * as expr from "./expr/";
27
27
  export { FILE_REF_PROP } from "./source/file";
28
- export { VAL_EXTENSION } from "./source";
28
+ export { VAL_EXTENSION, type SourceArray } from "./source";
29
+ export type { I18nSource } from "./source/i18n";
29
30
  export { derefPatch } from "./patch/deref";
30
31
  export {
31
32
  type SelectorSource,
package/src/initVal.ts CHANGED
@@ -3,11 +3,7 @@
3
3
  import { content } from "./module";
4
4
  import { i18n, I18n } from "./source/i18n";
5
5
  import { InitSchema, initSchema, InitSchemaLocalized } from "./initSchema";
6
- import { SelectorOf } from "./selector";
7
- import { getValPath as getPath, Val } from "./val";
8
- import { SelectorSource, GenericSelector } from "./selector";
9
- import { JsonOfSource } from "./val";
10
- import { fetchVal } from "./fetchVal";
6
+ import { getValPath as getPath } from "./val";
11
7
  import { remote } from "./source/remote";
12
8
  import { file } from "./source/file";
13
9
  import { richtext } from "./source/richtext";
@@ -15,7 +11,6 @@ import { richtext } from "./source/richtext";
15
11
  type ValConstructor = {
16
12
  content: typeof content;
17
13
  getPath: typeof getPath;
18
- key: typeof getPath;
19
14
  remote: typeof remote;
20
15
  file: typeof file;
21
16
  richtext: typeof richtext;
@@ -27,21 +22,10 @@ export type InitVal<Locales extends readonly string[] | undefined> = [
27
22
  val: ValConstructor & {
28
23
  i18n: I18n<Locales>;
29
24
  };
30
- fetchVal<T extends SelectorSource>(
31
- selector: T,
32
- locale: Locales[number]
33
- ): SelectorOf<T> extends GenericSelector<infer S>
34
- ? Promise<Val<JsonOfSource<S>>>
35
- : never;
36
25
  s: InitSchema & InitSchemaLocalized<Locales>;
37
26
  }
38
27
  : {
39
28
  val: ValConstructor;
40
- fetchVal<T extends SelectorSource>(
41
- selector: T
42
- ): SelectorOf<T> extends GenericSelector<infer S>
43
- ? Promise<Val<JsonOfSource<S>>>
44
- : never;
45
29
  s: InitSchema;
46
30
  };
47
31
 
@@ -72,11 +56,9 @@ export const initVal = <
72
56
  i18n,
73
57
  remote,
74
58
  getPath,
75
- key: getPath,
76
59
  file,
77
60
  richtext,
78
61
  },
79
- fetchVal: fetchVal,
80
62
  s,
81
63
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
82
64
  } as any;
@@ -86,11 +68,9 @@ export const initVal = <
86
68
  content,
87
69
  remote,
88
70
  getPath,
89
- key: getPath,
90
71
  file,
91
72
  richtext,
92
73
  },
93
- fetchVal: fetchVal,
94
74
  s: {
95
75
  ...s,
96
76
  i18n: undefined,
@@ -6,7 +6,7 @@ import { SourcePath } from "../val";
6
6
  import { Source } from "../source";
7
7
  import { evaluate } from "../expr/eval";
8
8
  import * as expr from "../expr/expr";
9
- import { result } from "../../fp";
9
+ import { result } from "../fp";
10
10
  import { object } from "../schema/object";
11
11
  import { newSelectorProxy, selectorToVal } from "./SelectorProxy";
12
12
  import { newExprSelectorProxy } from "./ExprProxy";
@@ -1,7 +0,0 @@
1
- export type Token = {
2
- readonly type: "!(" | "(" | ")" | "string" | "token" | "ws" | "${" | "}" | "'";
3
- readonly span: [start: number, stop: number];
4
- readonly value?: string;
5
- readonly unescapedValue?: string;
6
- };
7
- export declare function tokenize(input: string): [tokens: Token[], endCursor: number];
@@ -1,7 +0,0 @@
1
- import { GenericSelector } from ".";
2
- import { Source } from "../source";
3
- import { SourcePath } from "../val";
4
- export declare function isSelector(source: any): source is GenericSelector<Source>;
5
- export declare function newSelectorProxy(source: any, path?: SourcePath, moduleSchema?: any): any;
6
- export declare function createValPathOfItem(arrayPath: SourcePath | undefined, prop: string | number | symbol): SourcePath | undefined;
7
- export declare function selectorToVal(s: any): any;