Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into codeAction-xml-import
  • Loading branch information
TwitchBronBron committed Apr 13, 2022
2 parents b753479 + fc18a22 commit 32f1be6
Show file tree
Hide file tree
Showing 149 changed files with 29,512 additions and 2,750 deletions.
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,14 @@ module.exports = {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
}, {
files: ['src/roku-types/data.json'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/quotes': 'off',
'no-template-curly-in-string': 'off',
'eol-last': 'off',
'@typescript-eslint/semi': 'off'
}
}]
};
2 changes: 1 addition & 1 deletion .github/workflows/create-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hey there! I just built a new version of the vscode extension based on ${{ github.event.pull_request.head.sha }}. You can downloaded the .vsix [here](${{steps.create-vsix.outputs.workflow-url}}) and then follow [these installation instructions](https://github.com/rokucommunity/vscode-brightscript-language#pre-release-versions).'
body: 'Hey there! I just built a new version of the vscode extension based on ${{ github.event.pull_request.head.sha }}. You can download the .vsix [here](${{steps.create-vsix.outputs.workflow-url}}) and then follow [these installation instructions](https://github.com/rokucommunity/vscode-brightscript-language#pre-release-versions).'
})
27 changes: 24 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,32 @@
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/typescript/**",
"!**/node_modules/vscode-languageserver/**"
"!**/node_modules/vscode-languageserver*/**"
]
},
{
"name": "Debug Doc Generator",
"type": "pwa-node",
"request": "launch",
"args": [
"scripts/compile-doc-examples.ts"
],
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register"
],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/typescript/**",
"!**/node_modules/vscode-languageserver/**"
]
},
{
"name": "Debug Roku Docs Scraper",
"type": "node",
"request": "launch",
"runtimeExecutable": "node",
Expand All @@ -55,7 +76,7 @@
"ts-node/register/transpile-only"
],
"args": [
"scripts/compile-doc-examples.ts"
"scripts/scrape-roku-docs.ts"
],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
Expand All @@ -65,4 +86,4 @@
]
}
]
}
}
25 changes: 23 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
"presentation": {
"group": "watch"
},
"problemMatcher": []
"isBackground": true,
"problemMatcher": [
"$tsc-watch"
]
},
{
"type": "npm",
Expand All @@ -41,10 +44,28 @@
"test:nocover",
"--silent"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "scrape-roku-docs",
"type": "shell",
"command": "npm",
"args": [
"run",
"scrape-roku-docs"
],
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -56,4 +77,4 @@
"problemMatcher": []
}
]
}
}
127 changes: 127 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,133 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0



## [0.47.3](https://github.com/rokucommunity/brighterscript/compare/v0.47.2...v0.47.3) - 2022-04-08
### Fixed
- accuracy issues when parsing the manifest ([#565](https://github.com/rokucommunity/brighterscript/pull/565))



## [0.47.2](https://github.com/rokucommunity/brighterscript/compare/v0.47.1...v0.47.2) - 2022-04-07
### Fixed
- enum transpile bug for binary expressions ([#559](https://github.com/rokucommunity/brighterscript/pull/559))
- add missing `require` entry to `bsconfig.schema.json` ([#560](https://github.com/rokucommunity/brighterscript/pull/560))



## [0.47.1](https://github.com/rokucommunity/brighterscript/compare/v0.47.0...v0.47.1) - 2022-04-05
### Changed
- disable strict cli args to empower plugins ([#557](https://github.com/rokucommunity/brighterscript/pull/557))
- don't add trailing commas in transpiled output for array and aa literals ([#556](https://github.com/rokucommunity/brighterscript/pull/556))
- retain quote char when transpiling xml attributes ([#552](https://github.com/rokucommunity/brighterscript/pull/552))



## [0.47.0](https://github.com/rokucommunity/brighterscript/compare/v0.46.0...v0.47.0) - 2022-03-30
### Added
- `require` flag to allow loading external node modules as part of the build process (useful for things like `ts-node/register`). ([#550](https://github.com/rokucommunity/brighterscript/pull/550), [#551](https://github.com/rokucommunity/brighterscript/pull/551))



## [0.46.0](https://github.com/rokucommunity/brighterscript/compare/v0.45.6...v0.46.0) - 2022-03-24
### Changed
- refactored try-catch statement to make the expressions and bodies easier to access via plugins. [#514](https://github.com/rokucommunity/brighterscript/pull/514)



## [0.45.6](https://github.com/rokucommunity/brighterscript/compare/v0.45.5...v0.45.6) - 2022-03-17
### Changed
- upgrade to [[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#354---2022-03-17) which fixed significant performance issues during globbing. ([roku-deploy#86](https://github.com/rokucommunity/roku-deploy/pull/86))
### Fixed
- crash when checking for enums to transpile [#539](https://github.com/rokucommunity/brighterscript/pull/539)
- Transpile if statements as written [#537](https://github.com/rokucommunity/brighterscript/pull/537)
- Keep the original type case when transpiling. [#536](https://github.com/rokucommunity/brighterscript/pull/536)
- Show cli usage in plugins documentation



## [0.45.5](https://github.com/rokucommunity/brighterscript/compare/v0.45.4...v0.45.5) - 2022-03-10
### Fixed
- bug with typedefs and auto-generated class constructor functions [#535](https://github.com/rokucommunity/brighterscript/pull/535)



## [0.45.4](https://github.com/rokucommunity/brighterscript/compare/v0.45.3...v0.45.4) - 2022-03-08
### Fixed
- bug that wasn't computing ownScriptImports after calling `invalidateReferences()` [#529](https://github.com/rokucommunity/brighterscript/pull/529)
- bug with logger.time() not having accurate timings when run asynchronously [#532](https://github.com/rokucommunity/brighterscript/pull/532)



## [0.45.3](https://github.com/rokucommunity/brighterscript/compare/v0.45.2...v0.45.3) - 2022-02-25
### Fixed
- source map bug with plugins that used the AST node creation functions depending on `interpolatedRange`. [#528](https://github.com/rokucommunity/brighterscript/pull/528)



## [0.45.2](https://github.com/rokucommunity/brighterscript/compare/v0.45.1...v0.45.2) - 2022-02-24
### Changed
- add default token values in creators. [#520](https://github.com/rokucommunity/brighterscript/pull/520)
### Fixed
- significant memory leak [#527](https://github.com/rokucommunity/brighterscript/pull/527)
- bug with transpiling empty for loop [#519](https://github.com/rokucommunity/brighterscript/pull/519)



## [0.45.1](https://github.com/rokucommunity/brighterscript/compare/v0.45.0...v0.45.1) - 2022-02-16
### Changed
- upgrade to [[email protected]](https://github.com/rokucommunity/roku-deploy/blob/master/CHANGELOG.md#353---2022-02-16) which fixed a missing typescript definition issue.



## [0.45.0](https://github.com/rokucommunity/brighterscript/compare/v0.44.0...v0.45.0) - 2022-02-11
### Added
- `enum` language feature ([#484](https://github.com/rokucommunity/brighterscript/pull/484))
- transpile override for plugins when providing AST edits. ([#511](https://github.com/rokucommunity/brighterscript/pull/511))
- `setFile` method to align with v1. ([#510](https://github.com/rokucommunity/brighterscript/pull/510))
### Changed
- deprecated `addOrReplaceFile` method to align with v1. ([#510](https://github.com/rokucommunity/brighterscript/pull/510))
- internal `Cache` method now extends `Map` instead of keeping an internal map. ([#509](https://github.com/rokucommunity/brighterscript/pull/509))



## [0.44.0](https://github.com/rokucommunity/brighterscript/compare/v0.43.1...v0.44.0) - 2022-02-08
### Added
- `onScopeValidate` plugin event useful when plugins want to contribute scope validations ([#505](https://github.com/rokucommunity/brighterscript/pull/505))
### Changed
- show plugin transpile modifications in the `getTranspiledFile` callback (used for "show preview" functionality in vscode) ([#502](https://github.com/rokucommunity/brighterscript/pull/502))
- make `Program.getFile` more flexible, and deprecate `Program.getFileByPkgPath`, `Program.getFileByPathAbsolute` ([#506](https://github.com/rokucommunity/brighterscript/pull/506))
- add `Program.getFiles` and deprecate `Program.getFilesByPkgPath` ([#506](https://github.com/rokucommunity/brighterscript/pull/506))
- move file validation plugin event emitting into `Program.validate()` which means you can't trigger those events by calling `File.validate()` anymore. ([#504](https://github.com/rokucommunity/brighterscript/pull/504))
- support generics for `Cache` class ([#503](https://github.com/rokucommunity/brighterscript/pull/503))
### Fixed
- bug in hover showing required params as optional and optional params as required ([#501](https://github.com/rokucommunity/brighterscript/pull/501))



## [0.43.1](https://github.com/rokucommunity/brighterscript/compare/v0.43.0...v0.43.1) - 2022-01-28
### Fixed
- crash when hovering over global functions ([#497](https://github.com/rokucommunity/brighterscript/pull/497))



## [0.43.0](https://github.com/rokucommunity/brighterscript/compare/v0.42.0...v0.43.0) - 2022-01-28
### Added
- show function documentation when hovering over functions. ([#495](https://github.com/rokucommunity/brighterscript/pull/495))
- for plugin authors:
- added `beforeFileValidate` and `onFileValidate` plugin hooks ([#490](https://github.com/rokucommunity/brighterscript/pull/490))
- added `expressions` collection to `BrsFile.parser.references` which includes all the full expressions, which can be used instead of AST walking in many cases. ([#487](https://github.com/rokucommunity/brighterscript/pull/487))
### Changed
- For plugin authors:
- move parse and validate events to `Program` class and out of `XmlFile` and `BrsFile`. This only impacts plugins that depend on the `afterFileParse`, `onFileValidate` and `afterFileValidate` events while also constructing those files with their constructors directly. ([#494](https://github.com/rokucommunity/brighterscript/pull/494))
- removed internal [barrels](https://github.com/basarat/typescript-book/blob/master/docs/tips/barrel.md). This means plugins can no longer do things like: `import { something} from 'brighterscript/some-path'`. All necessary exports can be done from the top-level brighterscript package directly. ([#492](https://github.com/rokucommunity/brighterscript/pull/492))
- use `Map` for `ClassValidator` class lookup instead of an object. ([#481](https://github.com/rokucommunity/brighterscript/pull/481))



### Fixed
- bug preventing code to come after an interface statement. ([#493](https://github.com/rokucommunity/brighterscript/pull/493))
- don't crash on null options in `printDiagnostics`. ([3147202](https://github.com/rokucommunity/brighterscript/commit/3147202b948d08be198255c068f082857c9de1f0))

## [0.42.0](https://github.com/rokucommunity/brighterscript/compare/v0.41.6...v0.42.0) - 2022-01-10
### Added
- AST editing utility for transformations during between the begin and end transpile lifecycle events. See [the documentation](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md#modifying-code) for more info. ([#478](https://github.com/rokucommunity/brighterscript/pull/478))
Expand Down
39 changes: 29 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

A superset of Roku's BrightScript language. Compiles to standard BrightScript.

[![build](https://img.shields.io/github/workflow/status/rokucommunity/brighterscript/build.svg?logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=workflow%3Abuild)
[![Coverage Status](https://coveralls.io/repos/github/rokucommunity/brighterscript/badge.svg?branch=master)](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
[![NPM Version](https://badge.fury.io/js/brighterscript.svg?style=flat)](https://npmjs.org/package/brighterscript)

[![build status](https://img.shields.io/github/workflow/status/rokucommunity/brighterscript/build.svg?logo=github)](https://github.com/rokucommunity/brighterscript/actions?query=workflow%3Abuild)
[![coverage status](https://img.shields.io/coveralls/github/rokucommunity/brighterscript?logo=coveralls)](https://coveralls.io/github/rokucommunity/brighterscript?branch=master)
[![monthly downloads](https://img.shields.io/npm/dm/brighterscript.svg?sanitize=true&logo=npm&logoColor=)](https://npmcharts.com/compare/brighterscript?minimal=true)
[![npm version](https://img.shields.io/npm/v/brighterscript.svg?logo=npm)](https://www.npmjs.com/package/brighterscript)
[![license](https://img.shields.io/npm/l/brighterscript.svg)](LICENSE)
[![Slack](https://img.shields.io/badge/Slack-RokuCommunity-4A154B?logo=slack)](https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA)

## Overview

Expand Down Expand Up @@ -59,12 +61,27 @@ BrighterScript adds several new features to the BrightScript language such as Na
- And if it's not enough, the [plugin API](https://github.com/rokucommunity/brighterscript/blob/master/docs/plugins.md) allows extending the compiler to provide extra diagnostics or transformations.

## Who uses Brighterscript?

Brighterscript is used by [applicaster](https://www.applicaster.com/), [The miracle channel](https://miraclechannel.ca/corco/), and in open source projects such as [rooibos](https://github.com/georgejecook/rooibos/blob/master/docs/index.md), the [maestro framework](https://github.com/georgejecook/maestro/blob/master/docs/index.md), and more.

The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=rokucommunity.brightscript) VSCode extension, and other tools.

More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler as part of their build pipeline. Be sure to watch this space!
<br/>
<p align="center">
<a href="https://www.applicaster.com/">
<img src="https://user-images.githubusercontent.com/2544493/96571912-377af280-129a-11eb-8295-49eb12e54aeb.png">
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.miraclechannel.ca/corcoplus">
<img src="https://user-images.githubusercontent.com/2544493/157429644-ba0d574a-d3c3-425f-8e68-98103fb8f707.png">
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.nba.com/">
<img src="https://user-images.githubusercontent.com/2544493/157430017-a27b62d0-63de-4e87-a6df-8448007bd24d.png">
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/georgejecook/rooibos/blob/master/docs/index.md">
<img src="https://user-images.githubusercontent.com/2544493/157430331-20913e84-f3f4-447a-b093-8780cd1241e6.png">
</a>
</p>
<br/>


The BrighterScript project is used to power the popular [Brightscript Language](https://marketplace.visualstudio.com/items?itemName=rokucommunity.brightscript) VSCode extension, the [maestro framework](https://github.com/georgejecook/maestro/blob/master/docs/index.md), and more.

[Contact us](https://github.com/rokucommunity/brighterscript/issues/new) if you use BrighterScript on your project and would like your logo listed above. More projects are adopting BrighterScript all the time, from using the new BrighterScript language features to simply using the compiler in their build pipeline.

## What's with the name?
The name BrighterScript is a compliment to everything that is great about Roku's awesome BrightScript language. Naming things is hard, and discoverability and recognizability are both very important. Here are the reasons we chose this name:
Expand Down Expand Up @@ -226,6 +243,8 @@ These are the options available in the `bsconfig.json` file.
- **plugins**: `Array<string>` - List of node scripts or npm modules to load as plugins to the BrighterScript compiler.
- **require**: `Array<string>` - List of node scripts or npm modules to load during the startup sequence. Useful for running things like `ts-node/require`
## 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
Loading

0 comments on commit 32f1be6

Please sign in to comment.