-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗 add
amp check-json-schemas
task to validate JSON files in PRs (#3…
…6350) Co-authored-by: Raghu Simha <rsimha@amp.dev>
- Loading branch information
1 parent
7fb31fe
commit f57e57f
Showing
14 changed files
with
405 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "@ampproject/filesize JSON config", | ||
"type": "object", | ||
"patternProperties": { | ||
"^dist.+$": { | ||
"type": "object", | ||
"required": [ | ||
"approvers", | ||
"threshold" | ||
], | ||
"properties": { | ||
"approvers": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"minItems": 1, | ||
"items": { | ||
"type": "string", | ||
"pattern": "^ampproject/wg-[\\w_-]+$" | ||
} | ||
}, | ||
"threshold": { | ||
"type": "number", | ||
"exclusiveMinimum": 0 | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "AMP_CONFIG for canary/prod configurations", | ||
"type": "object", | ||
"required": [ | ||
"allow-doc-opt-in", | ||
"allow-url-opt-in", | ||
"canary" | ||
], | ||
"properties": { | ||
"allow-doc-opt-in": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[\\w-]+$" | ||
} | ||
}, | ||
"allow-url-opt-in": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[\\w-]+$" | ||
} | ||
}, | ||
"canary": { | ||
"type": "number", | ||
"enum": [ | ||
0, | ||
1 | ||
] | ||
} | ||
}, | ||
"patternProperties": { | ||
"^(?!allow-doc-opt-in|allow-url-opt-in|canary)[\\w-]+$": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "List of known AMP caches", | ||
"type": "object", | ||
"required": [ | ||
"caches" | ||
], | ||
"properties": { | ||
"caches": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"name", | ||
"docs", | ||
"cacheDomain", | ||
"updateCacheApiDomainSuffix", | ||
"thirdPartyFrameDomainSuffix" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"pattern": "^[a-z0-9]+$" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"docs": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"cacheDomain": { | ||
"type": "string" | ||
}, | ||
"updateCacheApiDomainSuffix": { | ||
"type": "string" | ||
}, | ||
"thirdPartyFrameDomainSuffix": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
39 changes: 39 additions & 0 deletions
39
build-system/json-schemas/client-side-experiments-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "Client-side (AMP_EXP) experiment definitions", | ||
"type": "object", | ||
"required": [ | ||
"experiments" | ||
], | ||
"properties": { | ||
"experiments": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"required": [ | ||
"name", | ||
"percentage" | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"pattern": "^[A-Za-z][\\w-]*$" | ||
}, | ||
"percentage": { | ||
"type": "number", | ||
"minimum": 0, | ||
"maximum": 1 | ||
}, | ||
"rtvPrefixes": { | ||
"type": "array", | ||
"items": { | ||
"type": "string", | ||
"pattern": "^[\\d\\.]+$" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"description": "@ampproject/filesize JSON config", | ||
"type": "object", | ||
"required": [ | ||
"filesize" | ||
], | ||
"properties": { | ||
"filesize": { | ||
"type": "object", | ||
"required": [ | ||
"track" | ||
], | ||
"properties": { | ||
"track": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
"trackFormat": { | ||
"type": "array", | ||
"uniqueItems": true, | ||
"items": { | ||
"type": "string", | ||
"enum": [ | ||
"brotli", | ||
"gzip", | ||
"none" | ||
] | ||
} | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
}, | ||
"additionalProperties": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.