@studiokloek/vite-config 0.13.1 → 0.14.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/README.md +114 -9
- package/bin/assets.js +8 -0
- package/bin/build.js +6 -61
- package/bin/development.js +6 -23
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +64 -0
- package/dist/commands-ujEjJD4C.js +862 -0
- package/dist/index.d.ts +207 -45
- package/dist/index.js +2 -732
- package/package.json +69 -85
- package/dist/config.d.ts +0 -2
- package/dist/plugins/base.d.ts +0 -3
- package/dist/plugins/build.d.ts +0 -3
- package/dist/plugins/lib/handlebars/context.d.ts +0 -2
- package/dist/plugins/lib/handlebars/handlebars-plugin.d.ts +0 -3
- package/dist/plugins/lib/handlebars/partials.d.ts +0 -4
- package/dist/plugins/lib/html-plugin.d.ts +0 -3
- package/dist/plugins/lib/image-plugin.d.ts +0 -3
- package/dist/plugins/lib/manifest-plugin.d.ts +0 -3
- package/dist/plugins/serve.d.ts +0 -6
- package/dist/public.d.ts +0 -49
- package/dist/utils/build.d.ts +0 -3
- package/dist/utils/cwd.d.ts +0 -1
- package/dist/utils/game.d.ts +0 -5
- package/dist/utils/hash.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/interfaces.d.ts +0 -77
- package/dist/utils/json.d.ts +0 -1
- package/dist/utils/pkg.d.ts +0 -2
- package/dist/utils/zip.d.ts +0 -1
- /package/{dist/partials → partials}/development.hbs +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,45 +1,207 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
1
|
+
import { BuildOptions, ConfigEnv, LogLevel, UserConfig } from "vite";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/commands.d.ts
|
|
4
|
+
interface KloekDevelopmentOptions {
|
|
5
|
+
mode?: string;
|
|
6
|
+
/** Projectmap; standaard de huidige map. */
|
|
7
|
+
cwd?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Een optie die niet opgegeven is (`undefined`) laat de waarde uit package.json staan. */
|
|
10
|
+
interface KloekBuildOptions {
|
|
11
|
+
base?: string;
|
|
12
|
+
mode?: string;
|
|
13
|
+
logLevel?: LogLevel;
|
|
14
|
+
emptyOutDir?: boolean;
|
|
15
|
+
sourcemaps?: boolean;
|
|
16
|
+
inlineSourcemaps?: boolean;
|
|
17
|
+
createZip?: boolean;
|
|
18
|
+
/** Projectmap; standaard de huidige map. */
|
|
19
|
+
cwd?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function kloekDevelopment(options?: KloekDevelopmentOptions): Promise<void>;
|
|
22
|
+
export declare function kloekBuild(options?: KloekBuildOptions): Promise<void>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/config/schema.d.ts
|
|
25
|
+
/**
|
|
26
|
+
* De game-secties zijn vrije template-data voor handlebars en de manifest; alleen de velden die
|
|
27
|
+
* vite-config zelf gebruikt, krijgen een type. Andere velden blijven gewoon behouden.
|
|
28
|
+
*/
|
|
29
|
+
declare const gameSettingsSchema: z.ZodObject<{
|
|
30
|
+
info: z.ZodPrefault<z.ZodObject<{
|
|
31
|
+
id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
page: z.ZodOptional<z.ZodString>;
|
|
33
|
+
version: z.ZodOptional<z.ZodString>;
|
|
34
|
+
client: z.ZodOptional<z.ZodString>;
|
|
35
|
+
year: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
36
|
+
}, z.core.$loose>>;
|
|
37
|
+
meta: z.ZodPrefault<z.ZodObject<{
|
|
38
|
+
title: z.ZodOptional<z.ZodString>;
|
|
39
|
+
description: z.ZodOptional<z.ZodString>;
|
|
40
|
+
apptitle: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$loose>>;
|
|
42
|
+
options: z.ZodPrefault<z.ZodObject<{
|
|
43
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
44
|
+
orientation: z.ZodOptional<z.ZodString>;
|
|
45
|
+
fullscreen: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$loose>>;
|
|
47
|
+
}, z.core.$loose>;
|
|
48
|
+
declare const imageQualitySchema: z.ZodObject<{
|
|
49
|
+
jpeg: z.ZodDefault<z.ZodNumber>;
|
|
50
|
+
png: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
declare const buildSchema: z.ZodObject<{
|
|
53
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
54
|
+
legacy: z.ZodDefault<z.ZodBoolean>;
|
|
55
|
+
imageQuality: z.ZodPrefault<z.ZodObject<{
|
|
56
|
+
jpeg: z.ZodDefault<z.ZodNumber>;
|
|
57
|
+
png: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
imageExclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
60
|
+
manifest: z.ZodDefault<z.ZodBoolean>;
|
|
61
|
+
analyzeBundle: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
sourceMaps: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
63
|
+
hidden: "hidden";
|
|
64
|
+
inline: "inline";
|
|
65
|
+
}>]>>;
|
|
66
|
+
createZip: z.ZodDefault<z.ZodBoolean>;
|
|
67
|
+
cleanPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
68
|
+
}, z.core.$strict>;
|
|
69
|
+
/** `package.json#vite`. Onbekende keys zijn een fout, zodat een typefout niet stil genegeerd wordt. */
|
|
70
|
+
declare const viteSchema: z.ZodObject<{
|
|
71
|
+
dev: z.ZodPrefault<z.ZodObject<{
|
|
72
|
+
serveParams: z.ZodDefault<z.ZodString>;
|
|
73
|
+
fullReloadSvelte: z.ZodDefault<z.ZodBoolean>;
|
|
74
|
+
cors: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
https: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
}, z.core.$strict>>;
|
|
77
|
+
build: z.ZodPrefault<z.ZodObject<{
|
|
78
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
79
|
+
legacy: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
imageQuality: z.ZodPrefault<z.ZodObject<{
|
|
81
|
+
jpeg: z.ZodDefault<z.ZodNumber>;
|
|
82
|
+
png: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
83
|
+
}, z.core.$strict>>;
|
|
84
|
+
imageExclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
85
|
+
manifest: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
analyzeBundle: z.ZodDefault<z.ZodBoolean>;
|
|
87
|
+
sourceMaps: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
88
|
+
hidden: "hidden";
|
|
89
|
+
inline: "inline";
|
|
90
|
+
}>]>>;
|
|
91
|
+
createZip: z.ZodDefault<z.ZodBoolean>;
|
|
92
|
+
cleanPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
93
|
+
}, z.core.$strict>>;
|
|
94
|
+
dedupe: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
/** De delen van `package.json` die vite-config leest; de rest van het bestand blijft buiten beschouwing. */
|
|
97
|
+
declare const packageSchema: z.ZodObject<{
|
|
98
|
+
name: z.ZodDefault<z.ZodString>;
|
|
99
|
+
version: z.ZodDefault<z.ZodString>;
|
|
100
|
+
description: z.ZodDefault<z.ZodString>;
|
|
101
|
+
browserslist: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
102
|
+
vite: z.ZodPrefault<z.ZodObject<{
|
|
103
|
+
dev: z.ZodPrefault<z.ZodObject<{
|
|
104
|
+
serveParams: z.ZodDefault<z.ZodString>;
|
|
105
|
+
fullReloadSvelte: z.ZodDefault<z.ZodBoolean>;
|
|
106
|
+
cors: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
+
https: z.ZodDefault<z.ZodBoolean>;
|
|
108
|
+
}, z.core.$strict>>;
|
|
109
|
+
build: z.ZodPrefault<z.ZodObject<{
|
|
110
|
+
basePath: z.ZodDefault<z.ZodString>;
|
|
111
|
+
legacy: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
+
imageQuality: z.ZodPrefault<z.ZodObject<{
|
|
113
|
+
jpeg: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
png: z.ZodDefault<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
115
|
+
}, z.core.$strict>>;
|
|
116
|
+
imageExclude: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
117
|
+
manifest: z.ZodDefault<z.ZodBoolean>;
|
|
118
|
+
analyzeBundle: z.ZodDefault<z.ZodBoolean>;
|
|
119
|
+
sourceMaps: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodEnum<{
|
|
120
|
+
hidden: "hidden";
|
|
121
|
+
inline: "inline";
|
|
122
|
+
}>]>>;
|
|
123
|
+
createZip: z.ZodDefault<z.ZodBoolean>;
|
|
124
|
+
cleanPatterns: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
125
|
+
}, z.core.$strict>>;
|
|
126
|
+
dedupe: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
127
|
+
}, z.core.$strict>>;
|
|
128
|
+
settings: z.ZodPrefault<z.ZodObject<{
|
|
129
|
+
generic: z.ZodPrefault<z.ZodObject<{
|
|
130
|
+
info: z.ZodPrefault<z.ZodObject<{
|
|
131
|
+
id: z.ZodOptional<z.ZodString>;
|
|
132
|
+
page: z.ZodOptional<z.ZodString>;
|
|
133
|
+
version: z.ZodOptional<z.ZodString>;
|
|
134
|
+
client: z.ZodOptional<z.ZodString>;
|
|
135
|
+
year: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
136
|
+
}, z.core.$loose>>;
|
|
137
|
+
meta: z.ZodPrefault<z.ZodObject<{
|
|
138
|
+
title: z.ZodOptional<z.ZodString>;
|
|
139
|
+
description: z.ZodOptional<z.ZodString>;
|
|
140
|
+
apptitle: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, z.core.$loose>>;
|
|
142
|
+
options: z.ZodPrefault<z.ZodObject<{
|
|
143
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
144
|
+
orientation: z.ZodOptional<z.ZodString>;
|
|
145
|
+
fullscreen: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$loose>>;
|
|
147
|
+
}, z.core.$loose>>;
|
|
148
|
+
games: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
149
|
+
info: z.ZodPrefault<z.ZodObject<{
|
|
150
|
+
id: z.ZodOptional<z.ZodString>;
|
|
151
|
+
page: z.ZodOptional<z.ZodString>;
|
|
152
|
+
version: z.ZodOptional<z.ZodString>;
|
|
153
|
+
client: z.ZodOptional<z.ZodString>;
|
|
154
|
+
year: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
155
|
+
}, z.core.$loose>>;
|
|
156
|
+
meta: z.ZodPrefault<z.ZodObject<{
|
|
157
|
+
title: z.ZodOptional<z.ZodString>;
|
|
158
|
+
description: z.ZodOptional<z.ZodString>;
|
|
159
|
+
apptitle: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$loose>>;
|
|
161
|
+
options: z.ZodPrefault<z.ZodObject<{
|
|
162
|
+
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
163
|
+
orientation: z.ZodOptional<z.ZodString>;
|
|
164
|
+
fullscreen: z.ZodOptional<z.ZodString>;
|
|
165
|
+
}, z.core.$loose>>;
|
|
166
|
+
}, z.core.$loose>>>;
|
|
167
|
+
}, z.core.$strict>>;
|
|
168
|
+
kloekAssets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
169
|
+
}, z.core.$loose>;
|
|
170
|
+
type GameSettings = z.output<typeof gameSettingsSchema>;
|
|
171
|
+
type GamesSettings = Record<string, GameSettings>;
|
|
172
|
+
type ViteSettings = z.output<typeof viteSchema>;
|
|
173
|
+
type BuildSettings = z.output<typeof buildSchema>;
|
|
174
|
+
type ImageQuality = z.output<typeof imageQualitySchema>;
|
|
175
|
+
type PackageConfig = z.output<typeof packageSchema>;
|
|
176
|
+
type PackageConfigInput = z.input<typeof packageSchema>;
|
|
177
|
+
export declare function parsePackageConfig(input: unknown, file?: string): PackageConfig;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/core/game.d.ts
|
|
180
|
+
interface GamesData {
|
|
181
|
+
/** De generieke instellingen; context voor de development-pagina. */
|
|
182
|
+
development: GameSettings;
|
|
183
|
+
/** Per pagina-id. */
|
|
184
|
+
games: GamesSettings;
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/config/load.d.ts
|
|
188
|
+
/** Alles wat vite-config over een project weet; paden zijn absoluut. */
|
|
189
|
+
interface Project extends GamesData {
|
|
190
|
+
cwd: string;
|
|
191
|
+
/** Vite-root: `source/`. */
|
|
192
|
+
sourceDirectory: string;
|
|
193
|
+
/** Build-output: `public/`. */
|
|
194
|
+
outputDirectory: string;
|
|
195
|
+
package: PackageConfig;
|
|
196
|
+
}
|
|
197
|
+
/** Leest en valideert `package.json` van het project in `cwd`. */
|
|
198
|
+
export declare function loadProject(cwd?: string): Project;
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/config/build.d.ts
|
|
201
|
+
export declare function defineBuildConfig(project: Project): BuildOptions;
|
|
202
|
+
//#endregion
|
|
203
|
+
//#region src/config/vite.d.ts
|
|
204
|
+
/** De volledige Vite-config voor een kloek-project; standaard dat in de huidige map. */
|
|
205
|
+
export declare function defineKloekViteConfig(environment: ConfigEnv, project?: Project): Promise<UserConfig>;
|
|
206
|
+
//#endregion
|
|
207
|
+
export type { BuildSettings, GameSettings, GamesSettings, ImageQuality, KloekBuildOptions, KloekDevelopmentOptions, PackageConfig, PackageConfigInput, Project, ViteSettings };
|