@teambit/schema 0.0.753 → 0.0.756
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/mock/button-old-schema.json +41 -0
- package/dist/mock/button-schemas.json +39 -12
- package/dist/schema.spec.js +15 -0
- package/dist/schema.spec.js.map +1 -1
- package/mock/button-old-schema.json +41 -0
- package/mock/button-schemas.json +39 -12
- package/package-tar/teambit-schema-0.0.756.tgz +0 -0
- package/package.json +12 -12
- package/{preview-1654572446572.js → preview-1654745302834.js} +2 -2
- package/package-tar/teambit-schema-0.0.753.tgz +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__schema": "APISchema",
|
|
3
|
+
"location": {
|
|
4
|
+
"file": "index.ts",
|
|
5
|
+
"line": 13,
|
|
6
|
+
"character": 1
|
|
7
|
+
},
|
|
8
|
+
"module": {
|
|
9
|
+
"__schema": "Module",
|
|
10
|
+
"location": {
|
|
11
|
+
"file": "index.ts",
|
|
12
|
+
"line": 13,
|
|
13
|
+
"character": 1
|
|
14
|
+
},
|
|
15
|
+
"exports": [
|
|
16
|
+
{
|
|
17
|
+
"__schema": "VariableSchema",
|
|
18
|
+
"location": {
|
|
19
|
+
"file": "index.ts",
|
|
20
|
+
"line": 21,
|
|
21
|
+
"character": 14
|
|
22
|
+
},
|
|
23
|
+
"name": "a",
|
|
24
|
+
"signature": "const a: 4",
|
|
25
|
+
"type": {
|
|
26
|
+
"__schema": "InferenceTypeSchema",
|
|
27
|
+
"location": {
|
|
28
|
+
"file": "index.ts",
|
|
29
|
+
"line": 21,
|
|
30
|
+
"character": 14
|
|
31
|
+
},
|
|
32
|
+
"type": "4"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"componentId": {
|
|
38
|
+
"name": "button",
|
|
39
|
+
"scope": "org.scope"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"character": 24
|
|
35
35
|
},
|
|
36
36
|
"name": "a",
|
|
37
|
+
"isOptional": false,
|
|
37
38
|
"defaultValue": "4",
|
|
38
39
|
"type": {
|
|
39
40
|
"__schema": "InferenceTypeSchema",
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
"character": 31
|
|
54
55
|
},
|
|
55
56
|
"name": "b",
|
|
57
|
+
"isOptional": false,
|
|
56
58
|
"defaultValue": "5",
|
|
57
59
|
"type": {
|
|
58
60
|
"__schema": "InferenceTypeSchema",
|
|
@@ -178,7 +180,7 @@
|
|
|
178
180
|
},
|
|
179
181
|
"members": [
|
|
180
182
|
{
|
|
181
|
-
"__schema": "
|
|
183
|
+
"__schema": "VariableLikeSchema",
|
|
182
184
|
"location": {
|
|
183
185
|
"file": "button.tsx",
|
|
184
186
|
"line": 13,
|
|
@@ -186,6 +188,7 @@
|
|
|
186
188
|
},
|
|
187
189
|
"name": "children",
|
|
188
190
|
"signature": "(property) children: any",
|
|
191
|
+
"isOptional": false,
|
|
189
192
|
"type": {
|
|
190
193
|
"__schema": "InferenceTypeSchema",
|
|
191
194
|
"location": {
|
|
@@ -196,7 +199,7 @@
|
|
|
196
199
|
}
|
|
197
200
|
},
|
|
198
201
|
{
|
|
199
|
-
"__schema": "
|
|
202
|
+
"__schema": "VariableLikeSchema",
|
|
200
203
|
"location": {
|
|
201
204
|
"file": "button.tsx",
|
|
202
205
|
"line": 18,
|
|
@@ -204,6 +207,7 @@
|
|
|
204
207
|
},
|
|
205
208
|
"name": "href",
|
|
206
209
|
"signature": "(property) href?: string",
|
|
210
|
+
"isOptional": true,
|
|
207
211
|
"type": {
|
|
208
212
|
"__schema": "KeywordTypeSchema",
|
|
209
213
|
"location": {
|
|
@@ -215,7 +219,7 @@
|
|
|
215
219
|
}
|
|
216
220
|
},
|
|
217
221
|
{
|
|
218
|
-
"__schema": "
|
|
222
|
+
"__schema": "VariableLikeSchema",
|
|
219
223
|
"location": {
|
|
220
224
|
"file": "button.tsx",
|
|
221
225
|
"line": 23,
|
|
@@ -223,6 +227,7 @@
|
|
|
223
227
|
},
|
|
224
228
|
"name": "className",
|
|
225
229
|
"signature": "(property) className?: string",
|
|
230
|
+
"isOptional": true,
|
|
226
231
|
"type": {
|
|
227
232
|
"__schema": "KeywordTypeSchema",
|
|
228
233
|
"location": {
|
|
@@ -267,6 +272,7 @@
|
|
|
267
272
|
"character": 24
|
|
268
273
|
},
|
|
269
274
|
"name": "props",
|
|
275
|
+
"isOptional": false,
|
|
270
276
|
"type": {
|
|
271
277
|
"__schema": "TypeRefSchema",
|
|
272
278
|
"location": {
|
|
@@ -344,7 +350,7 @@
|
|
|
344
350
|
}
|
|
345
351
|
},
|
|
346
352
|
{
|
|
347
|
-
"__schema": "
|
|
353
|
+
"__schema": "VariableLikeSchema",
|
|
348
354
|
"location": {
|
|
349
355
|
"file": "index.ts",
|
|
350
356
|
"line": 21,
|
|
@@ -352,6 +358,7 @@
|
|
|
352
358
|
},
|
|
353
359
|
"name": "a",
|
|
354
360
|
"signature": "const a: 4",
|
|
361
|
+
"isOptional": false,
|
|
355
362
|
"type": {
|
|
356
363
|
"__schema": "InferenceTypeSchema",
|
|
357
364
|
"location": {
|
|
@@ -363,7 +370,7 @@
|
|
|
363
370
|
}
|
|
364
371
|
},
|
|
365
372
|
{
|
|
366
|
-
"__schema": "
|
|
373
|
+
"__schema": "VariableLikeSchema",
|
|
367
374
|
"location": {
|
|
368
375
|
"file": "index.ts",
|
|
369
376
|
"line": 22,
|
|
@@ -371,6 +378,7 @@
|
|
|
371
378
|
},
|
|
372
379
|
"name": "b",
|
|
373
380
|
"signature": "const b: 5",
|
|
381
|
+
"isOptional": false,
|
|
374
382
|
"type": {
|
|
375
383
|
"__schema": "LiteralTypeSchema",
|
|
376
384
|
"location": {
|
|
@@ -431,6 +439,7 @@
|
|
|
431
439
|
"character": 24
|
|
432
440
|
},
|
|
433
441
|
"name": "{ children = <BasicButton /> }",
|
|
442
|
+
"isOptional": false,
|
|
434
443
|
"type": {
|
|
435
444
|
"__schema": "TypeLiteralSchema",
|
|
436
445
|
"location": {
|
|
@@ -539,7 +548,7 @@
|
|
|
539
548
|
"namespace": "Compositions"
|
|
540
549
|
},
|
|
541
550
|
{
|
|
542
|
-
"__schema": "
|
|
551
|
+
"__schema": "VariableLikeSchema",
|
|
543
552
|
"location": {
|
|
544
553
|
"file": "index.ts",
|
|
545
554
|
"line": 26,
|
|
@@ -547,6 +556,7 @@
|
|
|
547
556
|
},
|
|
548
557
|
"name": "HiThere",
|
|
549
558
|
"signature": "const HiThere: \"HiThere\"",
|
|
559
|
+
"isOptional": false,
|
|
550
560
|
"type": {
|
|
551
561
|
"__schema": "InferenceTypeSchema",
|
|
552
562
|
"location": {
|
|
@@ -579,7 +589,7 @@
|
|
|
579
589
|
}
|
|
580
590
|
},
|
|
581
591
|
{
|
|
582
|
-
"__schema": "
|
|
592
|
+
"__schema": "VariableLikeSchema",
|
|
583
593
|
"location": {
|
|
584
594
|
"file": "index.ts",
|
|
585
595
|
"line": 30,
|
|
@@ -587,6 +597,7 @@
|
|
|
587
597
|
},
|
|
588
598
|
"name": "Array",
|
|
589
599
|
"signature": "const Array: string[]",
|
|
600
|
+
"isOptional": false,
|
|
590
601
|
"type": {
|
|
591
602
|
"__schema": "TypeRefSchema",
|
|
592
603
|
"location": {
|
|
@@ -608,7 +619,7 @@
|
|
|
608
619
|
},
|
|
609
620
|
"members": [
|
|
610
621
|
{
|
|
611
|
-
"__schema": "
|
|
622
|
+
"__schema": "VariableLikeSchema",
|
|
612
623
|
"location": {
|
|
613
624
|
"file": "index.ts",
|
|
614
625
|
"line": 35,
|
|
@@ -616,6 +627,7 @@
|
|
|
616
627
|
},
|
|
617
628
|
"name": "app",
|
|
618
629
|
"signature": "(property) ClassSomething.app: string",
|
|
630
|
+
"isOptional": false,
|
|
619
631
|
"type": {
|
|
620
632
|
"__schema": "InferenceTypeSchema",
|
|
621
633
|
"location": {
|
|
@@ -642,6 +654,7 @@
|
|
|
642
654
|
"character": 15
|
|
643
655
|
},
|
|
644
656
|
"name": "da",
|
|
657
|
+
"isOptional": false,
|
|
645
658
|
"type": {
|
|
646
659
|
"__schema": "LiteralTypeSchema",
|
|
647
660
|
"location": {
|
|
@@ -711,6 +724,7 @@
|
|
|
711
724
|
"character": 14
|
|
712
725
|
},
|
|
713
726
|
"name": "a",
|
|
727
|
+
"isOptional": false,
|
|
714
728
|
"type": {
|
|
715
729
|
"__schema": "KeywordTypeSchema",
|
|
716
730
|
"location": {
|
|
@@ -757,6 +771,7 @@
|
|
|
757
771
|
"character": 27
|
|
758
772
|
},
|
|
759
773
|
"name": "key",
|
|
774
|
+
"isOptional": false,
|
|
760
775
|
"type": {
|
|
761
776
|
"__schema": "KeywordTypeSchema",
|
|
762
777
|
"location": {
|
|
@@ -791,7 +806,7 @@
|
|
|
791
806
|
"name": "Hello",
|
|
792
807
|
"members": [
|
|
793
808
|
{
|
|
794
|
-
"__schema": "
|
|
809
|
+
"__schema": "VariableLikeSchema",
|
|
795
810
|
"location": {
|
|
796
811
|
"file": "index.ts",
|
|
797
812
|
"line": 53,
|
|
@@ -799,6 +814,7 @@
|
|
|
799
814
|
},
|
|
800
815
|
"name": "propertySig",
|
|
801
816
|
"signature": "(property) Hello.propertySig: () => void",
|
|
817
|
+
"isOptional": false,
|
|
802
818
|
"type": {
|
|
803
819
|
"__schema": "FunctionLikeSchema",
|
|
804
820
|
"location": {
|
|
@@ -845,7 +861,7 @@
|
|
|
845
861
|
]
|
|
846
862
|
},
|
|
847
863
|
{
|
|
848
|
-
"__schema": "
|
|
864
|
+
"__schema": "VariableLikeSchema",
|
|
849
865
|
"location": {
|
|
850
866
|
"file": "index.ts",
|
|
851
867
|
"line": 59,
|
|
@@ -853,6 +869,7 @@
|
|
|
853
869
|
},
|
|
854
870
|
"name": "a1",
|
|
855
871
|
"signature": "const a1: {\n a: number;\n b: number;\n}",
|
|
872
|
+
"isOptional": false,
|
|
856
873
|
"type": {
|
|
857
874
|
"__schema": "TypeQuerySchema",
|
|
858
875
|
"location": {
|
|
@@ -928,6 +945,7 @@
|
|
|
928
945
|
"character": 24
|
|
929
946
|
},
|
|
930
947
|
"name": "bar",
|
|
948
|
+
"isOptional": false,
|
|
931
949
|
"type": {
|
|
932
950
|
"__schema": "TypeRefSchema",
|
|
933
951
|
"location": {
|
|
@@ -968,6 +986,7 @@
|
|
|
968
986
|
"character": 23
|
|
969
987
|
},
|
|
970
988
|
"name": "[ a, b, c ]",
|
|
989
|
+
"isOptional": false,
|
|
971
990
|
"type": {
|
|
972
991
|
"__schema": "TupleTypeSchema",
|
|
973
992
|
"location": {
|
|
@@ -1182,6 +1201,7 @@
|
|
|
1182
1201
|
"character": 33
|
|
1183
1202
|
},
|
|
1184
1203
|
"name": "str",
|
|
1204
|
+
"isOptional": false,
|
|
1185
1205
|
"type": {
|
|
1186
1206
|
"__schema": "KeywordTypeSchema",
|
|
1187
1207
|
"location": {
|
|
@@ -1234,6 +1254,7 @@
|
|
|
1234
1254
|
"character": 39
|
|
1235
1255
|
},
|
|
1236
1256
|
"name": "condition",
|
|
1257
|
+
"isOptional": false,
|
|
1237
1258
|
"type": {
|
|
1238
1259
|
"__schema": "KeywordTypeSchema",
|
|
1239
1260
|
"location": {
|
|
@@ -1252,6 +1273,7 @@
|
|
|
1252
1273
|
"character": 55
|
|
1253
1274
|
},
|
|
1254
1275
|
"name": "msg",
|
|
1276
|
+
"isOptional": true,
|
|
1255
1277
|
"type": {
|
|
1256
1278
|
"__schema": "KeywordTypeSchema",
|
|
1257
1279
|
"location": {
|
|
@@ -1296,6 +1318,7 @@
|
|
|
1296
1318
|
"character": 45
|
|
1297
1319
|
},
|
|
1298
1320
|
"name": "{ prop = 1 }",
|
|
1321
|
+
"isOptional": false,
|
|
1299
1322
|
"type": {
|
|
1300
1323
|
"__schema": "TypeLiteralSchema",
|
|
1301
1324
|
"location": {
|
|
@@ -1350,6 +1373,7 @@
|
|
|
1350
1373
|
"character": 44
|
|
1351
1374
|
},
|
|
1352
1375
|
"name": "[ prop ]",
|
|
1376
|
+
"isOptional": false,
|
|
1353
1377
|
"type": {
|
|
1354
1378
|
"__schema": "TupleTypeSchema",
|
|
1355
1379
|
"location": {
|
|
@@ -1427,7 +1451,7 @@
|
|
|
1427
1451
|
"name": "ComputedNameWithType",
|
|
1428
1452
|
"members": [
|
|
1429
1453
|
{
|
|
1430
|
-
"__schema": "
|
|
1454
|
+
"__schema": "VariableLikeSchema",
|
|
1431
1455
|
"location": {
|
|
1432
1456
|
"file": "index.ts",
|
|
1433
1457
|
"line": 108,
|
|
@@ -1435,6 +1459,7 @@
|
|
|
1435
1459
|
},
|
|
1436
1460
|
"name": "[computedName]",
|
|
1437
1461
|
"signature": "",
|
|
1462
|
+
"isOptional": false,
|
|
1438
1463
|
"type": {
|
|
1439
1464
|
"__schema": "KeywordTypeSchema",
|
|
1440
1465
|
"location": {
|
|
@@ -1457,7 +1482,7 @@
|
|
|
1457
1482
|
"name": "ComputedNameNoType",
|
|
1458
1483
|
"members": [
|
|
1459
1484
|
{
|
|
1460
|
-
"__schema": "
|
|
1485
|
+
"__schema": "VariableLikeSchema",
|
|
1461
1486
|
"location": {
|
|
1462
1487
|
"file": "index.ts",
|
|
1463
1488
|
"line": 111,
|
|
@@ -1465,6 +1490,7 @@
|
|
|
1465
1490
|
},
|
|
1466
1491
|
"name": "[computedName]",
|
|
1467
1492
|
"signature": "",
|
|
1493
|
+
"isOptional": false,
|
|
1468
1494
|
"type": {
|
|
1469
1495
|
"__schema": "InferenceTypeSchema",
|
|
1470
1496
|
"location": {
|
|
@@ -1565,6 +1591,7 @@
|
|
|
1565
1591
|
"character": 7
|
|
1566
1592
|
},
|
|
1567
1593
|
"name": "a",
|
|
1594
|
+
"isOptional": false,
|
|
1568
1595
|
"type": {
|
|
1569
1596
|
"__schema": "KeywordTypeSchema",
|
|
1570
1597
|
"location": {
|
package/dist/schema.spec.js
CHANGED
|
@@ -148,6 +148,21 @@ describe('SchemaAspect', function () {
|
|
|
148
148
|
|
|
149
149
|
expect(apiSchema.toObject()).toMatchObject(json);
|
|
150
150
|
});
|
|
151
|
+
it('should not throw when it does not recognize the schema', () => {
|
|
152
|
+
const jsonPath = _path().default.join(getMockDir(), 'button-old-schema.json');
|
|
153
|
+
|
|
154
|
+
const json = _fsExtra().default.readJsonSync(jsonPath);
|
|
155
|
+
|
|
156
|
+
const apiSchema = schema.getSchemaFromObject(json);
|
|
157
|
+
expect(apiSchema instanceof _semanticsEntities().APISchema).toBeTruthy();
|
|
158
|
+
expect(apiSchema.module.exports[0] instanceof _semanticsEntities().UnknownSchema).toBeTruthy(); // @ts-ignore
|
|
159
|
+
|
|
160
|
+
expect(apiSchema.module.exports[0].location).toMatchObject({
|
|
161
|
+
file: 'index.ts',
|
|
162
|
+
line: 21,
|
|
163
|
+
character: 14
|
|
164
|
+
});
|
|
165
|
+
});
|
|
151
166
|
});
|
|
152
167
|
});
|
|
153
168
|
|
package/dist/schema.spec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["describe","schema","workspace","workspaceData","beforeAll","mockWorkspace","workspacePath","console","log","loadAspect","SchemaAspect","afterAll","destroyWorkspace","apiSchema","compDir","path","join","src","getMockDir","fs","copy","WorkspaceAspect","track","rootDir","defaultScope","bitMap","write","compId","resolveComponentId","comp","get","getSchema","it","results","toObject","expectedJsonPath","expectedJson","readJsonSync","expect","toMatchObject","jsonPath","json","getSchemaFromObject","APISchema","toBeTruthy","componentId","ComponentID","getCurrentDir","currentDir","__dirname","endsWith","sep","slice"],"sources":["schema.spec.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\nimport { APISchema } from '@teambit/semantics.entities.semantic-schema';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { SchemaMain } from './schema.main.runtime';\nimport { SchemaAspect } from '.';\n\ndescribe('SchemaAspect', function () {\n let schema: SchemaMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n beforeAll(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n schema = await loadAspect(SchemaAspect, workspacePath);\n });\n afterAll(async () => {\n await destroyWorkspace(workspaceData);\n });\n describe('getSchema()', () => {\n let apiSchema: APISchema;\n beforeAll(async () => {\n const { workspacePath } = workspaceData;\n const compDir = path.join(workspacePath, 'button');\n const src = path.join(getMockDir(), 'button');\n await fs.copy(src, compDir);\n workspace = await loadAspect(WorkspaceAspect, workspacePath);\n await workspace.track({ rootDir: compDir, defaultScope: 'org.scope' });\n await workspace.bitMap.write();\n schema = await loadAspect(SchemaAspect, workspacePath);\n const compId = await workspace.resolveComponentId('button');\n const comp = await workspace.get(compId);\n apiSchema = await schema.getSchema(comp);\n });\n it('should be able to generate JSON object with all schemas', async () => {\n const results = apiSchema.toObject();\n const expectedJsonPath = path.join(getMockDir(), 'button-schemas.json');\n // uncomment the next line temporarily to sync the expected json with new schema changes\n // fs.outputFileSync(expectedJsonPath, JSON.stringify(results, undefined, 2));\n const expectedJson = fs.readJsonSync(expectedJsonPath);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(results).toMatchObject(expectedJson);\n });\n });\n describe('getSchemaFromObject', () => {\n it('should be able to deserialize an JSON object to SchemaNode instances', () => {\n const jsonPath = path.join(getMockDir(), 'button-schemas.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).toBeTruthy();\n expect(apiSchema.componentId instanceof ComponentID).toBeTruthy();\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(apiSchema.toObject()).toMatchObject(json);\n });\n });\n});\n\nfunction getCurrentDir() {\n const currentDir = __dirname;\n if (currentDir.endsWith(`${path.sep}dist`)) return currentDir.slice(0, -5);\n return currentDir;\n}\n\nfunction getMockDir() {\n return path.join(getCurrentDir(), 'mock');\n}\n"],"mappings":";;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEAA,QAAQ,CAAC,cAAD,EAAiB,YAAY;EACnC,IAAIC,MAAJ;EACA,IAAIC,SAAJ;EACA,IAAIC,aAAJ;EACAC,SAAS,CAAC,YAAY;IACpBD,aAAa,GAAG,IAAAE,iCAAA,GAAhB;IACA,MAAM;MAAEC;IAAF,IAAoBH,aAA1B,CAFoB,CAGpB;;IACAI,OAAO,CAACC,GAAR,CAAY,uBAAZ,EAAqCF,aAArC;IACAL,MAAM,GAAG,MAAM,IAAAQ,4BAAA,EAAWC,gBAAX,EAAyBJ,aAAzB,CAAf;EACD,CANQ,CAAT;EAOAK,QAAQ,CAAC,YAAY;IACnB,MAAM,IAAAC,oCAAA,EAAiBT,aAAjB,CAAN;EACD,CAFO,CAAR;EAGAH,QAAQ,CAAC,aAAD,EAAgB,MAAM;IAC5B,IAAIa,SAAJ;IACAT,SAAS,CAAC,YAAY;MACpB,MAAM;QAAEE;MAAF,IAAoBH,aAA1B;;MACA,MAAMW,OAAO,GAAGC,eAAA,CAAKC,IAAL,CAAUV,aAAV,EAAyB,QAAzB,CAAhB;;MACA,MAAMW,GAAG,GAAGF,eAAA,CAAKC,IAAL,CAAUE,UAAU,EAApB,EAAwB,QAAxB,CAAZ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AAH,CAAgBG,QAAhB,CAAb;;MACA,MAAM3B,SAAS,GAAGZ,MAAM,CAACyC,mBAAP,CAA2BD,IAA3B,CAAlB;MACAH,MAAM,CAACzB,SAAS,YAAY8B,8BAAtB,CAAN,CAAuCC,UAAvC;MACAN,MAAM,CAACzB,SAAS,CAACgC,WAAV,YAAiCC,0BAAlC,CAAN,CAAqDF,UAArD,GAL+E,CAM/E;;MACAN,MAAM,CAACzB,SAAS,CAACqB,QAAV,EAAD,CAAN,CAA6BK,aAA7B,CAA2CE,IAA3C;IACD,CARC,CAAF;EASD,
|
|
1
|
+
{"version":3,"names":["describe","schema","workspace","workspaceData","beforeAll","mockWorkspace","workspacePath","console","log","loadAspect","SchemaAspect","afterAll","destroyWorkspace","apiSchema","compDir","path","join","src","getMockDir","fs","copy","WorkspaceAspect","track","rootDir","defaultScope","bitMap","write","compId","resolveComponentId","comp","get","getSchema","it","results","toObject","expectedJsonPath","expectedJson","readJsonSync","expect","toMatchObject","jsonPath","json","getSchemaFromObject","APISchema","toBeTruthy","componentId","ComponentID","module","exports","UnknownSchema","location","file","line","character","getCurrentDir","currentDir","__dirname","endsWith","sep","slice"],"sources":["schema.spec.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs-extra';\nimport { APISchema, UnknownSchema } from '@teambit/semantics.entities.semantic-schema';\nimport { loadAspect } from '@teambit/harmony.testing.load-aspect';\nimport { mockWorkspace, destroyWorkspace, WorkspaceData } from '@teambit/workspace.testing.mock-workspace';\nimport { ComponentID } from '@teambit/component-id';\nimport WorkspaceAspect, { Workspace } from '@teambit/workspace';\nimport { SchemaMain } from './schema.main.runtime';\nimport { SchemaAspect } from '.';\n\ndescribe('SchemaAspect', function () {\n let schema: SchemaMain;\n let workspace: Workspace;\n let workspaceData: WorkspaceData;\n beforeAll(async () => {\n workspaceData = mockWorkspace();\n const { workspacePath } = workspaceData;\n // eslint-disable-next-line no-console\n console.log('workspace created at ', workspacePath);\n schema = await loadAspect(SchemaAspect, workspacePath);\n });\n afterAll(async () => {\n await destroyWorkspace(workspaceData);\n });\n describe('getSchema()', () => {\n let apiSchema: APISchema;\n beforeAll(async () => {\n const { workspacePath } = workspaceData;\n const compDir = path.join(workspacePath, 'button');\n const src = path.join(getMockDir(), 'button');\n await fs.copy(src, compDir);\n workspace = await loadAspect(WorkspaceAspect, workspacePath);\n await workspace.track({ rootDir: compDir, defaultScope: 'org.scope' });\n await workspace.bitMap.write();\n schema = await loadAspect(SchemaAspect, workspacePath);\n const compId = await workspace.resolveComponentId('button');\n const comp = await workspace.get(compId);\n apiSchema = await schema.getSchema(comp);\n });\n it('should be able to generate JSON object with all schemas', async () => {\n const results = apiSchema.toObject();\n const expectedJsonPath = path.join(getMockDir(), 'button-schemas.json');\n // uncomment the next line temporarily to sync the expected json with new schema changes\n // fs.outputFileSync(expectedJsonPath, JSON.stringify(results, undefined, 2));\n const expectedJson = fs.readJsonSync(expectedJsonPath);\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(results).toMatchObject(expectedJson);\n });\n });\n describe('getSchemaFromObject', () => {\n it('should be able to deserialize an JSON object to SchemaNode instances', () => {\n const jsonPath = path.join(getMockDir(), 'button-schemas.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).toBeTruthy();\n expect(apiSchema.componentId instanceof ComponentID).toBeTruthy();\n // @ts-ignore it exists on Jest. for some reason ts assumes this is Jasmine.\n expect(apiSchema.toObject()).toMatchObject(json);\n });\n it('should not throw when it does not recognize the schema', () => {\n const jsonPath = path.join(getMockDir(), 'button-old-schema.json');\n const json = fs.readJsonSync(jsonPath);\n const apiSchema = schema.getSchemaFromObject(json);\n expect(apiSchema instanceof APISchema).toBeTruthy();\n expect(apiSchema.module.exports[0] instanceof UnknownSchema).toBeTruthy();\n // @ts-ignore\n expect(apiSchema.module.exports[0].location).toMatchObject({ file: 'index.ts', line: 21, character: 14 });\n });\n });\n});\n\nfunction getCurrentDir() {\n const currentDir = __dirname;\n if (currentDir.endsWith(`${path.sep}dist`)) return currentDir.slice(0, -5);\n return currentDir;\n}\n\nfunction getMockDir() {\n return path.join(getCurrentDir(), 'mock');\n}\n"],"mappings":";;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEAA,QAAQ,CAAC,cAAD,EAAiB,YAAY;EACnC,IAAIC,MAAJ;EACA,IAAIC,SAAJ;EACA,IAAIC,aAAJ;EACAC,SAAS,CAAC,YAAY;IACpBD,aAAa,GAAG,IAAAE,iCAAA,GAAhB;IACA,MAAM;MAAEC;IAAF,IAAoBH,aAA1B,CAFoB,CAGpB;;IACAI,OAAO,CAACC,GAAR,CAAY,uBAAZ,EAAqCF,aAArC;IACAL,MAAM,GAAG,MAAM,IAAAQ,4BAAA,EAAWC,gBAAX,EAAyBJ,aAAzB,CAAf;EACD,CANQ,CAAT;EAOAK,QAAQ,CAAC,YAAY;IACnB,MAAM,IAAAC,oCAAA,EAAiBT,aAAjB,CAAN;EACD,CAFO,CAAR;EAGAH,QAAQ,CAAC,aAAD,EAAgB,MAAM;IAC5B,IAAIa,SAAJ;IACAT,SAAS,CAAC,YAAY;MACpB,MAAM;QAAEE;MAAF,IAAoBH,aAA1B;;MACA,MAAMW,OAAO,GAAGC,eAAA,CAAKC,IAAL,CAAUV,aAAV,EAAyB,QAAzB,CAAhB;;MACA,MAAMW,GAAG,GAAGF,eAAA,CAAKC,IAAL,CAAUE,UAAU,EAApB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4C,OAAOH,UAAU,CAACI,KAAX,CAAiB,CAAjB,EAAoB,CAAC,CAArB,CAAP;EAC5C,OAAOJ,UAAP;AACD;;AAED,SAASrC,UAAT,GAAsB;EACpB,OAAOH,eAAA,CAAKC,IAAL,CAAUsC,aAAa,EAAvB,EAA2B,MAA3B,CAAP;AACD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"__schema": "APISchema",
|
|
3
|
+
"location": {
|
|
4
|
+
"file": "index.ts",
|
|
5
|
+
"line": 13,
|
|
6
|
+
"character": 1
|
|
7
|
+
},
|
|
8
|
+
"module": {
|
|
9
|
+
"__schema": "Module",
|
|
10
|
+
"location": {
|
|
11
|
+
"file": "index.ts",
|
|
12
|
+
"line": 13,
|
|
13
|
+
"character": 1
|
|
14
|
+
},
|
|
15
|
+
"exports": [
|
|
16
|
+
{
|
|
17
|
+
"__schema": "VariableSchema",
|
|
18
|
+
"location": {
|
|
19
|
+
"file": "index.ts",
|
|
20
|
+
"line": 21,
|
|
21
|
+
"character": 14
|
|
22
|
+
},
|
|
23
|
+
"name": "a",
|
|
24
|
+
"signature": "const a: 4",
|
|
25
|
+
"type": {
|
|
26
|
+
"__schema": "InferenceTypeSchema",
|
|
27
|
+
"location": {
|
|
28
|
+
"file": "index.ts",
|
|
29
|
+
"line": 21,
|
|
30
|
+
"character": 14
|
|
31
|
+
},
|
|
32
|
+
"type": "4"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"componentId": {
|
|
38
|
+
"name": "button",
|
|
39
|
+
"scope": "org.scope"
|
|
40
|
+
}
|
|
41
|
+
}
|
package/mock/button-schemas.json
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"character": 24
|
|
35
35
|
},
|
|
36
36
|
"name": "a",
|
|
37
|
+
"isOptional": false,
|
|
37
38
|
"defaultValue": "4",
|
|
38
39
|
"type": {
|
|
39
40
|
"__schema": "InferenceTypeSchema",
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
"character": 31
|
|
54
55
|
},
|
|
55
56
|
"name": "b",
|
|
57
|
+
"isOptional": false,
|
|
56
58
|
"defaultValue": "5",
|
|
57
59
|
"type": {
|
|
58
60
|
"__schema": "InferenceTypeSchema",
|
|
@@ -178,7 +180,7 @@
|
|
|
178
180
|
},
|
|
179
181
|
"members": [
|
|
180
182
|
{
|
|
181
|
-
"__schema": "
|
|
183
|
+
"__schema": "VariableLikeSchema",
|
|
182
184
|
"location": {
|
|
183
185
|
"file": "button.tsx",
|
|
184
186
|
"line": 13,
|
|
@@ -186,6 +188,7 @@
|
|
|
186
188
|
},
|
|
187
189
|
"name": "children",
|
|
188
190
|
"signature": "(property) children: any",
|
|
191
|
+
"isOptional": false,
|
|
189
192
|
"type": {
|
|
190
193
|
"__schema": "InferenceTypeSchema",
|
|
191
194
|
"location": {
|
|
@@ -196,7 +199,7 @@
|
|
|
196
199
|
}
|
|
197
200
|
},
|
|
198
201
|
{
|
|
199
|
-
"__schema": "
|
|
202
|
+
"__schema": "VariableLikeSchema",
|
|
200
203
|
"location": {
|
|
201
204
|
"file": "button.tsx",
|
|
202
205
|
"line": 18,
|
|
@@ -204,6 +207,7 @@
|
|
|
204
207
|
},
|
|
205
208
|
"name": "href",
|
|
206
209
|
"signature": "(property) href?: string",
|
|
210
|
+
"isOptional": true,
|
|
207
211
|
"type": {
|
|
208
212
|
"__schema": "KeywordTypeSchema",
|
|
209
213
|
"location": {
|
|
@@ -215,7 +219,7 @@
|
|
|
215
219
|
}
|
|
216
220
|
},
|
|
217
221
|
{
|
|
218
|
-
"__schema": "
|
|
222
|
+
"__schema": "VariableLikeSchema",
|
|
219
223
|
"location": {
|
|
220
224
|
"file": "button.tsx",
|
|
221
225
|
"line": 23,
|
|
@@ -223,6 +227,7 @@
|
|
|
223
227
|
},
|
|
224
228
|
"name": "className",
|
|
225
229
|
"signature": "(property) className?: string",
|
|
230
|
+
"isOptional": true,
|
|
226
231
|
"type": {
|
|
227
232
|
"__schema": "KeywordTypeSchema",
|
|
228
233
|
"location": {
|
|
@@ -267,6 +272,7 @@
|
|
|
267
272
|
"character": 24
|
|
268
273
|
},
|
|
269
274
|
"name": "props",
|
|
275
|
+
"isOptional": false,
|
|
270
276
|
"type": {
|
|
271
277
|
"__schema": "TypeRefSchema",
|
|
272
278
|
"location": {
|
|
@@ -344,7 +350,7 @@
|
|
|
344
350
|
}
|
|
345
351
|
},
|
|
346
352
|
{
|
|
347
|
-
"__schema": "
|
|
353
|
+
"__schema": "VariableLikeSchema",
|
|
348
354
|
"location": {
|
|
349
355
|
"file": "index.ts",
|
|
350
356
|
"line": 21,
|
|
@@ -352,6 +358,7 @@
|
|
|
352
358
|
},
|
|
353
359
|
"name": "a",
|
|
354
360
|
"signature": "const a: 4",
|
|
361
|
+
"isOptional": false,
|
|
355
362
|
"type": {
|
|
356
363
|
"__schema": "InferenceTypeSchema",
|
|
357
364
|
"location": {
|
|
@@ -363,7 +370,7 @@
|
|
|
363
370
|
}
|
|
364
371
|
},
|
|
365
372
|
{
|
|
366
|
-
"__schema": "
|
|
373
|
+
"__schema": "VariableLikeSchema",
|
|
367
374
|
"location": {
|
|
368
375
|
"file": "index.ts",
|
|
369
376
|
"line": 22,
|
|
@@ -371,6 +378,7 @@
|
|
|
371
378
|
},
|
|
372
379
|
"name": "b",
|
|
373
380
|
"signature": "const b: 5",
|
|
381
|
+
"isOptional": false,
|
|
374
382
|
"type": {
|
|
375
383
|
"__schema": "LiteralTypeSchema",
|
|
376
384
|
"location": {
|
|
@@ -431,6 +439,7 @@
|
|
|
431
439
|
"character": 24
|
|
432
440
|
},
|
|
433
441
|
"name": "{ children = <BasicButton /> }",
|
|
442
|
+
"isOptional": false,
|
|
434
443
|
"type": {
|
|
435
444
|
"__schema": "TypeLiteralSchema",
|
|
436
445
|
"location": {
|
|
@@ -539,7 +548,7 @@
|
|
|
539
548
|
"namespace": "Compositions"
|
|
540
549
|
},
|
|
541
550
|
{
|
|
542
|
-
"__schema": "
|
|
551
|
+
"__schema": "VariableLikeSchema",
|
|
543
552
|
"location": {
|
|
544
553
|
"file": "index.ts",
|
|
545
554
|
"line": 26,
|
|
@@ -547,6 +556,7 @@
|
|
|
547
556
|
},
|
|
548
557
|
"name": "HiThere",
|
|
549
558
|
"signature": "const HiThere: \"HiThere\"",
|
|
559
|
+
"isOptional": false,
|
|
550
560
|
"type": {
|
|
551
561
|
"__schema": "InferenceTypeSchema",
|
|
552
562
|
"location": {
|
|
@@ -579,7 +589,7 @@
|
|
|
579
589
|
}
|
|
580
590
|
},
|
|
581
591
|
{
|
|
582
|
-
"__schema": "
|
|
592
|
+
"__schema": "VariableLikeSchema",
|
|
583
593
|
"location": {
|
|
584
594
|
"file": "index.ts",
|
|
585
595
|
"line": 30,
|
|
@@ -587,6 +597,7 @@
|
|
|
587
597
|
},
|
|
588
598
|
"name": "Array",
|
|
589
599
|
"signature": "const Array: string[]",
|
|
600
|
+
"isOptional": false,
|
|
590
601
|
"type": {
|
|
591
602
|
"__schema": "TypeRefSchema",
|
|
592
603
|
"location": {
|
|
@@ -608,7 +619,7 @@
|
|
|
608
619
|
},
|
|
609
620
|
"members": [
|
|
610
621
|
{
|
|
611
|
-
"__schema": "
|
|
622
|
+
"__schema": "VariableLikeSchema",
|
|
612
623
|
"location": {
|
|
613
624
|
"file": "index.ts",
|
|
614
625
|
"line": 35,
|
|
@@ -616,6 +627,7 @@
|
|
|
616
627
|
},
|
|
617
628
|
"name": "app",
|
|
618
629
|
"signature": "(property) ClassSomething.app: string",
|
|
630
|
+
"isOptional": false,
|
|
619
631
|
"type": {
|
|
620
632
|
"__schema": "InferenceTypeSchema",
|
|
621
633
|
"location": {
|
|
@@ -642,6 +654,7 @@
|
|
|
642
654
|
"character": 15
|
|
643
655
|
},
|
|
644
656
|
"name": "da",
|
|
657
|
+
"isOptional": false,
|
|
645
658
|
"type": {
|
|
646
659
|
"__schema": "LiteralTypeSchema",
|
|
647
660
|
"location": {
|
|
@@ -711,6 +724,7 @@
|
|
|
711
724
|
"character": 14
|
|
712
725
|
},
|
|
713
726
|
"name": "a",
|
|
727
|
+
"isOptional": false,
|
|
714
728
|
"type": {
|
|
715
729
|
"__schema": "KeywordTypeSchema",
|
|
716
730
|
"location": {
|
|
@@ -757,6 +771,7 @@
|
|
|
757
771
|
"character": 27
|
|
758
772
|
},
|
|
759
773
|
"name": "key",
|
|
774
|
+
"isOptional": false,
|
|
760
775
|
"type": {
|
|
761
776
|
"__schema": "KeywordTypeSchema",
|
|
762
777
|
"location": {
|
|
@@ -791,7 +806,7 @@
|
|
|
791
806
|
"name": "Hello",
|
|
792
807
|
"members": [
|
|
793
808
|
{
|
|
794
|
-
"__schema": "
|
|
809
|
+
"__schema": "VariableLikeSchema",
|
|
795
810
|
"location": {
|
|
796
811
|
"file": "index.ts",
|
|
797
812
|
"line": 53,
|
|
@@ -799,6 +814,7 @@
|
|
|
799
814
|
},
|
|
800
815
|
"name": "propertySig",
|
|
801
816
|
"signature": "(property) Hello.propertySig: () => void",
|
|
817
|
+
"isOptional": false,
|
|
802
818
|
"type": {
|
|
803
819
|
"__schema": "FunctionLikeSchema",
|
|
804
820
|
"location": {
|
|
@@ -845,7 +861,7 @@
|
|
|
845
861
|
]
|
|
846
862
|
},
|
|
847
863
|
{
|
|
848
|
-
"__schema": "
|
|
864
|
+
"__schema": "VariableLikeSchema",
|
|
849
865
|
"location": {
|
|
850
866
|
"file": "index.ts",
|
|
851
867
|
"line": 59,
|
|
@@ -853,6 +869,7 @@
|
|
|
853
869
|
},
|
|
854
870
|
"name": "a1",
|
|
855
871
|
"signature": "const a1: {\n a: number;\n b: number;\n}",
|
|
872
|
+
"isOptional": false,
|
|
856
873
|
"type": {
|
|
857
874
|
"__schema": "TypeQuerySchema",
|
|
858
875
|
"location": {
|
|
@@ -928,6 +945,7 @@
|
|
|
928
945
|
"character": 24
|
|
929
946
|
},
|
|
930
947
|
"name": "bar",
|
|
948
|
+
"isOptional": false,
|
|
931
949
|
"type": {
|
|
932
950
|
"__schema": "TypeRefSchema",
|
|
933
951
|
"location": {
|
|
@@ -968,6 +986,7 @@
|
|
|
968
986
|
"character": 23
|
|
969
987
|
},
|
|
970
988
|
"name": "[ a, b, c ]",
|
|
989
|
+
"isOptional": false,
|
|
971
990
|
"type": {
|
|
972
991
|
"__schema": "TupleTypeSchema",
|
|
973
992
|
"location": {
|
|
@@ -1182,6 +1201,7 @@
|
|
|
1182
1201
|
"character": 33
|
|
1183
1202
|
},
|
|
1184
1203
|
"name": "str",
|
|
1204
|
+
"isOptional": false,
|
|
1185
1205
|
"type": {
|
|
1186
1206
|
"__schema": "KeywordTypeSchema",
|
|
1187
1207
|
"location": {
|
|
@@ -1234,6 +1254,7 @@
|
|
|
1234
1254
|
"character": 39
|
|
1235
1255
|
},
|
|
1236
1256
|
"name": "condition",
|
|
1257
|
+
"isOptional": false,
|
|
1237
1258
|
"type": {
|
|
1238
1259
|
"__schema": "KeywordTypeSchema",
|
|
1239
1260
|
"location": {
|
|
@@ -1252,6 +1273,7 @@
|
|
|
1252
1273
|
"character": 55
|
|
1253
1274
|
},
|
|
1254
1275
|
"name": "msg",
|
|
1276
|
+
"isOptional": true,
|
|
1255
1277
|
"type": {
|
|
1256
1278
|
"__schema": "KeywordTypeSchema",
|
|
1257
1279
|
"location": {
|
|
@@ -1296,6 +1318,7 @@
|
|
|
1296
1318
|
"character": 45
|
|
1297
1319
|
},
|
|
1298
1320
|
"name": "{ prop = 1 }",
|
|
1321
|
+
"isOptional": false,
|
|
1299
1322
|
"type": {
|
|
1300
1323
|
"__schema": "TypeLiteralSchema",
|
|
1301
1324
|
"location": {
|
|
@@ -1350,6 +1373,7 @@
|
|
|
1350
1373
|
"character": 44
|
|
1351
1374
|
},
|
|
1352
1375
|
"name": "[ prop ]",
|
|
1376
|
+
"isOptional": false,
|
|
1353
1377
|
"type": {
|
|
1354
1378
|
"__schema": "TupleTypeSchema",
|
|
1355
1379
|
"location": {
|
|
@@ -1427,7 +1451,7 @@
|
|
|
1427
1451
|
"name": "ComputedNameWithType",
|
|
1428
1452
|
"members": [
|
|
1429
1453
|
{
|
|
1430
|
-
"__schema": "
|
|
1454
|
+
"__schema": "VariableLikeSchema",
|
|
1431
1455
|
"location": {
|
|
1432
1456
|
"file": "index.ts",
|
|
1433
1457
|
"line": 108,
|
|
@@ -1435,6 +1459,7 @@
|
|
|
1435
1459
|
},
|
|
1436
1460
|
"name": "[computedName]",
|
|
1437
1461
|
"signature": "",
|
|
1462
|
+
"isOptional": false,
|
|
1438
1463
|
"type": {
|
|
1439
1464
|
"__schema": "KeywordTypeSchema",
|
|
1440
1465
|
"location": {
|
|
@@ -1457,7 +1482,7 @@
|
|
|
1457
1482
|
"name": "ComputedNameNoType",
|
|
1458
1483
|
"members": [
|
|
1459
1484
|
{
|
|
1460
|
-
"__schema": "
|
|
1485
|
+
"__schema": "VariableLikeSchema",
|
|
1461
1486
|
"location": {
|
|
1462
1487
|
"file": "index.ts",
|
|
1463
1488
|
"line": 111,
|
|
@@ -1465,6 +1490,7 @@
|
|
|
1465
1490
|
},
|
|
1466
1491
|
"name": "[computedName]",
|
|
1467
1492
|
"signature": "",
|
|
1493
|
+
"isOptional": false,
|
|
1468
1494
|
"type": {
|
|
1469
1495
|
"__schema": "InferenceTypeSchema",
|
|
1470
1496
|
"location": {
|
|
@@ -1565,6 +1591,7 @@
|
|
|
1565
1591
|
"character": 7
|
|
1566
1592
|
},
|
|
1567
1593
|
"name": "a",
|
|
1594
|
+
"isOptional": false,
|
|
1568
1595
|
"type": {
|
|
1569
1596
|
"__schema": "KeywordTypeSchema",
|
|
1570
1597
|
"location": {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/schema",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.756",
|
|
4
4
|
"homepage": "https://bit.dev/teambit/semantics/schema",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.semantics",
|
|
8
8
|
"name": "schema",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.756"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"p-map-series": "2.1.0",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"core-js": "^3.0.0",
|
|
17
17
|
"@teambit/harmony": "0.3.3",
|
|
18
18
|
"@teambit/base-react.navigation.link": "2.0.27",
|
|
19
|
-
"@teambit/semantics.entities.semantic-schema": "0.0.
|
|
20
|
-
"@teambit/builder": "0.0.
|
|
21
|
-
"@teambit/component": "0.0.
|
|
22
|
-
"@teambit/cli": "0.0.
|
|
23
|
-
"@teambit/logger": "0.0.
|
|
24
|
-
"@teambit/envs": "0.0.
|
|
25
|
-
"@teambit/graphql": "0.0.
|
|
19
|
+
"@teambit/semantics.entities.semantic-schema": "0.0.19",
|
|
20
|
+
"@teambit/builder": "0.0.756",
|
|
21
|
+
"@teambit/component": "0.0.756",
|
|
22
|
+
"@teambit/cli": "0.0.499",
|
|
23
|
+
"@teambit/logger": "0.0.592",
|
|
24
|
+
"@teambit/envs": "0.0.756",
|
|
25
|
+
"@teambit/graphql": "0.0.756"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "^17.0.8",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"@teambit/component-id": "0.0.402",
|
|
37
37
|
"@teambit/harmony.testing.load-aspect": "0.0.6",
|
|
38
38
|
"@teambit/workspace.testing.mock-workspace": "0.0.5",
|
|
39
|
-
"@teambit/workspace": "0.0.
|
|
39
|
+
"@teambit/workspace": "0.0.756"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@teambit/legacy": "1.0.
|
|
42
|
+
"@teambit/legacy": "1.0.279",
|
|
43
43
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
44
44
|
"react": "^16.8.0 || ^17.0.0"
|
|
45
45
|
},
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"react": "-"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@teambit/legacy": "1.0.
|
|
70
|
+
"@teambit/legacy": "1.0.279",
|
|
71
71
|
"react-dom": "^16.8.0 || ^17.0.0",
|
|
72
72
|
"react": "^16.8.0 || ^17.0.0"
|
|
73
73
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.
|
|
2
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.
|
|
1
|
+
export const compositions = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.756/dist/schema.composition.js'), require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.756/dist/mock/button/button.composition.js')]
|
|
2
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.semantics_schema@0.0.756/dist/schema.docs.mdx')]
|
|
Binary file
|