@liferay/generator-js
Version:
Yeoman generators for Liferay DXP and Portal CE JavaScript projects.
57 lines (56 loc) • 1.9 kB
TypeScript
/**
* SPDX-FileCopyrightText: © 2017 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
import JsonModifier from '../JsonModifier';
/**
* A class to help modifying the package.json file.
*/
export default class extends JsonModifier {
/**
* @param {Generator} generator a Yeoman generator
* @param space the space string/number of spaces to use when stringifying
*/
constructor(generator: any, space?: string | number);
/**
* Set the main entry of the package.json file
* @param {string} module module name
*/
setMain(module: any): void;
/**
* Add a devDependency to the pacakge.json file
* @param {String} name package name
* @param {String} semver semver constraints
*/
addDevDependency(name: any, semver: any): void;
/**
* Add a dependency to the pacakge.json file
* @param {String} name package name
* @param {String} semver semver constraints
*/
addDependency(name: any, semver: any): void;
/**
* Merge all dependencies and devDependencies contained in a JSON object
* into the package.json file.
* @param {Object} dependencies an object with dependencies and
* devDependencies fields
*/
mergeDependencies(dependencies: any): void;
/**
* Prepend a build command to the build npm script of package.json
* @param {String} command the command to run
*/
addBuildStep(command: any): void;
/**
* Add a new npm script to package.json
* @param {String} name name of script
* @param {String} command command to run
*/
addScript(name: any, command: any): void;
/**
* Add a property inside the portlet section.
* @param {string} name name of property
* @param {any} value value of property
*/
addPortletProperty(name: any, value: any): void;
}