@teleporthq/teleport-uidl-validator 0.18.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/LICENSE +21 -0
- package/README.md +14 -0
- package/__tests__/parser/componennt-with-referenced-styles.json +111 -0
- package/__tests__/parser/component-parsing.ts +116 -0
- package/__tests__/parser/component-referenced.ts +50 -0
- package/__tests__/parser/component-with-primitive-values.json +61 -0
- package/__tests__/parser/component-with-proper-values.json +97 -0
- package/__tests__/parser/component-with-reusalble-styles.json +117 -0
- package/__tests__/validator/component-element-with-empty-name.json +36 -0
- package/__tests__/validator/component-invalid-sample.json +184 -0
- package/__tests__/validator/component-uidl-with-event-modifier-undefined.json +45 -0
- package/__tests__/validator/component-uidl-with-null-undefined.json +24 -0
- package/__tests__/validator/index.ts +216 -0
- package/__tests__/validator/old-project-invalid-sample.json +317 -0
- package/__tests__/validator/project-invalid-sample-no-route.json +667 -0
- package/__tests__/validator/project-invalid-sample.json +671 -0
- package/__tests__/validator/project-sample.json +667 -0
- package/dist/cjs/decoders/component-decoder.d.ts +4 -0
- package/dist/cjs/decoders/component-decoder.js +30 -0
- package/dist/cjs/decoders/component-decoder.js.map +1 -0
- package/dist/cjs/decoders/custom-combinators.d.ts +8 -0
- package/dist/cjs/decoders/custom-combinators.js +59 -0
- package/dist/cjs/decoders/custom-combinators.js.map +1 -0
- package/dist/cjs/decoders/index.d.ts +2 -0
- package/dist/cjs/decoders/index.js +9 -0
- package/dist/cjs/decoders/index.js.map +1 -0
- package/dist/cjs/decoders/project-decoder.d.ts +5 -0
- package/dist/cjs/decoders/project-decoder.js +38 -0
- package/dist/cjs/decoders/project-decoder.js.map +1 -0
- package/dist/cjs/decoders/utils.d.ts +59 -0
- package/dist/cjs/decoders/utils.js +305 -0
- package/dist/cjs/decoders/utils.js.map +1 -0
- package/dist/cjs/index.d.ts +7 -0
- package/dist/cjs/index.js +38 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/parser/index.d.ts +10 -0
- package/dist/cjs/parser/index.js +156 -0
- package/dist/cjs/parser/index.js.map +1 -0
- package/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/dist/cjs/validator/index.d.ts +15 -0
- package/dist/cjs/validator/index.js +94 -0
- package/dist/cjs/validator/index.js.map +1 -0
- package/dist/cjs/validator/utils.d.ts +16 -0
- package/dist/cjs/validator/utils.js +373 -0
- package/dist/cjs/validator/utils.js.map +1 -0
- package/dist/esm/decoders/component-decoder.d.ts +4 -0
- package/dist/esm/decoders/component-decoder.js +27 -0
- package/dist/esm/decoders/component-decoder.js.map +1 -0
- package/dist/esm/decoders/custom-combinators.d.ts +8 -0
- package/dist/esm/decoders/custom-combinators.js +56 -0
- package/dist/esm/decoders/custom-combinators.js.map +1 -0
- package/dist/esm/decoders/index.d.ts +2 -0
- package/dist/esm/decoders/index.js +3 -0
- package/dist/esm/decoders/index.js.map +1 -0
- package/dist/esm/decoders/project-decoder.d.ts +5 -0
- package/dist/esm/decoders/project-decoder.js +35 -0
- package/dist/esm/decoders/project-decoder.js.map +1 -0
- package/dist/esm/decoders/utils.d.ts +59 -0
- package/dist/esm/decoders/utils.js +301 -0
- package/dist/esm/decoders/utils.js.map +1 -0
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/parser/index.d.ts +10 -0
- package/dist/esm/parser/index.js +151 -0
- package/dist/esm/parser/index.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -0
- package/dist/esm/validator/index.d.ts +15 -0
- package/dist/esm/validator/index.js +73 -0
- package/dist/esm/validator/index.js.map +1 -0
- package/dist/esm/validator/utils.d.ts +16 -0
- package/dist/esm/validator/utils.js +359 -0
- package/dist/esm/validator/utils.js.map +1 -0
- package/package.json +32 -0
- package/src/decoders/component-decoder.ts +48 -0
- package/src/decoders/custom-combinators.ts +59 -0
- package/src/decoders/index.ts +2 -0
- package/src/decoders/project-decoder.ts +40 -0
- package/src/decoders/utils.ts +571 -0
- package/src/index.ts +9 -0
- package/src/parser/index.ts +227 -0
- package/src/validator/index.ts +105 -0
- package/src/validator/utils.ts +463 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
{
|
|
2
|
+
"globals": {
|
|
3
|
+
"settings": {
|
|
4
|
+
"language": 1,
|
|
5
|
+
"title": "teleportHQ",
|
|
6
|
+
"key": "test"
|
|
7
|
+
},
|
|
8
|
+
"meta" : [
|
|
9
|
+
{ "name": "description", "content": "Free Web tutorials" },
|
|
10
|
+
{ "name": "keywords", "content": "prea bun, prea ca la tara" },
|
|
11
|
+
{ "name": "viewport", "content": "width=device-width, initial-scale=1.0" },
|
|
12
|
+
{ "property": "og:title", "content": "Free Web tutorials" },
|
|
13
|
+
{ "property": "og:url", "content": "/playground_assets/asdasd.png" }
|
|
14
|
+
],
|
|
15
|
+
"manifest": {
|
|
16
|
+
"icons": [
|
|
17
|
+
{
|
|
18
|
+
"src": "/playground_assets/icons-192.png",
|
|
19
|
+
"type": "image/png",
|
|
20
|
+
"sizes": "192x192"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"src": "/playground_assets/icons-512.png",
|
|
24
|
+
"type": "image/png",
|
|
25
|
+
"sizes": "512x512"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"theme_color": "#822CEC",
|
|
29
|
+
"background_color": "#822CEC"
|
|
30
|
+
},
|
|
31
|
+
"assets": [
|
|
32
|
+
{
|
|
33
|
+
"type": "style",
|
|
34
|
+
"path": "https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css",
|
|
35
|
+
"options": {
|
|
36
|
+
"target": "body"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"type": "scripts",
|
|
41
|
+
"path": "https://www.googletagmanager.com/gtm.js",
|
|
42
|
+
"options": {
|
|
43
|
+
"defer": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "script",
|
|
48
|
+
"content": "console.log(\"inline script\")",
|
|
49
|
+
"options": {
|
|
50
|
+
"target": "body"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "font",
|
|
55
|
+
"path": "https://fonts.googleapis.com/css?family=Roboto"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "style",
|
|
59
|
+
"content": "body{font-family: 'Roboto', sans-serif;}"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "icon",
|
|
63
|
+
"path": "/playground_assets/favicon-32x32.png",
|
|
64
|
+
"options": {
|
|
65
|
+
"type": "image/png",
|
|
66
|
+
"iconSizes": "32x32"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"variables": {
|
|
71
|
+
"primaryColor": "#822CEC",
|
|
72
|
+
"secondaryColor": "#414141",
|
|
73
|
+
"spacing": "10px"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"root": {
|
|
77
|
+
"name": "App",
|
|
78
|
+
"stateDefinitions": {
|
|
79
|
+
"route": {
|
|
80
|
+
"type": "string",
|
|
81
|
+
"defaultValue": "index",
|
|
82
|
+
"values": [
|
|
83
|
+
{
|
|
84
|
+
"value": "index",
|
|
85
|
+
"pageOptions": {
|
|
86
|
+
"navLink": "/",
|
|
87
|
+
"componentName": "Home"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"value": "about",
|
|
92
|
+
"pageOptions": {
|
|
93
|
+
"navLink": "/about",
|
|
94
|
+
"componentName": "About"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"value": "contact-us",
|
|
99
|
+
"pageOptions": {
|
|
100
|
+
"navLink": "/here-we-are",
|
|
101
|
+
"componentName": "Us"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"node": {
|
|
108
|
+
"type": "element",
|
|
109
|
+
"content": {
|
|
110
|
+
"elementType": "Router",
|
|
111
|
+
"children": [
|
|
112
|
+
{
|
|
113
|
+
"type": "conditional",
|
|
114
|
+
"content": {
|
|
115
|
+
"node": {
|
|
116
|
+
"type": "element",
|
|
117
|
+
"content": {
|
|
118
|
+
"elementType": "container",
|
|
119
|
+
"children": [
|
|
120
|
+
{
|
|
121
|
+
"type": "static",
|
|
122
|
+
"content": "Page 1"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"value": "index",
|
|
128
|
+
"reference": {
|
|
129
|
+
"type": "dynamic",
|
|
130
|
+
"content": {
|
|
131
|
+
"referenceType": "state",
|
|
132
|
+
"id": "route"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "conditional",
|
|
139
|
+
"content": {
|
|
140
|
+
"node": {
|
|
141
|
+
"type": "element",
|
|
142
|
+
"content": {
|
|
143
|
+
"elementType": "container",
|
|
144
|
+
"children": [
|
|
145
|
+
{
|
|
146
|
+
"type": "static",
|
|
147
|
+
"content": "Page 2"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"value": "about",
|
|
153
|
+
"reference": {
|
|
154
|
+
"type": "dynamic",
|
|
155
|
+
"content": {
|
|
156
|
+
"referenceType": "state",
|
|
157
|
+
"id": "route"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
},{
|
|
162
|
+
"type": "conditional",
|
|
163
|
+
"content": {
|
|
164
|
+
"node": {
|
|
165
|
+
"type": "element",
|
|
166
|
+
"content": {
|
|
167
|
+
"elementType": "container",
|
|
168
|
+
"children": [
|
|
169
|
+
{
|
|
170
|
+
"type": "static",
|
|
171
|
+
"content": "Page 3"
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"value": "contact-us",
|
|
177
|
+
"reference": {
|
|
178
|
+
"type": "dynamic",
|
|
179
|
+
"content": {
|
|
180
|
+
"referenceType": "state",
|
|
181
|
+
"id": "route"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"components": {
|
|
191
|
+
"OneComponent": {
|
|
192
|
+
"name": "OneComponent",
|
|
193
|
+
"propDefinitions": {
|
|
194
|
+
"title": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"defaultValue": "Hello"
|
|
197
|
+
},
|
|
198
|
+
"items": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"defaultValue": []
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"stateDefinitions": {
|
|
204
|
+
"isVisible": {
|
|
205
|
+
"type": "boolean",
|
|
206
|
+
"defaultValue": true
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"node": {
|
|
210
|
+
"type": "element",
|
|
211
|
+
"content": {
|
|
212
|
+
"elementType": "container",
|
|
213
|
+
"attrs": {
|
|
214
|
+
"data-static-attr": {
|
|
215
|
+
"type": "static",
|
|
216
|
+
"content": "test"
|
|
217
|
+
},
|
|
218
|
+
"data-dynamic-attr": {
|
|
219
|
+
"type": "dynamic",
|
|
220
|
+
"content": {
|
|
221
|
+
"referenceType": "prop",
|
|
222
|
+
"id": "title"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"children": [
|
|
227
|
+
{
|
|
228
|
+
"type": "element",
|
|
229
|
+
"content": {
|
|
230
|
+
"elementType": "text",
|
|
231
|
+
"children": [
|
|
232
|
+
{
|
|
233
|
+
"type": "static",
|
|
234
|
+
"content": "Hello World!"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "dynamic",
|
|
238
|
+
"content": {
|
|
239
|
+
"referenceType": "prop",
|
|
240
|
+
"id": "title"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"type": "repeat",
|
|
248
|
+
"content": {
|
|
249
|
+
"node": {
|
|
250
|
+
"type": "element",
|
|
251
|
+
"content": {
|
|
252
|
+
"elementType": "text",
|
|
253
|
+
"children": [
|
|
254
|
+
{
|
|
255
|
+
"type": "dynamic",
|
|
256
|
+
"content": {
|
|
257
|
+
"referenceType": "local",
|
|
258
|
+
"id": "item"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"type": "element",
|
|
263
|
+
"content": {
|
|
264
|
+
"elementType": "list",
|
|
265
|
+
"attrs": {
|
|
266
|
+
"items": {
|
|
267
|
+
"type": "static",
|
|
268
|
+
"content": ["angular", "react", "vue"]
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
"dataSource": {
|
|
277
|
+
"type": "dynamic",
|
|
278
|
+
"content": {
|
|
279
|
+
"referenceType": "prop",
|
|
280
|
+
"id": "items"
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"meta": {
|
|
284
|
+
"useIndex": true,
|
|
285
|
+
"iteratorName": "item"
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"type": "conditional",
|
|
291
|
+
"content": {
|
|
292
|
+
"reference": {
|
|
293
|
+
"type": "dynamic",
|
|
294
|
+
"content": {
|
|
295
|
+
"referenceType": "state",
|
|
296
|
+
"id": "isVisible"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"value": true,
|
|
300
|
+
"node": {
|
|
301
|
+
"type": "element",
|
|
302
|
+
"content": {
|
|
303
|
+
"elementType": "text",
|
|
304
|
+
"children": [{
|
|
305
|
+
"type": "static",
|
|
306
|
+
"content": "Now you see me!"
|
|
307
|
+
}]
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|