Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,12 @@ If you need to configure `bsc`, you can do so in two ways:
bsc --watch
```

3. Run the compiler in watch mode, and redeploy to the roku on every change
```bash
bsc --watch --deploy --host 192.168.1.10 --password secret_password
```
4. Use a bsconfig.json file not located at cwd
3. Use a bsconfig.json file not located at cwd
```bash
bsc --project ./some_folder/bsconfig.json
```

5. Run the compiler as a **linter** only (watch mode supported)
4. Run the compiler as a **linter** only (watch mode supported)
```bash
bsc --create-package false --copy-to-staging false
```
Expand All @@ -183,8 +179,7 @@ The presence of a `bsconfig.json` file in a directory indicates that the directo
"files": [
"**/*"
],
"stagingFolderPath": "dist",
"retainStagingFolder": true,
"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
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/lex-parse-validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ module.exports = (options: TargetOptions) => {

builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/lex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/parse-brs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/parse-xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/transpile-brs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/transpile-xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/targets/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ module.exports = async (options: TargetOptions) => {
//run the first run outside of the test
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/targets/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ module.exports = async (options: TargetOptions) => {
//run the first run so we we can focus the test on validate
await builder.run({
cwd: projectPath,
createPackage: false,
copyToStaging: false,
noEmit: true,
enableTypeValidation: true,
//disable diagnostic reporting (they still get collected)
diagnosticFilters: ['**/*'],
logLevel: 'error',
Expand Down
29 changes: 21 additions & 8 deletions bsconfig.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,12 @@
"default": false
},
"copyToStaging": {
"description": "If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled",
"description": "(Deprecated use 'noEmit') If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled",
"deprecated": true,
"type": "boolean"
},
"noEmit": {
"description": "If true, then no files are copied to outDir.",
"type": "boolean"
},
"watch": {
Expand All @@ -109,19 +114,23 @@
"default": false
},
"deploy": {
"description": "If true, after a successful build, the project will be deployed to the roku specified in host",
"description": "(Deprecated) If true, after a successful buld, the project will be deployed to the roku specified in host",
"deprecated": true,
"type": "boolean"
},
"host": {
"description": "The host of the Roku that the package will be deploy to",
"description": "(Deprecated) host of the Roku that the package will be deploy to",
"deprecated": true,
"type": "string"
},
"username": {
"description": "The username to use when deploying to a Roku device",
"description": "(Deprecated) The username to use when deploying to a Roku device",
"deprecated": true,
"type": "string"
},
"password": {
"description": " The password to use when deploying to a Roku device",
"description": "(Deprecated) The password to use when deploying to a Roku device",
"deprecated": true,
"type": "string"
},
"retainStagingDir": {
Expand All @@ -132,17 +141,21 @@
"retainStagingFolder": {
"type": "boolean",
"deprecated": true,
"description": "Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
"description": "(Deprecated) Prevent the staging folder from being deleted after the deployment package is created. This is helpful for troubleshooting why your package isn't being created the way you expected.",
"default": false
},
"stagingDir": {
"type": "string",
"description": "The path to the staging folder (where all files are copied before creating the zip package)"
},
"outDir": {
"type": "string",
"description": "TODO better description: The path to the output directory (where all files are copied before creating the zip package)"
},
"stagingFolderPath": {
"type": "string",
"deprecated": true,
"deprecationMessage": "Deprecated. Use `stagingDir` instead.",
"deprecationMessage": "Deprecated. Use `outDir` instead.",
"description": "The path to the staging folder (where all files are copied before creating the zip package)"
},
"ignoreErrorCodes": {
Expand Down Expand Up @@ -311,4 +324,4 @@
"default": false
}
}
}
}
36 changes: 0 additions & 36 deletions docs/bsconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ While a minimal `bsconfig.json` file is sufficient for getting started, `bsc` su
- [allowBrighterScriptInBrightScript](#allowBrighterScriptInBrightScript)
- [autoImportComponentScript](#autoImportComponentScript)
- [bslibDestinationDir](#bslibDestinationDir)
- [createPackage](#createPackage)
- [cwd](#cwd)
- [deploy](#deploy)
- [diagnosticFilters](#diagnosticFilters)
- [diagnosticLevel](#diagnosticLevel)
- [diagnosticSeverityOverrides](#diagnosticSeverityOverrides)
- [emitDefinitions](#emitDefinitions)
- [emitFullPaths](#emitFullPaths)
- [extends](#extends)
- [files](#files)
- [host](#host)
- [outFile](#outFile)
- [password](#password)
- [plugins](#plugins)
- [project](#project)
- [pruneEmptyCodeFiles](#pruneEmptyCodeFiles)
Expand All @@ -27,7 +23,6 @@ While a minimal `bsconfig.json` file is sufficient for getting started, `bsc` su
- [rootDir](#rootDir)
- [sourceRoot](#sourceRoot)
- [stagingDir](#stagingDir)
- [username](#username)
- [watch](#watch)

## `allowBrighterScriptInBrightScript`
Expand All @@ -50,24 +45,12 @@ Override the destination directory for the bslib.brs file. Use this if you want

Defaults to `source`.

## `createPackage`

Type: `boolean`

Causes the build to create a zip package. Defaults to `true`. This setting is ignored when [`deploy`](#deploy) is enabled.

## `cwd`

Type: `string`

If present, overrides the current working directory when invoking `bsc`. Defaults to `process.cwd()`.

## `deploy`

Type: `boolean`

If `true`, after a successful build, the project will be deployed to the Roku specified in host. Defaults to `false`. If this field is set to `true`, then the [`host`](#host) and [`password`](#password) fields must be set as well.

## `diagnosticFilters`

Type: `Array<string | number | {files: string | Array<string | {src: string} | {dest: string}>; codes?: Array<number | string>}`
Expand Down Expand Up @@ -371,24 +354,12 @@ For example, if you have a base project and a child project that wants to overri
}
```

