@instana/core
Advanced tools
Comparing version 1.94.0 to 1.95.0
{ | ||
"name": "@instana/core", | ||
"version": "1.94.0", | ||
"version": "1.95.0", | ||
"description": "Core library for Instana's Node.js packages", | ||
@@ -136,3 +136,3 @@ "main": "src/index.js", | ||
}, | ||
"gitHead": "3cdf243b6e54af501c6f9a4c20c1d02dfeee6d6f" | ||
"gitHead": "4272b0bd93264d722534761435aca19ac4382ad6" | ||
} |
@@ -10,3 +10,8 @@ 'use strict'; | ||
var mainPackageJsonPath; | ||
var appInstalledIntoNodeModules = false; | ||
exports.isAppInstalledIntoNodeModules = function isAppInstalledIntoNodeModules() { | ||
return appInstalledIntoNodeModules; | ||
}; | ||
exports.getMainPackageJson = function getMainPackageJson(startDirectory, cb) { | ||
@@ -98,5 +103,15 @@ if (typeof startDirectory === 'function') { | ||
appInstalledIntoNodeModules = dir.indexOf('node_modules') >= 0; | ||
if (appInstalledIntoNodeModules) { | ||
// Some users do not deploy their app by cloning/copying the app's sources to the target system and installing its | ||
// dependencies via npm/yarn there. Instead, they publish the whole app into an npm-compatible registry and use | ||
// npm install $appName on the target system to deploy the app including its dependencies. In this scenario, we | ||
// need to skip the check for an accompanying node_modules folder (see below). We can recognize this pattern | ||
// (heuristically) by the fact that the segment 'node_modules' already appears in the path to the main module. | ||
return process.nextTick(cb, null, fileToCheck); | ||
} | ||
// If the package.json file actually exists, we also need to make sure that there is a node_modules directory | ||
// located next to it. This way we can be relatively certain that we did not encounter a component package.json | ||
// (as used by the React for example). It is highly unlikely that the application has no dependencies, because | ||
// (as used by React for example). It is highly unlikely that the application has no dependencies, because | ||
// @instana/core is a dependency itself. | ||
@@ -103,0 +118,0 @@ if (stats.isFile()) { |
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
323118
8737