Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,11 @@ The presence of a `bsconfig.json` file in a directory indicates that the directo
"**/*"
],
"outDir": "out",
//this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
"autoImportComponentScript": true,
"sourceMap": true
"compilerOptions": {
//this flag tells BrighterScript that for every xml file, try to import a .bs file with the same name and location
"autoImportComponentScript": true,
"sourceMap": true
}
}
```

Expand Down
136 changes: 136 additions & 0 deletions bsconfig.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
},
"manifest": {
"description": "A entry to modify manifest values",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.manifest` instead.",
"type": "object",
"properties": {
"bs_const": {
Expand Down Expand Up @@ -147,11 +149,15 @@
},
"sourceMap": {
"description": "Enables generating sourcemap files, which allow debugging tools to show the original source code while running the emitted files.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.sourceMap` instead.",
"type": "boolean",
"default": false
},
"relativeSourceMaps": {
"description": "If true, source file paths in generated sourcemaps will be relative to the map file location instead of absolute. This makes sourcemaps portable across different machines and environments.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.relativeSourceMaps` instead.",
"type": "boolean",
"default": false
},
Expand Down Expand Up @@ -258,16 +264,22 @@
},
"emitFullPaths": {
"description": "Emit full paths to files when printing diagnostics to the console.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.emitFullPaths` instead.",
"type": "boolean",
"default": false
},
"emitDefinitions": {
"description": "Emit type definition files (`d.bs`) during transpile",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.emitDefinitions` instead.",
"type": "boolean",
"default": false
},
"removeParameterTypes": {
"description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.removeParameterTypes` instead.",
"type": "boolean",
"default": false
},
Expand Down Expand Up @@ -343,6 +355,8 @@
},
"autoImportComponentScript": {
"description": "When enabled, every xml component will search for a .bs or .brs file with the same name in the same folder, and add it as a script import if found. Disabled by default",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.autoImportComponentScript` instead.",
"type": "boolean",
"default": false
},
Expand All @@ -361,10 +375,14 @@
},
"sourceRoot": {
"description": "Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.sourceRoot` instead.",
"type": "string"
},
"resolveSourceRoot": {
"description": "Should the `sourceRoot` property be resolve to an absolute path (relative to the bsconfig it's defined in)",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.resolveSourceRoot` instead.",
"type": "boolean",
"default": false
},
Expand Down Expand Up @@ -396,16 +414,22 @@
},
"allowBrighterScriptInBrightScript": {
"description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.allowBrighterScriptInBrightScript` instead.",
"type": "boolean",
"default": false
},
"legacyCallfuncHandling": {
"description": "Legacy RokuOS versions required at least one argument in callfunc() invocations. Previous brighterscript versions handled this by inserting invalid as an argument when no other args are present. This is not necessary in modern RokuOS versions.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.legacyCallfuncHandling` instead.",
"type": "boolean",
"default": false
},
"minFirmwareVersion": {
"description": "The minimum Roku firmware version required to run this project. When set, BrightScript (.brs) files will be validated to ensure they only use language features available in that firmware version or earlier. BrighterScript (.bs) files are always allowed to use all features since they are transpiled. Should be a semver-compatible string (e.g. \"11.0.0\").",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.minFirmwareVersion` instead.",
"type": "string",
"examples": [
"11.0.0",
Expand All @@ -414,18 +438,130 @@
},
"strict": {
"description": "Enables a set of stricter type-checking rules and language features. When set, this acts as a default value for other `strict`-related options. Defaults to false.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.strict` instead.",
"type": "boolean",
"default": false
},
"strictCallFunc": {
"description": "Enables stricter type-checking for callfunc() invocations. When true, callfunc() invocations will not be allowed on generic Node types. Defaults to false.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.strictCallFunc` instead.",
"type": "boolean",
"default": false
},
"strictNodeMembers": {
"description": "Enables stricter type-checking for Node members. When true, unknown members on Node types will be treated as errors instead of dynamic values. Defaults to false.",
"deprecated": true,
"deprecationMessage": "Deprecated starting in v1. Use `compilerOptions.strictNodeMembers` instead.",
"type": "boolean",
"default": false
},
"compilerOptions": {
"description": "Options that control how BrighterScript interprets, validates, and compiles your code (as opposed to the top-level options, which control project structure, file discovery, and tooling/reporting behavior). Similar in spirit to TypeScript's `compilerOptions`. If an option is set both here and at the top level (deprecated location), the value here wins.",
"type": "object",
"properties": {
"allowBrighterScriptInBrightScript": {
"description": "Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.",
"type": "boolean",
"default": false
},
"autoImportComponentScript": {
"description": "When enabled, every xml component will search for a .bs or .brs file with the same name in the same folder, and add it as a script import if found. Disabled by default",
"type": "boolean",
"default": false
},
"bslibDestinationDir": {
"description": "Override the destination directory for the bslib.brs file. Use this if you want to customize where the bslib.brs file is located in the staging directory. Note that using a location outside of `source` will break scripts inside `source` that depend on bslib.brs. Defaults to `source`.",
"type": "string",
"default": "source"
},
"emitDefinitions": {
"description": "Emit type definition files (`d.bs`) during transpile",
"type": "boolean",
"default": false
},
"emitFullPaths": {
"description": "Emit full paths to files when printing diagnostics to the console.",
"type": "boolean",
"default": false
},
"legacyCallfuncHandling": {
"description": "Legacy RokuOS versions required at least one argument in callfunc() invocations. Previous brighterscript versions handled this by inserting invalid as an argument when no other args are present. This is not necessary in modern RokuOS versions.",
"type": "boolean",
"default": false
},
"manifest": {
"description": "A entry to modify manifest values",
"type": "object",
"properties": {
"bs_const": {
"description": "A dictionary of bs_consts to change or add to the manifest. Each entry ",
"type": "object",
"patternProperties": {
"^.+$": {
"type": [
"boolean",
"null"
]
}
}
}
}
},
"minFirmwareVersion": {
"description": "The minimum Roku firmware version required to run this project. When set, BrightScript (.brs) files will be validated to ensure they only use language features available in that firmware version or earlier. BrighterScript (.bs) files are always allowed to use all features since they are transpiled. Should be a semver-compatible string (e.g. \"11.0.0\").",
"type": "string",
"examples": [
"11.0.0",
"12.0.0"
]
},
"pruneEmptyCodeFiles": {
"description": "Excludes empty files from being included in the output. Some Brighterscript files are left empty or with only comments after transpilation to Brightscript. The default behavior is to write these to disk after transpilation. Setting this flag to `true` will prevent empty files being written and will remove associated script tags from XML.",
"type": "boolean",
"default": false
},
"relativeSourceMaps": {
"description": "If true, source file paths in generated sourcemaps will be relative to the map file location instead of absolute. This makes sourcemaps portable across different machines and environments.",
"type": "boolean",
"default": false
},
"removeParameterTypes": {
"description": "Removes the explicit type to function's parameters and return (i.e. the `as type` syntax) ",
"type": "boolean",
"default": false
},
"resolveSourceRoot": {
"description": "Should the `sourceRoot` property be resolve to an absolute path (relative to the bsconfig it's defined in)",
"type": "boolean",
"default": false
},
"sourceMap": {
"description": "Enables generating sourcemap files, which allow debugging tools to show the original source code while running the emitted files.",
"type": "boolean",
"default": false
},
"sourceRoot": {
"description": "Override the root directory path where debugger should locate the source files. The location will be embedded in the source map to help debuggers locate the original source files. This only applies to files found within rootDir. This is useful when you want to preprocess files before passing them to BrighterScript, and want a debugger to open the original files. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals.",
"type": "string"
},
"strict": {
"description": "Enables a set of stricter type-checking rules and language features. When set, this acts as a default value for other `strict`-related options. Defaults to false.",
"type": "boolean",
"default": false
},
"strictCallFunc": {
"description": "Enables stricter type-checking for callfunc() invocations. When true, callfunc() invocations will not be allowed on generic Node types. Defaults to false.",
"type": "boolean",
"default": false
},
"strictNodeMembers": {
"description": "Enables stricter type-checking for Node members. When true, unknown members on Node types will be treated as errors instead of dynamic values. Defaults to false.",
"type": "boolean",
"default": false
}
}
}
}
}
Loading
Loading