File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "type" : " object" ,
33 "properties" : {
4+ "$schema" : {
5+ "type" : " string" ,
6+ "title" : " $schema"
7+ },
48 "output" : {
59 "type" : " object" ,
610 "properties" : {
Original file line number Diff line number Diff line change 11{
22 "name" : " policygen" ,
3- "version" : " 0.5.2 " ,
3+ "version" : " 0.5.3 " ,
44 "description" : " A CLI tool to generate policies" ,
55 "bin" : {
66 "policygen" : " ./dist/index.js"
Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ export type OutputConfig = {
191191} ;
192192
193193export type PolicygenConfig = {
194+ $schema ?: string ;
194195 output : OutputConfig ;
195196 entity : EntityConfig ;
196197 privacy ?: PrivacyConfig ;
Original file line number Diff line number Diff line change @@ -18,13 +18,10 @@ export function loadConfig(): PolicygenConfig {
1818 }
1919
2020 const raw = fs . readFileSync ( configPath , "utf-8" ) ;
21- const parsed = JSON . parse ( raw ) as Partial < PolicygenConfig > & {
22- $schema ?: string ;
23- } ; // Allow $schema as an extra field
21+ const parsed = JSON . parse ( raw ) as Partial < PolicygenConfig > ; // Allow $schema as an extra field
2422
2523 // Get the schema version from the `$schema` field
2624 const schemaUrl = parsed . $schema ;
27- delete parsed . $schema ; // Remove the $schema field from the object
2825 if ( ! schemaUrl ) {
2926 console . error ( "❌ Config file is missing the `$schema` field." ) ;
3027 process . exit ( 1 ) ;
You can’t perform that action at this time.
0 commit comments