@player-lang/json-language-service 0.0.2-next.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/dist/cjs/index.cjs +2314 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +2249 -0
- package/dist/index.mjs +2249 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
- package/src/__tests__/__snapshots__/service.test.ts.snap +213 -0
- package/src/__tests__/service.test.ts +298 -0
- package/src/constants.ts +38 -0
- package/src/index.ts +490 -0
- package/src/parser/__tests__/parse.test.ts +18 -0
- package/src/parser/document.ts +456 -0
- package/src/parser/edits.ts +31 -0
- package/src/parser/index.ts +38 -0
- package/src/parser/jsonParseErrors.ts +69 -0
- package/src/parser/types.ts +314 -0
- package/src/parser/utils.ts +94 -0
- package/src/plugins/__tests__/asset-wrapper-array-plugin.test.ts +112 -0
- package/src/plugins/__tests__/binding-schema-plugin.test.ts +62 -0
- package/src/plugins/__tests__/duplicate-id-plugin.test.ts +195 -0
- package/src/plugins/__tests__/missing-asset-wrapper-plugin.test.ts +190 -0
- package/src/plugins/__tests__/nav-state-plugin.test.ts +136 -0
- package/src/plugins/__tests__/view-node-plugin.test.ts +154 -0
- package/src/plugins/asset-wrapper-array-plugin.ts +123 -0
- package/src/plugins/binding-schema-plugin.ts +289 -0
- package/src/plugins/duplicate-id-plugin.ts +158 -0
- package/src/plugins/missing-asset-wrapper-plugin.ts +96 -0
- package/src/plugins/nav-state-plugin.ts +139 -0
- package/src/plugins/view-node-plugin.ts +225 -0
- package/src/plugins/xlr-plugin.ts +371 -0
- package/src/types.ts +119 -0
- package/src/utils.ts +143 -0
- package/src/xlr/__tests__/__snapshots__/transform.test.ts.snap +390 -0
- package/src/xlr/__tests__/transform.test.ts +108 -0
- package/src/xlr/index.ts +3 -0
- package/src/xlr/registry.ts +99 -0
- package/src/xlr/service.ts +190 -0
- package/src/xlr/transforms.ts +169 -0
- package/types/constants.d.ts +7 -0
- package/types/index.d.ts +69 -0
- package/types/parser/document.d.ts +25 -0
- package/types/parser/edits.d.ts +10 -0
- package/types/parser/index.d.ts +16 -0
- package/types/parser/jsonParseErrors.d.ts +27 -0
- package/types/parser/types.d.ts +188 -0
- package/types/parser/utils.d.ts +26 -0
- package/types/plugins/asset-wrapper-array-plugin.d.ts +9 -0
- package/types/plugins/binding-schema-plugin.d.ts +15 -0
- package/types/plugins/duplicate-id-plugin.d.ts +7 -0
- package/types/plugins/missing-asset-wrapper-plugin.d.ts +9 -0
- package/types/plugins/nav-state-plugin.d.ts +9 -0
- package/types/plugins/view-node-plugin.d.ts +9 -0
- package/types/plugins/xlr-plugin.d.ts +7 -0
- package/types/types.d.ts +81 -0
- package/types/utils.d.ts +24 -0
- package/types/xlr/index.d.ts +4 -0
- package/types/xlr/registry.d.ts +17 -0
- package/types/xlr/service.d.ts +22 -0
- package/types/xlr/transforms.d.ts +18 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`player language service > completion > basic object completions 1`] = `
|
|
4
|
+
[
|
|
5
|
+
{
|
|
6
|
+
"documentation": "The text to display",
|
|
7
|
+
"kind": 10,
|
|
8
|
+
"label": "value",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"documentation": "Any modifiers on the text",
|
|
12
|
+
"kind": 10,
|
|
13
|
+
"label": "modifiers",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"documentation": "Evaluate the given expression (or boolean) and if falsy, remove this node from the tree. This is re-computed for each change in the data-model",
|
|
17
|
+
"kind": 10,
|
|
18
|
+
"label": "applicability",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"documentation": "Adds a comment for the given node",
|
|
22
|
+
"kind": 10,
|
|
23
|
+
"label": "_comment",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"documentation": "A list of templates to process for this node",
|
|
27
|
+
"kind": 10,
|
|
28
|
+
"label": "template",
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`player language service > completion > basic object completions 2`] = `
|
|
34
|
+
[
|
|
35
|
+
{
|
|
36
|
+
"documentation": "The name of the Flow to begin on",
|
|
37
|
+
"kind": 10,
|
|
38
|
+
"label": "BEGIN",
|
|
39
|
+
},
|
|
40
|
+
]
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
exports[`player language service > completion > basic value completions 1`] = `
|
|
44
|
+
[
|
|
45
|
+
{
|
|
46
|
+
"kind": 12,
|
|
47
|
+
"label": "VIEW",
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"kind": 12,
|
|
51
|
+
"label": "END",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"kind": 12,
|
|
55
|
+
"label": "FLOW",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"kind": 12,
|
|
59
|
+
"label": "ACTION",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"kind": 12,
|
|
63
|
+
"label": "EXTERNAL",
|
|
64
|
+
},
|
|
65
|
+
]
|
|
66
|
+
`;
|
|
67
|
+
|
|
68
|
+
exports[`player language service > completion > schema completions 1`] = `
|
|
69
|
+
[
|
|
70
|
+
{
|
|
71
|
+
"kind": 12,
|
|
72
|
+
"label": "",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"kind": 12,
|
|
76
|
+
"label": ".bar",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": 12,
|
|
80
|
+
"label": ".baz",
|
|
81
|
+
},
|
|
82
|
+
]
|
|
83
|
+
`;
|
|
84
|
+
|
|
85
|
+
exports[`player language service > hover > basic hover docs 1`] = `
|
|
86
|
+
{
|
|
87
|
+
"contents": {
|
|
88
|
+
"kind": "plaintext",
|
|
89
|
+
"value": "Each asset requires a unique id per view",
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
`;
|
|
93
|
+
|
|
94
|
+
exports[`player language service > hover > basic hover docs 2`] = `
|
|
95
|
+
{
|
|
96
|
+
"contents": {
|
|
97
|
+
"kind": "plaintext",
|
|
98
|
+
"value": "The asset type determines the semantics of how a user interacts with a page",
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
|
|
103
|
+
exports[`player language service > hover > basic hover docs 3`] = `
|
|
104
|
+
{
|
|
105
|
+
"contents": {
|
|
106
|
+
"kind": "plaintext",
|
|
107
|
+
"value": "Any initial data that the flow can use",
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
|
|
112
|
+
exports[`player language service > validation > throws AssetWrapper errors 1`] = `
|
|
113
|
+
[
|
|
114
|
+
{
|
|
115
|
+
"message": "Content Validation Error - type: Expected type "string" but got "null"",
|
|
116
|
+
"range": {
|
|
117
|
+
"end": {
|
|
118
|
+
"character": 28,
|
|
119
|
+
"line": 20,
|
|
120
|
+
},
|
|
121
|
+
"start": {
|
|
122
|
+
"character": 16,
|
|
123
|
+
"line": 20,
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
"severity": 1,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"message": "Content Validation Error - missing: Property "BEGIN" missing from type "Navigation"",
|
|
130
|
+
"range": {
|
|
131
|
+
"end": {
|
|
132
|
+
"character": 26,
|
|
133
|
+
"line": 16,
|
|
134
|
+
},
|
|
135
|
+
"start": {
|
|
136
|
+
"character": 24,
|
|
137
|
+
"line": 16,
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
"severity": 1,
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"message": "Navigation Validation Error - missing: Property "BEGIN" missing from type "Navigation"",
|
|
144
|
+
"range": {
|
|
145
|
+
"end": {
|
|
146
|
+
"character": 26,
|
|
147
|
+
"line": 16,
|
|
148
|
+
},
|
|
149
|
+
"start": {
|
|
150
|
+
"character": 24,
|
|
151
|
+
"line": 16,
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
"severity": 1,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"message": "View is not reachable",
|
|
158
|
+
"range": {
|
|
159
|
+
"end": {
|
|
160
|
+
"character": 33,
|
|
161
|
+
"line": 5,
|
|
162
|
+
},
|
|
163
|
+
"start": {
|
|
164
|
+
"character": 20,
|
|
165
|
+
"line": 5,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
"severity": 2,
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"message": "View Validation Error - value: Does not match any of the expected types for type: 'AssetWrapperOrSwitch'",
|
|
172
|
+
"range": {
|
|
173
|
+
"end": {
|
|
174
|
+
"character": 16,
|
|
175
|
+
"line": 12,
|
|
176
|
+
},
|
|
177
|
+
"start": {
|
|
178
|
+
"character": 23,
|
|
179
|
+
"line": 8,
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
"severity": 1,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"message": "Expected: AssetWrapper & object literal | StaticSwitch & object literal | DynamicSwitch & object literal",
|
|
186
|
+
"range": {
|
|
187
|
+
"end": {
|
|
188
|
+
"character": 16,
|
|
189
|
+
"line": 12,
|
|
190
|
+
},
|
|
191
|
+
"start": {
|
|
192
|
+
"character": 23,
|
|
193
|
+
"line": 8,
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
"severity": 3,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"message": "Implicit Array -> "collection" assets is not supported.",
|
|
200
|
+
"range": {
|
|
201
|
+
"end": {
|
|
202
|
+
"character": 21,
|
|
203
|
+
"line": 8,
|
|
204
|
+
},
|
|
205
|
+
"start": {
|
|
206
|
+
"character": 14,
|
|
207
|
+
"line": 8,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
"severity": 1,
|
|
211
|
+
},
|
|
212
|
+
]
|
|
213
|
+
`;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { test, expect, describe, beforeEach } from "vitest";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import {
|
|
4
|
+
ReferenceAssetsWebPluginManifest,
|
|
5
|
+
Types,
|
|
6
|
+
} from "@player-lang/static-xlrs";
|
|
7
|
+
import { PlayerLanguageService } from "..";
|
|
8
|
+
import { toTextDocument } from "../utils";
|
|
9
|
+
|
|
10
|
+
describe("player language service", () => {
|
|
11
|
+
let service: PlayerLanguageService;
|
|
12
|
+
|
|
13
|
+
beforeEach(async () => {
|
|
14
|
+
service = new PlayerLanguageService();
|
|
15
|
+
await service.setAssetTypesFromModule([
|
|
16
|
+
Types,
|
|
17
|
+
ReferenceAssetsWebPluginManifest,
|
|
18
|
+
]);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
describe("formatting", () => {
|
|
22
|
+
test("formats a document", async () => {
|
|
23
|
+
const document = toTextDocument(
|
|
24
|
+
`{
|
|
25
|
+
"id": "foo",
|
|
26
|
+
"views": [{"id":"view1"}]
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const formatEdits = await service.formatTextDocument(document, {
|
|
32
|
+
tabSize: 2,
|
|
33
|
+
insertSpaces: true,
|
|
34
|
+
});
|
|
35
|
+
expect(formatEdits).toHaveLength(8);
|
|
36
|
+
const updatedDocument = TextDocument.applyEdits(
|
|
37
|
+
document,
|
|
38
|
+
formatEdits ?? [],
|
|
39
|
+
);
|
|
40
|
+
expect(updatedDocument).toMatchInlineSnapshot(`
|
|
41
|
+
"{
|
|
42
|
+
"id": "foo",
|
|
43
|
+
"views": [
|
|
44
|
+
{
|
|
45
|
+
"id": "view1"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}"
|
|
49
|
+
`);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe("validation", () => {
|
|
54
|
+
test("throws AssetWrapper errors", async () => {
|
|
55
|
+
const document = toTextDocument(
|
|
56
|
+
`
|
|
57
|
+
{
|
|
58
|
+
"id": "foo",
|
|
59
|
+
"views": [
|
|
60
|
+
{
|
|
61
|
+
"id": "input-asset",
|
|
62
|
+
"type": "input",
|
|
63
|
+
"binding": "foo",
|
|
64
|
+
"label": [{
|
|
65
|
+
"id":"test",
|
|
66
|
+
"type": "text",
|
|
67
|
+
"value": "test"
|
|
68
|
+
}]
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"data": {},
|
|
72
|
+
"navigation": {},
|
|
73
|
+
"schema": {
|
|
74
|
+
"ROOT": {
|
|
75
|
+
"application": {
|
|
76
|
+
"type": null
|
|
77
|
+
},
|
|
78
|
+
"foo": {
|
|
79
|
+
"type": "fooType"
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"fooType": {
|
|
83
|
+
"bar": {
|
|
84
|
+
"type": "barType",
|
|
85
|
+
"validation": [
|
|
86
|
+
{
|
|
87
|
+
"type": "required",
|
|
88
|
+
"severity": "error"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
"baz": {
|
|
93
|
+
"type": "bazType",
|
|
94
|
+
"validation": [
|
|
95
|
+
{
|
|
96
|
+
"type": "required",
|
|
97
|
+
"message": "this is my own message"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`,
|
|
105
|
+
);
|
|
106
|
+
const validationErrors = await service.validateTextDocument(document);
|
|
107
|
+
|
|
108
|
+
expect(validationErrors).toMatchSnapshot();
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe("completion", () => {
|
|
113
|
+
test("basic object completions", async () => {
|
|
114
|
+
const document = toTextDocument(
|
|
115
|
+
`
|
|
116
|
+
{
|
|
117
|
+
"id": "foo",
|
|
118
|
+
"views": [
|
|
119
|
+
{
|
|
120
|
+
"id": "view-1",
|
|
121
|
+
"type": "main",
|
|
122
|
+
"title": {
|
|
123
|
+
"asset": {
|
|
124
|
+
"id": "title-asset",
|
|
125
|
+
"type": "text",
|
|
126
|
+
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"data":{},
|
|
132
|
+
"navigation":{
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
`,
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
let completions = await service.getCompletionsAtPosition(document, {
|
|
140
|
+
line: 11,
|
|
141
|
+
character: 6,
|
|
142
|
+
});
|
|
143
|
+
expect(completions.items).toMatchSnapshot();
|
|
144
|
+
|
|
145
|
+
completions = await service.getCompletionsAtPosition(document, {
|
|
146
|
+
line: 18,
|
|
147
|
+
character: 2,
|
|
148
|
+
});
|
|
149
|
+
expect(completions.items).toMatchSnapshot();
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test("basic value completions", async () => {
|
|
153
|
+
const document = toTextDocument(
|
|
154
|
+
`
|
|
155
|
+
{
|
|
156
|
+
"id": "foo",
|
|
157
|
+
"views": [],
|
|
158
|
+
"data":{},
|
|
159
|
+
"navigation":{
|
|
160
|
+
"BEGIN": "FLOW_1",
|
|
161
|
+
"FLOW_1": {
|
|
162
|
+
"startState": "VIEW_1",
|
|
163
|
+
"VIEW_1": {
|
|
164
|
+
"state_type": "",
|
|
165
|
+
"ref": "action",
|
|
166
|
+
"transitions": {
|
|
167
|
+
"*": "END_Done"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"END_Done": {
|
|
171
|
+
"state_type": "END",
|
|
172
|
+
"outcome": "done"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
`,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
const completions = await service.getCompletionsAtPosition(document, {
|
|
181
|
+
line: 10,
|
|
182
|
+
character: 19,
|
|
183
|
+
});
|
|
184
|
+
expect(completions.items).toMatchSnapshot();
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test("schema completions", async () => {
|
|
188
|
+
const document = toTextDocument(
|
|
189
|
+
`
|
|
190
|
+
{
|
|
191
|
+
"id": "foo",
|
|
192
|
+
"views": [
|
|
193
|
+
{
|
|
194
|
+
"id": "view-1",
|
|
195
|
+
"type": "main",
|
|
196
|
+
"title": {
|
|
197
|
+
"asset": {
|
|
198
|
+
"id": "input-asset",
|
|
199
|
+
"type": "input",
|
|
200
|
+
"binding": "foo"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"data": {},
|
|
206
|
+
"navigation": {},
|
|
207
|
+
"schema": {
|
|
208
|
+
"ROOT": {
|
|
209
|
+
"application": {
|
|
210
|
+
"type": null
|
|
211
|
+
},
|
|
212
|
+
"foo": {
|
|
213
|
+
"type": "fooType"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
"fooType": {
|
|
217
|
+
"bar": {
|
|
218
|
+
"type": "barType",
|
|
219
|
+
"validation": [
|
|
220
|
+
{
|
|
221
|
+
"type": "required",
|
|
222
|
+
"severity": "error"
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
"baz": {
|
|
227
|
+
"type": "bazType",
|
|
228
|
+
"validation": [
|
|
229
|
+
{
|
|
230
|
+
"type": "required",
|
|
231
|
+
"message": "this is my own message"
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
`,
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
const completions = await service.getCompletionsAtPosition(document, {
|
|
243
|
+
line: 11,
|
|
244
|
+
character: 33,
|
|
245
|
+
});
|
|
246
|
+
expect(completions.items).toMatchSnapshot();
|
|
247
|
+
});
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
describe("hover", () => {
|
|
251
|
+
test("basic hover docs", async () => {
|
|
252
|
+
const document = toTextDocument(
|
|
253
|
+
`
|
|
254
|
+
{
|
|
255
|
+
"id": "foo",
|
|
256
|
+
"views": [
|
|
257
|
+
{
|
|
258
|
+
"id": "view-1",
|
|
259
|
+
"type": "main",
|
|
260
|
+
"title": {
|
|
261
|
+
"asset": {
|
|
262
|
+
"id": "title-asset",
|
|
263
|
+
"type": "text"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
"data": {},
|
|
269
|
+
"navigation": {
|
|
270
|
+
"BEGIN":""
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
`,
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
let docs = await service.getHoverInfoAtPosition(document, {
|
|
277
|
+
line: 5,
|
|
278
|
+
character: 9,
|
|
279
|
+
});
|
|
280
|
+
expect(docs).toBeDefined();
|
|
281
|
+
expect(docs).toMatchSnapshot();
|
|
282
|
+
|
|
283
|
+
docs = await service.getHoverInfoAtPosition(document, {
|
|
284
|
+
line: 10,
|
|
285
|
+
character: 13,
|
|
286
|
+
});
|
|
287
|
+
expect(docs).toBeDefined();
|
|
288
|
+
expect(docs).toMatchSnapshot();
|
|
289
|
+
|
|
290
|
+
docs = await service.getHoverInfoAtPosition(document, {
|
|
291
|
+
line: 15,
|
|
292
|
+
character: 6,
|
|
293
|
+
});
|
|
294
|
+
expect(docs).toBeDefined();
|
|
295
|
+
expect(docs).toMatchSnapshot();
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
});
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Filters } from "@xlr-lib/xlr-sdk";
|
|
2
|
+
import { TransformFunction } from "@xlr-lib/xlr";
|
|
3
|
+
|
|
4
|
+
import type { PlayerLanguageServicePlugin } from ".";
|
|
5
|
+
import { AssetWrapperArrayPlugin } from "./plugins/asset-wrapper-array-plugin";
|
|
6
|
+
import { SchemaInfoPlugin } from "./plugins/binding-schema-plugin";
|
|
7
|
+
import { XLRPlugin } from "./plugins/xlr-plugin";
|
|
8
|
+
import { DuplicateIDPlugin } from "./plugins/duplicate-id-plugin";
|
|
9
|
+
import { MissingAssetWrapperPlugin } from "./plugins/missing-asset-wrapper-plugin";
|
|
10
|
+
import { NavStatePlugin } from "./plugins/nav-state-plugin";
|
|
11
|
+
import { ViewNodePlugin } from "./plugins/view-node-plugin";
|
|
12
|
+
import {
|
|
13
|
+
applyAssetWrapperOrSwitch,
|
|
14
|
+
applyCommonProps,
|
|
15
|
+
applyTemplateProperty,
|
|
16
|
+
applyValueRefs,
|
|
17
|
+
} from "./xlr/transforms";
|
|
18
|
+
|
|
19
|
+
export const PLUGINS: Array<PlayerLanguageServicePlugin> = [
|
|
20
|
+
new DuplicateIDPlugin(),
|
|
21
|
+
new ViewNodePlugin(),
|
|
22
|
+
new SchemaInfoPlugin(),
|
|
23
|
+
new AssetWrapperArrayPlugin(),
|
|
24
|
+
new NavStatePlugin(),
|
|
25
|
+
new MissingAssetWrapperPlugin(),
|
|
26
|
+
new XLRPlugin(),
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export const DEFAULT_FILTERS: Filters = {
|
|
30
|
+
typeFilter: "Transformed",
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const TRANSFORM_FUNCTIONS: Array<TransformFunction> = [
|
|
34
|
+
applyAssetWrapperOrSwitch,
|
|
35
|
+
applyValueRefs,
|
|
36
|
+
applyCommonProps,
|
|
37
|
+
applyTemplateProperty,
|
|
38
|
+
];
|