lage 2.2.3 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backfill-config.d.ts +100 -0
- package/dist/index.d.ts +238 -0
- package/dist/lage.js +13 -13
- package/dist/lage.js.map +1 -1
- package/package.json +11 -5
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
|
|
2
|
+
// Bundle of types from "backfill-config" and packages it references.
|
|
3
|
+
// This file was generated by dts-bundle-generator and packages/lage/scripts/update-dts-bundle.js
|
|
4
|
+
|
|
5
|
+
import { Readable } from 'stream';
|
|
6
|
+
|
|
7
|
+
declare const logLevelsObject: {
|
|
8
|
+
silly: number;
|
|
9
|
+
verbose: number;
|
|
10
|
+
info: number;
|
|
11
|
+
warn: number;
|
|
12
|
+
error: number;
|
|
13
|
+
mute: number;
|
|
14
|
+
};
|
|
15
|
+
declare type LogLevel = keyof typeof logLevelsObject;
|
|
16
|
+
declare type ConsoleLogger = {
|
|
17
|
+
silly(...args: string[]): void;
|
|
18
|
+
verbose(...args: string[]): void;
|
|
19
|
+
info(...args: string[]): void;
|
|
20
|
+
warn(...args: string[]): void;
|
|
21
|
+
error(...args: string[]): void;
|
|
22
|
+
};
|
|
23
|
+
declare type Times = "hashTime" | "buildTime" | "putTime" | "fetchTime";
|
|
24
|
+
declare type Logger = ConsoleLogger & {
|
|
25
|
+
setName(name: string): void;
|
|
26
|
+
setHash(hash: string): void;
|
|
27
|
+
setCacheProvider(cacheProvider: string): void;
|
|
28
|
+
setHit(hit: boolean): void;
|
|
29
|
+
setTime(type: Times): {
|
|
30
|
+
stop(): void;
|
|
31
|
+
};
|
|
32
|
+
setMode(mode: string, logLevel: "verbose" | "info"): void;
|
|
33
|
+
setHashOfOutput(hash: string): void;
|
|
34
|
+
toFile(logFolder: string): Promise<void>;
|
|
35
|
+
pipeProcessOutput(stdout: Readable | null, stderr: Readable | null): void;
|
|
36
|
+
};
|
|
37
|
+
export interface ICacheStorage {
|
|
38
|
+
fetch: (hash: string) => Promise<boolean>;
|
|
39
|
+
put: (hash: string, filesToCache: string[]) => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export declare type AzureBlobCacheStorageOptions = {
|
|
42
|
+
connectionString: string;
|
|
43
|
+
container: string;
|
|
44
|
+
maxSize?: number;
|
|
45
|
+
};
|
|
46
|
+
export declare type NpmCacheStorageOptions = {
|
|
47
|
+
npmPackageName: string;
|
|
48
|
+
registryUrl: string;
|
|
49
|
+
npmrcUserconfig?: string;
|
|
50
|
+
};
|
|
51
|
+
export declare type AzureBlobCacheStorageConfig = {
|
|
52
|
+
provider: "azure-blob";
|
|
53
|
+
options: AzureBlobCacheStorageOptions;
|
|
54
|
+
};
|
|
55
|
+
export declare type NpmCacheStorageConfig = {
|
|
56
|
+
provider: "npm";
|
|
57
|
+
options: NpmCacheStorageOptions;
|
|
58
|
+
};
|
|
59
|
+
export declare type CustomStorageConfig = {
|
|
60
|
+
provider: (logger: Logger, cwd: string) => ICacheStorage;
|
|
61
|
+
name?: string;
|
|
62
|
+
};
|
|
63
|
+
export declare type CacheStorageConfig = {
|
|
64
|
+
provider: "local";
|
|
65
|
+
} | {
|
|
66
|
+
provider: "local-skip";
|
|
67
|
+
} | NpmCacheStorageConfig | AzureBlobCacheStorageConfig | CustomStorageConfig;
|
|
68
|
+
export declare function getNpmConfigFromSerializedOptions(options: string, logger: Logger): NpmCacheStorageConfig;
|
|
69
|
+
export declare function getAzureBlobConfigFromSerializedOptions(options: string, logger: Logger): AzureBlobCacheStorageConfig;
|
|
70
|
+
export declare function getEnvConfig(logger: Logger): Partial<Config>;
|
|
71
|
+
export declare type HashGlobs = string[];
|
|
72
|
+
export declare const modesObject: {
|
|
73
|
+
READ_ONLY: string;
|
|
74
|
+
WRITE_ONLY: string;
|
|
75
|
+
READ_WRITE: string;
|
|
76
|
+
PASS: string;
|
|
77
|
+
};
|
|
78
|
+
export declare type BackfillModes = keyof typeof modesObject;
|
|
79
|
+
export declare type Config = {
|
|
80
|
+
cacheStorageConfig: CacheStorageConfig;
|
|
81
|
+
clearOutput: boolean;
|
|
82
|
+
internalCacheFolder: string;
|
|
83
|
+
logFolder: string;
|
|
84
|
+
logLevel: LogLevel;
|
|
85
|
+
name: string;
|
|
86
|
+
mode: BackfillModes;
|
|
87
|
+
outputGlob: string[];
|
|
88
|
+
packageRoot: string;
|
|
89
|
+
performanceReportName?: string;
|
|
90
|
+
producePerformanceLogs: boolean;
|
|
91
|
+
validateOutput: boolean;
|
|
92
|
+
incrementalCaching: boolean;
|
|
93
|
+
};
|
|
94
|
+
export declare function isCorrectMode(mode: string): mode is BackfillModes;
|
|
95
|
+
export declare function getName(packageRoot: string): any;
|
|
96
|
+
export declare function getSearchPaths(fromPath: string): string[];
|
|
97
|
+
export declare function createDefaultConfig(fromPath: string): Config;
|
|
98
|
+
export declare function createConfig(logger: Logger, fromPath: string): Config;
|
|
99
|
+
|
|
100
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
|
|
2
|
+
// Bundle of types from "lage" and packages it references.
|
|
3
|
+
// This file was generated by dts-bundle-generator and packages/lage/scripts/update-dts-bundle.js
|
|
4
|
+
|
|
5
|
+
import { Config as BackfillCacheOptions } from './backfill-config.js';
|
|
6
|
+
|
|
7
|
+
export type CacheOptions = BackfillCacheOptions & {
|
|
8
|
+
environmentGlob: string[];
|
|
9
|
+
cacheKey: string;
|
|
10
|
+
writeRemoteCache: boolean;
|
|
11
|
+
skipLocalCache: boolean;
|
|
12
|
+
};
|
|
13
|
+
export interface Priority {
|
|
14
|
+
/** package name, as in package.json */
|
|
15
|
+
package?: string;
|
|
16
|
+
/** task name, as listed in the `scripts` section of package.json */
|
|
17
|
+
task: string;
|
|
18
|
+
/** priority, the higher the more priority; undefined priority means lowest priority*/
|
|
19
|
+
priority: number;
|
|
20
|
+
}
|
|
21
|
+
interface Target {
|
|
22
|
+
/**
|
|
23
|
+
* Unique ID of the target (e.g. "pkg-a#build")
|
|
24
|
+
*/
|
|
25
|
+
id: string;
|
|
26
|
+
label: string;
|
|
27
|
+
cwd: string;
|
|
28
|
+
task: string;
|
|
29
|
+
/**
|
|
30
|
+
* Type of the target. If not specified, it will default to "npmScript". Determines the runner for the target.
|
|
31
|
+
*/
|
|
32
|
+
type?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Package name of the target. Undefined if this target is associated with repo root.
|
|
35
|
+
*/
|
|
36
|
+
packageName?: string;
|
|
37
|
+
/**
|
|
38
|
+
* List of "dependency specs" like "^build", "build", "foo#build"
|
|
39
|
+
*/
|
|
40
|
+
depSpecs: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Dependencies of the target - these are the targets that must be complete before the target can be complete
|
|
43
|
+
*/
|
|
44
|
+
dependencies: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Dependents of the target - these are the targets that depend on this target
|
|
47
|
+
*/
|
|
48
|
+
dependents: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Any custom priority for the target. A priority of >0 will always be prioritized over the default targets in queue
|
|
51
|
+
*/
|
|
52
|
+
priority?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Outputs of this target (for cache purposes)
|
|
55
|
+
*/
|
|
56
|
+
outputs?: string[];
|
|
57
|
+
/**
|
|
58
|
+
* Inputs for this target (for cache purposes)
|
|
59
|
+
*/
|
|
60
|
+
inputs?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* Whether to cache this target
|
|
63
|
+
*/
|
|
64
|
+
cache?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* An optional override of environmentGlob for cases when targets that need different patterns
|
|
67
|
+
*/
|
|
68
|
+
environmentGlob?: string[];
|
|
69
|
+
/**
|
|
70
|
+
* How many workers to dedicate to this task type
|
|
71
|
+
*/
|
|
72
|
+
maxWorkers?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Weight of a target - used to determine the number of "worker slots" to dedicate to a target
|
|
75
|
+
*
|
|
76
|
+
* Even if we have workers "free", we might not want to dedicate them to a target that is very heavy (i.e. takes multiple CPU cores).
|
|
77
|
+
* An example is jest targets that can take up multiple cores with its own worker pool.
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
weight?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Run options for the Target
|
|
83
|
+
*/
|
|
84
|
+
options?: Record<string, any>;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the target should be displayed by reporters
|
|
87
|
+
*/
|
|
88
|
+
hidden?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Target configuration - to be used inside `lage.config.js` options.pipeline configurations
|
|
92
|
+
*/
|
|
93
|
+
export interface TargetConfig {
|
|
94
|
+
/**
|
|
95
|
+
* The type of the target - The configuration parser will use the id of the target to determine the type.
|
|
96
|
+
* e.g. npmScript, worker
|
|
97
|
+
*/
|
|
98
|
+
type?: string;
|
|
99
|
+
/**
|
|
100
|
+
* @deprecated - use `dependsOn` instead
|
|
101
|
+
*
|
|
102
|
+
* The dependencies of the target. Dependencies are target specs in one of these forms:
|
|
103
|
+
* - "pkg-a#build"
|
|
104
|
+
* - "build"
|
|
105
|
+
* - "^build"
|
|
106
|
+
* - "^^build"
|
|
107
|
+
*/
|
|
108
|
+
deps?: string[];
|
|
109
|
+
/**
|
|
110
|
+
* The dependencies of the target. Dependencies are target specs in one of these forms:
|
|
111
|
+
* - "pkg-a#build"
|
|
112
|
+
* - "build"
|
|
113
|
+
* - "^build"
|
|
114
|
+
* - "^^build"
|
|
115
|
+
*/
|
|
116
|
+
dependsOn?: string[];
|
|
117
|
+
/**
|
|
118
|
+
* Inputs for targets. This is used to determine the hash key for caching
|
|
119
|
+
*/
|
|
120
|
+
inputs?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Outputs for targets. This is used to determine the files to be stored for caching
|
|
123
|
+
*/
|
|
124
|
+
outputs?: string[];
|
|
125
|
+
/**
|
|
126
|
+
* Priority of the target. A priority of >0 will always be prioritized over the default targets in queue
|
|
127
|
+
*/
|
|
128
|
+
priority?: number;
|
|
129
|
+
/**
|
|
130
|
+
* Whether to cache this target (defaults to true)
|
|
131
|
+
*/
|
|
132
|
+
cache?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* An optional override of environmentGlob for cases when targets that need different patterns
|
|
135
|
+
*/
|
|
136
|
+
environmentGlob?: string[];
|
|
137
|
+
/**
|
|
138
|
+
* How many workers to dedicate to this task type
|
|
139
|
+
*/
|
|
140
|
+
maxWorkers?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Weight of a target - used to determine the number of "worker slots" to dedicate to a target
|
|
143
|
+
*
|
|
144
|
+
* Even if we have workers "free", we might not want to dedicate them to a target that is very heavy (i.e. takes multiple CPU cores).
|
|
145
|
+
* An example is jest targets that can take up multiple cores with its own worker pool.
|
|
146
|
+
*
|
|
147
|
+
* This weight will be "culled" to the max number of workers (concurrency) for the target type. (i.e. maxWorkers above)
|
|
148
|
+
*/
|
|
149
|
+
weight?: number | ((target: Target, maxWorkers?: number) => number);
|
|
150
|
+
/**
|
|
151
|
+
* Run options for the Target Runner. (e.g. `{ env: ...process.env, colors: true, ... }`)
|
|
152
|
+
*/
|
|
153
|
+
options?: Record<string, any>;
|
|
154
|
+
}
|
|
155
|
+
export interface PipelineDefinition {
|
|
156
|
+
[task: string]: string[] | TargetConfig;
|
|
157
|
+
}
|
|
158
|
+
declare const LogLevel: {
|
|
159
|
+
readonly error: 10;
|
|
160
|
+
readonly warn: 20;
|
|
161
|
+
readonly info: 30;
|
|
162
|
+
readonly verbose: 40;
|
|
163
|
+
readonly silly: 50;
|
|
164
|
+
};
|
|
165
|
+
type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
|
|
166
|
+
export interface LoggerOptions {
|
|
167
|
+
disp?: {
|
|
168
|
+
[level: string]: string;
|
|
169
|
+
};
|
|
170
|
+
style?: {
|
|
171
|
+
[level: string]: {
|
|
172
|
+
fg?: string;
|
|
173
|
+
bg?: string;
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
levels?: {
|
|
177
|
+
[level: string]: LogLevel;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
export interface TargetRunnerPickerOptions {
|
|
181
|
+
[key: string]: {
|
|
182
|
+
script: string;
|
|
183
|
+
options: any;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
type NpmClient = "npm" | "yarn" | "pnpm";
|
|
187
|
+
export interface ConfigOptions {
|
|
188
|
+
/**
|
|
189
|
+
* Defines the task pipeline, prefix with "^" character to denote a direct topological dependency,
|
|
190
|
+
* prefix with ^^ to denote a transitive topological dependency.
|
|
191
|
+
*
|
|
192
|
+
* Example:
|
|
193
|
+
*
|
|
194
|
+
* ```
|
|
195
|
+
* {
|
|
196
|
+
* build: ["^build"],
|
|
197
|
+
* test: ["build"],
|
|
198
|
+
* lint: []
|
|
199
|
+
* bundle: ["^^transpile"],
|
|
200
|
+
* transpile: [],
|
|
201
|
+
* }
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
pipeline: PipelineDefinition;
|
|
205
|
+
/** Backfill cache options */
|
|
206
|
+
cacheOptions: CacheOptions;
|
|
207
|
+
/** Which files to ignore when calculating scopes with --since */
|
|
208
|
+
ignore: string[];
|
|
209
|
+
/** disables --since flag when any of this list of files changed */
|
|
210
|
+
repoWideChanges: string[];
|
|
211
|
+
/** Which NPM Client to use when running npm lifecycle scripts */
|
|
212
|
+
npmClient: NpmClient;
|
|
213
|
+
/** Optional priority to set on tasks in a package to make the scheduler give priority to tasks on the critical path for high priority tasks */
|
|
214
|
+
priorities: Priority[];
|
|
215
|
+
/**
|
|
216
|
+
* Options that will be sent to all log reporters.
|
|
217
|
+
*/
|
|
218
|
+
loggerOptions: LoggerOptions;
|
|
219
|
+
/**
|
|
220
|
+
* Custom runners for tasks in the pipeline. The key is the task name, and the value is a configuration describing what would be
|
|
221
|
+
* passed to the runner constructor.
|
|
222
|
+
*/
|
|
223
|
+
runners: TargetRunnerPickerOptions;
|
|
224
|
+
/**
|
|
225
|
+
* Maximum worker idle memory, this would cause workers to restart if they exceed this limit. This is useful to prevent memory leaks.
|
|
226
|
+
*/
|
|
227
|
+
workerIdleMemoryLimit: number;
|
|
228
|
+
/**
|
|
229
|
+
* Maximum number of concurrent tasks to run
|
|
230
|
+
*/
|
|
231
|
+
concurrency: number;
|
|
232
|
+
/**
|
|
233
|
+
* Allows for no targets run
|
|
234
|
+
*/
|
|
235
|
+
allowNoTargetRuns: boolean;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export {};
|