liferay-npm-build-tools-common
Advanced tools
Comparing version 2.15.1 to 2.16.0
@@ -72,6 +72,9 @@ /** | ||
* tests. | ||
* @param projectPath project's path in native format (whether absolute or | ||
* relative to cwd) | ||
* @param projectPath | ||
* project's path in native format (whether absolute or relative to cwd) | ||
* @param configFilePath | ||
* optional path to configuration file (relative to `projectPath` if not | ||
* given as an absolute path) | ||
*/ | ||
loadFrom(projectPath: string): void; | ||
loadFrom(projectPath: string, configFilePath?: string): void; | ||
/** | ||
@@ -95,3 +98,7 @@ * Requires a module in the context of the project (as opposed to the | ||
*/ | ||
argv: string[]; | ||
argv: { | ||
config: string; | ||
'create-jar': boolean; | ||
'dump-report': boolean; | ||
}; | ||
/** | ||
@@ -125,8 +132,14 @@ * Requires a tool module in the context of the project (as opposed to the | ||
_loadPkgJson(): void; | ||
/** Project relative path to build directory */ | ||
private _buildDir; | ||
/** Absolute path to config file */ | ||
private _configFile; | ||
private _npmbundlerrc; | ||
private _pkgJson; | ||
private _pkgManager; | ||
/** Absolute path to project directory */ | ||
private _projectDir; | ||
/** Project relative paths to source directories */ | ||
private _sources; | ||
/** Absolute path to tools directory (usually project or preset dir) */ | ||
private _toolsDir; | ||
@@ -133,0 +146,0 @@ private _versionsInfo; |
@@ -169,8 +169,12 @@ "use strict"; | ||
* tests. | ||
* @param projectPath project's path in native format (whether absolute or | ||
* relative to cwd) | ||
* @param projectPath | ||
* project's path in native format (whether absolute or relative to cwd) | ||
* @param configFilePath | ||
* optional path to configuration file (relative to `projectPath` if not | ||
* given as an absolute path) | ||
*/ | ||
loadFrom(projectPath) { | ||
loadFrom(projectPath, configFilePath = '.npmbundlerrc') { | ||
// First reset everything | ||
this._buildDir = undefined; | ||
this._configFile = undefined; | ||
this._npmbundlerrc = undefined; | ||
@@ -184,2 +188,5 @@ this._pkgJson = undefined; | ||
this._projectDir = new file_path_1.default(path_1.default.resolve(projectPath)); | ||
this._configFile = new file_path_1.default(path_1.default.isAbsolute(configFilePath) | ||
? configFilePath | ||
: path_1.default.resolve(path_1.default.join(projectPath, configFilePath))); | ||
this._toolsDir = this._projectDir; | ||
@@ -224,11 +231,11 @@ // Load configuration files | ||
const { _npmbundlerrc } = this; | ||
if (argv.includes('-j') || argv.includes('--create-jar')) { | ||
if (argv.config) { | ||
this.loadFrom('.', argv.config); | ||
} | ||
if (argv['create-jar']) { | ||
_npmbundlerrc['create-jar'] = true; | ||
} | ||
if (argv.includes('-r') || argv.includes('--dump-report')) { | ||
if (argv['dump-report']) { | ||
_npmbundlerrc['dump-report'] = true; | ||
} | ||
if (argv.includes('--no-tracking')) { | ||
_npmbundlerrc['no-tracking'] = true; | ||
} | ||
} | ||
@@ -273,4 +280,3 @@ /** | ||
_loadNpmbundlerrc() { | ||
const npmbundlerrcPath = this._projectDir.join('.npmbundlerrc') | ||
.asNative; | ||
const npmbundlerrcPath = this._configFile.asNative; | ||
const config = fs_1.default.existsSync(npmbundlerrcPath) | ||
@@ -277,0 +283,0 @@ ? read_json_sync_1.default(npmbundlerrcPath) |
{ | ||
"name": "liferay-npm-build-tools-common", | ||
"version": "2.15.1", | ||
"version": "2.16.0", | ||
"description": "Utility library for Liferay NPM Build Tools.", | ||
@@ -14,3 +14,3 @@ "scripts": { | ||
"escape-string-regexp": "^2.0.0", | ||
"liferay-npm-bundler-preset-standard": "2.15.1", | ||
"liferay-npm-bundler-preset-standard": "2.16.0", | ||
"merge": "^1.2.1", | ||
@@ -21,3 +21,3 @@ "properties": "^1.2.1", | ||
}, | ||
"gitHead": "d3f746c7a0fbbdeb9e9321777396057317034423" | ||
"gitHead": "e65dc5c74a4ca87a675a4e6168510b827ec1dd52" | ||
} |
@@ -221,8 +221,15 @@ /** | ||
* tests. | ||
* @param projectPath project's path in native format (whether absolute or | ||
* relative to cwd) | ||
* @param projectPath | ||
* project's path in native format (whether absolute or relative to cwd) | ||
* @param configFilePath | ||
* optional path to configuration file (relative to `projectPath` if not | ||
* given as an absolute path) | ||
*/ | ||
loadFrom(projectPath: string): void { | ||
loadFrom( | ||
projectPath: string, | ||
configFilePath: string = '.npmbundlerrc' | ||
): void { | ||
// First reset everything | ||
this._buildDir = undefined; | ||
this._configFile = undefined; | ||
this._npmbundlerrc = undefined; | ||
@@ -237,2 +244,7 @@ this._pkgJson = undefined; | ||
this._projectDir = new FilePath(path.resolve(projectPath)); | ||
this._configFile = new FilePath( | ||
path.isAbsolute(configFilePath) | ||
? configFilePath | ||
: path.resolve(path.join(projectPath, configFilePath)) | ||
); | ||
this._toolsDir = this._projectDir; | ||
@@ -280,16 +292,20 @@ | ||
*/ | ||
set argv(argv: string[]) { | ||
set argv(argv: { | ||
config: string; | ||
'create-jar': boolean; | ||
'dump-report': boolean; | ||
}) { | ||
const {_npmbundlerrc} = this; | ||
if (argv.includes('-j') || argv.includes('--create-jar')) { | ||
if (argv.config) { | ||
this.loadFrom('.', argv.config); | ||
} | ||
if (argv['create-jar']) { | ||
_npmbundlerrc['create-jar'] = true; | ||
} | ||
if (argv.includes('-r') || argv.includes('--dump-report')) { | ||
if (argv['dump-report']) { | ||
_npmbundlerrc['dump-report'] = true; | ||
} | ||
if (argv.includes('--no-tracking')) { | ||
_npmbundlerrc['no-tracking'] = true; | ||
} | ||
} | ||
@@ -336,4 +352,3 @@ | ||
_loadNpmbundlerrc(): void { | ||
const npmbundlerrcPath = this._projectDir.join('.npmbundlerrc') | ||
.asNative; | ||
const npmbundlerrcPath = this._configFile.asNative; | ||
@@ -398,9 +413,21 @@ const config = fs.existsSync(npmbundlerrcPath) | ||
/** Project relative path to build directory */ | ||
private _buildDir: FilePath; | ||
/** Absolute path to config file */ | ||
private _configFile: FilePath; | ||
private _npmbundlerrc: object; | ||
private _pkgJson: object; | ||
private _pkgManager: PkgManager; | ||
/** Absolute path to project directory */ | ||
private _projectDir: FilePath; | ||
/** Project relative paths to source directories */ | ||
private _sources: FilePath[]; | ||
/** Absolute path to tools directory (usually project or preset dir) */ | ||
private _toolsDir: FilePath; | ||
private _versionsInfo: Map<string, VersionInfo>; | ||
@@ -407,0 +434,0 @@ } |
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
303591
9321
+ Addedbabel-plugin-add-module-metadata@2.16.0(transitive)
+ Addedbabel-plugin-alias-modules@2.16.0(transitive)
+ Addedbabel-plugin-name-amd-modules@2.16.0(transitive)
+ Addedbabel-plugin-namespace-amd-define@2.16.0(transitive)
+ Addedbabel-plugin-namespace-modules@2.16.0(transitive)
+ Addedbabel-plugin-normalize-requires@2.16.0(transitive)
+ Addedbabel-plugin-wrap-modules-amd@2.16.0(transitive)
+ Addedbabel-preset-liferay-standard@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-exclude-imports@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-inject-imports-dependencies@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-inject-peer-dependencies@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-namespace-packages@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-replace-browser-modules@2.16.0(transitive)
+ Addedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.16.0(transitive)
+ Addedliferay-npm-bundler-preset-standard@2.16.0(transitive)
- Removedbabel-plugin-add-module-metadata@2.15.1(transitive)
- Removedbabel-plugin-alias-modules@2.15.1(transitive)
- Removedbabel-plugin-name-amd-modules@2.15.1(transitive)
- Removedbabel-plugin-namespace-amd-define@2.15.1(transitive)
- Removedbabel-plugin-namespace-modules@2.15.1(transitive)
- Removedbabel-plugin-normalize-requires@2.15.1(transitive)
- Removedbabel-plugin-wrap-modules-amd@2.15.1(transitive)
- Removedbabel-preset-liferay-standard@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-exclude-imports@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-inject-imports-dependencies@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-inject-peer-dependencies@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-namespace-packages@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-replace-browser-modules@2.15.1(transitive)
- Removedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.15.1(transitive)
- Removedliferay-npm-bundler-preset-standard@2.15.1(transitive)