New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

burp-brightscript

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

burp-brightscript - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

CHANGELOG.md

2

dist/lib/BurpConfig.d.ts

@@ -8,4 +8,4 @@ export interface BurpReplacement {

sourcePath?: string;
globPattern?: string;
filePattern?: string[];
replacements?: BurpReplacement[];
}

@@ -5,2 +5,3 @@ "use strict";

var path = require("path");
var util_1 = require("util");
var FileDescriptor_1 = require("./FileDescriptor");

@@ -19,3 +20,3 @@ var FileProcessor_1 = require("./FileProcessor");

this._config = config;
console.log("Starting directory: " + process.cwd() + " sourcePath " + this._config.sourcePath);
debug("Starting directory: " + process.cwd() + " sourcePath " + this._config.sourcePath);
try {

@@ -25,10 +26,10 @@ process.chdir(this._config.sourcePath);

catch (err) {
console.log('Could not change directory to source path: ' + err);
debug('Could not change directory to source path: ' + err);
throw new Error('Aborting');
}
this._rootPath = process.cwd();
console.log('Set working directory to : ' + process.cwd());
debug('Set working directory to : ' + process.cwd());
this._warnings = [];
this._errors = [];
this._config.globPattern = this._config.globPattern || '**/*.brs';
this._config.filePattern = this._config.filePattern || ['**/*.brs'];
}

@@ -56,3 +57,4 @@ Object.defineProperty(BurpProcessor.prototype, "errors", {

fileProcessor.rootPath = process.cwd();
var files = glob.sync(this._config.globPattern);
var files = glob.sync(this._config.filePattern);
debug(util_1.inspect(files));
files.forEach(function (file) {

@@ -59,0 +61,0 @@ debug("file " + file + ", " + path.resolve(file));

@@ -9,7 +9,5 @@ "use strict";

var chaiSubset = require('chai-subset');
var dircompare = require('dir-compare');
chai.use(chaiSubset);
var processor;
var sourcePath = path.resolve(__dirname, '../test/stubProject');
var testsPath = 'build/source/tests';
var targetPath = 'build';

@@ -34,3 +32,3 @@ function clearFiles() {

sourcePath: targetPath,
globPattern: '**/*.brs',
filePattern: ['**/*.brs'],
replacements: []

@@ -37,0 +35,0 @@ };

@@ -18,2 +18,4 @@ "use strict";

return FileType_1.FileType.Brs;
case '.bs':
return FileType_1.FileType.Bs;
default:

@@ -36,2 +38,3 @@ return FileType_1.FileType.Other;

pkgPath = pkgPath.replace(cwd, '');
pkgPath = pkgPath.replace('.bs', '.brs');
return pkgPath.replace('pkg://', 'pkg:/');

@@ -38,0 +41,0 @@ };

export declare enum FileType {
Brs = 0,
Other = 1
Bs = 0,
Brs = 1,
Other = 2
}

@@ -5,5 +5,6 @@ "use strict";

(function (FileType) {
FileType[FileType["Brs"] = 0] = "Brs";
FileType[FileType["Other"] = 1] = "Other";
FileType[FileType["Bs"] = 0] = "Bs";
FileType[FileType["Brs"] = 1] = "Brs";
FileType[FileType["Other"] = 2] = "Other";
})(FileType = exports.FileType || (exports.FileType = {}));
//# sourceMappingURL=FileType.js.map
{
"name": "burp-brightscript",
"version": "0.3.2",
"version": "0.4.0",
"description": "lightweight processor for roku brightscript projects",

@@ -18,3 +18,2 @@ "main": "dist/index.js",

"glob-all": "^3.1.0",
"glob-fs": "^0.1.7",
"lodash": "latest",

@@ -21,0 +20,0 @@ "os": "^0.1.1",

@@ -11,7 +11,5 @@ <h3 align="center">

## Links
- **[Documentation](documentation)**
- **[Release notes / History / Changes](CHANGELOG.md)**
- [Roku developer slack group](https://join.slack.com/t/rokudevelopers/shared_invite/enQtMzgyODg0ODY0NDM5LTc2ZDdhZWI2MDBmYjcwYTk5MmE1MTYwMTA2NGVjZmJiNWM4ZWY2MjY1MDY0MmViNmQ1ZWRmMWUzYTVhNzJiY2M)
- [Issue tracker](https://github.com/georgejecook/burp/issues)
- [Roadmap](ROADMAP.md)
- [CHANGELOG](CHANGELOG.md)

@@ -28,2 +26,9 @@ ## Development

## What kinds of things can you do with it?
- Add line numbers to log calls in your files, or disable logs
- Prevent further asserts executing in unit tests, if a test has failed
- Replace tokens in your files
- and more
## Usage

@@ -45,4 +50,3 @@

"sourcePath": "build/.roku-deploy-staging",
// "sourcePath": "build/wtf",
"globPattern": "**/*.brs",
"globPattern": ["**/*.brs","**/*.bs"],
"replacements": [

@@ -72,7 +76,5 @@ {

```
export function addDevLogs(cb) {
let config: BurpConfig = {
{
"sourcePath": "build/.roku-deploy-staging",
// "sourcePath": "build/wtf",
"globPattern": "**/*.brs",
"globPattern": ["**/*.brs"],
"replacements": [

@@ -89,6 +91,3 @@ {

}
const processor = new BurpProcessor(config);
processor.processFiles();
cb();
}
```

@@ -98,2 +97,3 @@ - Execute Burp `burp burpConfig.json`

### Replacement values
You can use the following constants in your regex replacements:

@@ -108,7 +108,54 @@

## Why call it Burp?
I like the name. It doesn't mean anything.
## Using with .bs files
Note, you should invoke burp BEFORE you transpile, until further notice - this is because the line numbers will be completely wrong in your transpiled code.
Burp will rename all file paths in the output from .bs to .brs
Here's a gulp example of how you can achieve this (please feel free to put up a pr with docs improvements, for a better suggestion) - the following is for mac/linux:
```
export async function compile(cb) {
// copy all sources to tmp folder
// so we can add the line numbers to them prior to transpiling
await copyFiles();
await sleep(100);
await applyBurpPreprocessing();
let builder = new ProgramBuilder();
await builder.run({
stagingFolderPath: outDir,
createPackage: false,
"rootDir": tmpBuildDir,
"autoImportComponentScript": true,
});
}
public async copyFiles() {
let oldPath = path.resolve(process.cwd());
try {
let outPath = path.resolve(this.config.outputPath);
fs.mkdirSync(this.config.outputPath);
let sourcePaths = this.config.sourcePaths.map((p) => {
p = path.resolve(p);
p = p.endsWith('/') ? p : p + '/';
if (!fs.existsSync(p)) {
feedbackError(new File(p, '', '', ''), `cannot find source path ${p}`, true);
}
return p;
}).join(' ');
await exec(`rsync -az ${sourcePaths} ${outPath}`);
console.log(`files copied to ${outPath} dir is now ${process.cwd()}`);
} catch (err) {
console.error(err);
}
process.chdir(oldPath);
}
```
## Why did you make this?
I also made [rLog](https://github.com/georgejecook/rLog) and needed a tool that could process source files to insert the line number and function name. I figured this is a more generally useful way of doing it, which other's might leverage in their own tool-chains and build processes.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc