Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@backtrace-labs/rollup-plugin

Package Overview
Dependencies
Maintainers
7
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backtrace-labs/rollup-plugin - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

56

lib/index.js
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -12,26 +21,27 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

name: 'backtrace',
async writeBundle(outputOptions, bundle) {
const logWithPrefix = (level) => (message) => this[level](`Backtrace: ${message}`);
const info = logWithPrefix('info');
const debug = logWithPrefix('debug');
const processAndUpload = (0, sourcemap_tools_1.processAndUploadAssetsCommand)(options ?? {}, {
beforeAll: (assets) => info(`processing ${assets.length} files`),
afterProcess: (asset) => debug(`[${asset.asset.name}] processed source and sourcemap`),
afterWrite: (asset) => debug(`[${asset.asset.name}] wrote source and sourcemap to file`),
assetFinished: (asset) => info(`[${asset.asset.name}] asset processed successfully`),
assetError: (asset) => this.warn(`[${asset.asset.name}] ${asset.error}`),
beforeArchive: (paths) => this.debug(`creating archive to upload from ${paths.length} files`),
beforeUpload: () => info(`uploading sourcemaps...`),
afterUpload: (result) => info(`sourcemaps uploaded to Backtrace: ${result.rxid}`),
uploadError: (error) => this.warn(`failed to upload sourcemaps: ${error}`),
writeBundle(outputOptions, bundle) {
return __awaiter(this, void 0, void 0, function* () {
const logWithPrefix = (level) => (message) => this[level](`Backtrace: ${message}`);
const info = logWithPrefix('info');
const debug = logWithPrefix('debug');
const processAndUpload = (0, sourcemap_tools_1.processAndUploadAssetsCommand)(options !== null && options !== void 0 ? options : {}, {
beforeAll: (assets) => info(`processing ${assets.length} files`),
afterProcess: (asset) => debug(`[${asset.asset.name}] processed source and sourcemap`),
afterWrite: (asset) => debug(`[${asset.asset.name}] wrote source and sourcemap to file`),
assetFinished: (asset) => info(`[${asset.asset.name}] asset processed successfully`),
assetError: (asset) => this.warn(`[${asset.asset.name}] ${asset.error}`),
beforeUpload: (paths) => info(`uploading ${paths.length} sourcemaps...`),
afterUpload: (result) => info(`sourcemaps uploaded to Backtrace: ${result.rxid}`),
uploadError: (error) => this.warn(`failed to upload sourcemaps: ${error}`),
});
const outputDir = outputOptions.dir;
if (!outputDir) {
this.warn('output dir not set, cannot continue');
return;
}
const assets = Object.keys(bundle)
.filter(sourcemap_tools_1.matchSourceExtension)
.map((asset) => ({ name: asset, path: path_1.default.join(outputDir, asset) }));
yield processAndUpload(assets);
});
const outputDir = outputOptions.dir;
if (!outputDir) {
this.warn('output dir not set, cannot continue');
return;
}
const assets = Object.keys(bundle)
.filter(sourcemap_tools_1.matchSourceExtension)
.map((asset) => ({ name: asset, path: path_1.default.join(outputDir, asset) }));
await processAndUpload(assets);
},

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

{
"name": "@backtrace-labs/rollup-plugin",
"version": "0.0.1",
"version": "0.0.2",
"description": "Backtrace Rollup plugin",

@@ -52,3 +52,3 @@ "main": "lib/index.js",

"dependencies": {
"@backtrace-labs/sourcemap-tools": "^0.0.1"
"@backtrace-labs/sourcemap-tools": "^0.1.0"
},

@@ -55,0 +55,0 @@ "peerDependencies": {

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