Skip to content

Commit

Permalink
Move file
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 30, 2022
1 parent 4c903e0 commit a5dbec1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/config/load/npx.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { env } from 'process'

import { CONFIG_PLUGIN_TYPE } from '../plugin/types.js'
import { CONFIG_PLUGIN_TYPE } from '../plugin/types/config.js'

// In principle, users can use `npx` with the "npm" resolver by doing:
// npx --package=spyd-config-{name} spyd --config=spyd-config-{name} ...
Expand Down
2 changes: 1 addition & 1 deletion src/config/load/resolvers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { UserError } from '../../error/main.js'
import { getPluginPath } from '../plugin/load.js'
import { CONFIG_PLUGIN_TYPE } from '../plugin/types.js'
import { CONFIG_PLUGIN_TYPE } from '../plugin/types/config.js'

// The `config` can be:
// - a file path
Expand Down
2 changes: 1 addition & 1 deletion src/config/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { findUp } from 'find-up'
import pLocate from 'p-locate'
import { pathExists } from 'path-exists'

import { CONFIG_PLUGIN_TYPE } from './plugin/types.js'
import { CONFIG_PLUGIN_TYPE } from './plugin/types/config.js'

// The default values for `config` and `tasks` look for `spyd.*` and `tasks.*`
// in the current or parent directories.
Expand Down
2 changes: 1 addition & 1 deletion src/config/merge/tasks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PLUGIN_TYPES } from '../plugin/types.js'
import { PLUGIN_TYPES } from '../plugin/types/main.js'

// Custom merging logic for tasks.
// `tasks` or `runnnerConfig.{runnerId}.tasks` are concatenated, not overridden
Expand Down
2 changes: 1 addition & 1 deletion src/config/plugin/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { normalizeReporters } from '../../report/config/main.js'

import { addPluginsConfig } from './config.js'
import { loadPlugins } from './load.js'
import { PLUGIN_TYPES_ARRAY } from './types.js'
import { PLUGIN_TYPES_ARRAY } from './types/main.js'

// Several configuration properties (`runner`, `reporter`)
// can be customized with custom modules. This loads them. Each type can specify
Expand Down
2 changes: 1 addition & 1 deletion src/config/plugin/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
validateJson,
} from '../normalize/validate.js'

import { PLUGIN_TYPES_ARRAY } from './types.js'
import { PLUGIN_TYPES_ARRAY } from './types/main.js'

// Retrieve the definition for plugins, both the selection property
// (like `reporter`) and the configuration one (like `reporterConfig`).
Expand Down
6 changes: 6 additions & 0 deletions src/config/plugin/types/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// 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-',
}
19 changes: 6 additions & 13 deletions src/config/plugin/types.js → src/config/plugin/types/main.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { DEFAULT_REPORTER_OUTPUT } from '../../report/contents/output.js'
import { getReportMethods } from '../../report/formats/list.js'
import { DEFAULT_REPORTER_OUTPUT } from '../../../report/contents/output.js'
import { getReportMethods } from '../../../report/formats/list.js'
import {
BUILTIN_REPORTERS,
DEFAULT_REPORTERS,
} from '../../report/reporters/main.js'
import { BUILTIN_RUNNERS, DEFAULT_RUNNERS } from '../../runners/main.js'
import { normalizeOptionalArray } from '../normalize/transform.js'
} from '../../../report/reporters/main.js'
import { BUILTIN_RUNNERS, DEFAULT_RUNNERS } from '../../../runners/main.js'
import { normalizeOptionalArray } from '../../normalize/transform.js'
import {
validateBoolean,
validateDefinedString,
validateObject,
validateEmptyArray,
validateFunction,
} from '../normalize/validate.js'
} from '../../normalize/validate.js'

// All plugin types
export const PLUGIN_TYPES = {
Expand Down Expand Up @@ -105,10 +105,3 @@ export const PLUGIN_TYPES = {
}

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-',
}

0 comments on commit a5dbec1

Please sign in to comment.