require.schema.json 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. {
  2. "$schema": "http://json-schema.org/draft-07/schema#",
  3. "type": "array",
  4. "description": "Configuration for libraries loaded via @require (only supports UMD bundles or user libraries).",
  5. "items": {
  6. "type": "object",
  7. "required": ["pkgName", "global"],
  8. "description": "Configuration for a library (via UMD bundle or global variable).",
  9. "properties": {
  10. "pkgName": {
  11. "type": "string",
  12. "description": "Full identifier of the NPM package.",
  13. "pattern": "^@?[a-z0-9-_/]+$"
  14. },
  15. "path": {
  16. "type": "string",
  17. "description": "Path to the package's UMD/global bundle file, relative to the library root folder.",
  18. "pattern": "^.+\\.(m|c)?(j|t)sx?$"
  19. },
  20. "global": {
  21. "type": "string",
  22. "description": "Name of the global variable created in the package's UMD/global bundle.",
  23. "pattern": "^[$_a-zA-Z][$_a-zA-Z0-9]*$"
  24. },
  25. "link": {
  26. "type": "string",
  27. "description": "If the path to a UMD/global bundle is provided here, the file will be injected into the userscript source as a locally linked package instead of included via @require.",
  28. "pattern": "^.+\\.(m|c)?js$"
  29. }
  30. },
  31. "additionalProperties": false
  32. }
  33. }