@oprt/manifest 0.1.0 → 0.3.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/dist/index.d.ts CHANGED
@@ -1222,11 +1222,216 @@ declare const ComponentGuidanceSchema: z.ZodObject<{
1222
1222
  use: string;
1223
1223
  }[] | undefined;
1224
1224
  }>;
1225
+ /**
1226
+ * What a project needs besides the source it copies or the package it imports: the packages, the
1227
+ * stylesheet lines and the root import. One source for `oprt add`'s output, the READMEs, the docs
1228
+ * and both agent guides. A package's `range` is added when the CLI is built.
1229
+ */
1230
+ declare const SetupSchema: z.ZodObject<{
1231
+ tailwind: z.ZodString;
1232
+ packages: z.ZodArray<z.ZodObject<{
1233
+ name: z.ZodString;
1234
+ dev: z.ZodBoolean;
1235
+ why: z.ZodString;
1236
+ range: z.ZodOptional<z.ZodString>;
1237
+ }, "strip", z.ZodTypeAny, {
1238
+ name: string;
1239
+ dev: boolean;
1240
+ why: string;
1241
+ range?: string | undefined;
1242
+ }, {
1243
+ name: string;
1244
+ dev: boolean;
1245
+ why: string;
1246
+ range?: string | undefined;
1247
+ }>, "many">;
1248
+ stylesheet: z.ZodArray<z.ZodObject<{
1249
+ line: z.ZodString;
1250
+ why: z.ZodString;
1251
+ }, "strip", z.ZodTypeAny, {
1252
+ why: string;
1253
+ line: string;
1254
+ }, {
1255
+ why: string;
1256
+ line: string;
1257
+ }>, "many">;
1258
+ package_source: z.ZodObject<{
1259
+ when: z.ZodString;
1260
+ line: z.ZodString;
1261
+ why: z.ZodString;
1262
+ }, "strip", z.ZodTypeAny, {
1263
+ why: string;
1264
+ line: string;
1265
+ when: string;
1266
+ }, {
1267
+ why: string;
1268
+ line: string;
1269
+ when: string;
1270
+ }>;
1271
+ root_import: z.ZodString;
1272
+ root_import_note: z.ZodString;
1273
+ not_needed: z.ZodArray<z.ZodObject<{
1274
+ name: z.ZodString;
1275
+ why: z.ZodString;
1276
+ }, "strip", z.ZodTypeAny, {
1277
+ name: string;
1278
+ why: string;
1279
+ }, {
1280
+ name: string;
1281
+ why: string;
1282
+ }>, "many">;
1283
+ }, "strip", z.ZodTypeAny, {
1284
+ tailwind: string;
1285
+ packages: {
1286
+ name: string;
1287
+ dev: boolean;
1288
+ why: string;
1289
+ range?: string | undefined;
1290
+ }[];
1291
+ stylesheet: {
1292
+ why: string;
1293
+ line: string;
1294
+ }[];
1295
+ package_source: {
1296
+ why: string;
1297
+ line: string;
1298
+ when: string;
1299
+ };
1300
+ root_import: string;
1301
+ root_import_note: string;
1302
+ not_needed: {
1303
+ name: string;
1304
+ why: string;
1305
+ }[];
1306
+ }, {
1307
+ tailwind: string;
1308
+ packages: {
1309
+ name: string;
1310
+ dev: boolean;
1311
+ why: string;
1312
+ range?: string | undefined;
1313
+ }[];
1314
+ stylesheet: {
1315
+ why: string;
1316
+ line: string;
1317
+ }[];
1318
+ package_source: {
1319
+ why: string;
1320
+ line: string;
1321
+ when: string;
1322
+ };
1323
+ root_import: string;
1324
+ root_import_note: string;
1325
+ not_needed: {
1326
+ name: string;
1327
+ why: string;
1328
+ }[];
1329
+ }>;
1225
1330
  /**
1226
1331
  * `guidance.json`: the companion to the contract. The contract says what each component accepts;
1227
1332
  * the guidance says which component, and which option, to choose.
1228
1333
  */
