Socket
Socket
Sign inDemoInstall

azure-devops-symbols-webpack4-plugin

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-devops-symbols-webpack4-plugin - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

23

CHANGELOG.json

@@ -5,3 +5,24 @@ {

{
"date": "Tue, 29 Mar 2022 18:59:02 GMT",
"date": "Tue, 12 Jul 2022 20:18:34 GMT",
"tag": "azure-devops-symbols-webpack4-plugin_v1.1.0",
"version": "1.1.0",
"comments": {
"minor": [
{
"author": "yfeigelson@microsoft.com",
"package": "azure-devops-symbols-webpack4-plugin",
"commit": "ff2b13510854cdcb28823fec5b2751ef3b936d0b",
"comment": "Adding an optional configuration to use Edge devtools + ADO PAT"
},
{
"author": "beachball",
"package": "azure-devops-symbols-webpack4-plugin",
"comment": "Bump azure-devops-symbols-sourcemap to v1.2.1",
"commit": "ff2b13510854cdcb28823fec5b2751ef3b936d0b"
}
]
}
},
{
"date": "Tue, 29 Mar 2022 18:59:05 GMT",
"tag": "azure-devops-symbols-webpack4-plugin_v1.0.1",

@@ -8,0 +29,0 @@ "version": "1.0.1",

# Change Log - azure-devops-symbols-webpack4-plugin
This log was last generated on Tue, 29 Mar 2022 18:59:02 GMT and should not be manually modified.
This log was last generated on Tue, 12 Jul 2022 20:18:34 GMT and should not be manually modified.
<!-- Start content -->
## 1.1.0
Tue, 12 Jul 2022 20:18:34 GMT
### Minor changes
- Adding an optional configuration to use Edge devtools + ADO PAT (yfeigelson@microsoft.com)
- Bump azure-devops-symbols-sourcemap to v1.2.1
## 1.0.1
Tue, 29 Mar 2022 18:59:02 GMT
Tue, 29 Mar 2022 18:59:05 GMT

@@ -11,0 +20,0 @@ ### Patches

import * as webpackTypes from "webpack";
export interface AzureDevOpsSymbolsPluginOptions {
organization: string;
useEdgePAT?: boolean;
}

@@ -10,4 +11,5 @@ /**

organization: string;
useEdgePAT: boolean;
constructor(options?: AzureDevOpsSymbolsPluginOptions);
apply(compiler: webpackTypes.Compiler): void;
}

15

lib/plugin.js

@@ -15,4 +15,6 @@ "use strict";

this.organization = "<Organization>";
this.useEdgePAT = false;
if (options) {
this.organization = options.organization;
this.useEdgePAT = !!options.useEdgePAT;
}

@@ -56,4 +58,7 @@ }

if (sourceMap) {
// Compute the hash of the sourcefile (before appending the sourceUrl comment)
const hash = webpack.util.createHash(compilation.outputOptions.hashFunction || "md4");
// Compute the hash of the sourcefile (this is the hash before appending the sourceUrl comment, if appended)
const hashFunc = this.useEdgePAT
? "sha256"
: compilation.outputOptions.hashFunction || "md4";
const hash = webpack.util.createHash(hashFunc);
asset.source.updateHash(hash);

@@ -66,6 +71,6 @@ const clientKey = hash.digest("hex");

const sourceMapLineToAppend = (0, azure_devops_symbols_sourcemap_1.computeSourceMapUrlLine)(this.organization, clientKey, sourceMapFileName);
const sourceWithMapLineAppended = new webpackSources.ConcatSource(
const updatedSourceMapSource = new webpackSources.ConcatSource(
// @ts-ignore is fine for Webpack v4...
asset.source.source(), sourceMapLineToAppend);
const assetWithClientKeyOnSourceMap = new webpackSources.SourceMapSource(sourceWithMapLineAppended.source(), asset.name,
asset.source.source(), this.useEdgePAT ? "" : sourceMapLineToAppend);
const assetWithClientKeyOnSourceMap = new webpackSources.SourceMapSource(updatedSourceMapSource.source(), asset.name,
// @ts-ignore is fine for Webpack v4...

@@ -72,0 +77,0 @@ sourceMap, // Note: For w/e reason this has no affect on the output .map file

{
"name": "azure-devops-symbols-webpack4-plugin",
"version": "1.0.1",
"version": "1.1.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "main": "lib/plugin.js",

@@ -14,2 +14,5 @@ import * as webpackTypes from "webpack";

organization: string;
// Using the Edge AzureDevOps PersonalAccessToken route. In this case the 'sourceMappingURL' isn't appended, and users must add their ADO PAT in Edge DevTools
// See https://blogs.windows.com/msedgedev/2022/04/12/retrieve-source-maps-securely-in-production-in-microsoft-edge-devtools/
useEdgePAT?: boolean;
}

@@ -22,2 +25,3 @@

organization: string = "<Organization>";
useEdgePAT: boolean = false;

@@ -27,2 +31,3 @@ constructor(options?: AzureDevOpsSymbolsPluginOptions) {

this.organization = options.organization;
this.useEdgePAT = !!options.useEdgePAT;
}

@@ -36,3 +41,3 @@ }

!options.devtool ||
(<any>options.devtool) === true ||
<any>options.devtool === true ||
!options.devtool.includes("source-map")

@@ -80,6 +85,7 @@ ) {

if (sourceMap) {
// Compute the hash of the sourcefile (before appending the sourceUrl comment)
const hash = webpack.util.createHash(
compilation.outputOptions.hashFunction || "md4"
);
// Compute the hash of the sourcefile (this is the hash before appending the sourceUrl comment, if appended)
const hashFunc = this.useEdgePAT
? "sha256"
: compilation.outputOptions.hashFunction || "md4";
const hash = webpack.util.createHash(hashFunc);
asset.source.updateHash(hash);

@@ -100,10 +106,10 @@ const clientKey = <string>hash.digest("hex");

);
const sourceWithMapLineAppended = new webpackSources.ConcatSource(
const updatedSourceMapSource = new webpackSources.ConcatSource(
// @ts-ignore is fine for Webpack v4...
asset.source.source(),
sourceMapLineToAppend
this.useEdgePAT ? "" : sourceMapLineToAppend
);
const assetWithClientKeyOnSourceMap =
new webpackSources.SourceMapSource(
sourceWithMapLineAppended.source(),
updatedSourceMapSource.source(),
asset.name,

@@ -110,0 +116,0 @@ // @ts-ignore is fine for Webpack v4...

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