Skip to content

Commit de75579

Browse files
author
nickpape-msft
authored
Move schemafiles into web-build-tools (microsoft#75)
* Move schemafiles into web-build-tools * Changefile
1 parent a3fa081 commit de75579

19 files changed

Lines changed: 301 additions & 3 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"changes": [
3+
{
4+
"packageName": "@microsoft/gulp-core-build-webpack",
5+
"comment": "Introduce schema for WebpackTask",
6+
"type": "patch"
7+
},
8+
{
9+
"packageName": "@microsoft/gulp-core-build-typescript",
10+
"comment": "Introduce schema for TsLintTask, TypeScriptTask",
11+
"type": "patch"
12+
},
13+
{
14+
"packageName": "@microsoft/gulp-core-build-serve",
15+
"comment": "Introduce schema for ServeTask",
16+
"type": "patch"
17+
},
18+
{
19+
"packageName": "@microsoft/gulp-core-build-sass",
20+
"comment": "Introduce schema for SassTask",
21+
"type": "patch"
22+
},
23+
{
24+
"packageName": "@microsoft/gulp-core-build-karma",
25+
"comment": "Introduce schema for KarmaTask",
26+
"type": "patch"
27+
}
28+
],
29+
"email": "nickpape-msft@users.noreply.github.com"
30+
}

