|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$ref": "#/definitions/PackageConfigFile", |
| 4 | + "title": "Package Config File Schema", |
| 5 | + "description": "Schema for a Dart .dart_tool/package_config.json file. Note that this is reverse engineered and not the source of truth.", |
| 6 | + "definitions": { |
| 7 | + "PackageConfigEntry": { |
| 8 | + "type": "object", |
| 9 | + "properties": { |
| 10 | + "languageVersion": { |
| 11 | + "description": "The minimum Dart language version required by this package (e.g., '2.12', '3.0').", |
| 12 | + "type": "string", |
| 13 | + "pattern": "^[0-9]+\\.[0-9]+$" |
| 14 | + }, |
| 15 | + "name": { |
| 16 | + "description": "The name of the package.", |
| 17 | + "type": "string", |
| 18 | + "pattern": "^[a-zA-Z_]\\w*$" |
| 19 | + }, |
| 20 | + "packageUri": { |
| 21 | + "description": "The URI relative to rootUri where Dart files for this package are found (typically 'lib/').", |
| 22 | + "type": "string" |
| 23 | + }, |
| 24 | + "rootUri": { |
| 25 | + "description": "The root URI of the package, where its pubspec.yaml file is located. Can be a file URI or relative path.", |
| 26 | + "type": "string", |
| 27 | + "format": "uri" |
| 28 | + } |
| 29 | + }, |
| 30 | + "required": [ |
| 31 | + "languageVersion", |
| 32 | + "name", |
| 33 | + "packageUri", |
| 34 | + "rootUri" |
| 35 | + ], |
| 36 | + "additionalProperties": false |
| 37 | + }, |
| 38 | + "PackageConfigFile": { |
| 39 | + "type": "object", |
| 40 | + "properties": { |
| 41 | + "configVersion": { |
| 42 | + "description": "The version of the package configuration format.", |
| 43 | + "type": "integer" |
| 44 | + }, |
| 45 | + "flutterRoot": { |
| 46 | + "description": "The root URI of the Flutter SDK (if applicable).", |
| 47 | + "type": "string", |
| 48 | + "format": "uri" |
| 49 | + }, |
| 50 | + "flutterVersion": { |
| 51 | + "description": "The version of the Flutter SDK (if applicable).", |
| 52 | + "type": "string" |
| 53 | + }, |
| 54 | + "generator": { |
| 55 | + "description": "The tool that generated this package configuration (e.g., 'pub').", |
| 56 | + "type": "string" |
| 57 | + }, |
| 58 | + "generatorVersion": { |
| 59 | + "description": "The version of the generator tool.", |
| 60 | + "type": "string" |
| 61 | + }, |
| 62 | + "packages": { |
| 63 | + "description": "A list of package configurations.", |
| 64 | + "type": "array", |
| 65 | + "items": { |
| 66 | + "$ref": "#/definitions/PackageConfigEntry" |
| 67 | + } |
| 68 | + }, |
| 69 | + "pubCache": { |
| 70 | + "description": "The URI of the Pub cache directory.", |
| 71 | + "type": "string", |
| 72 | + "format": "uri" |
| 73 | + } |
| 74 | + }, |
| 75 | + "required": [ |
| 76 | + "configVersion", |
| 77 | + "packages" |
| 78 | + ], |
| 79 | + "additionalProperties": false |
| 80 | + } |
| 81 | + } |
| 82 | +} |
0 commit comments