@jay-framework/plugin-validator 0.15.6 → 0.16.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.
Files changed (2) hide show
  1. package/dist/index.js +46 -0
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -553,6 +553,52 @@ async function validateSchema(context, result) {
553
553
  });
554
554
  }
555
555
  }
556
+ if (manifest.routes) {
557
+ if (!Array.isArray(manifest.routes)) {
558
+ result.errors.push({
559
+ type: "schema",
560
+ message: 'Field "routes" must be an array',
561
+ location: "plugin.yaml"
562
+ });
563
+ } else {
564
+ manifest.routes.forEach((route, index) => {
565
+ if (!route.path) {
566
+ result.errors.push({
567
+ type: "schema",
568
+ message: `Route at index ${index} is missing "path" field`,
569
+ location: "plugin.yaml"
570
+ });
571
+ }
572
+ if (!route.jayHtml) {
573
+ result.errors.push({
574
+ type: "schema",
575
+ message: `Route "${route.path || index}" is missing "jayHtml" field`,
576
+ location: "plugin.yaml",
577
+ suggestion: "Specify the export subpath for the jay-html file"
578
+ });
579
+ }
580
+ if (!route.component) {
581
+ result.errors.push({
582
+ type: "schema",
583
+ message: `Route "${route.path || index}" is missing "component" field`,
584
+ location: "plugin.yaml",
585
+ suggestion: "Specify the exported member name for the page component"
586
+ });
587
+ }
588
+ if (route.jayHtml) {
589
+ validateDocFile(
590
+ route.jayHtml,
591
+ `route "${route.path}" jayHtml`,
592
+ context,
593
+ result
594
+ );
595
+ }
596
+ if (route.css) {
597
+ validateDocFile(route.css, `route "${route.path}" css`, context, result);
598
+ }
599
+ });
600
+ }
601
+ }
556
602
  }
557
603
  function resolveContractFile(contractSpec, context) {
558
604
  if (context.isNpmPackage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/plugin-validator",
3
- "version": "0.15.6",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Validation tool for Jay Stack plugins",
@@ -25,15 +25,15 @@
25
25
  "test:watch": ":"
26
26
  },
27
27
  "dependencies": {
28
- "@jay-framework/compiler-jay-html": "^0.15.6",
29
- "@jay-framework/compiler-shared": "^0.15.6",
30
- "@jay-framework/editor-protocol": "^0.15.6",
31
- "@jay-framework/typescript-bridge": "^0.15.6",
28
+ "@jay-framework/compiler-jay-html": "^0.16.0",
29
+ "@jay-framework/compiler-shared": "^0.16.0",
30
+ "@jay-framework/editor-protocol": "^0.16.0",
31
+ "@jay-framework/typescript-bridge": "^0.16.0",
32
32
  "chalk": "^4.1.2",
33
33
  "yaml": "^2.3.4"
34
34
  },
35
35
  "devDependencies": {
36
- "@jay-framework/dev-environment": "^0.15.6",
36
+ "@jay-framework/dev-environment": "^0.16.0",
37
37
  "@types/node": "^22.15.21",
38
38
  "rimraf": "^5.0.5",
39
39
  "tsup": "^8.0.1",