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

@ms-cloudpack/bundler-plugin-webpack

Package Overview
Dependencies
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ms-cloudpack/bundler-plugin-webpack - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

5

lib/getPathsOfModules.d.ts
/**
* Resolves the paths of the provided modules.
* @param modules - The modules to resolve.
* Resolves the paths of the provided modules relative to the bundler-plugin-webpack package,
* and returns a list of unique containing folders which webpack can use as module search paths.
* @param modules - The modules to resolve. Must be dependencies of this package.
* @returns - Containing folders of the modules. (ie: /path/to/node_modules/)

@@ -5,0 +6,0 @@ */

37

lib/getPathsOfModules.js

@@ -1,23 +0,11 @@

import { createRequire } from 'module';
import path from 'path';
const safeRequire = createRequire(import.meta.url);
function findContainingFolder(filePath, folderName) {
// Resolve the provided file path to an absolute path
const absolutePath = path.resolve(filePath);
// Split the path into an array of directories
const pathParts = absolutePath.split(path.sep);
// Find the index of the provided folder name in the path parts
const folderIndex = pathParts.indexOf(folderName);
// If the folder name is found and it's not the last part of the path,
// return the path of the parent directory
if (folderIndex !== -1 && folderIndex < pathParts.length - 1) {
const parentFolder = path.join(...pathParts.slice(0, folderIndex));
return parentFolder;
}
// If the folder name is not found or it's the last part of the path,
return undefined;
}
import { moduleResolve } from 'import-meta-resolve';
import { fileURLToPath } from 'url';
import { findPackageRoot } from '@ms-cloudpack/path-utilities';
const conditions = new Set(['node', 'require', 'import', 'default']);
const resolveFrom = new URL(import.meta.url);
/**
* Resolves the paths of the provided modules.
* @param modules - The modules to resolve.
* Resolves the paths of the provided modules relative to the bundler-plugin-webpack package,
* and returns a list of unique containing folders which webpack can use as module search paths.
* @param modules - The modules to resolve. Must be dependencies of this package.
* @returns - Containing folders of the modules. (ie: /path/to/node_modules/)

@@ -28,5 +16,8 @@ */

for (const moduleName of modules) {
const modulePath = findContainingFolder(safeRequire.resolve(moduleName), moduleName);
if (modulePath) {
paths.add(modulePath);
// Resolve the module path and find the package root from there.
// preserveSymlinks ensures we get the path where it's installed as a dependency, not from the store.
const modulePath = moduleResolve(moduleName, resolveFrom, conditions, true /*preserveSymlinks*/);
const packageRoot = findPackageRoot(fileURLToPath(modulePath));
if (packageRoot) {
paths.add(path.dirname(packageRoot));
}

@@ -33,0 +24,0 @@ }

{
"name": "@ms-cloudpack/bundler-plugin-webpack",
"version": "0.2.4",
"version": "0.2.5",
"description": "A cloudpack plugin for abstracting webpack.",

@@ -17,9 +17,11 @@ "license": "MIT",

"dependencies": {
"@ms-cloudpack/bundler-types": "^0.25.1",
"@ms-cloudpack/esm-stub-utilities": "^0.10.10",
"@ms-cloudpack/package-utilities": "^6.0.1",
"@ms-cloudpack/bundler-types": "^0.25.2",
"@ms-cloudpack/esm-stub-utilities": "^0.10.11",
"@ms-cloudpack/package-utilities": "^6.0.2",
"@ms-cloudpack/path-string-parsing": "^1.2.1",
"@ms-cloudpack/path-utilities": "^2.6.1",
"@ms-cloudpack/worker-pool": "^0.1.1",
"@swc/core": "^1.4.0",
"css-loader": "^6.0.0",
"import-meta-resolve": "^4.0.0",
"resolve-typescript-plugin": "^2.0.0",

@@ -26,0 +28,0 @@ "sass": "^1.0.0",

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