Skip to content

Commit 266fcf2

Browse files
author
Jakub Jankowski
authored
fix: remove ui-kit (#149)
* fix: remove ui-kit * chore: storybook styles * fix: lodash default exports
1 parent 12a4601 commit 266fcf2

File tree

12 files changed

+1109
-864
lines changed

12 files changed

+1109
-864
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
},
2222
"scripts": {
2323
"build": "sl-scripts bundle --sourcemap",
24+
"postbuild": "yarn test.packaging",
2425
"build.docs": "build-storybook -c .storybook -o docs-auto",
2526
"commit": "git-cz",
2627
"lint": "eslint 'src/**/*.{ts,tsx}'",
@@ -32,33 +33,32 @@
3233
"test": "jest",
3334
"test.prod": "yarn lint && yarn test --coverage --maxWorkers=2",
3435
"test.update": "yarn test --updateSnapshot",
35-
"test.watch": "yarn test --watch"
36+
"test.watch": "yarn test --watch",
37+
"test.packaging": "node -e \"require('./dist/index.js')\" && node --input-type=module -e \"import './dist/index.mjs'\""
3638
},
3739
"peerDependencies": {
38-
"@stoplight/markdown-viewer": "^4",
39-
"@stoplight/ui-kit": "^3",
40+
"@stoplight/markdown-viewer": "^5",
4041
"react": ">=16.8",
4142
"react-dom": ">=16.8"
4243
},
4344
"dependencies": {
4445
"@fortawesome/free-solid-svg-icons": "^5.15.2",
4546
"@stoplight/json": "^3.10.0",
4647
"@stoplight/json-schema-tree": "^2.0.1",
47-
"@stoplight/mosaic": "1.0.0-beta.46",
48+
"@stoplight/mosaic": "1.0.0-beta.58",
49+
"@stoplight/mosaic-code-viewer": "1.0.0-beta.58",
4850
"@stoplight/react-error-boundary": "^1.0.0",
4951
"@types/json-schema": "^7.0.7",
5052
"classnames": "^2.2.6",
5153
"lodash": "^4.17.19"
5254
},
5355
"devDependencies": {
54-
"@rollup/plugin-typescript": "^3.1.1",
5556
"@sambego/storybook-state": "^1.3.6",
5657
"@stoplight/eslint-config": "^1.2.0",
57-
"@stoplight/markdown-viewer": "^4.3.4",
58-
"@stoplight/scripts": "^8.2.0",
58+
"@stoplight/markdown-viewer": "^5.0.0-beta.4",
59+
"@stoplight/scripts": "9.0.1",
5960
"@stoplight/storybook-config": "^2.0.6",
6061
"@stoplight/types": "^11.9.0",
61-
"@stoplight/ui-kit": "3.0.0-beta.39",
6262
"@types/classnames": "^2.2.11",
6363
"@types/enzyme": "^3.10.8",
6464
"@types/jest": "^26.0.18",

rollup.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

setupTests.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const Enzyme = require('enzyme');
22
const Adapter = require('enzyme-adapter-react-16');
33

4-
jest.mock('react-virtualized-auto-sizer', () => ({ children }: any) => children({ height: 600, width: 600 }));
5-
64
Enzyme.configure({ adapter: new Adapter() });
75

86
jest.mock('react');

src/__stories__/_styles.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@
66
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
77
border: 1px dotted #bbb; // to visualize component boundaries
88
}
9+
10+
.JsonSchemaViewer {
11+
p {
12+
font-size: 14px;
13+
}
14+
}

