@alloy-js/json 0.23.0-dev.2 → 0.23.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.
- package/CHANGELOG.md +8 -0
- package/dist/dev/src/components/array.test.js +51 -0
- package/dist/dev/src/components/array.test.js.map +1 -0
- package/dist/dev/src/components/index.js +6 -0
- package/dist/dev/src/components/index.js.map +1 -0
- package/dist/dev/src/components/json-array.js +163 -0
- package/dist/dev/src/components/json-array.js.map +1 -0
- package/dist/dev/src/components/json-object.js +187 -0
- package/dist/dev/src/components/json-object.js.map +1 -0
- package/dist/dev/src/components/json-value.js +62 -0
- package/dist/dev/src/components/json-value.js.map +1 -0
- package/dist/dev/src/components/json-value.test.js +66 -0
- package/dist/dev/src/components/json-value.test.js.map +1 -0
- package/dist/dev/src/components/object.test.js +118 -0
- package/dist/dev/src/components/object.test.js.map +1 -0
- package/dist/dev/src/components/primitives.test.js +7 -0
- package/dist/dev/src/components/primitives.test.js.map +1 -0
- package/dist/dev/src/components/reference.js +15 -0
- package/dist/dev/src/components/reference.js.map +1 -0
- package/dist/dev/src/components/reference.test.js +476 -0
- package/dist/dev/src/components/reference.test.js.map +1 -0
- package/dist/dev/src/components/source-file.js +52 -0
- package/dist/dev/src/components/source-file.js.map +1 -0
- package/dist/dev/src/components/stc/index.js +10 -0
- package/dist/dev/src/components/stc/index.js.map +1 -0
- package/dist/dev/src/context/JsonFileContext.js +10 -0
- package/dist/dev/src/context/JsonFileContext.js.map +1 -0
- package/dist/dev/src/context/index.js +2 -0
- package/dist/dev/src/context/index.js.map +1 -0
- package/dist/dev/src/index.js +4 -0
- package/dist/dev/src/index.js.map +1 -0
- package/dist/dev/src/symbols/index.js +51 -0
- package/dist/dev/src/symbols/index.js.map +1 -0
- package/dist/dev/src/symbols/json-symbol.js +59 -0
- package/dist/dev/src/symbols/json-symbol.js.map +1 -0
- package/dist/dev/test/utils.js +31 -0
- package/dist/dev/test/utils.js.map +1 -0
- package/dist/dev/test/vitest.setup.js +2 -0
- package/dist/dev/test/vitest.setup.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/docs/api/components/JsonArrayElement.md +65 -0
- package/docs/api/components/JsonObject.md +91 -0
- package/docs/api/components/JsonObjectProperty.md +67 -0
- package/docs/api/components/JsonValue.md +28 -0
- package/docs/api/components/Reference.md +31 -0
- package/docs/api/components/SourceFile.md +36 -0
- package/docs/api/components/index.md +8 -0
- package/docs/api/contexts/JsonFile-context.md +21 -0
- package/docs/api/contexts/index.md +3 -0
- package/docs/api/functions/index.md +4 -0
- package/docs/api/functions/ref.md +18 -0
- package/docs/api/functions/useJsonFileContext.md +17 -0
- package/docs/api/index.md +7 -0
- package/docs/api/types/CreateJsonSymbolOptions.md +9 -0
- package/docs/api/types/JsonArrayElementProps.md +5 -0
- package/docs/api/types/JsonArrayProps.md +5 -0
- package/docs/api/types/JsonArrayPropsBase.md +7 -0
- package/docs/api/types/JsonObjectProps.md +5 -0
- package/docs/api/types/JsonObjectPropsBase.md +8 -0
- package/docs/api/types/JsonOutputSymbol.md +16 -0
- package/docs/api/types/ObjectPropertyProps.md +5 -0
- package/docs/api/types/index.md +10 -0
- package/docs/api/variables/JsonSymbolFlags.md +5 -0
- package/docs/api/variables/index.md +3 -0
- package/package.json +9 -7
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createComponent as _$createComponent, memo as _$memo } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { SourceFile as CoreSourceFile, createSourceFileTap, createSymbol, moveTakenMembersTo } from "@alloy-js/core";
|
|
3
|
+
import { JsonFileContext } from "../context/JsonFileContext.js";
|
|
4
|
+
import { JsonOutputSymbol } from "../symbols/json-symbol.js";
|
|
5
|
+
import { Reference } from "./reference.js";
|
|
6
|
+
/**
|
|
7
|
+
* Creates a JSON source file which defines a JSON value.
|
|
8
|
+
*
|
|
9
|
+
* @see {@link (JsonFileContext:variable)}
|
|
10
|
+
* @see {@link @alloy-js/core#(MemberDeclarationContext:variable)}
|
|
11
|
+
* @see {@link @alloy-js/core#(SourceFileContext:variable)}
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export function SourceFile(props) {
|
|
15
|
+
const jsonValueSym = createSymbol(JsonOutputSymbol, props.path, undefined);
|
|
16
|
+
moveTakenMembersTo(jsonValueSym);
|
|
17
|
+
const fileContext = {
|
|
18
|
+
symbol: jsonValueSym,
|
|
19
|
+
path: props.path
|
|
20
|
+
};
|
|
21
|
+
const SfTapper = createSourceFileTap(context => {
|
|
22
|
+
jsonValueSym.name = context.path;
|
|
23
|
+
});
|
|
24
|
+
return _$createComponent(CoreSourceFile, {
|
|
25
|
+
filetype: "json",
|
|
26
|
+
get path() {
|
|
27
|
+
return props.path;
|
|
28
|
+
},
|
|
29
|
+
reference: Reference,
|
|
30
|
+
get children() {
|
|
31
|
+
return [_$createComponent(SfTapper, {}, {
|
|
32
|
+
fileName: import.meta.url,
|
|
33
|
+
lineNumber: 42,
|
|
34
|
+
columnNumber: 7
|
|
35
|
+
}), _$createComponent(JsonFileContext.Provider, {
|
|
36
|
+
value: fileContext,
|
|
37
|
+
get children() {
|
|
38
|
+
return props.children;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
fileName: import.meta.url,
|
|
42
|
+
lineNumber: 43,
|
|
43
|
+
columnNumber: 7
|
|
44
|
+
})];
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
fileName: import.meta.url,
|
|
48
|
+
lineNumber: 41,
|
|
49
|
+
columnNumber: 5
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=source-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SourceFile","CoreSourceFile","createSourceFileTap","createSymbol","moveTakenMembersTo","JsonFileContext","JsonOutputSymbol","Reference","props","jsonValueSym","path","undefined","fileContext","symbol","SfTapper","context","name","_$createComponent","filetype","reference","children","fileName","import","meta","url","lineNumber","columnNumber","Provider","value"],"sources":["../../../../src/components/source-file.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAEEA,UAAU,IAAIC,cAAc,EAC5BC,mBAAmB,EACnBC,YAAY,EACZC,kBAAkB,QACb,gBAAgB;AACvB,SAASC,eAAe,QAAQ,+BAA+B;AAC/D,SAASC,gBAAgB,QAAQ,2BAA2B;AAC5D,SAASC,SAAS;AAUlB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASP,UAAUA,CAACQ,KAAsB,EAAE;EACjD,MAAMC,YAAY,GAAGN,YAAY,CAACG,gBAAgB,EAAEE,KAAK,CAACE,IAAI,EAAEC,SAAS,CAAC;EAC1EP,kBAAkB,CAACK,YAAY,CAAC;EAChC,MAAMG,WAA4B,GAAG;IACnCC,MAAM,EAAEJ,YAAY;IACpBC,IAAI,EAAEF,KAAK,CAACE;EACd,CAAC;EAED,MAAMI,QAAQ,GAAGZ,mBAAmB,CAAEa,OAAO,IAAK;IAChDN,YAAY,CAACO,IAAI,GAAGD,OAAO,CAACL,IAAI;EAClC,CAAC,CAAC;EAEF,OAAAO,iBAAA,CACGhB,cAAc;IAACiB,QAAQ;IAAA,IAAQR,IAAIA,CAAA;MAAA,OAAEF,KAAK,CAACE,IAAI;IAAA;IAAES,SAAS,EAAEZ,SAAS;IAAA,IAAAa,SAAA;MAAA,QAAAH,iBAAA,CACnEH,QAAQ;QAAAO,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;QAAAC,UAAA;QAAAC,YAAA;MAAA,IAAAT,iBAAA,CACRZ,eAAe,CAACsB,QAAQ;QAACC,KAAK,EAAEhB,WAAW;QAAA,IAAAQ,SAAA;UAAA,OACzCZ,KAAK,CAACY,QAAQ;QAAA;MAAA;QAAAC,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;QAAAC,UAAA;QAAAC,YAAA;MAAA;IAAA;EAAA;IAAAL,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;IAAAC,UAAA;IAAAC,YAAA;EAAA;AAIvB","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as core from "@alloy-js/core";
|
|
2
|
+
import * as Jsx from "../index.js";
|
|
3
|
+
export const JsonArray = core.stc(Jsx.JsonArray);
|
|
4
|
+
export const JsonArrayElement = core.stc(Jsx.JsonArrayElement);
|
|
5
|
+
export const JsonObject = core.stc(Jsx.JsonObject);
|
|
6
|
+
export const JsonObjectProperty = core.stc(Jsx.JsonObjectProperty);
|
|
7
|
+
export const JsonValue = core.stc(Jsx.JsonValue);
|
|
8
|
+
export const Reference = core.stc(Jsx.Reference);
|
|
9
|
+
export const SourceFile = core.stc(Jsx.SourceFile);
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["core","Jsx","JsonArray","stc","JsonArrayElement","JsonObject","JsonObjectProperty","JsonValue","Reference","SourceFile"],"sources":["../../../../../src/components/stc/index.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,gBAAgB;AACtC,OAAO,KAAKC,GAAG,MAAM,aAAa;AAElC,OAAO,MAAMC,SAAS,GAAGF,IAAI,CAACG,GAAG,CAACF,GAAG,CAACC,SAAS,CAAC;AAChD,OAAO,MAAME,gBAAgB,GAAGJ,IAAI,CAACG,GAAG,CAACF,GAAG,CAACG,gBAAgB,CAAC;AAC9D,OAAO,MAAMC,UAAU,GAAGL,IAAI,CAACG,GAAG,CAACF,GAAG,CAACI,UAAU,CAAC;AAClD,OAAO,MAAMC,kBAAkB,GAAGN,IAAI,CAACG,GAAG,CAACF,GAAG,CAACK,kBAAkB,CAAC;AAClE,OAAO,MAAMC,SAAS,GAAGP,IAAI,CAACG,GAAG,CAACF,GAAG,CAACM,SAAS,CAAC;AAChD,OAAO,MAAMC,SAAS,GAAGR,IAAI,CAACG,GAAG,CAACF,GAAG,CAACO,SAAS,CAAC;AAChD,OAAO,MAAMC,UAAU,GAAGT,IAAI,CAACG,GAAG,CAACF,GAAG,CAACQ,UAAU,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createNamedContext, useContext } from "@alloy-js/core";
|
|
2
|
+
/**
|
|
3
|
+
* Provides information about the current JSON source file. This context is used
|
|
4
|
+
* to allow references between JSON files.
|
|
5
|
+
*/
|
|
6
|
+
export const JsonFileContext = createNamedContext("JsonFile");
|
|
7
|
+
export function useJsonFileContext() {
|
|
8
|
+
return useContext(JsonFileContext);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=JsonFileContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createNamedContext","useContext","JsonFileContext","useJsonFileContext"],"sources":["../../../../src/context/JsonFileContext.ts"],"sourcesContent":[null],"mappings":"AAAA,SAEEA,kBAAkB,EAClBC,UAAU,QACL,gBAAgB;AAcvB;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAkD,GAC7DF,kBAAkB,CAAkB,UAAU,CAAC;AAEjD,OAAO,SAASG,kBAAkBA,CAAA,EAAgC;EAChE,OAAOF,UAAU,CAACC,eAAe,CAAC;AACpC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../../src/context/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,oBAAoB;AAClC,cAAc,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { memo, resolve, unresolvedRefkey } from "@alloy-js/core";
|
|
2
|
+
import { dirname, relative } from "pathe";
|
|
3
|
+
import { useJsonFileContext } from "../context/JsonFileContext.js";
|
|
4
|
+
export * from "./json-symbol.js";
|
|
5
|
+
export function ref(refkey) {
|
|
6
|
+
const sourceFile = useJsonFileContext();
|
|
7
|
+
if (!sourceFile) {
|
|
8
|
+
return unresolvedRefkey(refkey);
|
|
9
|
+
}
|
|
10
|
+
const resolveResult = resolve(refkey);
|
|
11
|
+
return memo(() => {
|
|
12
|
+
if (resolveResult.value === undefined) {
|
|
13
|
+
return unresolvedRefkey(refkey);
|
|
14
|
+
}
|
|
15
|
+
const {
|
|
16
|
+
pathDown,
|
|
17
|
+
pathUp,
|
|
18
|
+
lexicalDeclaration,
|
|
19
|
+
memberPath,
|
|
20
|
+
commonScope,
|
|
21
|
+
fullSymbolPath
|
|
22
|
+
} = resolveResult.value;
|
|
23
|
+
let ref = "";
|
|
24
|
+
let isCrossFile = false;
|
|
25
|
+
// When we have no common scope and we don't path up through the symbol
|
|
26
|
+
// we're referencing (i.e. the symbol we're referencing isn't the symbol for
|
|
27
|
+
// the file the reference occurs in), append the file path.
|
|
28
|
+
if (commonScope === undefined && pathUp[0] && pathUp[0].ownerSymbol !== lexicalDeclaration) {
|
|
29
|
+
const currentPath = sourceFile.symbol.name;
|
|
30
|
+
const targetPath = lexicalDeclaration.name;
|
|
31
|
+
isCrossFile = true;
|
|
32
|
+
ref += relative(dirname(currentPath), targetPath);
|
|
33
|
+
}
|
|
34
|
+
ref += "#";
|
|
35
|
+
if (commonScope === undefined && pathDown.length === 0 && memberPath.length === 0) {
|
|
36
|
+
// we are referring to the root of a file
|
|
37
|
+
return ref;
|
|
38
|
+
}
|
|
39
|
+
ref += "/";
|
|
40
|
+
if (isCrossFile) {
|
|
41
|
+
// the lexical declaration is the file symbol, so we just need any
|
|
42
|
+
// additional members.
|
|
43
|
+
ref += memberPath.map(s => s.name).join("/");
|
|
44
|
+
} else {
|
|
45
|
+
// merge together the member scopes, lexical declaration, and member path
|
|
46
|
+
ref += fullSymbolPath.slice(1).map(s => s.ownerSymbol.name).concat(lexicalDeclaration.name).concat(memberPath.map(s => s.name)).join("/");
|
|
47
|
+
}
|
|
48
|
+
return ref;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","resolve","unresolvedRefkey","dirname","relative","useJsonFileContext","ref","refkey","sourceFile","resolveResult","value","undefined","pathDown","pathUp","lexicalDeclaration","memberPath","commonScope","fullSymbolPath","isCrossFile","ownerSymbol","currentPath","symbol","name","targetPath","length","map","s","join","slice","concat"],"sources":["../../../../src/symbols/index.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,IAAI,EAGJC,OAAO,EACPC,gBAAgB,QACX,gBAAgB;AACvB,SAASC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACzC,SAASC,kBAAkB,QAAQ,+BAA+B;AAElE,cAAc,kBAAkB;AAEhC,OAAO,SAASC,GAAGA,CAACC,MAAc,EAAE;EAClC,MAAMC,UAAU,GAAGH,kBAAkB,CAAC,CAAC;EACvC,IAAI,CAACG,UAAU,EAAE;IACf,OAAON,gBAAgB,CAACK,MAAM,CAAC;EACjC;EAEA,MAAME,aAAa,GAAGR,OAAO,CAAgCM,MAAM,CAAC;EAEpE,OAAOP,IAAI,CAAC,MAAM;IAChB,IAAIS,aAAa,CAACC,KAAK,KAAKC,SAAS,EAAE;MACrC,OAAOT,gBAAgB,CAACK,MAAM,CAAC;IACjC;IACA,MAAM;MACJK,QAAQ;MACRC,MAAM;MACNC,kBAAkB;MAClBC,UAAU;MACVC,WAAW;MACXC;IACF,CAAC,GAAGR,aAAa,CAACC,KAAK;IAEvB,IAAIJ,GAAG,GAAG,EAAE;IACZ,IAAIY,WAAW,GAAG,KAAK;IACvB;IACA;IACA;IACA,IACEF,WAAW,KAAKL,SAAS,IACzBE,MAAM,CAAC,CAAC,CAAC,IACTA,MAAM,CAAC,CAAC,CAAC,CAACM,WAAW,KAAKL,kBAAkB,EAC5C;MACA,MAAMM,WAAW,GAAGZ,UAAU,CAACa,MAAM,CAACC,IAAI;MAC1C,MAAMC,UAAU,GAAGT,kBAAkB,CAACQ,IAAI;MAC1CJ,WAAW,GAAG,IAAI;MAClBZ,GAAG,IAAIF,QAAQ,CAACD,OAAO,CAACiB,WAAW,CAAC,EAAEG,UAAU,CAAC;IACnD;IAEAjB,GAAG,IAAI,GAAG;IAEV,IACEU,WAAW,KAAKL,SAAS,IACzBC,QAAQ,CAACY,MAAM,KAAK,CAAC,IACrBT,UAAU,CAACS,MAAM,KAAK,CAAC,EACvB;MACA;MACA,OAAOlB,GAAG;IACZ;IAEAA,GAAG,IAAI,GAAG;IAEV,IAAIY,WAAW,EAAE;MACf;MACA;MACAZ,GAAG,IAAIS,UAAU,CAACU,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACJ,IAAI,CAAC,CAACK,IAAI,CAAC,GAAG,CAAC;IAChD,CAAC,MAAM;MACL;MACArB,GAAG,IAAIW,cAAc,CAClBW,KAAK,CAAC,CAAC,CAAC,CACRH,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACP,WAAW,CAAEG,IAAI,CAAC,CAC/BO,MAAM,CAACf,kBAAkB,CAACQ,IAAI,CAAC,CAC/BO,MAAM,CAACd,UAAU,CAACU,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACJ,IAAI,CAAC,CAAC,CACrCK,IAAI,CAAC,GAAG,CAAC;IACd;IAEA,OAAOrB,GAAG;EACZ,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createSymbol, OutputSymbol, track, TrackOpTypes, trigger, TriggerOpTypes } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
// prettier-ignore
|
|
4
|
+
export let JsonSymbolFlags = /*#__PURE__*/function (JsonSymbolFlags) {
|
|
5
|
+
JsonSymbolFlags[JsonSymbolFlags["None"] = 0] = "None";
|
|
6
|
+
JsonSymbolFlags[JsonSymbolFlags["Object"] = 1] = "Object";
|
|
7
|
+
JsonSymbolFlags[JsonSymbolFlags["Array"] = 2] = "Array";
|
|
8
|
+
return JsonSymbolFlags;
|
|
9
|
+
}({});
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* JsonOutputSymbol is created for JSON Values with a refkey. For JSON objects
|
|
13
|
+
* and arrays, the symbol will have the `StaticMemberContainer` flag. For JSON
|
|
14
|
+
* values that are members of an object or an array, the symbol will have the
|
|
15
|
+
* `StaticMember` flag.
|
|
16
|
+
*/
|
|
17
|
+
export class JsonOutputSymbol extends OutputSymbol {
|
|
18
|
+
static memberSpaces = ["static"];
|
|
19
|
+
#jsonFlags;
|
|
20
|
+
get jsonFlags() {
|
|
21
|
+
track(this, TrackOpTypes.GET, "jsonFlags");
|
|
22
|
+
return this.#jsonFlags;
|
|
23
|
+
}
|
|
24
|
+
set jsonFlags(value) {
|
|
25
|
+
const old = this.#jsonFlags;
|
|
26
|
+
if (old === value) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
this.#jsonFlags = value;
|
|
30
|
+
trigger(this, TriggerOpTypes.SET, "jsonFlags", value, old);
|
|
31
|
+
}
|
|
32
|
+
constructor(name, spaces, options = {}) {
|
|
33
|
+
super(name, spaces, options);
|
|
34
|
+
this.#jsonFlags = options.jsonFlags ?? JsonSymbolFlags.None;
|
|
35
|
+
}
|
|
36
|
+
copy() {
|
|
37
|
+
const options = this.getCopyOptions();
|
|
38
|
+
const binder = this.binder;
|
|
39
|
+
const copy = createSymbol(JsonOutputSymbol, this.name, undefined, {
|
|
40
|
+
...options,
|
|
41
|
+
binder,
|
|
42
|
+
jsonFlags: this.#jsonFlags
|
|
43
|
+
});
|
|
44
|
+
this.initializeCopy(copy);
|
|
45
|
+
return copy;
|
|
46
|
+
}
|
|
47
|
+
get debugInfo() {
|
|
48
|
+
return {
|
|
49
|
+
...super.debugInfo,
|
|
50
|
+
jsonFlags: this.#jsonFlags,
|
|
51
|
+
isObject: Boolean(this.#jsonFlags & JsonSymbolFlags.Object),
|
|
52
|
+
isArray: Boolean(this.#jsonFlags & JsonSymbolFlags.Array)
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
get staticMembers() {
|
|
56
|
+
return this.memberSpaceFor("static");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=json-symbol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createSymbol","OutputSymbol","track","TrackOpTypes","trigger","TriggerOpTypes","JsonSymbolFlags","JsonOutputSymbol","memberSpaces","jsonFlags","GET","value","old","SET","constructor","name","spaces","options","None","copy","getCopyOptions","binder","undefined","initializeCopy","debugInfo","isObject","Boolean","Object","isArray","Array","staticMembers","memberSpaceFor"],"sources":["../../../../src/symbols/json-symbol.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,YAAY,EAEZC,YAAY,EAEZC,KAAK,EACLC,YAAY,EACZC,OAAO,EACPC,cAAc,QACT,gBAAgB;;AAEvB;AACA,WAAYC,eAAe,0BAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAfA,eAAe,CAAfA,eAAe;EAAA,OAAfA,eAAe;AAAA;;AAM3B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SAASN,YAAY,CAAC;EACjD,OAAgBO,YAAY,GAAG,CAAC,QAAQ,CAAC;EAEzC,CAACC,SAAS;EACV,IAAIA,SAASA,CAAA,EAAoB;IAC/BP,KAAK,CAAC,IAAI,EAAEC,YAAY,CAACO,GAAG,EAAE,WAAW,CAAC;IAC1C,OAAO,IAAI,CAAC,CAACD,SAAS;EACxB;EAEA,IAAIA,SAASA,CAACE,KAAsB,EAAE;IACpC,MAAMC,GAAG,GAAG,IAAI,CAAC,CAACH,SAAS;IAC3B,IAAIG,GAAG,KAAKD,KAAK,EAAE;MACjB;IACF;IAEA,IAAI,CAAC,CAACF,SAAS,GAAGE,KAAK;IACvBP,OAAO,CAAC,IAAI,EAAEC,cAAc,CAACQ,GAAG,EAAE,WAAW,EAAEF,KAAK,EAAEC,GAAG,CAAC;EAC5D;EAEAE,WAAWA,CACTC,IAAY,EACZC,MAA+C,EAC/CC,OAAgC,GAAG,CAAC,CAAC,EACrC;IACA,KAAK,CAACF,IAAI,EAAEC,MAAM,EAAEC,OAAO,CAAC;IAE5B,IAAI,CAAC,CAACR,SAAS,GAAGQ,OAAO,CAACR,SAAS,IAAIH,eAAe,CAACY,IAAI;EAC7D;EAEAC,IAAIA,CAAA,EAAG;IACL,MAAMF,OAAO,GAAG,IAAI,CAACG,cAAc,CAAC,CAAC;IACrC,MAAMC,MAAM,GAAG,IAAI,CAACA,MAAM;IAC1B,MAAMF,IAAI,GAAGnB,YAAY,CAACO,gBAAgB,EAAE,IAAI,CAACQ,IAAI,EAAEO,SAAS,EAAE;MAChE,GAAGL,OAAO;MACVI,MAAM;MACNZ,SAAS,EAAE,IAAI,CAAC,CAACA;IACnB,CAAC,CAAC;IACF,IAAI,CAACc,cAAc,CAACJ,IAAI,CAAC;IACzB,OAAOA,IAAI;EACb;EAEA,IAAaK,SAASA,CAAA,EAA4B;IAChD,OAAO;MACL,GAAG,KAAK,CAACA,SAAS;MAClBf,SAAS,EAAE,IAAI,CAAC,CAACA,SAAS;MAC1BgB,QAAQ,EAAEC,OAAO,CAAC,IAAI,CAAC,CAACjB,SAAS,GAAGH,eAAe,CAACqB,MAAM,CAAC;MAC3DC,OAAO,EAAEF,OAAO,CAAC,IAAI,CAAC,CAACjB,SAAS,GAAGH,eAAe,CAACuB,KAAK;IAC1D,CAAC;EACH;EAEA,IAAIC,aAAaA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACC,cAAc,CAAC,QAAQ,CAAC;EACtC;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "@alloy-js/core/jsx-runtime";
|
|
2
|
+
import { Output } from "@alloy-js/core";
|
|
3
|
+
import { JsonValue } from "../src/components/json-value.js";
|
|
4
|
+
import { SourceFile } from "../src/components/source-file.js";
|
|
5
|
+
export function jsonTest(jsValue) {
|
|
6
|
+
return _$createComponent(Output, {
|
|
7
|
+
get children() {
|
|
8
|
+
return _$createComponent(SourceFile, {
|
|
9
|
+
path: "test.json",
|
|
10
|
+
get children() {
|
|
11
|
+
return _$createComponent(JsonValue, {
|
|
12
|
+
jsValue: jsValue
|
|
13
|
+
}, {
|
|
14
|
+
fileName: import.meta.url,
|
|
15
|
+
lineNumber: 9,
|
|
16
|
+
columnNumber: 9
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
fileName: import.meta.url,
|
|
21
|
+
lineNumber: 8,
|
|
22
|
+
columnNumber: 7
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
fileName: import.meta.url,
|
|
27
|
+
lineNumber: 7,
|
|
28
|
+
columnNumber: 5
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Output","JsonValue","SourceFile","jsonTest","jsValue","_$createComponent","children","path","fileName","import","meta","url","lineNumber","columnNumber"],"sources":["../../../test/utils.tsx"],"sourcesContent":[null],"mappings":";AAAA,SAASA,MAAM,QAAQ,gBAAgB;AACvC,SAASC,SAAS;AAClB,SAASC,UAAU;AAEnB,OAAO,SAASC,QAAQA,CAACC,OAAgB,EAAE;EACzC,OAAAC,iBAAA,CACGL,MAAM;IAAA,IAAAM,SAAA;MAAA,OAAAD,iBAAA,CACJH,UAAU;QAACK,IAAI;QAAA,IAAAD,SAAA;UAAA,OAAAD,iBAAA,CACbJ,SAAS;YAACG,OAAO,EAAEA;UAAO;YAAAI,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;YAAAC,UAAA;YAAAC,YAAA;UAAA;QAAA;MAAA;QAAAL,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;QAAAC,UAAA;QAAAC,YAAA;MAAA;IAAA;EAAA;IAAAL,QAAA,EAAAC,MAAA,CAAAC,IAAA,CAAAC,GAAA;IAAAC,UAAA;IAAAC,YAAA;EAAA;AAInC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["../../../test/vitest.setup.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,wBAAwB","ignoreList":[]}
|