@dotcom-tool-kit/config 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +60 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +2 -0
- package/package.json +18 -0
- package/src/index.ts +51 -0
- package/tsconfig.json +15 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Validated } from '@dotcom-tool-kit/validated';
|
|
2
|
+
import type { CommandTask, EntryPoint, Plugin, OptionsForPlugin, OptionsForTask } from '@dotcom-tool-kit/plugin';
|
|
3
|
+
import type { PluginOptions } from '@dotcom-tool-kit/schemas';
|
|
4
|
+
import type { Conflict } from '@dotcom-tool-kit/conflict';
|
|
5
|
+
export interface RawConfig {
|
|
6
|
+
root: string;
|
|
7
|
+
plugins: {
|
|
8
|
+
[id: string]: Validated<Plugin>;
|
|
9
|
+
};
|
|
10
|
+
resolutionTrackers: {
|
|
11
|
+
resolvedPluginOptions: Set<string>;
|
|
12
|
+
substitutedPlugins: Set<string>;
|
|
13
|
+
resolvedPlugins: Set<string>;
|
|
14
|
+
reducedInstallationPlugins: Set<string>;
|
|
15
|
+
};
|
|
16
|
+
tasks: {
|
|
17
|
+
[id: string]: EntryPoint | Conflict<EntryPoint>;
|
|
18
|
+
};
|
|
19
|
+
commandTasks: {
|
|
20
|
+
[id: string]: CommandTask | Conflict<CommandTask>;
|
|
21
|
+
};
|
|
22
|
+
pluginOptions: {
|
|
23
|
+
[id: string]: OptionsForPlugin | Conflict<OptionsForPlugin> | undefined;
|
|
24
|
+
};
|
|
25
|
+
taskOptions: {
|
|
26
|
+
[id: string]: OptionsForTask | Conflict<OptionsForTask> | undefined;
|
|
27
|
+
};
|
|
28
|
+
hooks: {
|
|
29
|
+
[id: string]: EntryPoint | Conflict<EntryPoint>;
|
|
30
|
+
};
|
|
31
|
+
inits: EntryPoint[];
|
|
32
|
+
hookManagedFiles: Set<string>;
|
|
33
|
+
}
|
|
34
|
+
export type ValidPluginsConfig = Omit<RawConfig, 'plugins'> & {
|
|
35
|
+
plugins: {
|
|
36
|
+
[id: string]: Plugin;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type ValidOptionsForPlugin<Id extends keyof PluginOptions> = Omit<OptionsForPlugin, 'options'> & {
|
|
40
|
+
options: PluginOptions[Id];
|
|
41
|
+
};
|
|
42
|
+
export type ValidPluginOptions = {
|
|
43
|
+
[Id in keyof PluginOptions]: ValidOptionsForPlugin<Id>;
|
|
44
|
+
};
|
|
45
|
+
export type ValidConfig = Omit<ValidPluginsConfig, 'tasks' | 'commandTasks' | 'pluginOptions' | 'taskOptions' | 'hooks'> & {
|
|
46
|
+
tasks: {
|
|
47
|
+
[id: string]: EntryPoint;
|
|
48
|
+
};
|
|
49
|
+
commandTasks: {
|
|
50
|
+
[id: string]: CommandTask;
|
|
51
|
+
};
|
|
52
|
+
pluginOptions: ValidPluginOptions;
|
|
53
|
+
taskOptions: {
|
|
54
|
+
[id: string]: OptionsForTask;
|
|
55
|
+
};
|
|
56
|
+
hooks: {
|
|
57
|
+
[id: string]: EntryPoint;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAEzD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAA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,gBAAgB,EAAE,SAAS,CAAC,GAAG;IACtG,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;KAC9B,EAAE,IAAI,MAAM,aAAa,GAAG,qBAAqB,CAAC,EAAE,CAAC;CACvD,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,kBAAkB,EAClB,OAAO,GAAG,cAAc,GAAG,eAAe,GAAG,aAAa,GAAG,OAAO,CACrE,GAAG;IACF,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAA;IACnC,YAAY,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,CAAA;KAAE,CAAA;IAC3C,aAAa,EAAE,kBAAkB,CAAA;IACjC,WAAW,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAA;IAC7C,KAAK,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,CAAA;KAAE,CAAA;CACpC,CAAA"}
|
package/lib/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dotcom-tool-kit/config",
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "lib",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"keywords": [],
|
|
10
|
+
"author": "",
|
|
11
|
+
"license": "ISC",
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@dotcom-tool-kit/conflict": "2.0.0-beta.0",
|
|
14
|
+
"@dotcom-tool-kit/plugin": "2.0.0-beta.0",
|
|
15
|
+
"@dotcom-tool-kit/schemas": "2.0.0-beta.0",
|
|
16
|
+
"@dotcom-tool-kit/validated": "2.0.0-beta.0"
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Validated } from '@dotcom-tool-kit/validated'
|
|
2
|
+
import type {
|
|
3
|
+
CommandTask,
|
|
4
|
+
EntryPoint,
|
|
5
|
+
Plugin,
|
|
6
|
+
OptionsForPlugin,
|
|
7
|
+
OptionsForTask
|
|
8
|
+
} from '@dotcom-tool-kit/plugin'
|
|
9
|
+
import type { PluginOptions } from '@dotcom-tool-kit/schemas'
|
|
10
|
+
import type { Conflict } from '@dotcom-tool-kit/conflict'
|
|
11
|
+
|
|
12
|
+
export interface RawConfig {
|
|
13
|
+
root: string
|
|
14
|
+
plugins: { [id: string]: Validated<Plugin> }
|
|
15
|
+
resolutionTrackers: {
|
|
16
|
+
resolvedPluginOptions: Set<string>
|
|
17
|
+
substitutedPlugins: Set<string>
|
|
18
|
+
resolvedPlugins: Set<string>
|
|
19
|
+
reducedInstallationPlugins: Set<string>
|
|
20
|
+
}
|
|
21
|
+
tasks: { [id: string]: EntryPoint | Conflict<EntryPoint> }
|
|
22
|
+
commandTasks: { [id: string]: CommandTask | Conflict<CommandTask> }
|
|
23
|
+
pluginOptions: { [id: string]: OptionsForPlugin | Conflict<OptionsForPlugin> | undefined }
|
|
24
|
+
taskOptions: { [id: string]: OptionsForTask | Conflict<OptionsForTask> | undefined }
|
|
25
|
+
hooks: { [id: string]: EntryPoint | Conflict<EntryPoint> }
|
|
26
|
+
inits: EntryPoint[]
|
|
27
|
+
hookManagedFiles: Set<string>
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type ValidPluginsConfig = Omit<RawConfig, 'plugins'> & {
|
|
31
|
+
plugins: { [id: string]: Plugin }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type ValidOptionsForPlugin<Id extends keyof PluginOptions> = Omit<OptionsForPlugin, 'options'> & {
|
|
35
|
+
options: PluginOptions[Id]
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type ValidPluginOptions = {
|
|
39
|
+
[Id in keyof PluginOptions]: ValidOptionsForPlugin<Id>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type ValidConfig = Omit<
|
|
43
|
+
ValidPluginsConfig,
|
|
44
|
+
'tasks' | 'commandTasks' | 'pluginOptions' | 'taskOptions' | 'hooks'
|
|
45
|
+
> & {
|
|
46
|
+
tasks: { [id: string]: EntryPoint }
|
|
47
|
+
commandTasks: { [id: string]: CommandTask }
|
|
48
|
+
pluginOptions: ValidPluginOptions
|
|
49
|
+
taskOptions: { [id: string]: OptionsForTask }
|
|
50
|
+
hooks: { [id: string]: EntryPoint }
|
|
51
|
+
}
|