1229
1334
  declare const GuidanceSchema: z.ZodObject<{
1335
+ setup: z.ZodObject<{
1336
+ tailwind: z.ZodString;
1337
+ packages: z.ZodArray<z.ZodObject<{
1338
+ name: z.ZodString;
1339
+ dev: z.ZodBoolean;
1340
+ why: z.ZodString;
1341
+ range: z.ZodOptional<z.ZodString>;
1342
+ }, "strip", z.ZodTypeAny, {
1343
+ name: string;
1344
+ dev: boolean;
1345
+ why: string;
1346
+ range?: string | undefined;
1347
+ }, {
1348
+ name: string;
1349
+ dev: boolean;
1350
+ why: string;
1351
+ range?: string | undefined;
1352
+ }>, "many">;
1353
+ stylesheet: z.ZodArray<z.ZodObject<{
1354
+ line: z.ZodString;
1355
+ why: z.ZodString;
1356
+ }, "strip", z.ZodTypeAny, {
1357
+ why: string;
1358
+ line: string;
1359
+ }, {
1360
+ why: string;
1361
+ line: string;
1362
+ }>, "many">;
1363
+ package_source: z.ZodObject<{
1364
+ when: z.ZodString;
1365
+ line: z.ZodString;
1366
+ why: z.ZodString;
1367
+ }, "strip", z.ZodTypeAny, {
1368
+ why: string;
1369
+ line: string;
1370
+ when: string;
1371
+ }, {
1372
+ why: string;
1373
+ line: string;
1374
+ when: string;
1375
+ }>;
1376
+ root_import: z.ZodString;
1377
+ root_import_note: z.ZodString;
1378
+ not_needed: z.ZodArray<z.ZodObject<{
1379
+ name: z.ZodString;
1380
+ why: z.ZodString;
1381
+ }, "strip", z.ZodTypeAny, {
1382
+ name: string;
1383
+ why: string;
1384
+ }, {
1385
+ name: string;
1386
+ why: string;
1387
+ }>, "many">;
1388
+ }, "strip", z.ZodTypeAny, {
1389
+ tailwind: string;
1390
+ packages: {
1391
+ name: string;
1392
+ dev: boolean;
1393
+ why: string;
1394
+ range?: string | undefined;
1395
+ }[];
1396
+ stylesheet: {
1397
+ why: string;
1398
+ line: string;
1399
+ }[];
1400
+ package_source: {
1401
+ why: string;
1402
+ line: string;
1403
+ when: string;
1404
+ };
1405
+ root_import: string;
1406
+ root_import_note: string;
1407
+ not_needed: {
1408
+ name: string;
1409
+ why: string;
1410
+ }[];
1411
+ }, {
1412
+ tailwind: string;
1413
+ packages: {
1414
+ name: string;
1415
+ dev: boolean;
1416
+ why: string;
1417
+ range?: string | undefined;
1418
+ }[];
1419
+ stylesheet: {
1420
+ why: string;
1421
+ line: string;
1422
+ }[];
1423
+ package_source: {
1424
+ why: string;
1425
+ line: string;
1426
+ when: string;
1427
+ };
1428
+ root_import: string;
1429
+ root_import_note: string;
1430
+ not_needed: {
1431
+ name: string;
1432
+ why: string;
1433
+ }[];
1434
+ }>;
1230
1435
  rules: z.ZodArray<z.ZodObject<{
1231
1436
  id: z.ZodString;
1232
1437
  rule: z.ZodString;
@@ -1288,6 +1493,30 @@ declare const GuidanceSchema: z.ZodObject<{
1288
1493
  use: string;
1289
1494
  }[] | undefined;
1290
1495
  }>;
1496
+ setup: {
1497
+ tailwind: string;
1498
+ packages: {
1499
+ name: string;
1500
+ dev: boolean;
1501
+ why: string;
1502
+ range?: string | undefined;
1503
+ }[];
1504
+ stylesheet: {
1505
+ why: string;
1506
+ line: string;
1507
+ }[];
1508
+ package_source: {
1509
+ why: string;
1510
+ line: string;
1511
+ when: string;
1512
+ };
1513
+ root_import: string;
1514
+ root_import_note: string;
1515
+ not_needed: {
1516
+ name: string;
1517
+ why: string;
1518
+ }[];
1519
+ };
1291
1520
  rules: {
1292
1521
  id: string;
1293
1522
  rule: string;
@@ -1304,6 +1533,30 @@ declare const GuidanceSchema: z.ZodObject<{
1304
1533
  use: string;
1305
1534
  }[] | undefined;
1306
1535
  }>;
1536
+ setup: {
1537
+ tailwind: string;
1538
+ packages: {
1539
+ name: string;
1540
+ dev: boolean;
1541
+ why: string;
1542
+ range?: string | undefined;
1543
+ }[];
1544
+ stylesheet: {
1545
+ why: string;
1546
+ line: string;
1547
+ }[];
1548
+ package_source: {
1549
+ why: string;
1550
+ line: string;
1551
+ when: string;
1552
+ };
1553
+ root_import: string;
1554
+ root_import_note: string;
1555
+ not_needed: {
1556
+ name: string;
1557
+ why: string;
1558
+ }[];
1559
+ };
1307
1560
  rules: {
1308
1561
  id: string;
1309
1562
  rule: string;
@@ -1313,6 +1566,7 @@ declare const GuidanceSchema: z.ZodObject<{
1313
1566
  }>;
1314
1567
  type Component = z.infer<typeof ComponentSchema>;
1315
1568
  type Guidance = z.infer<typeof GuidanceSchema>;
1569
+ type Setup = z.infer<typeof SetupSchema>;
1316
1570
  type GuidanceRule = z.infer<typeof GuidanceRuleSchema>;
1317
1571
  type ComponentGuidance = z.infer<typeof ComponentGuidanceSchema>;
1318
1572
  type Manifest = z.infer<typeof ManifestSchema>;
@@ -1323,4 +1577,4 @@ type Prop = z.infer<typeof PropSchema>;
1323
1577
  type Slot = z.infer<typeof SlotSchema>;
1324
1578
  type CompositionRule = CompositionRuleNode;
1325
1579
 
1326
- export { type Component, type ComponentGuidance, ComponentGuidanceSchema, ComponentSchema, type ComponentsManifest, ComponentsManifestSchema, type CompositionRule, type CompositionRuleNode, CompositionRuleSchema, type Guidance, type GuidanceRule, GuidanceRuleSchema, GuidanceSchema, type Manifest, ManifestSchema, type Pattern, PatternSchema, type PatternSummary, PatternSummarySchema, type Prop, PropSchema, type Slot, SlotSchema };
1580
+ export { type Component, type ComponentGuidance, ComponentGuidanceSchema, ComponentSchema, type ComponentsManifest, ComponentsManifestSchema, type CompositionRule, type CompositionRuleNode, CompositionRuleSchema, type Guidance, type GuidanceRule, GuidanceRuleSchema, GuidanceSchema, type Manifest, ManifestSchema, type Pattern, PatternSchema, type PatternSummary, PatternSummarySchema, type Prop, PropSchema, type Setup, SetupSchema, type Slot, SlotSchema };
package/dist/index.js CHANGED
@@ -116,7 +116,28 @@ var ComponentGuidanceSchema = z.object({
116
116
  /** Per option prop: a note for each of its values. */
117
117
  values: z.record(z.record(z.string().min(1))).optional()
118
118
  });
119
+ var SetupSchema = z.object({
120
+ tailwind: z.string().min(1),
121
+ packages: z.array(
122
+ z.object({
123
+ name: z.string().min(1),
124
+ dev: z.boolean(),
125
+ why: z.string().min(1),
126
+ range: z.string().min(1).optional()
127
+ })
128
+ ).min(1),
129
+ stylesheet: z.array(z.object({ line: z.string().min(1), why: z.string().min(1) })),
130
+ package_source: z.object({
131
+ when: z.string().min(1),
132
+ line: z.string().min(1),
133
+ why: z.string().min(1)
134
+ }),
135
+ root_import: z.string().min(1),
136
+ root_import_note: z.string().min(1),
137
+ not_needed: z.array(z.object({ name: z.string().min(1), why: z.string().min(1) }))
138
+ });
119
139
  var GuidanceSchema = z.object({
140
+ setup: SetupSchema,
120
141
  rules: z.array(GuidanceRuleSchema),
121
142
  components: z.record(ComponentGuidanceSchema)
122
143
  });
@@ -131,5 +152,6 @@ export {
131
152
  PatternSchema,
132
153
  PatternSummarySchema,
133
154
  PropSchema,
155
+ SetupSchema,
134
156
  SlotSchema
135
157
  };