|
| 1 | +import type { LogLevel } from './logging'; |
| 2 | +export interface BsConfig { |
| 3 | + /** |
| 4 | + * The inheritance tree for all parent configs used to generate this config. Do not set this, it is computed. |
| 5 | + */ |
| 6 | + _ancestors?: string[]; |
| 7 | + /** |
| 8 | + * A path to a project file. This is really only passed in from the command line, and should not be present in bsconfig.json files. |
| 9 | + * Prefix with a question mark (?) to prevent throwing an exception if the file does not exist. |
| 10 | + */ |
| 11 | + project?: string; |
| 12 | + manifest?: { |
| 13 | + bs_const?: Record<string, boolean | null>; |
| 14 | + }; |
| 15 | + /** |
| 16 | + * when set, bsconfig.json loading is disabled |
| 17 | + */ |
| 18 | + noProject?: boolean; |
| 19 | + /** |
| 20 | + * Relative or absolute path to another bsconfig.json file that this file should import and then override. |
| 21 | + * Prefix with a question mark (?) to prevent throwing an exception if the file does not exist. |
| 22 | + */ |
| 23 | + extends?: string; |
| 24 | + /** |
| 25 | + * Override the current working directory. |
| 26 | + */ |
| 27 | + cwd?: string; |
| 28 | + /** |
| 29 | + * The root directory of your Roku project. Defaults to current directory. |
| 30 | + */ |
| 31 | + rootDir?: string; |
| 32 | + /** |
| 33 | + * The list of file globs used to find all files for the project |
| 34 | + * If using the {src;dest;} format, you can specify a different destination directory |
| 35 | + * for the matched files in src. |
| 36 | + */ |
| 37 | + files?: Array<string | { |
| 38 | + src: string | string[]; |
| 39 | + dest?: string; |
| 40 | + }>; |
| 41 | + /** |
| 42 | + * The path where the output zip file should be placed. |
| 43 | + * @default "./out/package.zip" |
| 44 | + */ |
| 45 | + outFile?: string; |
| 46 | + /** |
| 47 | + * Creates a zip package. Defaults to true. This setting is ignored when deploy is enabled. |
| 48 | + */ |
| 49 | + createPackage?: boolean; |
| 50 | + /** |
| 51 | + * If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled |
| 52 | + */ |
| 53 | + copyToStaging?: boolean; |
| 54 | + /** |
| 55 | + * If true, the server will keep running and will watch and recompile on every file change |
| 56 | + * @default false |
| 57 | + */ |
| 58 | + watch?: boolean; |
| 59 | + /** |
| 60 | + * If true, after a successful buld, the project will be deployed to the roku specified in host |
| 61 | + */ |
| 62 | + deploy?: boolean; |
| 63 | + /** |
| 64 | + * The host of the Roku that this project will deploy to |
| 65 | + */ |
| 66 | + host?: string; |
| 67 | + /** |
| 68 | + * The username to use when deploying to a Roku device |
| 69 | + */ |
| 70 | + username?: string; |
| 71 | + /** |
| 72 | + * The password to use when deploying to a Roku device |
| 73 | + */ |
| 74 | + password?: string; |
| 75 | + /** |
| 76 | + * Prevent the staging folder from being deleted after creating the package |
| 77 | + * @default false |
| 78 | + */ |
| 79 | + retainStagingDir?: boolean; |
| 80 | + /** |
| 81 | + * Prevent the staging folder from being deleted after creating the package |
| 82 | + * @default false |
| 83 | + * @deprecated use `retainStagingDir` instead |
| 84 | + */ |
| 85 | + retainStagingFolder?: boolean; |
| 86 | + /** |
| 87 | + * The path to the staging directory (wehre the output files are copied immediately before creating the zip) |
| 88 | + */ |
| 89 | + stagingDir?: string; |
| 90 | + /** |
| 91 | + * The path to the staging folder (where all files are copied to right before creating the zip package) |
| 92 | + * @deprecated use `stagingDir` instead |
| 93 | + */ |
| 94 | + stagingFolderPath?: string; |
| 95 | + /** |
| 96 | + * A list of error codes the compiler should NOT emit, even if encountered. |
| 97 | + */ |
| 98 | + ignoreErrorCodes?: (number | string)[]; |
| 99 | + /** |
| 100 | + * A map of error codes with their severity level override (error|warn|info) |
| 101 | + */ |
| 102 | + diagnosticSeverityOverrides?: Record<number | string, 'error' | 'warn' | 'info' | 'hint'>; |
| 103 | + /** |
| 104 | + * Emit full paths to files when printing diagnostics to the console. Defaults to false |
| 105 | + */ |
| 106 | + emitFullPaths?: boolean; |
| 107 | + /** |
| 108 | + * Emit type definition files (`d.bs`) |
| 109 | + * @default false |
| 110 | + */ |
| 111 | + emitDefinitions?: boolean; |
| 112 | + /** |
| 113 | + * If true, removes the explicit type to function's parameters and return (i.e. the `as type` syntax); otherwise keep this information. |
| 114 | + * @default false |
| 115 | + */ |
| 116 | + removeParameterTypes?: boolean; |
| 117 | + /** |
| 118 | + * A list of filters used to exclude diagnostics from the output |
| 119 | + */ |
| 120 | + diagnosticFilters?: Array<number | string | { |
| 121 | + src: string; |
| 122 | + codes: (number | string)[]; |
| 123 | + } | { |
| 124 | + src: string; |
| 125 | + } | { |
| 126 | + codes: (number | string)[]; |
| 127 | + }>; |
| 128 | + /** |
| 129 | + * Specify what diagnostic types should be printed to the console. Defaults to 'warn' |
| 130 | + */ |
| 131 | + diagnosticLevel?: 'info' | 'hint' | 'warn' | 'error'; |
| 132 | + /** |
| 133 | + * A list of scripts or modules to add extra diagnostics or transform the AST |
| 134 | + */ |
| 135 | + plugins?: Array<string>; |
| 136 | + /** |
| 137 | + * A list of scripts or modules to pass to node's `require()` on startup. This is useful for doing things like ts-node registration |
| 138 | + */ |
| 139 | + require?: Array<string>; |
| 140 | + /** |
| 141 | + * When enabled, every xml component will search for a .bs or .brs file with the same name |
| 142 | + * in the same folder, and add it as a script import if found. Disabled by default" |
| 143 | + */ |
| 144 | + autoImportComponentScript?: boolean; |
| 145 | + /** |
| 146 | + * When enabled, diagnostics will be printed to the console. |
| 147 | + * When disabled, no diagnostics will be printed to the console. |
| 148 | + * @default true |
| 149 | + */ |
| 150 | + showDiagnosticsInConsole?: boolean; |
| 151 | + /** |
| 152 | + * The log level. |
| 153 | + * @default LogLevel.log |
| 154 | + */ |
| 155 | + logLevel?: LogLevel | 'error' | 'warn' | 'log' | 'info' | 'debug' | 'trace' | 'off'; |
| 156 | + /** |
| 157 | + * Override the path to source files in source maps. Use this if you have a preprocess step and want |
| 158 | + * to ensure the source maps point to the original location. |
| 159 | + * This will only alter source maps for files within rootDir. Any files found outside of rootDir will not |
| 160 | + * have their source maps changed. This option also affects the `SOURCE_FILE_PATH` and `SOURCE_LOCATION` source literals. |
| 161 | + */ |
| 162 | + sourceRoot?: string; |
| 163 | + /** |
| 164 | + * Should the `sourceRoot` property be resolve to an absolute path (relative to the bsconfig it's defined in) |
| 165 | + * @default false |
| 166 | + */ |
| 167 | + resolveSourceRoot?: boolean; |
| 168 | + /** |
| 169 | + * Enables generating sourcemap files, which allow debugging tools to show the original source code while running the emitted files. |
| 170 | + * @default true |
| 171 | + */ |
| 172 | + sourceMap?: boolean; |
| 173 | + /** |
| 174 | + * Excludes empty files from being included in the output. Some Brighterscript files |
| 175 | + * are left empty or with only comments after transpilation to Brightscript. |
| 176 | + * The default behavior is to write these to disk after transpilation. |
| 177 | + * Setting this flag to `true` will prevent empty files being written and will |
| 178 | + * remove associated script tags from XML |
| 179 | + * @default false |
| 180 | + */ |
| 181 | + pruneEmptyCodeFiles?: boolean; |
| 182 | + /** |
| 183 | + * Allow brighterscript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled. |
| 184 | + * @default false |
| 185 | + */ |
| 186 | + allowBrighterScriptInBrightScript?: boolean; |
| 187 | + /** |
| 188 | + * Override the destination directory for the bslib.brs file. Use this if |
| 189 | + * you want to customize where the bslib.brs file is located in the staging |
| 190 | + * directory. Note that using a location outside of `source` will break |
| 191 | + * scripts inside `source` that depend on bslib.brs. Defaults to `source`. |
| 192 | + */ |
| 193 | + bslibDestinationDir?: string; |
| 194 | +} |
| 195 | +declare type OptionalBsConfigFields = '_ancestors' | 'sourceRoot' | 'project' | 'manifest' | 'noProject' | 'extends' | 'host' | 'password' | 'require' | 'stagingFolderPath' | 'diagnosticLevel' | 'rootDir' | 'stagingDir'; |
| 196 | +export declare type FinalizedBsConfig = Omit<Required<BsConfig>, OptionalBsConfigFields> & Pick<BsConfig, OptionalBsConfigFields>; |
| 197 | +export {}; |
0 commit comments