UNPKG

1.49 kBPlain TextView Raw
1/**
2 * Export the Infrastructure Types that we support
3 * Each type may have certain characteristics within infrastructure-components
4 */
5export default {
6 /**
7 * The configuration is the top-level component of any infrastructure-components configuration
8 * configurations define the Plugins supported in the configuration
9 */
10 INFRASTRUCTURE_TYPE_CONFIGURATION: "INFRASTRUCTURE_TYPE_CONFIGURATION",
11
12 /**
13 * a client produces a webpack configuration, e.g. a webapp or an API endpoint
14 */
15 INFRASTRUCTURE_TYPE_CLIENT: "INFRASTRUCTURE_TYPE_CLIENT",
16
17 /**
18 * A component has no special characteristics
19 * what they do is completely up to their plugins
20 */
21 INFRASTRUCTURE_TYPE_COMPONENT: "INFRASTRUCTURE_TYPE_COMPONENT"
22};
23
24/**
25 * Any Infrastructure-Component must implement this interface
26 *
27 * it can run in webpack-hot-middleware-mode
28 * TODO extend respectively
29 */
30export interface IInfrastructure {
31
32 /**
33 * an infrastructure-component must have a type, see the default export for available types
34 * e.g.`Types.INFRASTRUCTURE_TYPE_CLIENT`
35 */
36 infrastructureType: string,
37
38 /**
39 * a unique identifier of the instance that allows finding it
40 * CAUTION: this id must be the same even though it may be processed at different times!!
41 */
42 instanceId: string,
43
44 /**
45 * a string that identifies the specific type of infrastructure, e.g. Middleware, Route, etc.
46 */
47 instanceType: string,
48}
\No newline at end of file