@ykdz/template 0.0.5 → 0.0.6

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.
@@ -16,6 +16,7 @@ export type PresetPackageAdditionOptions = {
16
16
  export type PresetPackageAdditionPlan = {
17
17
  readonly packagePath: string;
18
18
  readonly workspacePackageGlob: string;
19
+ readonly workspaceMembershipGlob?: string;
19
20
  readonly packageRole: PackageRole;
20
21
  readonly packageSourcePreset: PackageSourcePreset;
21
22
  readonly sourceRoot: string;
@@ -0,0 +1,430 @@
1
+ import type { BuiltInPreset, ValidationResult } from "./declarations.js";
2
+ import { type TemplateDependencyCatalog } from "./dependency-catalog.js";
3
+ import { type PresetProjectionDeclaration } from "./projection-capabilities.js";
4
+ export type PresetSourceManifestPresetSource = {
5
+ roots: string[];
6
+ files: string[];
7
+ sharedResources: string[];
8
+ };
9
+ export type PresetSourceManifestPreset = BuiltInPreset & {
10
+ dependencyCatalog?: string[];
11
+ projection?: PresetProjectionDeclaration;
12
+ source?: PresetSourceManifestPresetSource;
13
+ };
14
+ export type PresetSourceManifestSharedResource = {
15
+ id: string;
16
+ path: string;
17
+ };
18
+ export type PresetSourceFixtureMatrixPresetSupport = {
19
+ preset: string;
20
+ };
21
+ export type PresetSourceFixtureMatrixPackageAdditionSupport = {
22
+ preset: string;
23
+ packageLeafName: string;
24
+ };
25
+ export type PresetSourceFixtureMatrixCombination = {
26
+ basePreset: string;
27
+ addedPreset: string;
28
+ linkFrom?: string[];
29
+ };
30
+ export type PresetSourceFixtureMatrixSemanticSkip = {
31
+ basePreset: string;
32
+ addedPreset: string;
33
+ reason: string;
34
+ };
35
+ export type PresetSourceFixtureMatrixContract = {
36
+ initSupport: PresetSourceFixtureMatrixPresetSupport[];
37
+ packageAdditionSupport: PresetSourceFixtureMatrixPackageAdditionSupport[];
38
+ supportedCombinations: PresetSourceFixtureMatrixCombination[];
39
+ semanticSkips: PresetSourceFixtureMatrixSemanticSkip[];
40
+ checkRequirements: string[];
41
+ environmentPreparation: string[];
42
+ };
43
+ export type PresetSourceManifest = {
44
+ schemaVersion: 1;
45
+ name: string;
46
+ sharedResources: PresetSourceManifestSharedResource[];
47
+ fixtureMatrix?: PresetSourceFixtureMatrixContract;
48
+ presets: PresetSourceManifestPreset[];
49
+ };
50
+ export type PresetSourceManifestValidationOptions = {
51
+ readonly sourceRoot?: string;
52
+ readonly dependencyCatalog?: TemplateDependencyCatalog;
53
+ };
54
+ export declare const presetSourceManifestJsonSchema: {
55
+ readonly $schema: "https://json-schema.org/draft/2020-12/schema";
56
+ readonly $id: "https://ykdz.dev/schemas/template/preset-source-manifest.schema.json";
57
+ readonly title: "Preset Source Manifest";
58
+ readonly type: "object";
59
+ readonly additionalProperties: false;
60
+ readonly required: readonly ["schemaVersion", "name", "presets"];
61
+ readonly properties: {
62
+ readonly schemaVersion: {
63
+ readonly const: 1;
64
+ };
65
+ readonly name: {
66
+ readonly type: "string";
67
+ readonly minLength: 1;
68
+ };
69
+ readonly sharedResources: {
70
+ readonly type: "array";
71
+ readonly items: {
72
+ readonly type: "object";
73
+ readonly additionalProperties: false;
74
+ readonly required: readonly ["id", "path"];
75
+ readonly properties: {
76
+ readonly id: {
77
+ readonly type: "string";
78
+ readonly minLength: 1;
79
+ };
80
+ readonly path: {
81
+ readonly type: "string";
82
+ readonly minLength: 1;
83
+ };
84
+ };
85
+ };
86
+ };
87
+ readonly fixtureMatrix: {
88
+ readonly type: "object";
89
+ readonly additionalProperties: false;
90
+ readonly required: readonly ["initSupport", "packageAdditionSupport", "supportedCombinations", "semanticSkips", "checkRequirements", "environmentPreparation"];
91
+ readonly properties: {
92
+ readonly initSupport: {
93
+ readonly type: "array";
94
+ readonly items: {
95
+ readonly type: "object";
96
+ readonly additionalProperties: false;
97
+ readonly required: readonly ["preset"];
98
+ readonly properties: {
99
+ readonly preset: {
100
+ readonly type: "string";
101
+ readonly minLength: 1;
102
+ };
103
+ };
104
+ };
105
+ };
106
+ readonly packageAdditionSupport: {
107
+ readonly type: "array";
108
+ readonly items: {
109
+ readonly type: "object";
110
+ readonly additionalProperties: false;
111
+ readonly required: readonly ["preset", "packageLeafName"];
112
+ readonly properties: {
113
+ readonly preset: {
114
+ readonly type: "string";
115
+ readonly minLength: 1;
116
+ };
117
+ readonly packageLeafName: {
118
+ readonly type: "string";
119
+ readonly minLength: 1;
120
+ readonly pattern: "^[a-z0-9][a-z0-9-]*$";
121
+ };
122
+ };
123
+ };
124
+ };
125
+ readonly supportedCombinations: {
126
+ readonly type: "array";
127
+ readonly items: {
128
+ readonly type: "object";
129
+ readonly additionalProperties: false;
130
+ readonly required: readonly ["basePreset", "addedPreset"];
131
+ readonly properties: {
132
+ readonly basePreset: {
133
+ readonly type: "string";
134
+ readonly minLength: 1;
135
+ };
136
+ readonly addedPreset: {
137
+ readonly type: "string";
138
+ readonly minLength: 1;
139
+ };
140
+ readonly linkFrom: {
141
+ readonly type: "array";
142
+ readonly items: {
143
+ readonly type: "string";
144
+ readonly minLength: 1;
145
+ };
146
+ };
147
+ };
148
+ };
149
+ };
150
+ readonly semanticSkips: {
151
+ readonly type: "array";
152
+ readonly items: {
153
+ readonly type: "object";
154
+ readonly additionalProperties: false;
155
+ readonly required: readonly ["basePreset", "addedPreset", "reason"];
156
+ readonly properties: {
157
+ readonly basePreset: {
158
+ readonly type: "string";
159
+ readonly minLength: 1;
160
+ };
161
+ readonly addedPreset: {
162
+ readonly type: "string";
163
+ readonly minLength: 1;
164
+ };
165
+ readonly reason: {
166
+ readonly type: "string";
167
+ readonly minLength: 1;
168
+ };
169
+ };
170
+ };
171
+ };
172
+ readonly checkRequirements: {
173
+ readonly type: "array";
174
+ readonly items: {
175
+ readonly enum: readonly ["machine-verifiable-next-steps", "root-check-ci"];
176
+ };
177
+ readonly uniqueItems: true;
178
+ };
179
+ readonly environmentPreparation: {
180
+ readonly type: "array";
181
+ readonly items: {
182
+ readonly enum: readonly ["playwright-browser-assets"];
183
+ };
184
+ readonly uniqueItems: true;
185
+ };
186
+ };
187
+ };
188
+ readonly presets: {
189
+ readonly type: "array";
190
+ readonly minItems: 1;
191
+ readonly items: {
192
+ readonly type: "object";
193
+ readonly additionalProperties: false;
194
+ readonly required: readonly ["name", "title", "description", "generation", "supportedPackageManagers", "supportedProjectKinds", "packageAdditionSupport", "features"];
195
+ readonly properties: {
196
+ readonly name: {
197
+ readonly type: "string";
198
+ readonly minLength: 1;
199
+ };
200
+ readonly title: {
201
+ readonly type: "string";
202
+ readonly minLength: 1;
203
+ };
204
+ readonly description: {
205
+ readonly type: "string";
206
+ readonly minLength: 1;
207
+ };
208
+ readonly generation: {
209
+ readonly enum: readonly ["supported", "future"];
210
+ };
211
+ readonly supportedPackageManagers: {
212
+ readonly type: "array";
213
+ readonly items: {
214
+ readonly enum: readonly ["pnpm"];
215
+ };
216
+ readonly uniqueItems: true;
217
+ };
218
+ readonly supportedProjectKinds: {
219
+ readonly type: "array";
220
+ readonly minItems: 1;
221
+ readonly items: {
222
+ readonly enum: readonly ["multi-package"];
223
+ };
224
+ readonly uniqueItems: true;
225
+ };
226
+ readonly packageAdditionSupport: {
227
+ readonly enum: readonly ["supported", "unsupported"];
228
+ };
229
+ readonly features: {
230
+ readonly type: "array";
231
+ readonly items: {
232
+ readonly enum: ("devcontainer" | "oxc-format-lint" | "cargo-test" | "github-actions" | "dependabot" | "pnpm-catalog" | "strict-typescript" | "root-check" | "fix-command" | "rustfmt-clippy" | "native-binary-release")[];
233
+ };
234
+ readonly uniqueItems: true;
235
+ };
236
+ readonly dependencyCatalog: {
237
+ readonly type: "array";
238
+ readonly items: {
239
+ readonly type: "string";
240
+ readonly minLength: 1;
241
+ };
242
+ readonly uniqueItems: true;
243
+ };
244
+ readonly projection: {
245
+ readonly type: "object";
246
+ readonly additionalProperties: false;
247
+ readonly required: readonly ["capabilities"];
248
+ readonly properties: {
249
+ readonly capabilities: {
250
+ readonly type: "array";
251
+ readonly items: {
252
+ readonly oneOf: readonly [{
253
+ readonly type: "object";
254
+ readonly additionalProperties: false;
255
+ readonly required: readonly ["kind", "workspacePackageGlob", "packageRole", "packageSourcePreset", "sourceFiles"];
256
+ readonly properties: {
257
+ readonly kind: {
258
+ readonly const: "workspace-library-package";
259
+ };
260
+ readonly workspacePackageGlob: {
261
+ readonly const: "packages/*";
262
+ };
263
+ readonly packageRole: {
264
+ readonly const: "shared-library";
265
+ };
266
+ readonly packageSourcePreset: {
267
+ readonly const: "ts-lib";
268
+ };
269
+ readonly sourceFiles: {
270
+ readonly type: "array";
271
+ readonly minItems: 1;
272
+ readonly items: {
273
+ readonly type: "string";
274
+ readonly minLength: 1;
275
+ };
276
+ };
277
+ };
278
+ }, {
279
+ readonly type: "object";
280
+ readonly additionalProperties: false;
281
+ readonly required: readonly ["kind", "workspacePackageGlob", "packages"];
282
+ readonly properties: {
283
+ readonly kind: {
284
+ readonly const: "workspace-node-packages";
285
+ };
286
+ readonly workspacePackageGlob: {
287
+ readonly const: "apps/*";
288
+ };
289
+ readonly packages: {
290
+ readonly type: "array";
291
+ readonly minItems: 1;
292
+ readonly items: {
293
+ readonly type: "object";
294
+ readonly additionalProperties: false;
295
+ readonly required: readonly ["kind", "path", "sourceFiles"];
296
+ readonly properties: {
297
+ readonly kind: {
298
+ readonly enum: readonly ["hono-api", "vue-app"];
299
+ };
300
+ readonly path: {
301
+ readonly enum: readonly ["apps/api", "apps/web"];
302
+ };
303
+ readonly sourceFiles: {
304
+ readonly type: "array";
305
+ readonly minItems: 1;
306
+ readonly items: {
307
+ readonly type: "string";
308
+ readonly minLength: 1;
309
+ };
310
+ };
311
+ };
312
+ };
313
+ };
314
+ readonly packageLinks: {
315
+ readonly type: "array";
316
+ readonly items: {
317
+ readonly type: "object";
318
+ readonly additionalProperties: false;
319
+ readonly required: readonly ["consumerPackagePath", "providerPackagePath"];
320
+ readonly properties: {
321
+ readonly consumerPackagePath: {
322
+ readonly const: "apps/web";
323
+ };
324
+ readonly providerPackagePath: {
325
+ readonly const: "apps/api";
326
+ };
327
+ };
328
+ };
329
+ };
330
+ };
331
+ }, {
332
+ readonly type: "object";
333
+ readonly additionalProperties: false;
334
+ readonly required: readonly ["kind", "workspacePackageGlob", "sourceFiles"];
335
+ readonly properties: {
336
+ readonly kind: {
337
+ readonly const: "rust-binary-workspace";
338
+ };
339
+ readonly workspacePackageGlob: {
340
+ readonly const: "packages/*";
341
+ };
342
+ readonly sourceFiles: {
343
+ readonly type: "array";
344
+ readonly minItems: 1;
345
+ readonly items: {
346
+ readonly type: "string";
347
+ readonly minLength: 1;
348
+ };
349
+ };
350
+ };
351
+ }, {
352
+ readonly type: "object";
353
+ readonly additionalProperties: false;
354
+ readonly required: readonly ["kind"];
355
+ readonly properties: {
356
+ readonly kind: {
357
+ readonly const: "strict-typescript-root";
358
+ };
359
+ };
360
+ }, {
361
+ readonly type: "object";
362
+ readonly additionalProperties: false;
363
+ readonly required: readonly ["kind"];
364
+ readonly properties: {
365
+ readonly kind: {
366
+ readonly const: "oxc-format-lint";
367
+ };
368
+ };
369
+ }, {
370
+ readonly type: "object";
371
+ readonly additionalProperties: false;
372
+ readonly required: readonly ["kind"];
373
+ readonly properties: {
374
+ readonly kind: {
375
+ readonly const: "node-pnpm-devcontainer";
376
+ };
377
+ };
378
+ }, {
379
+ readonly type: "object";
380
+ readonly additionalProperties: false;
381
+ readonly required: readonly ["kind"];
382
+ readonly properties: {
383
+ readonly kind: {
384
+ readonly const: "github-maintenance";
385
+ };
386
+ };
387
+ }];
388
+ };
389
+ };
390
+ };
391
+ };
392
+ readonly source: {
393
+ readonly type: "object";
394
+ readonly additionalProperties: false;
395
+ readonly properties: {
396
+ readonly roots: {
397
+ readonly type: "array";
398
+ readonly items: {
399
+ readonly type: "string";
400
+ readonly minLength: 1;
401
+ };
402
+ };
403
+ readonly files: {
404
+ readonly type: "array";
405
+ readonly items: {
406
+ readonly type: "string";
407
+ readonly minLength: 1;
408
+ };
409
+ };
410
+ readonly sharedResources: {
411
+ readonly type: "array";
412
+ readonly items: {
413
+ readonly type: "string";
414
+ readonly minLength: 1;
415
+ };
416
+ };
417
+ };
418
+ };
419
+ };
420
+ };
421
+ };
422
+ };
423
+ };
424
+ export declare function validatePresetSourceManifest(input: unknown, options?: PresetSourceManifestValidationOptions): ValidationResult<PresetSourceManifest>;
425
+ export declare function validateBuiltInPresetSourceManifest(input: unknown, options?: PresetSourceManifestValidationOptions): ValidationResult<PresetSourceManifest>;
426
+ export declare function manifestReferencedSourceFiles(manifest: PresetSourceManifest, sourceRoot: string): string[];
427
+ export declare function loadPresetSourceManifestFile(filePath: string): PresetSourceManifest;
428
+ export declare function loadBuiltInPresetSourceManifest(): PresetSourceManifest;
429
+ export declare function findPresetSourceManifestPreset(manifest: PresetSourceManifest, presetName: string): PresetSourceManifestPreset | undefined;
430
+ export declare function findBuiltInPresetSourceManifestPreset(presetName: string): PresetSourceManifestPreset | undefined;