@lit-labs/gen-utils
Version:
Utilities for lit code generators
39 lines (38 loc) • 1.37 kB
TypeScript
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* Map npm package name to folder in monorepo to use instead
*/
export interface MonorepoPackages {
[index: string]: string;
}
/**
* Runs `npm i` in the package in the given packageRoot, optionally using
* monorepo packages in place of installing from the registry.
*
* Note that rather than using an `npm link` / symlink approach for substituting
* monorepo packages, we use `npm pack` and point package.json to the tarball
* for that package. This more closely matches how a given test package will be
* installed from the registry, and avoids issues when a monorepo has
* peerDependencies (since a monorepo package will have its own copy of its
* peerDependencies installed, which is not what will happen when installed as a
* dependency itself).
*
* @param packageRoot
* @param linkedPackages
*/
export declare const installPackage: (packageRoot: string, monorepoPackages?: MonorepoPackages) => Promise<void>;
/**
* Runs `npm run build` on the given package
* @param packageRoot
*/
export declare const buildPackage: (packageRoot: string) => Promise<void>;
/**
* Runs `npm pack` on the given package
* @param packageRoot
* @returns Absolute path to the packaged tarball
*/
export declare const packPackage: (packageRoot: string) => Promise<string>;