common/reviews/api/gulp-core-build-webpack.api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class WebpackTask extends GulpTask<IWebpackTaskConfig> {
1313
// (undocumented)
1414
public isEnabled(buildConfig: IBuildConfig): boolean;
1515
// (undocumented)
16+
protected loadSchema(): Object;
17+
// (undocumented)
1618
public name: string;
1719
// (undocumented)
1820
public readonly resources: Object;

common/reviews/api/node-library-build.api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ class TypeScriptTask extends GulpTask<ITypeScriptTaskConfig> {
189189
executeTask(gulp: gulpType.Gulp, completeCallback: (result?: string) => void): void;
190190
// (undocumented)
191191
getCleanMatch(buildConfig: IBuildConfig, taskConfig?: ITypeScriptTaskConfig): string[];
192+
// (undocumented)
193+
protected loadSchema(): Object;
192194
mergeConfig(config: ITypeScriptTaskConfig): void;
193195
// (undocumented)
194196
name: string;

common/reviews/api/web-library-build.api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ class TypeScriptTask extends GulpTask<ITypeScriptTaskConfig> {
197197
executeTask(gulp: gulpType.Gulp, completeCallback: (result?: string) => void): void;
198198
// (undocumented)
199199
getCleanMatch(buildConfig: IBuildConfig, taskConfig?: ITypeScriptTaskConfig): string[];
200+
// (undocumented)
201+
protected loadSchema(): Object;
200202
mergeConfig(config: ITypeScriptTaskConfig): void;
201203
// (undocumented)
202204
name: string;
@@ -222,6 +224,8 @@ class WebpackTask extends GulpTask<IWebpackTaskConfig> {
222224
// (undocumented)
223225
isEnabled(buildConfig: IBuildConfig): boolean;
224226
// (undocumented)
227+
protected loadSchema(): Object;
228+
// (undocumented)
225229
name: string;
226230
// (undocumented)
227231
resources: Object;

gulp-core-build-karma/src/KarmaTask.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ export class KarmaTask extends GulpTask<IKarmaTaskConfig> {
4545

4646
private _resources: Object;
4747

48+
public loadSchema(): Object {
49+
return require('./karma.schema.json');
50+
}
51+
4852
public getCleanMatch(buildConfig: IBuildConfig, taskConfig: IKarmaTaskConfig = this.taskConfig): string[] {
4953
return [
5054
path.join(buildConfig.tempFolder, 'tests.js')
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"title": "Karma Tester Task Configuration",
3+
"description": "Defines parameters for the Karma testing utility",
4+
5+
"type": "object",
6+
"additionalProperties": false,
7+
"properties": {
8+
"karmaConfigPath": {
9+
"title": "Path to the karma config file",
10+
"description": "Sets the path to the Karma Configuration file to use. If one has not been created, this task will prompt the user to run it again with the --initkarma flag.",
11+
"type": "string"
12+
}
13+
}
14+
}

gulp-core-build-sass/src/SassTask.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export class SassTask extends GulpTask<ISassTaskConfig> {
5656
'src/**/*.scss.ts'
5757
];
5858

59+
protected loadSchema(): Object {
60+
return require('./sass.schema.json');
61+
}
62+
5963
public executeTask(
6064
gulp: gulp.Gulp,
6165
completeCallback?: (result?: string) => void
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"title": "SASS Task Configuration",
3+
"description": "Defines configuration for the SASS compilation task",
4+
5+
"type": "object",
6+
"additionalProperties": false,
7+
"properties": {
8+
"preamble": {
9+
"title": "Preamble Text",
10+
"description": "An optional parameter for text to include in the generated typescript file.",
11+
"type": "string"
12+
},
13+
14+
"postamble": {
15+
"title": "Postamble Text",
16+
"description": "An optional parameter for text to include at the end of the generated typescript file.",
17+
"type": "string"
18+
},
19+
20+
"sassMatch": {
21+
"title": "Sass File Glob Pattern",
22+
"description": "An array of glob patterns for locating SASS files.",
23+
"type": "string"
24+
},
25+
26+
"useCSSModules": {
27+
"title": "Use CSS Modules",
28+
"description": "If this option is specified, files ending with .module.scss extension will automatically generate a corresponding TypeScript file. All classes will be appended with a hash to help ensure uniqueness on a page. This file can be imported directly, and will contain an object describing the mangled class names.",
29+
"type": "boolean"
30+
},
31+
32+
"dropCssFiles": {
33+
"title": "Create CSS Files",
34+
"description": "If true, we will generate a CSS in the lib folder. If false, the CSS is directly embedded into the TypeScript file",
35+
"type": "boolean"
36+
}
37+
}
38+
}

gulp-core-build-serve/src/ServeTask.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export class ServeTask extends GulpTask<IServeTaskConfig> {
8484
tryCreateDevCertificate: false
8585
};
8686

87+
protected loadSchema(): Object {
88+
return require('./serve.schema.json');
89+
}
90+
8791
public executeTask(gulp: gulp.Gulp, completeCallback?: (error?: string) => void): void {
8892
/* tslint:disable:typedef */
8993
const gulpConnect = require('gulp-connect');
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"title": "Serve Task Configuration",
3+
"description": "Defines parameters for the webserver which is spun up by the Serve Task",
4+
5+
"type": "object",
6+
"additionalProperties": false,
7+
"properties": {
8+
"api": {
9+
"title": "API server configuration",
10+
"description": "Parameters which configure the API server, which runs simultaneously and allows for mock testing",
11+
12+
"type": "object",
13+
"additionalProperties": false,
14+
"required": [ "port", "entryPath" ],
15+
"properties": {
16+
"port": {
17+
"title": "API Port",
18+
"description": "The port which the API server listens on",
19+
"type": "number"
20+
},
21+
"entryPath": {
22+
"title": "API Entry Point Path",
23+
"description": "The path to the script to run as the API server",
24+
"type": "string"
25+
}
26+
}
27+
},
28+
29+
"initialPage": {
30+
"title": "Initial Page",
31+
"description": "The path to the page which should open automatically after this task completes",
32+
"type": "string"
33+
},
34+
35+
"port": {
36+
"title": "Port",
37+
"description": "The port on which to host the file server.",
38+
"type": "number"
39+
},
40+
41+
"https": {
42+
"title": "HTTPS Mode",
43+
"description": "If true, the server should run on HTTPS",
44+
"type": "boolean"
45+
},
46+
47+
"keyPath": {
48+
"title": "HTTPS Key Path",
49+
"description": "Path to the HTTPS key",
50+
"type": "string"
51+
},
52+
53+
"certPath": {
54+
"title": "HTTPS Cert Path",
55+
"description": "Path to the HTTPS cert",
56+
"type": "string"
57+
},
58+
59+
"pfxPath": {
60+
"title": "HTTPS PFX Path",
61+
"description": "Path to the HTTPS PFX cert",
62+
"type": "string"
63+
},
64+
65+
"tryCreateDevCertificate": {
66+
"title": "Should Create Dev Certificate",
67+
"description": "If true, when gulp-core-build-serve is initialized and a dev certificate doesn't already exist and hasn't been specified, attempt to generate one and trust it automatically.",
68+
"type": "boolean"
69+
}
70+
}
71+
}

0 commit comments

Comments
 (0)