Skip to content

Commit

Permalink
Merge pull request #13296 from bolariin/issue-13284
Browse files Browse the repository at this point in the history
fix: resolve mismatch with types declaration and docs for resourceQuery
  • Loading branch information
sokra committed May 19, 2021
2 parents 08090a9 + e570628 commit ca2b56f
Show file tree
Hide file tree
Showing 8 changed files with 414 additions and 302 deletions.
64 changes: 36 additions & 28 deletions declarations/WebpackOptions.d.ts
Expand Up @@ -240,21 +240,8 @@ export type RuleSetConditionOrConditions = RuleSetCondition | RuleSetConditions;
export type RuleSetCondition =
| RegExp
| string
| {
/**
* Logical AND.
*/
and?: RuleSetConditions;
/**
* Logical NOT.
*/
not?: RuleSetConditions;
/**
* Logical OR.
*/
or?: RuleSetConditions;
}
| ((value: string) => boolean)
| RuleSetLogicalConditions
| RuleSetConditions;
/**
* A list of rule conditions.
Expand All @@ -272,21 +259,8 @@ export type RuleSetConditionOrConditionsAbsolute =
export type RuleSetConditionAbsolute =
| RegExp
| string
| {
/**
* Logical AND.
*/
and?: RuleSetConditionsAbsolute;
/**
* Logical NOT.
*/
not?: RuleSetConditionsAbsolute;
/**
* Logical OR.
*/
or?: RuleSetConditionsAbsolute;
}
| ((value: string) => boolean)
| RuleSetLogicalConditionsAbsolute
| RuleSetConditionsAbsolute;
/**
* A list of rule conditions matching an absolute path.
Expand Down Expand Up @@ -1438,6 +1412,40 @@ export interface RuleSetRule {
*/
use?: RuleSetUse;
}
/**
* Logic operators used in a condition matcher.
*/
export interface RuleSetLogicalConditions {
/**
* Logical AND.
*/
and?: RuleSetConditions;
/**
* Logical NOT.
*/
not?: RuleSetCondition;
/**
* Logical OR.
*/
or?: RuleSetConditions;
}
/**
* Logic operators used in a condition matcher.
*/
export interface RuleSetLogicalConditionsAbsolute {
/**
* Logical AND.
*/
and?: RuleSetConditionsAbsolute;
/**
* Logical NOT.
*/
not?: RuleSetConditionAbsolute;
/**
* Logical OR.
*/
or?: RuleSetConditionsAbsolute;
}
/**
* Options object for resolving requests.
*/
Expand Down
2 changes: 1 addition & 1 deletion schemas/WebpackOptions.check.js

Large diffs are not rendered by default.

128 changes: 68 additions & 60 deletions schemas/WebpackOptions.json
Expand Up @@ -3391,40 +3391,13 @@
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"and": {
"description": "Logical AND.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
}
]
},
"not": {
"description": "Logical NOT.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
}
]
},
"or": {
"description": "Logical OR.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
}
]
}
}
},
{
"instanceof": "Function",
"tsType": "((value: string) => boolean)"
},
{
"$ref": "#/definitions/RuleSetLogicalConditions"
},
{
"$ref": "#/definitions/RuleSetConditions"
}
Expand All @@ -3444,40 +3417,13 @@
"type": "string",
"absolutePath": true
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"and": {
"description": "Logical AND.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
]
},
"not": {
"description": "Logical NOT.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
]
},
"or": {
"description": "Logical OR.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
]
}
}
},
{
"instanceof": "Function",
"tsType": "((value: string) => boolean)"
},
{
"$ref": "#/definitions/RuleSetLogicalConditionsAbsolute"
},
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
Expand Down Expand Up @@ -3551,6 +3497,68 @@
}
]
},
"RuleSetLogicalConditions": {
"description": "Logic operators used in a condition matcher.",
"type": "object",
"additionalProperties": false,
"properties": {
"and": {
"description": "Logical AND.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
}
]
},
"not": {
"description": "Logical NOT.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetCondition"
}
]
},
"or": {
"description": "Logical OR.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditions"
}
]
}
}
},
"RuleSetLogicalConditionsAbsolute": {
"description": "Logic operators used in a condition matcher.",
"type": "object",
"additionalProperties": false,
"properties": {
"and": {
"description": "Logical AND.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
]
},
"not": {
"description": "Logical NOT.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionAbsolute"
}
]
},
"or": {
"description": "Logical OR.",
"oneOf": [
{
"$ref": "#/definitions/RuleSetConditionsAbsolute"
}
]
}
}
},
"RuleSetRule": {
"description": "A rule description with conditions and effects for modules.",
"type": "object",
Expand Down

0 comments on commit ca2b56f

Please sign in to comment.