Skip to content

Commit f7c29da

Browse files
authored
feat: converted the app schemas to typescript, removed typings file and related schema scripts. (microsoft#1869)
* feat: remove app json schemas and clean up * updated recently added schema refrences
1 parent 450a507 commit f7c29da

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+208
-299
lines changed

build/convert-schemas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* Utility for copying schemas to their dist folders.
3-
* Usage: node build/copy-schemas.js
3+
* Usage: node build/convert-schemas.js
44
*/
55
const path = require("path");
66
const fs = require("fs");

build/copy-schemas.js

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

packages/fast-components-react-base/app/components/react-html-element.schema.json

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

packages/fast-components-react-base/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"clean:dist": "node ../../build/clean.js dist",
2424
"convert:readme": "node ../../build/convert-readme.js .tmp",
2525
"copy:all": "npm run convert:json-schema && npm run copy:readme",
26-
"copy:json-schema": "node ../../build/copy-schemas.js",
2726
"convert:json-schema": "node ../../build/convert-schemas.js",
2827
"copy:readme": "node ../../build/copy-readme.js",
2928
"prepare": "npm run clean:dist && npm run build",

packages/fast-components-react-base/tsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,5 @@
33
"compilerOptions": {
44
"baseUrl": ".",
55
"outDir": "./dist"
6-
},
7-
"files": [
8-
"typings.d.ts"
9-
]
6+
}
107
}

packages/fast-components-react-base/typings.d.ts

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

packages/fast-components-react-msft/app/components/carousel-dark-image-content-child-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import CarouselDarkImageContentSchema from "./carousel-dark-image-content.schema.json";
1+
import CarouselDarkImageContentSchema from "./carousel-dark-image-content.schema";
22
import CarouselDarkImageContent from "./carousel-dark-image-content";
33
export default {
44
name: "Dark image slide",

packages/fast-components-react-msft/app/components/carousel-dark-image-content.schema.json

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export default {
2+
$schema: "http://json-schema.org/schema#",
3+
title: "Carousel Dark Image Content Test Element",
4+
description: "A carousel dark image content component's schema definition.",
5+
id: "carousel-dark-image-content",
6+
type: "object",
7+
properties: {
8+
image: {
9+
title: "Image",
10+
type: "object",
11+
properties: {
12+
src: {
13+
title: "HTML src attribute",
14+
type: "string",
15+
default: "http://placehold.it/1399x600/2F2F2F/171717",
16+
},
17+
alt: {
18+
title: "HTML alt attribute",
19+
type: "string",
20+
},
21+
},
22+
required: ["src"],
23+
},
24+
},
25+
};

packages/fast-components-react-msft/app/components/carousel-hero-content-child-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import CarouselHeroContentSchema from "./carousel-hero-content.schema.json";
1+
import CarouselHeroContentSchema from "./carousel-hero-content.schema";
22
import CarouselHeroContent from "./carousel-hero-content";
33
export default {
44
name: "Hero slide",

packages/fast-components-react-msft/app/components/carousel-hero-content.schema.json

Lines changed: 0 additions & 67 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
export default {
2+
$schema: "http://json-schema.org/schema#",
3+
title: "Carousel Hero Content Test Element",
4+
description: "A carousel hero content component's schema definition.",
5+
id: "carousel-hero-content",
6+
type: "object",
7+
properties: {
8+
heading: {
9+
title: "Heading",
10+
type: "object",
11+
properties: {
12+
children: {
13+
title: "Heading text",
14+
type: "string",
15+
},
16+
},
17+
},
18+
paragraph: {
19+
title: "Paragraph",
20+
type: "object",
21+
properties: {
22+
children: {
23+
title: "Hero paragraph test text",
24+
type: "string",
25+
},
26+
},
27+
},
28+
callToAction: {
29+
title: "Call to action",
30+
type: "object",
31+
properties: {
32+
children: {
33+
title: "Call to action",
34+
type: "string",
35+
},
36+
href: {
37+
title: "HTML href attribute",
38+
type: "string",
39+
},
40+
appearance: {
41+
title: "Appearance",
42+
type: "string",
43+
default: "primary",
44+
enum: ["primary", "justified", "lightweight"],
45+
},
46+
},
47+
},
48+
image: {
49+
title: "Image",
50+
type: "object",
51+
properties: {
52+
src: {
53+
title: "HTML src attribute",
54+
type: "string",
55+
},
56+
alt: {
57+
title: "HTML alt attribute",
58+
type: "string",
59+
},
60+
},
61+
},
62+
},
63+
};

packages/fast-components-react-msft/app/components/carousel-light-image-content-child-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import CarouselLightImageContentSchema from "./carousel-light-image-content.schema.json";
1+
import CarouselLightImageContentSchema from "./carousel-light-image-content.schema";
22
import CarouselLightImageContent from "./carousel-light-image-content";
33
export default {
44
name: "Light image slide",

packages/fast-components-react-msft/app/components/carousel-light-image-content.schema.json

Lines changed: 0 additions & 23 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export default {
2+
$schema: "http://json-schema.org/schema#",
3+
title: "Carousel Light Image Content Test Element",
4+
description: "A carousel light image content component's schema definition.",
5+
id: "carousel-light-image-content",
6+
type: "object",
7+
properties: {
8+
image: {
9+
title: "Image",
10+
type: "object",
11+
properties: {
12+
src: {
13+
title: "HTML src attribute",
14+
type: "string",
15+
},
16+
alt: {
17+
title: "HTML alt attribute",
18+
type: "string",
19+
},
20+
},
21+
},
22+
},
23+
};

packages/fast-components-react-msft/app/components/pivot-item-content-child-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PivotItemContentSchema from "./pivot-item-content.schema.json";
1+
import PivotItemContentSchema from "./pivot-item-content.schema";
22
import PivotItemContent from "./pivot-item-content";
33
export default {
44
name: "Pivot item content",

packages/fast-components-react-msft/app/components/pivot-item-content.schema.json

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export default {
2+
$schema: "http://json-schema.org/schema#",
3+
title: "Pivot Item Content",
4+
description: "A pivot item content component's schema definition.",
5+
id: "pivot-item-content",
6+
type: "object",
7+
properties: {},
8+
reactProperties: {
9+
children: {
10+
title: "Children",
11+
type: "children",
12+
defaults: ["text"],
13+
},
14+
},
15+
};

packages/fast-components-react-msft/app/components/pivot-item-tab-child-options.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import PivotItemTabSchema from "./pivot-item-tab.schema.json";
1+
import PivotItemTabSchema from "./pivot-item-tab.schema";
22
import PivotItemTab from "./pivot-item-tab";
33
export default {
44
name: "Pivot item tab",

0 commit comments

Comments
 (0)