Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into release-0.66.0
  • Loading branch information
TwitchBronBron committed Oct 16, 2023
2 parents 8a31693 + 157fc2e commit 85d680a
Show file tree
Hide file tree
Showing 20 changed files with 430 additions and 56 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ jobs:
- run: npm run build
#create npm package
- run: npm pack
- run: npm run test-related-projects

#create GitHub release
- name: Create GitHub Release
Expand Down
47 changes: 37 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.66.0-alpha.0](https://github.com/rokucommunity/brighterscript/compare/v0.65.1...v0.66.0-alpha.0) - 2023-06-09
### Changed
- all the type tracking stuff!
## [0.65.8](https://github.com/rokucommunity/brighterscript/compare/v0.65.7...v0.65.8) - 2023-10-06
### Added
- interface parameter support ([#924](https://github.com/rokucommunity/brighterscript/pull/924))
### Changed
- Bump postcss from 8.2.15 to 8.4.31 ([#928](https://github.com/rokucommunity/brighterscript/pull/928))
### Fixed
- chore: fix typescript typing for `Deferred` ([#923](https://github.com/rokucommunity/brighterscript/pull/923))



## [0.65.7](https://github.com/rokucommunity/brighterscript/compare/v0.65.6...v0.65.7) - 2023-09-28
### Fixed
- fix bug in --noproject flag logic ([#922](https://github.com/rokucommunity/brighterscript/pull/922))



## [0.65.6](https://github.com/rokucommunity/brighterscript/compare/v0.65.5...v0.65.6) - 2023-09-28
### Added
- `noProject` flag to bsc so `bsconfig.json` loading can be skipped entirely even if present ([#868](https://github.com/rokucommunity/brighterscript/pull/868))
### Changed
- docs: add some more details to the plugins ([#913](https://github.com/rokucommunity/brighterscript/pull/913))
- docs: add missing emitDefinitions ([#893](https://github.com/rokucommunity/brighterscript/pull/893))
### Fixed
- incorrect quasi location in template string ([#921](https://github.com/rokucommunity/brighterscript/pull/921))
- `UnaryExpression` transpile for namespace and const ([#914](https://github.com/rokucommunity/brighterscript/pull/914))



## [0.65.5](https://github.com/rokucommunity/brighterscript/compare/v0.65.4...v0.65.5) - 2023-09-06
### Added
- support overriding bs_const values in bsconfig ([#887](https://github.com/rokucommunity/brighterscript/pull/887))
- allow optionally specifying bslib destination directory ([#871](https://github.com/rokucommunity/brighterscript/pull/871))
- Print diagnostic related information ([#867](https://github.com/rokucommunity/brighterscript/pull/867))
### Fixed
- ensure consistent insertion of bslib.brs ([#870](https://github.com/rokucommunity/brighterscript/pull/870))
- Fix crashes in util for null ranges ([#869](https://github.com/rokucommunity/brighterscript/pull/869))
- Fix tab issue when printing diagnostics ([#865](https://github.com/rokucommunity/brighterscript/pull/865))



Expand Down Expand Up @@ -1719,13 +1756,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.1.0](https://github.com/rokucommunity/brighterscript/compare/v0.1.0...v0.1.0) - 2019-08-10
### Changed
- Cloned from [brightscript-language](https://github.com/rokucommunity/brightscript-language)










16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,12 @@ Type: `boolean`
Emit full paths to files when printing diagnostics to the console. Defaults to `false`.
#### `emitDefinitions`
Type: `boolean`
Emit type definition files (`d.bs`) during transpile. Defaults to `false`.
#### `diagnosticFilters`
Type: `Array<string | number | {src: string; codes: number[]}`
Expand Down Expand Up @@ -542,6 +548,16 @@ Type: `boolean`
Allow BrighterScript features (classes, interfaces, etc...) to be included in BrightScript (`.brs`) files, and force those files to be transpiled.
#### `bslibDestinationDir`
Type: `string`
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`.
## Ignore errors and warnings on a per-line basis
In addition to disabling an entire class of errors in `bsconfig.json` by using `ignoreErrorCodes`, you may also disable errors for a subset of the complier rules within a file with the following comment flags:
- `bs:disable-next-line`
Expand Down
15 changes: 15 additions & 0 deletions bsconfig.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
"description": "The root directory of your Roku project. Defaults to the current working directory (or cwd property)",
"type": "string"
},
"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"]
}
}
}
}
},
"files": {
"description": "The list of files that should be used in this project. Supports globs. Optionally, you can specify an object with `src` and `dest` properties to move files from one location into a different destination location",
"default": [
Expand Down
5 changes: 3 additions & 2 deletions docs/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ end interface
```
</details>

</details>

## Methods
Interfaces can describe complex methods as well
```brighterscript
Expand All @@ -105,6 +107,5 @@ end interface
<summary>View the transpiled BrightScript code</summary>

```BrightScript
```
</details>
</details>
25 changes: 24 additions & 1 deletion docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,29 @@ export default function plugin() {
}
```

## Modifying `bsconfig.json` via a plugin

In some cases you may want to modify the project's configuration via a plugin, such as to change settings based on environment variables or to dynamically modify the project's `files` array. Plugins may do so in the `beforeProgramCreate` step. For example, here's a plugin which adds an additional file to the build:
```typescript
import { CompilerPlugin, ProgramBuilder } from 'brighterscript';

export default function plugin() {
return {
name: 'addFilesDynamically',
beforeProgramCreate: (builder: ProgramBuilder) => {
if (!builder.options.files) {
builder.options.files = [];
}

builder.options.files.push({
src: "path/to/plugin/file.bs",
dest: "some/destination/path/goes/here"
})
}
} as CompilerPlugin;
}
```

## File API
By default, BrighterScript only parses files that it knows how to handle. Generally this includes `.xml` files in the compontents folder, `.brs`, `.bs` and `.d.bs` files. Other files may be handled in the future, such as `manifest`, `.ts` and possibly more. All other files are loaded into the program as `AssetFile` types and have no special handling or processing.

Expand Down Expand Up @@ -557,4 +580,4 @@ Here's an example file showing all three paths:
//location on device
pkgPath: "source/main.brs"
}
```
```
96 changes: 71 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion src/BsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ export interface BsConfig {
*/
project?: string;

manifest?: {
bs_const?: Record<string, boolean | null>;
};

/**
* when set, bsconfig.json loading is disabled
*/
noProject?: boolean;


/**
* Relative or absolute path to another bsconfig.json file that this file should import and then override.
* Prefix with a question mark (?) to prevent throwing an exception if the file does not exist.
Expand Down Expand Up @@ -105,7 +115,7 @@ export interface BsConfig {

/**
* Emit type definition files (`d.bs`)
* @default true
* @default false
*/
emitDefinitions?: boolean;

Expand Down Expand Up @@ -169,4 +179,12 @@ export interface BsConfig {
* @default false
*/
allowBrighterScriptInBrightScript?: boolean;

/**
* 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`.
*/
bslibDestinationDir?: string;
}
Loading

0 comments on commit 85d680a

Please sign in to comment.