piral-cli
Version:
The standard CLI for creating and building a Piral instance or a Pilet.
80 lines (79 loc) • 2.43 kB
TypeScript
import { LogLevels, PiletSchemaVersion, PiletPublishSource, PublishScheme } from '../types';
export interface PublishPiletOptions {
/**
* Sets the root module's path to use as source starting point when
* used with `--fresh`, otherwise expects source to be a path leading
* to a `*.tgz` file.
*/
source?: string | Array<string>;
/**
* Sets the URL of the feed service to deploy to.
*/
url?: string;
/**
* Sets the API key to use.
*/
apiKey?: string;
/**
* Sets the log level to use (1-5).
*/
logLevel?: LogLevels;
/**
* Specifies if the pilet should be built before publishing.
* If yes, then the tarball is created from fresh build artifacts.
*/
fresh?: boolean;
/**
* Defines a custom certificate for the feed service.
*/
cert?: string;
/**
* Allow self-signed certificates.
*/
allowSelfSigned?: boolean;
/**
* Sets the schema version of the pilet. Usually, the default one should be picked.
*/
schemaVersion?: PiletSchemaVersion;
/**
* Changing the publish source makes it possible to publish pilets that have
* been stored on non-local paths, e.g., when a pilet was already published to
* an npm feed.
*/
from?: PiletPublishSource;
/**
* Places additional fields that should be posted to the feed service.
*/
fields?: Record<string, string>;
/**
* Places additional headers that should be posted to the feed service.
*/
headers?: Record<string, string>;
/**
* Defines if authorization tokens can be retrieved interactively.
*/
interactive?: boolean;
/**
* Sets the bundler to use for building, if any specific.
*/
bundlerName?: string;
/**
* Sets the authorization scheme to use.
*/
mode?: PublishScheme;
/**
* Additional arguments for a specific bundler.
*/
_?: Record<string, any>;
/**
* Hooks to be triggered at various stages.
*/
hooks?: {
beforeBuild?(e: any): Promise<void>;
afterBuild?(e: any): Promise<void>;
beforeDeclaration?(e: any): Promise<void>;
afterDeclaration?(e: any): Promise<void>;
};
}
export declare const publishPiletDefaults: PublishPiletOptions;
export declare function publishPilet(baseDir?: string, options?: PublishPiletOptions): Promise<void>;