@backtrace-labs/rollup-plugin
Advanced tools
Comparing version 0.0.1 to 0.0.2
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9028
52
+ Added@backtrace-labs/sourcemap-tools@0.1.0(transitive)
+ Addedb4a@1.6.7(transitive)
+ Addedbare-events@2.5.4(transitive)
+ Addedfast-fifo@1.3.2(transitive)
+ Addedqueue-tick@1.0.1(transitive)
+ Addedstreamx@2.21.1(transitive)
+ Addedtar-stream@3.1.7(transitive)
+ Addedtext-decoder@1.2.3(transitive)
- Removed@backtrace-labs/sourcemap-tools@0.0.1(transitive)
- Removedarchiver@5.3.2(transitive)
- Removedarchiver-utils@2.1.03.0.4(transitive)
- Removedasync@3.2.6(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbase64-js@1.5.1(transitive)
- Removedbl@4.1.0(transitive)
- Removedbrace-expansion@1.1.112.0.1(transitive)
- Removedbuffer@5.7.1(transitive)
- Removedbuffer-crc32@0.2.13(transitive)
- Removedcompress-commons@4.1.2(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcrc-32@1.2.2(transitive)
- Removedcrc32-stream@4.0.3(transitive)
- Removedend-of-stream@1.4.4(transitive)
- Removedfs-constants@1.0.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedieee754@1.2.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@1.0.0(transitive)
- Removedlazystream@1.0.1(transitive)
- Removedlodash.defaults@4.2.0(transitive)
- Removedlodash.difference@4.5.0(transitive)
- Removedlodash.flatten@4.4.0(transitive)
- Removedlodash.isplainobject@4.0.6(transitive)
- Removedlodash.union@4.6.0(transitive)
- Removedminimatch@3.1.25.1.6(transitive)
- Removednormalize-path@3.0.0(transitive)
- Removedonce@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.83.6.2(transitive)
- Removedreaddir-glob@1.1.3(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsource-map@0.7.4(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedtar-stream@2.2.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedzip-stream@4.1.1(transitive)