-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
129 additions
and
119 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
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
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,17 @@ | ||
import { REPORTER_PLUGIN_TYPE } from '../../report/reporters/plugin.js' | ||
import { RUNNER_PLUGIN_TYPE } from '../../runners/plugin.js' | ||
|
||
// All plugin types | ||
export const PLUGIN_TYPES = { | ||
[RUNNER_PLUGIN_TYPE.type]: RUNNER_PLUGIN_TYPE, | ||
[REPORTER_PLUGIN_TYPE.type]: REPORTER_PLUGIN_TYPE, | ||
} | ||
|
||
export const PLUGIN_TYPES_ARRAY = Object.values(PLUGIN_TYPES) | ||
|
||
// Shared configurations are plugins when using the npm resolver. | ||
// They are handled differently, i.e. require a separate type. | ||
export const CONFIG_PLUGIN_TYPE = { | ||
type: 'config', | ||
modulePrefix: 'spyd-config-', | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,64 @@ | ||
import { normalizeOptionalArray } from '../../config/normalize/transform.js' | ||
import { | ||
validateBoolean, | ||
validateDefinedString, | ||
validateObject, | ||
validateFunction, | ||
} from '../../config/normalize/validate.js' | ||
import { DEFAULT_REPORTER_OUTPUT } from '../contents/output.js' | ||
import { getReportMethods } from '../formats/list.js' | ||
|
||
import { BUILTIN_REPORTERS, DEFAULT_REPORTERS } from './main.js' | ||
|
||
export const REPORTER_PLUGIN_TYPE = { | ||
type: 'reporter', | ||
varName: 'reporters', | ||
selectProp: 'reporter', | ||
configProp: 'reporterConfig', | ||
topProps: [ | ||
'quiet', | ||
'output', | ||
'colors', | ||
'showTitles', | ||
'showSystem', | ||
'showMetadata', | ||
'showPrecision', | ||
'showDiff', | ||
], | ||
modulePrefix: 'spyd-reporter-', | ||
commands: ['remove', 'run', 'show'], | ||
isCombinationDimension: false, | ||
builtins: BUILTIN_REPORTERS, | ||
selectPropDefault: DEFAULT_REPORTERS, | ||
selectPropDefinition: { | ||
transform(value, { config }) { | ||
return config.force ? [] : normalizeOptionalArray(value) | ||
}, | ||
}, | ||
mainDefinitions: [ | ||
...getReportMethods().map((name) => ({ | ||
name, | ||
validate: validateFunction, | ||
})), | ||
{ | ||
name: 'capabilities', | ||
default: {}, | ||
validate: validateObject, | ||
}, | ||
{ | ||
name: 'capabilities.debugStats', | ||
default: false, | ||
validate: validateBoolean, | ||
}, | ||
{ | ||
name: 'capabilities.history', | ||
default: false, | ||
validate: validateBoolean, | ||
}, | ||
{ | ||
name: 'defaultOutput', | ||
default: DEFAULT_REPORTER_OUTPUT, | ||
validate: validateDefinedString, | ||
}, | ||
], | ||
} |
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,42 @@ | ||
import { | ||
validateEmptyArray, | ||
validateFunction, | ||
} from '../config/normalize/validate.js' | ||
|
||
import { BUILTIN_RUNNERS, DEFAULT_RUNNERS } from './main.js' | ||
|
||
export const RUNNER_PLUGIN_TYPE = { | ||
// Shown in error message | ||
type: 'runner', | ||
// Internal variable name | ||
varName: 'runners', | ||
// Configuration property selecting the plugin | ||
selectProp: 'runner', | ||
// Configuration property configuring the plugin | ||
configProp: 'runnerConfig', | ||
// Configuration properties which can be overridden by each plugin | ||
topProps: ['tasks'], | ||
// Prefix of the npm package | ||
modulePrefix: 'spyd-runner-', | ||
// Commands which use the plugin | ||
commands: ['dev', 'run'], | ||
// Whether this is a combination's dimension. | ||
// When false, this allows using custom prefixes. | ||
isCombinationDimension: true, | ||
// Builtin plugins | ||
builtins: BUILTIN_RUNNERS, | ||
// Default value for the `selectProp` | ||
selectPropDefault: DEFAULT_RUNNERS, | ||
// Additional configuration definition for `selectProp` | ||
selectPropDefinition: { | ||
validate: validateEmptyArray, | ||
}, | ||
// Configuration definition for the plugin itself | ||
mainDefinitions: [ | ||
{ | ||
name: 'launch', | ||
required: true, | ||
validate: validateFunction, | ||
}, | ||
], | ||
} |