UNPKG

2.16 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 * Google as part of the polymer project is also subject to an additional IP
9 * rights grant found at http://polymer.github.io/PATENTS.txt
10 */
11import { MountPoint } from './server';
12import { BenchmarkSpec, GitDependency, NpmPackageJson, PackageVersion } from './types';
13interface GitDependencyWithTempDir extends GitDependency {
14 tempDir: string;
15 sha: string;
16}
17/**
18 * Parse an array of strings of the form <package>@<version>.
19 */
20export declare function parsePackageVersions(flags: string[]): PackageVersion[];
21export interface ServerPlan {
22 /** The benchmarks this server will handle. */
23 specs: BenchmarkSpec[];
24 /** NPM installations needed for this server. */
25 npmInstalls: NpmInstall[];
26 /** URL to disk path mappings. */
27 mountPoints: MountPoint[];
28}
29export interface NpmInstall {
30 installDir: string;
31 packageJson: NpmPackageJson;
32}
33export declare function makeServerPlans(benchmarkRoot: string, npmInstallRoot: string, specs: BenchmarkSpec[]): Promise<{
34 plans: ServerPlan[];
35 gitInstalls: GitDependencyWithTempDir[];
36}>;
37export declare function hashStrings(...strings: string[]): string;
38export declare const tachometerVersion: any;
39/**
40 * Write the given package.json to the given directory and run "npm install" in
41 * it. If the directory already exists, don't do anything except log.
42 */
43export declare function prepareVersionDirectory({ installDir, packageJson }: NpmInstall, forceCleanInstall: boolean): Promise<void>;
44/**
45 * Check out the given commit from the given git repo, and run setup commands.
46 * If the directory already exists, don't do anything except log.
47 */
48export declare function installGitDependency(gitInstall: GitDependencyWithTempDir, forceCleanInstall: boolean): Promise<void>;
49export {};