## `host`

Type: `string`

The host of the Roku that this project will deploy to when the [`deploy`](#deploy) field is set to `true`. Defaults to `undefined`.

## `outFile`

Type: `string`

The path (including filename) where the output file should be placed. Defaults to `"./out/${WORKSPACE_FOLDER_NAME}.zip"`.

## `password`

Type: `string`

The password that will be used to deploy to the Roku device when the [`deploy`](#deploy) field is set to `true`. Defaults to `undefined`.

## `plugins`

Type: `Array<string>`
Expand Down Expand Up @@ -442,17 +413,10 @@ Type: `string`
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`](#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.

## `stagingDir`

Type: `string`

The folder where the transpiled files are placed. This folder will be created automatically if it does not exist, and will be deleted after transpilation completes unless [`retainStagingDir`](#retainstagingdir) is set to `true`. Defaults to `./out/.roku-deploy-staging`.

## `username`

Type: `string`

The username that will be used to deploy to the Roku device when the [`deploy`](#deploy) field is set to `true`. Defaults to `undefined`.

## `watch`

Type: `boolean`
Expand Down
44 changes: 12 additions & 32 deletions src/BsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,9 @@ export interface BsConfig {
outFile?: string;

/**
* Creates a zip package. Defaults to true. This setting is ignored when deploy is enabled.
* If true, the files are not copied to outDir.
*/
createPackage?: boolean;

/**
* If true, the files are copied to staging. This setting is ignored when deploy is enabled or if createPackage is enabled
*/
copyToStaging?: boolean;
noEmit?: boolean;

/**
* If true, the server will keep running and will watch and recompile on every file change
Expand All @@ -68,35 +63,22 @@ export interface BsConfig {
watch?: boolean;

/**
* If true, after a successful buld, the project will be deployed to the roku specified in host
*/
deploy?: boolean;

/**
* The host of the Roku that this project will deploy to
*/
host?: string;

/**
* The username to use when deploying to a Roku device
*/
username?: string;

/**
* The password to use when deploying to a Roku device
* The path to the staging directory (wehre the output files are copied immediately before creating the zip)
* @deprecated use `outDir` instead
*/
password?: string;
stagingDir?: string;

/**
* Prevent the staging folder from being deleted after creating the package
* @default false
* The path to the staging folder (where all files are copied to right before creating the zip package)
* @deprecated use `outDir` instead
*/
retainStagingDir?: boolean;
stagingFolderPath?: string;

/**
* The path to the staging directory (wehre the output files are copied immediately before creating the zip)
* The path to the out folder
* @default "./out"
*/
stagingDir?: string;
outDir?: string;

/**
* A list of error codes the compiler should NOT emit, even if encountered.
Expand Down Expand Up @@ -220,10 +202,8 @@ type OptionalBsConfigFields =
| 'manifest'
| 'noProject'
| 'extends'
| 'host'
| 'password'
| 'require'
| 'stagingDir'
| 'outDir'
| 'diagnosticLevel'
| 'rootDir'
| 'stagingDir';
Expand Down
Loading
Loading