src/__tests__/__snapshots__/index.spec.tsx.snap

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`Expanded depth nested object static given initial level set to 0, should render top 2 levels 1`] = `
4-
"<div class=\\"\\">
4+
"<div data-overlay-container=\\"true\\" class=\\"\\">
55
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
66
<div style=\\"margin-left: -25px\\">
77
<div style=\\"padding-left: 25px\\">
@@ -46,7 +46,7 @@ exports[`Expanded depth nested object static given initial level set to 0, shoul
4646
`;
4747
4848
exports[`Expanded depth nested object static given initial level set to 1, should render top 3 levels 1`] = `
49-
"<div class=\\"\\">
49+
"<div data-overlay-container=\\"true\\" class=\\"\\">
5050
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
5151
<div style=\\"margin-left: -25px\\">
5252
<div style=\\"padding-left: 25px\\">
@@ -174,7 +174,7 @@ exports[`Expanded depth nested object static given initial level set to 1, shoul
174174
`;
175175
176176
exports[`Expanded depth nested object static given initial level set to 2, should render top 4 levels 1`] = `
177-
"<div class=\\"\\">
177+
"<div data-overlay-container=\\"true\\" class=\\"\\">
178178
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
179179
<div style=\\"margin-left: -25px\\">
180180
<div style=\\"padding-left: 25px\\">
@@ -319,7 +319,7 @@ exports[`Expanded depth nested object static given initial level set to 2, shoul
319319
`;
320320
321321
exports[`HTML Output given anyOf combiner placed next to allOf given allOf merging enabled, should merge contents of allOf combiners 1`] = `
322-
"<div class=\\"\\">
322+
"<div data-overlay-container=\\"true\\" class=\\"\\">
323323
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
324324
<div style=\\"margin-left: -25px\\">
325325
<div>
@@ -459,7 +459,7 @@ exports[`HTML Output given anyOf combiner placed next to allOf given allOf mergi
459459
`;
460460
461461
exports[`HTML Output given array with oneOf containing items, should merge it correctly 1`] = `
462-
"<div class=\\"\\">
462+
"<div data-overlay-container=\\"true\\" class=\\"\\">
463463
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
464464
<div style=\\"margin-left: -25px\\">
465465
<div>
@@ -507,7 +507,7 @@ exports[`HTML Output given array with oneOf containing items, should merge it co
507507
`;
508508

509509
exports[`HTML Output given complex type that includes array and complex array subtype, should not ignore subtype 1`] = `
510-
"<div class=\\"\\">
510+
"<div data-overlay-container=\\"true\\" class=\\"\\">
511511
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
512512
<div style=\\"margin-left: -25px\\">
513513
<div style=\\"padding-left: 25px\\">
@@ -550,7 +550,7 @@ exports[`HTML Output given complex type that includes array and complex array su
550550
`;
551551
552552
exports[`HTML Output given multiple object and string type, should process properties 1`] = `
553-
"<div class=\\"\\">
553+
"<div data-overlay-container=\\"true\\" class=\\"\\">
554554
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
555555
<div>
556556
<div>
@@ -594,7 +594,7 @@ exports[`HTML Output given multiple object and string type, should process prope
594594
`;
595595
596596
exports[`HTML Output given oneOf combiner placed next to allOf given allOf merging enabled, should merge contents of allOf combiners 1`] = `
597-
"<div class=\\"\\">
597+
"<div data-overlay-container=\\"true\\" class=\\"\\">
598598
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
599599
<div style=\\"margin-left: -25px\\">
600600
<div>
@@ -734,7 +734,7 @@ exports[`HTML Output given oneOf combiner placed next to allOf given allOf mergi
734734
`;
735735
736736
exports[`HTML Output given read mode, should populate proper nodes 1`] = `
737-
"<div class=\\"\\">
737+
"<div data-overlay-container=\\"true\\" class=\\"\\">
738738
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
739739
<div>
740740
<div>
@@ -778,7 +778,7 @@ exports[`HTML Output given read mode, should populate proper nodes 1`] = `
778778
`;
779779
780780
exports[`HTML Output given standalone mode, should populate proper nodes 1`] = `
781-
"<div class=\\"\\">
781+
"<div data-overlay-container=\\"true\\" class=\\"\\">
782782
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
783783
<div>
784784
<div>
@@ -840,7 +840,7 @@ exports[`HTML Output given standalone mode, should populate proper nodes 1`] = `
840840
`;
841841
842842
exports[`HTML Output given visible $ref node, should try to inject the title immediately 1`] = `
843-
"<div class=\\"\\">
843+
"<div data-overlay-container=\\"true\\" class=\\"\\">
844844
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
845845
<div style=\\"margin-left: -25px\\">
846846
<div style=\\"padding-left: 25px\\">
@@ -902,7 +902,7 @@ exports[`HTML Output given visible $ref node, should try to inject the title imm
902902
`;
903903
904904
exports[`HTML Output given write mode, should populate proper nodes 1`] = `
905-
"<div class=\\"\\">
905+
"<div data-overlay-container=\\"true\\" class=\\"\\">
906906
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
907907
<div>
908908
<div>
@@ -946,7 +946,7 @@ exports[`HTML Output given write mode, should populate proper nodes 1`] = `
946946
`;
947947
948948
exports[`HTML Output should match arrays/of-allofs.json 1`] = `
949-
"<div class=\\"\\">
949+
"<div data-overlay-container=\\"true\\" class=\\"\\">
950950
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
951951
<div style=\\"margin-left: -25px\\">
952952
<div style=\\"padding-left: 25px\\">
@@ -1007,7 +1007,7 @@ exports[`HTML Output should match arrays/of-allofs.json 1`] = `
10071007
`;
10081008
10091009
exports[`HTML Output should match arrays/of-arrays.json 1`] = `
1010-
"<div class=\\"\\">
1010+
"<div data-overlay-container=\\"true\\" class=\\"\\">
10111011
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
10121012
<div style=\\"margin-left: -25px\\">
10131013
<div>
@@ -1053,7 +1053,7 @@ exports[`HTML Output should match arrays/of-arrays.json 1`] = `
10531053
`;
10541054
10551055
exports[`HTML Output should match arrays/of-complex-objects.json 1`] = `
1056-
"<div class=\\"\\">
1056+
"<div data-overlay-container=\\"true\\" class=\\"\\">
10571057
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
10581058
<div style=\\"margin-left: -25px\\">
10591059
<div>
@@ -1424,7 +1424,7 @@ exports[`HTML Output should match arrays/of-complex-objects.json 1`] = `
14241424
`;
14251425
14261426
exports[`HTML Output should match arrays/of-objects.json 1`] = `
1427-
"<div class=\\"\\">
1427+
"<div data-overlay-container=\\"true\\" class=\\"\\">
14281428
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
14291429
<div style=\\"margin-left: -25px\\">
14301430
<div style=\\"padding-left: 25px\\">
@@ -1469,7 +1469,7 @@ exports[`HTML Output should match arrays/of-objects.json 1`] = `
14691469
`;
14701470
14711471
exports[`HTML Output should match arrays/of-refs.json 1`] = `
1472-
"<div class=\\"\\">
1472+
"<div data-overlay-container=\\"true\\" class=\\"\\">
14731473
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
14741474
<div>
14751475
<div>
@@ -1504,7 +1504,7 @@ exports[`HTML Output should match arrays/of-refs.json 1`] = `
15041504
`;
15051505
15061506
exports[`HTML Output should match arrays/with-multiple-arrayish-items.json 1`] = `
1507-
"<div class=\\"\\">
1507+
"<div data-overlay-container=\\"true\\" class=\\"\\">
15081508
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
15091509
<div>
15101510
<div>
@@ -1604,7 +1604,7 @@ exports[`HTML Output should match arrays/with-multiple-arrayish-items.json 1`] =
16041604
`;
16051605
16061606
exports[`HTML Output should match arrays/with-ordered-items.json 1`] = `
1607-
"<div class=\\"\\">
1607+
"<div data-overlay-container=\\"true\\" class=\\"\\">
16081608
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
16091609
<div>
16101610
<div>
@@ -1652,7 +1652,7 @@ exports[`HTML Output should match arrays/with-ordered-items.json 1`] = `
16521652
`;
16531653
16541654
exports[`HTML Output should match arrays/with-single-arrayish-items.json 1`] = `
1655-
"<div class=\\"\\">
1655+
"<div data-overlay-container=\\"true\\" class=\\"\\">
16561656
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
16571657
<div style=\\"margin-left: -25px\\">
16581658
<div>
@@ -1716,7 +1716,7 @@ exports[`HTML Output should match arrays/with-single-arrayish-items.json 1`] = `
17161716
`;
17171717
17181718
exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
1719-
"<div class=\\"\\">
1719+
"<div data-overlay-container=\\"true\\" class=\\"\\">
17201720
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
17211721
<div style=\\"margin-left: -25px\\">
17221722
<div style=\\"padding-left: 25px\\">
@@ -1939,7 +1939,7 @@ exports[`HTML Output should match combiners/allOfs/base.json 1`] = `
19391939
`;
19401940
19411941
exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
1942-
"<div class=\\"\\">
1942+
"<div data-overlay-container=\\"true\\" class=\\"\\">
19431943
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
19441944
<div style=\\"margin-left: -25px\\">
19451945
<div style=\\"padding-left: 25px\\">
@@ -2210,7 +2210,7 @@ exports[`HTML Output should match combiners/allOfs/complex.json 1`] = `
22102210
`;
22112211
22122212
exports[`HTML Output should match combiners/allOfs/todo-full.json 1`] = `
2213-
"<div class=\\"\\">
2213+
"<div data-overlay-container=\\"true\\" class=\\"\\">
22142214
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
22152215
<div style=\\"margin-left: -25px\\">
22162216
<div>
@@ -2400,7 +2400,7 @@ exports[`HTML Output should match combiners/allOfs/todo-full.json 1`] = `
24002400
`;
24012401
24022402
exports[`HTML Output should match combiners/allOfs/todo-full-2.json 1`] = `
2403-
"<div class=\\"\\">
2403+
"<div data-overlay-container=\\"true\\" class=\\"\\">
24042404
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
24052405
<div style=\\"margin-left: -25px\\">
24062406
<div style=\\"padding-left: 25px\\">
@@ -2503,7 +2503,7 @@ exports[`HTML Output should match combiners/allOfs/todo-full-2.json 1`] = `
25032503
`;
25042504
25052505
exports[`HTML Output should match combiners/allOfs/with-type.json 1`] = `
2506-
"<div class=\\"\\">
2506+
"<div data-overlay-container=\\"true\\" class=\\"\\">
25072507
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
25082508
<div style=\\"margin-left: -25px\\">
25092509
<div>
@@ -2662,7 +2662,7 @@ exports[`HTML Output should match combiners/allOfs/with-type.json 1`] = `
26622662
`;
26632663
26642664
exports[`HTML Output should match combiners/oneof-with-array-type.json 1`] = `
2665-
"<div class=\\"\\">
2665+
"<div data-overlay-container=\\"true\\" class=\\"\\">
26662666
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
26672667
<div style=\\"margin-left: -25px\\">
26682668
<div>
@@ -2747,7 +2747,7 @@ exports[`HTML Output should match combiners/oneof-with-array-type.json 1`] = `
27472747
`;
27482748
27492749
exports[`HTML Output should match combiners/oneof-within-array-item.json 1`] = `
2750-
"<div class=\\"\\">
2750+
"<div data-overlay-container=\\"true\\" class=\\"\\">
27512751
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
27522752
<div style=\\"margin-left: -25px\\">
27532753
<div>
@@ -2816,7 +2816,7 @@ exports[`HTML Output should match combiners/oneof-within-array-item.json 1`] = `
28162816
`;
28172817
28182818
exports[`HTML Output should match default-schema.json 1`] = `
2819-
"<div class=\\"\\">
2819+
"<div data-overlay-container=\\"true\\" class=\\"\\">
28202820
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
28212821
<div style=\\"margin-left: -25px\\">
28222822
<div style=\\"padding-left: 25px\\">
@@ -3189,7 +3189,7 @@ exports[`HTML Output should match default-schema.json 1`] = `
31893189
`;
31903190
31913191
exports[`HTML Output should match formats-schema.json 1`] = `
3192-
"<div class=\\"\\">
3192+
"<div data-overlay-container=\\"true\\" class=\\"\\">
31933193
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
31943194
<div style=\\"margin-left: -25px\\">
31953195
<div style=\\"padding-left: 25px\\">
@@ -3311,7 +3311,7 @@ exports[`HTML Output should match formats-schema.json 1`] = `
33113311
`;
33123312
33133313
exports[`HTML Output should match references/base.json 1`] = `
3314-
"<div class=\\"\\">
3314+
"<div data-overlay-container=\\"true\\" class=\\"\\">
33153315
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
33163316
<div style=\\"margin-left: -25px\\">
33173317
<div style=\\"padding-left: 25px\\">
@@ -3408,7 +3408,7 @@ exports[`HTML Output should match references/base.json 1`] = `
34083408
`;
34093409
34103410
exports[`HTML Output should match references/nested.json 1`] = `
3411-
"<div class=\\"\\">
3411+
"<div data-overlay-container=\\"true\\" class=\\"\\">
34123412
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
34133413
<div style=\\"margin-left: -25px\\">
34143414
<div style=\\"padding-left: 25px\\">
@@ -3464,7 +3464,7 @@ exports[`HTML Output should match references/nested.json 1`] = `
34643464
`;
34653465
34663466
exports[`HTML Output should match references/nullish.json 1`] = `
3467-
"<div class=\\"\\">
3467+
"<div data-overlay-container=\\"true\\" class=\\"\\">
34683468
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
34693469
<div style=\\"margin-left: -25px\\">
34703470
<div style=\\"padding-left: 25px\\">
@@ -3491,7 +3491,7 @@ exports[`HTML Output should match references/nullish.json 1`] = `
34913491
`;
34923492
34933493
exports[`HTML Output should match tickets.schema.json 1`] = `
3494-
"<div class=\\"\\">
3494+
"<div data-overlay-container=\\"true\\" class=\\"\\">
34953495
<div style=\\"padding-left: 25px\\" class=\\"JsonSchemaViewer\\">
34963496
<div style=\\"margin-left: -25px\\">
34973497
<div style=\\"padding-left: 25px\\">

0 commit comments

Comments
 (0)