-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathtypings.ts
More file actions
138 lines (117 loc) · 2.6 KB
/
typings.ts
File metadata and controls
138 lines (117 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
export interface NpmPackage {
/**
* Package dependencies to run in production.
*/
dependencies?: Record<string, string>;
/**
* Package dependencies to run in development.
*/
devDependencies?: Record<string, string>;
/**
* Lowercase name of the project.
*/
name: string;
/**
* `npm run`-capable scripts in the project.
*/
scripts: Record<string, string>;
}
/**
* Schema for package.json contents.
*/
export interface ShenanigansPackage extends NpmPackage {
/**
* Shenanigans-specific settings for the project.
*/
shenanigans: ShenanigansSchema;
[i: string]: string | Record<string, string> | ShenanigansSchema | undefined;
}
/**
* Settings for a shenanigans project.
*/
export interface ShenanigansSchema {
/**
* Whether to include a webpack-bundled dist/ directory.
*/
dist?: boolean;
/**
* Whether this is an example project located in the EightBittr monorepo.
*/
example?: boolean;
/**
* Whether to include dependencies to instantiate a EightBittr game.
*/
game?: boolean;
/**
* Whether this is a shenanigans project outside of the EightBittr monorepo.
*/
external?: boolean;
/**
* Customizations around loading the package in browser code.
*/
loading?: PackageLoading;
/**
* PascalCase name of the project.
*/
name: string;
/**
* Whether to set the package up with an index.html file.
*/
web?: boolean;
}
/**
* Customizations around loading the package in browser code.
*/
export interface PackageLoading {
/**
* Additional webpack entry points.
*/
entries?: Entry[];
/**
* Any external script dependencies.
*/
externals?: External[];
}
/**
* Additional webpack entry point in a shenanigans schema.
*/
export interface Entry {
/**
* Entry file point for webpack.
*/
entry: string;
/**
* Friendly name of the entry point.
*/
name: string;
/**
* Dependencies the generated bundle requires.
*/
sources: string[];
}
/**
* Description of an external dependency.
*/
export interface External {
/**
* Scripts the dependency needs to bring in.
*/
js: ExternalScripts;
/**
* Package name of the dependency.
*/
name: string;
}
/**
* Scripts a dependency needs to brig in.
*/
export interface ExternalScripts {
/**
* Development version of the script.
*/
dev: string;
/**
* Production version of the script, if used in production.
*/
prod?: string;
}