@salesforce/plugin-release-management
Version:
A plugin for preparing and publishing npm packages
53 lines (52 loc) • 1.82 kB
TypeScript
/**
* String representing the parsed components of an NpmName
*
* @example
* const f: NpmName = NpmName.parse('@salesforce/jj@foo');
* console.log(f.tag === 'foo')
*/
export declare class NpmName {
static readonly DEFAULT_TAG = "latest";
scope: string;
tag: string;
name: string;
/**
* Private ctor. Use static parse method.
*/
private constructor();
/**
* Parse an NPM package name into {scope, name, tag}. The tag is 'latest' by default and can be any semver string.
*
* @param {string} npmName - The npm name to parse.
* @return {NpmName} - An object with the parsed components.
*/
static parse(npmName: string): NpmName;
/**
* Static helper to parse the name and scope.
*
* @param {string} name - The string to parse.
* @param returnNpmName - The object to update.
*/
private static setNameAndScope;
/**
* Validate a component part that it's not empty and return it trimmed.
*
* @param {string} name The component to validate.
* @return {string} A whitespace trimmed version of the component.
*/
private static validateComponentString;
/**
* Produce a string that can be used by npm. @salesforce/jj@1.2.3 becomes "salesforce-jj-1.2.3.tgz
*
* @param {string} [ext = tgz] The file extension to use.
* @param {boolean} includeLatestTag - True if the "latest" tag should be used. Generally you wouldn't do this.
* @return {string} Formatted npm string thats compatible with the npm utility
*/
toFilename(ext?: string, includeLatestTag?: boolean): string;
/**
* Produces a formatted string version of the object.
*
* @return {string} A formatted string version of the object.
*/
toString(includeTag?: boolean): string;
}