@codedrifters/configulator 0.0.86 → 0.0.88
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/lib/index.d.mts +1311 -0
- package/lib/index.d.ts +1312 -10
- package/lib/index.js +1508 -26
- package/lib/index.js.map +1 -0
- package/lib/index.mjs +1497 -0
- package/lib/index.mjs.map +1 -0
- package/package.json +7 -4
- package/lib/aws/aws-deployment-config.d.ts +0 -78
- package/lib/aws/aws-deployment-config.js +0 -134
- package/lib/aws/aws-deployment-target.d.ts +0 -183
- package/lib/aws/aws-deployment-target.js +0 -163
- package/lib/aws/aws-types.d.ts +0 -63
- package/lib/aws/aws-types.js +0 -9
- package/lib/aws/index.d.ts +0 -2
- package/lib/aws/index.js +0 -19
- package/lib/git/git-types.d.ts +0 -18
- package/lib/git/git-types.js +0 -9
- package/lib/git/index.d.ts +0 -1
- package/lib/git/index.js +0 -18
- package/lib/jsii/index.d.ts +0 -1
- package/lib/jsii/index.js +0 -18
- package/lib/jsii/jsii-faker.d.ts +0 -47
- package/lib/jsii/jsii-faker.js +0 -103
- package/lib/pnpm/index.d.ts +0 -1
- package/lib/pnpm/index.js +0 -18
- package/lib/pnpm/pnpm-workspace.d.ts +0 -244
- package/lib/pnpm/pnpm-workspace.js +0 -176
- package/lib/projects/index.d.ts +0 -2
- package/lib/projects/index.js +0 -19
- package/lib/projects/monorepo-project.d.ts +0 -100
- package/lib/projects/monorepo-project.js +0 -321
- package/lib/projects/typescript-project.d.ts +0 -20
- package/lib/projects/typescript-project.js +0 -199
- package/lib/tasks/index.d.ts +0 -1
- package/lib/tasks/index.js +0 -18
- package/lib/tasks/reset-task.d.ts +0 -51
- package/lib/tasks/reset-task.js +0 -149
- package/lib/turbo/index.d.ts +0 -2
- package/lib/turbo/index.js +0 -19
- package/lib/turbo/turbo-repo-task.d.ts +0 -36
- package/lib/turbo/turbo-repo-task.js +0 -43
- package/lib/turbo/turbo-repo.d.ts +0 -375
- package/lib/turbo/turbo-repo.js +0 -299
- package/lib/typescript/index.d.ts +0 -1
- package/lib/typescript/index.js +0 -18
- package/lib/typescript/typescript-config.d.ts +0 -13
- package/lib/typescript/typescript-config.js +0 -40
- package/lib/versions.d.ts +0 -34
- package/lib/versions.js +0 -38
- package/lib/vscode/index.d.ts +0 -1
- package/lib/vscode/index.js +0 -18
- package/lib/vscode/vscode.d.ts +0 -10
- package/lib/vscode/vscode.js +0 -38
- package/lib/workflows/aws-deploy-workflow.d.ts +0 -86
- package/lib/workflows/aws-deploy-workflow.js +0 -313
- package/lib/workflows/index.d.ts +0 -1
- package/lib/workflows/index.js +0 -18
package/lib/index.d.mts
ADDED
|
@@ -0,0 +1,1311 @@
|
|
|
1
|
+
import { Component, Project, typescript } from 'projen';
|
|
2
|
+
import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';
|
|
3
|
+
import { AwsStageType, DeploymentTargetRoleType, AwsEnvironmentType, AWS_STAGE_TYPE } from '@codedrifters/utils';
|
|
4
|
+
import * as spec from '@jsii/spec';
|
|
5
|
+
import { TypeScriptProject as TypeScriptProject$1, TypeScriptAppProject, TypeScriptProjectOptions as TypeScriptProjectOptions$1 } from 'projen/lib/typescript';
|
|
6
|
+
import { ValueOf } from 'type-fest';
|
|
7
|
+
import { NodeProject, UpgradeDependencies, UpgradeDependenciesOptions } from 'projen/lib/javascript';
|
|
8
|
+
import { Component as Component$1, Project as Project$1, Task } from 'projen/lib';
|
|
9
|
+
import { BuildWorkflowOptions, BuildWorkflow } from 'projen/lib/build';
|
|
10
|
+
import { JobStep } from 'projen/lib/github/workflows-model';
|
|
11
|
+
|
|
12
|
+
/*******************************************************************************
|
|
13
|
+
*
|
|
14
|
+
* Git configs for this repo. This venn diagram has a great deal of overlap
|
|
15
|
+
* with GitHub config options but is not a perfect circle.
|
|
16
|
+
*
|
|
17
|
+
******************************************************************************/
|
|
18
|
+
interface GitBranch {
|
|
19
|
+
/**
|
|
20
|
+
* The name of the branch pattern.
|
|
21
|
+
*
|
|
22
|
+
* @example "main" or "feature/*"
|
|
23
|
+
*/
|
|
24
|
+
branch: string;
|
|
25
|
+
/**
|
|
26
|
+
* Description for this branch's purpose, used for generated documentation.
|
|
27
|
+
*/
|
|
28
|
+
description?: Array<string>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/*******************************************************************************
|
|
32
|
+
*
|
|
33
|
+
* AWS Deployment Configuration
|
|
34
|
+
*
|
|
35
|
+
* A single deployment target that CDK applications can be deployed into.
|
|
36
|
+
*
|
|
37
|
+
******************************************************************************/
|
|
38
|
+
/**
|
|
39
|
+
* Represents the configuration for local deployment in AWS.
|
|
40
|
+
*/
|
|
41
|
+
interface AwsLocalDeploymentConfig {
|
|
42
|
+
/**
|
|
43
|
+
* The AWS profile (in ~/.aws/config) to use for local deployment.
|
|
44
|
+
*
|
|
45
|
+
* @default generated dynamically based role name, account and region
|
|
46
|
+
*/
|
|
47
|
+
readonly profile?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Named Role used to conduct local deployments.
|
|
50
|
+
*
|
|
51
|
+
* @default "poweruseraccess"
|
|
52
|
+
*/
|
|
53
|
+
readonly roleName?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The pattern used to identify stacks to deploy in CI deployments.
|
|
56
|
+
*
|
|
57
|
+
* @default *-${account}-${region}
|
|
58
|
+
*/
|
|
59
|
+
readonly stackPattern?: string;
|
|
60
|
+
}
|
|
61
|
+
interface CiDeploymentConfig {
|
|
62
|
+
/**
|
|
63
|
+
* The OIDC IAM Role to assume for CI deployments.
|
|
64
|
+
*/
|
|
65
|
+
readonly roleArn: string;
|
|
66
|
+
/**
|
|
67
|
+
* The pattern used to identify stacks to deploy in CI deployments.
|
|
68
|
+
*
|
|
69
|
+
* @default *-${account}-${region}
|
|
70
|
+
*/
|
|
71
|
+
readonly stackPattern?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Represents a deployment target in AWS, including account and region, and
|
|
75
|
+
* branches allowed to deploy to this target.
|
|
76
|
+
*/
|
|
77
|
+
interface AwsDeploymentTargetOptions {
|
|
78
|
+
/**
|
|
79
|
+
* The account name for the deployment target.
|
|
80
|
+
*/
|
|
81
|
+
readonly account: string;
|
|
82
|
+
/**
|
|
83
|
+
* The AWS region for the deployment target.
|
|
84
|
+
*/
|
|
85
|
+
readonly region: string;
|
|
86
|
+
/**
|
|
87
|
+
* AWS deployment type, such as dev, stage, or prod.
|
|
88
|
+
*
|
|
89
|
+
* @default 'dev'
|
|
90
|
+
*/
|
|
91
|
+
readonly awsStageType?: AwsStageType;
|
|
92
|
+
/**
|
|
93
|
+
* Deployment target role: whether this (account, region) is the primary or
|
|
94
|
+
* secondary deployment target (e.g. primary vs replica region).
|
|
95
|
+
*
|
|
96
|
+
* @default 'primary'
|
|
97
|
+
*/
|
|
98
|
+
readonly deploymentTargetRole?: DeploymentTargetRoleType;
|
|
99
|
+
/**
|
|
100
|
+
* AWS environment type, such as primary or secondary.
|
|
101
|
+
*
|
|
102
|
+
* @deprecated Use `deploymentTargetRole` instead. This property is maintained for backward compatibility.
|
|
103
|
+
* @default 'primary'
|
|
104
|
+
*/
|
|
105
|
+
readonly awsEnvironmentType?: AwsEnvironmentType;
|
|
106
|
+
/**
|
|
107
|
+
* The AWS profile to use for this deployment target.
|
|
108
|
+
*
|
|
109
|
+
* @default ['main'] when prod release type, ['feature/*'] when dev type
|
|
110
|
+
*/
|
|
111
|
+
readonly branches?: Array<GitBranch>;
|
|
112
|
+
/**
|
|
113
|
+
* Can this deployment target be used for local development?
|
|
114
|
+
*
|
|
115
|
+
* @default true for dev environments, false for prod environments
|
|
116
|
+
*/
|
|
117
|
+
readonly localDeployment?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Configuration when deploying to this target locally.
|
|
120
|
+
*/
|
|
121
|
+
readonly localDeploymentConfig?: AwsLocalDeploymentConfig;
|
|
122
|
+
/**
|
|
123
|
+
* Can this deployment target be used in CI deployments?
|
|
124
|
+
*
|
|
125
|
+
* @default false
|
|
126
|
+
*/
|
|
127
|
+
readonly ciDeployment?: boolean;
|
|
128
|
+
readonly ciDeploymentConfig?: CiDeploymentConfig;
|
|
129
|
+
}
|
|
130
|
+
declare class AwsDeploymentTarget extends Component {
|
|
131
|
+
/**
|
|
132
|
+
* Static method to discovert targets in a project.
|
|
133
|
+
*/
|
|
134
|
+
static of(project: AwsCdkTypeScriptApp): Array<AwsDeploymentTarget> | undefined;
|
|
135
|
+
/**
|
|
136
|
+
* The account name for the deployment target.
|
|
137
|
+
*/
|
|
138
|
+
account: string;
|
|
139
|
+
/**
|
|
140
|
+
* The AWS region for the deployment target.
|
|
141
|
+
*/
|
|
142
|
+
region: string;
|
|
143
|
+
/**'
|
|
144
|
+
* AWS stage type, such as dev, stage, or prod.
|
|
145
|
+
*
|
|
146
|
+
* @default 'dev'
|
|
147
|
+
*/
|
|
148
|
+
awsStageType: AwsStageType;
|
|
149
|
+
/**
|
|
150
|
+
* Deployment target role: whether this (account, region) is the primary or
|
|
151
|
+
* secondary deployment target (e.g. primary vs replica region).
|
|
152
|
+
*
|
|
153
|
+
* @default 'primary'
|
|
154
|
+
*/
|
|
155
|
+
deploymentTargetRole: DeploymentTargetRoleType;
|
|
156
|
+
/**
|
|
157
|
+
* AWS environment type, such as primary or secondary.
|
|
158
|
+
*
|
|
159
|
+
* @deprecated Use `deploymentTargetRole` instead. This property is maintained for backward compatibility.
|
|
160
|
+
* @default 'primary'
|
|
161
|
+
*/
|
|
162
|
+
awsEnvironmentType: AwsEnvironmentType;
|
|
163
|
+
/**
|
|
164
|
+
* The AWS profile to use for this deployment target.
|
|
165
|
+
*
|
|
166
|
+
* @default ['main'] when prod release type, ['feature/*'] when dev type
|
|
167
|
+
*/
|
|
168
|
+
branches: Array<GitBranch>;
|
|
169
|
+
/**
|
|
170
|
+
* Can this deployment target be used for local development?
|
|
171
|
+
*
|
|
172
|
+
* @default true for dev environments, false for prod environments
|
|
173
|
+
*/
|
|
174
|
+
localDeployment?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Configuration when deploying to this target locally.
|
|
177
|
+
*/
|
|
178
|
+
localDeploymentConfig?: AwsLocalDeploymentConfig;
|
|
179
|
+
/**
|
|
180
|
+
* Can this deployment target be used in CI deployments?
|
|
181
|
+
*
|
|
182
|
+
* @default false
|
|
183
|
+
*/
|
|
184
|
+
ciDeployment?: boolean;
|
|
185
|
+
ciDeploymentConfig?: Required<CiDeploymentConfig>;
|
|
186
|
+
/**
|
|
187
|
+
* Configuration for the CDK output directory for this deployment target.
|
|
188
|
+
*/
|
|
189
|
+
awsDeploymentConfig: AwsDeploymentConfig;
|
|
190
|
+
constructor(project: AwsCdkTypeScriptApp, options: AwsDeploymentTargetOptions);
|
|
191
|
+
/*****************************************************************************
|
|
192
|
+
*
|
|
193
|
+
* Deploy Tasks
|
|
194
|
+
*
|
|
195
|
+
* - If local deploy, add a deploy task.
|
|
196
|
+
*
|
|
197
|
+
****************************************************************************/
|
|
198
|
+
private configureDeployTask;
|
|
199
|
+
/*****************************************************************************
|
|
200
|
+
*
|
|
201
|
+
* Watch tasks
|
|
202
|
+
*
|
|
203
|
+
* - Configure watch task to use the branch name
|
|
204
|
+
* - configure watch task to use the correct synth output location.
|
|
205
|
+
*
|
|
206
|
+
****************************************************************************/
|
|
207
|
+
private configureWatchTask;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/*******************************************************************************
|
|
211
|
+
*
|
|
212
|
+
* AWS Deployment Configuration
|
|
213
|
+
*
|
|
214
|
+
* This component allows configuration of multiple AWS deployment
|
|
215
|
+
* targets, each with its own account, region, and deployment type
|
|
216
|
+
* (dev, stage, prod). It supports both local and CI deployments,
|
|
217
|
+
* with customizable settings for each target.
|
|
218
|
+
*
|
|
219
|
+
******************************************************************************/
|
|
220
|
+
declare class AwsDeploymentConfig extends Component {
|
|
221
|
+
static of(project: AwsCdkTypeScriptApp): AwsDeploymentConfig | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Environment variables to be injected into all tasks.
|
|
224
|
+
*/
|
|
225
|
+
readonly env: Record<string, string>;
|
|
226
|
+
/**
|
|
227
|
+
* The relative path to the project directory from the root of the project.
|
|
228
|
+
*/
|
|
229
|
+
readonly projectPath: string;
|
|
230
|
+
/**
|
|
231
|
+
* The relative path to the root of the project from the output directory.
|
|
232
|
+
*/
|
|
233
|
+
readonly rootPath: string;
|
|
234
|
+
/**
|
|
235
|
+
* The output directory for the CDK synthesis, from the root directory.
|
|
236
|
+
*/
|
|
237
|
+
readonly rootCdkOut: string;
|
|
238
|
+
/**
|
|
239
|
+
* The output directory for the CDK synthesis.
|
|
240
|
+
*/
|
|
241
|
+
readonly cdkOut: string;
|
|
242
|
+
/**
|
|
243
|
+
* Array of targets for deployment.
|
|
244
|
+
*/
|
|
245
|
+
readonly awsDeploymentTargets: Array<AwsDeploymentTarget>;
|
|
246
|
+
constructor(project: AwsCdkTypeScriptApp);
|
|
247
|
+
/*****************************************************************************
|
|
248
|
+
*
|
|
249
|
+
* Target filter helpers
|
|
250
|
+
*
|
|
251
|
+
* Return various targets for deployment scripts to use.
|
|
252
|
+
*
|
|
253
|
+
****************************************************************************/
|
|
254
|
+
/**
|
|
255
|
+
* @returns All production deployment targets.
|
|
256
|
+
*/
|
|
257
|
+
get prodTargets(): Array<AwsDeploymentTarget>;
|
|
258
|
+
get prodTargetsForCI(): Array<AwsDeploymentTarget>;
|
|
259
|
+
get prodTargetsForLocal(): Array<AwsDeploymentTarget>;
|
|
260
|
+
/**
|
|
261
|
+
*
|
|
262
|
+
* @returns All stage deployment targets.
|
|
263
|
+
*/
|
|
264
|
+
get stageTargets(): Array<AwsDeploymentTarget>;
|
|
265
|
+
get stageTargetsForCI(): Array<AwsDeploymentTarget>;
|
|
266
|
+
get stageTargetsForLocal(): Array<AwsDeploymentTarget>;
|
|
267
|
+
/**
|
|
268
|
+
*
|
|
269
|
+
* @returns All dev deployment targets.
|
|
270
|
+
*/
|
|
271
|
+
get devTargets(): Array<AwsDeploymentTarget>;
|
|
272
|
+
get devTargetsForCI(): Array<AwsDeploymentTarget>;
|
|
273
|
+
get devTargetsForLocal(): Array<AwsDeploymentTarget>;
|
|
274
|
+
/*****************************************************************************
|
|
275
|
+
*
|
|
276
|
+
* Synth Tasks
|
|
277
|
+
*
|
|
278
|
+
* - Configure synth task to use the branch name
|
|
279
|
+
* - Change the output location for easier workflows.
|
|
280
|
+
*
|
|
281
|
+
****************************************************************************/
|
|
282
|
+
private configureSynthTask;
|
|
283
|
+
preSynthesize(): void;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/*******************************************************************************
|
|
287
|
+
*
|
|
288
|
+
* AWS Organization, Account, and Region Definitions. These shapes are used
|
|
289
|
+
* when configuring deployment targets that automation can deploy projects into.
|
|
290
|
+
*
|
|
291
|
+
******************************************************************************/
|
|
292
|
+
/**
|
|
293
|
+
* AWS Region
|
|
294
|
+
*
|
|
295
|
+
* Represents an active Region that deployments can be made into.
|
|
296
|
+
*/
|
|
297
|
+
interface AwsRegion {
|
|
298
|
+
/**
|
|
299
|
+
* The name of the AWS region.
|
|
300
|
+
*/
|
|
301
|
+
name: string;
|
|
302
|
+
/**
|
|
303
|
+
* The code of the AWS region (e.g., us-east-1).
|
|
304
|
+
*/
|
|
305
|
+
code: string;
|
|
306
|
+
/**
|
|
307
|
+
* Indicates if the region is currently active as a targets for deployments.
|
|
308
|
+
*/
|
|
309
|
+
active: boolean;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* AWS Account
|
|
313
|
+
*
|
|
314
|
+
* Represents an AWS account with its details.
|
|
315
|
+
*/
|
|
316
|
+
interface AwsAccount {
|
|
317
|
+
/**
|
|
318
|
+
* The name of the AWS account.
|
|
319
|
+
*/
|
|
320
|
+
name: string;
|
|
321
|
+
/**
|
|
322
|
+
* The ID (account number) of the AWS account.
|
|
323
|
+
*/
|
|
324
|
+
id: string;
|
|
325
|
+
/**
|
|
326
|
+
* The list of active regions available in the AWS account.
|
|
327
|
+
*/
|
|
328
|
+
regions: Array<AwsRegion>;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* AWS Organization
|
|
332
|
+
*
|
|
333
|
+
* Represents one Organization configuration.
|
|
334
|
+
*/
|
|
335
|
+
interface AwsOrganization {
|
|
336
|
+
/**
|
|
337
|
+
* The name of the AWS organization.
|
|
338
|
+
*/
|
|
339
|
+
name: string;
|
|
340
|
+
/**
|
|
341
|
+
* The ID of the AWS organization.
|
|
342
|
+
*/
|
|
343
|
+
id: string;
|
|
344
|
+
/**
|
|
345
|
+
* The list of AWS accounts in the organization.
|
|
346
|
+
*/
|
|
347
|
+
accounts: Array<AwsAccount>;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The FQNs for the base classes and options used by Jsii.
|
|
352
|
+
*
|
|
353
|
+
* These are the defaults used by Projen's TypeScriptProject.
|
|
354
|
+
*/
|
|
355
|
+
declare const ProjenBaseFqn: {
|
|
356
|
+
readonly TYPESCRIPT_PROJECT: "projen.typescript.TypeScriptProject";
|
|
357
|
+
readonly TYPESCRIPT_PROJECT_OPTIONS: "projen.typescript.TypeScriptProjectOptions";
|
|
358
|
+
};
|
|
359
|
+
interface ClassTypeOptions {
|
|
360
|
+
/**
|
|
361
|
+
* The name of the class.
|
|
362
|
+
*
|
|
363
|
+
* @example "MyProject"
|
|
364
|
+
*/
|
|
365
|
+
name: string;
|
|
366
|
+
/**
|
|
367
|
+
* The FQN for the base class this class is extending.
|
|
368
|
+
*
|
|
369
|
+
* @default ProjenBaseFqn.TYPESCRIPT_PROJECT
|
|
370
|
+
*/
|
|
371
|
+
baseFqn?: ValueOf<typeof ProjenBaseFqn> | string;
|
|
372
|
+
/**
|
|
373
|
+
* The FQN for the options for this class.
|
|
374
|
+
*
|
|
375
|
+
* @default ProjenBaseFqn.TYPESCRIPT_PROJECT_OPTIONS
|
|
376
|
+
*/
|
|
377
|
+
optionsFqn?: ValueOf<typeof ProjenBaseFqn> | string;
|
|
378
|
+
}
|
|
379
|
+
declare class JsiiFaker extends Component {
|
|
380
|
+
readonly project: TypeScriptProject$1;
|
|
381
|
+
static of(project: TypeScriptProject$1): JsiiFaker | undefined;
|
|
382
|
+
private _assemblyName;
|
|
383
|
+
private _types;
|
|
384
|
+
constructor(project: TypeScriptProject$1);
|
|
385
|
+
toJSON: () => {
|
|
386
|
+
types: {
|
|
387
|
+
[name: string]: spec.Type;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
addClassType(options: ClassTypeOptions): void;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Predefined minimum release age values in minutes.
|
|
395
|
+
*/
|
|
396
|
+
declare const MIMIMUM_RELEASE_AGE: {
|
|
397
|
+
ZERO_DAYS: number;
|
|
398
|
+
ONE_HOUR: number;
|
|
399
|
+
SIX_HOURS: number;
|
|
400
|
+
TWELVE_HOURS: number;
|
|
401
|
+
ONE_DAY: number;
|
|
402
|
+
TWO_DAYS: number;
|
|
403
|
+
THREE_DAYS: number;
|
|
404
|
+
FOUR_DAYS: number;
|
|
405
|
+
FIVE_DAYS: number;
|
|
406
|
+
SIX_DAYS: number;
|
|
407
|
+
ONE_WEEK: number;
|
|
408
|
+
};
|
|
409
|
+
interface PnpmWorkspaceOptions {
|
|
410
|
+
/**
|
|
411
|
+
* Filename for the pnpm workspace file. This should probably never change.
|
|
412
|
+
*
|
|
413
|
+
* @default "pnpm-workspace.yaml"
|
|
414
|
+
*/
|
|
415
|
+
readonly fileName?: string;
|
|
416
|
+
/**
|
|
417
|
+
* To reduce the risk of installing compromised packages, you can delay the
|
|
418
|
+
* installation of newly published versions. In most cases, malicious releases
|
|
419
|
+
* are discovered and removed from the registry within an hour.
|
|
420
|
+
*
|
|
421
|
+
* minimumReleaseAge defines the minimum number of minutes that must pass
|
|
422
|
+
* after a version is published before pnpm will install it. This applies to
|
|
423
|
+
* all dependencies, including transitive ones.
|
|
424
|
+
*
|
|
425
|
+
* Note: this should match depsUpgradeOptions.cooldown in the project config.
|
|
426
|
+
*
|
|
427
|
+
* See: https://pnpm.io/settings#minimumreleaseage
|
|
428
|
+
*
|
|
429
|
+
* @default MIMIMUM_RELEASE_AGE.ONE_DAY
|
|
430
|
+
*/
|
|
431
|
+
readonly minimumReleaseAge?: ValueOf<typeof MIMIMUM_RELEASE_AGE>;
|
|
432
|
+
/**
|
|
433
|
+
* If you set minimumReleaseAge but need certain dependencies to always
|
|
434
|
+
* install the newest version immediately, you can list them under
|
|
435
|
+
* minimumReleaseAgeExclude. The exclusion works by package name and applies
|
|
436
|
+
* to all versions of that package.
|
|
437
|
+
*
|
|
438
|
+
* @default - no exclusions (empty array)
|
|
439
|
+
*
|
|
440
|
+
* See: https://pnpm.io/settings#minimumreleaseageexclude
|
|
441
|
+
*/
|
|
442
|
+
readonly minimumReleaseAgeExclude?: Array<string>;
|
|
443
|
+
/**
|
|
444
|
+
* A list of package names that are allowed to execute "preinstall",
|
|
445
|
+
* "install", and/or "postinstall" scripts during installation. Only the
|
|
446
|
+
* packages listed in this array will be able to run those lifecycle scripts.
|
|
447
|
+
* If onlyBuiltDependenciesFile and neverBuiltDependencies are omitted, this
|
|
448
|
+
* configuration option will default to blocking all install scripts.
|
|
449
|
+
*
|
|
450
|
+
* You may restrict allowances to specific versions (and lists of versions
|
|
451
|
+
* using a disjunction with ||). When versions are specified, only those
|
|
452
|
+
* versions of the package may run lifecycle scripts:
|
|
453
|
+
*
|
|
454
|
+
* See: https://pnpm.io/settings#onlybuiltdependencies
|
|
455
|
+
*
|
|
456
|
+
* @default none (empty array)
|
|
457
|
+
*/
|
|
458
|
+
readonly onlyBuiltDependencies?: Array<string>;
|
|
459
|
+
/**
|
|
460
|
+
* A list of package names that are NOT allowed to execute "preinstall",
|
|
461
|
+
* "install", and/or "postinstall" scripts during installation and will not
|
|
462
|
+
* warn or ask to be executed.
|
|
463
|
+
*
|
|
464
|
+
* This is useful when you want to hide the warning because you know the
|
|
465
|
+
* lifecycle scripts are not needed.
|
|
466
|
+
*
|
|
467
|
+
* https://pnpm.io/settings#ignoredbuiltdependencies
|
|
468
|
+
*
|
|
469
|
+
* @default none (empty array)
|
|
470
|
+
*/
|
|
471
|
+
readonly ignoredBuiltDependencies?: Array<string>;
|
|
472
|
+
/**
|
|
473
|
+
* Additional subproject paths to include in the workspace packages array.
|
|
474
|
+
* These will be combined with any subprojects discovered via projen's
|
|
475
|
+
* project.subprojects property. Paths should be relative to the project root.
|
|
476
|
+
*
|
|
477
|
+
* @default none (empty array)
|
|
478
|
+
*/
|
|
479
|
+
readonly subprojects?: Array<string>;
|
|
480
|
+
/**
|
|
481
|
+
* Catalog of reusable dependency version ranges.
|
|
482
|
+
*
|
|
483
|
+
* The catalog allows you to define dependency versions as reusable constants
|
|
484
|
+
* that can be referenced in package.json files using the catalog: protocol.
|
|
485
|
+
*
|
|
486
|
+
* Example:
|
|
487
|
+
* ```yaml
|
|
488
|
+
* catalog:
|
|
489
|
+
* react: ^18.0.0
|
|
490
|
+
* typescript: ^5.0.0
|
|
491
|
+
* ```
|
|
492
|
+
*
|
|
493
|
+
* Then in package.json:
|
|
494
|
+
* ```json
|
|
495
|
+
* {
|
|
496
|
+
* "dependencies": {
|
|
497
|
+
* "react": "catalog:react"
|
|
498
|
+
* }
|
|
499
|
+
* }
|
|
500
|
+
* ```
|
|
501
|
+
*
|
|
502
|
+
* @default undefined (not included in output)
|
|
503
|
+
*
|
|
504
|
+
* See: https://pnpm.io/pnpm-workspace_yaml#catalog
|
|
505
|
+
*/
|
|
506
|
+
readonly defaultCatalog?: {
|
|
507
|
+
[key: string]: string;
|
|
508
|
+
};
|
|
509
|
+
/**
|
|
510
|
+
* Named catalogs of reusable dependency version ranges.
|
|
511
|
+
*
|
|
512
|
+
* Multiple named catalogs with arbitrarily chosen names can be configured under the namedCatalogs key.
|
|
513
|
+
*
|
|
514
|
+
* Example:
|
|
515
|
+
* ```yaml
|
|
516
|
+
* namedCatalogs:
|
|
517
|
+
* frontend:
|
|
518
|
+
* react: ^18.0.0
|
|
519
|
+
* typescript: ^5.0.0
|
|
520
|
+
* backend:
|
|
521
|
+
* express: ^4.18.0
|
|
522
|
+
* ```
|
|
523
|
+
*
|
|
524
|
+
* Then in package.json:
|
|
525
|
+
* ```json
|
|
526
|
+
* {
|
|
527
|
+
* "dependencies": {
|
|
528
|
+
* "react": "catalog:frontend/react"
|
|
529
|
+
* }
|
|
530
|
+
* }
|
|
531
|
+
* ```
|
|
532
|
+
*
|
|
533
|
+
* @default undefined (not included in output)
|
|
534
|
+
*
|
|
535
|
+
* See: https://pnpm.io/catalogs
|
|
536
|
+
*/
|
|
537
|
+
readonly namedCatalogs?: {
|
|
538
|
+
[catalogName: string]: {
|
|
539
|
+
[dependencyName: string]: string;
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
declare class PnpmWorkspace extends Component {
|
|
544
|
+
/**
|
|
545
|
+
* Get the pnpm workspace component of a project. If it does not exist,
|
|
546
|
+
* return undefined.
|
|
547
|
+
*
|
|
548
|
+
* @param project
|
|
549
|
+
* @returns
|
|
550
|
+
*/
|
|
551
|
+
static of(project: Project): PnpmWorkspace | undefined;
|
|
552
|
+
/**
|
|
553
|
+
* Filename for the pnpm workspace file.
|
|
554
|
+
*/
|
|
555
|
+
readonly fileName: string;
|
|
556
|
+
/**
|
|
557
|
+
* To reduce the risk of installing compromised packages, you can delay the
|
|
558
|
+
* installation of newly published versions. In most cases, malicious releases
|
|
559
|
+
* are discovered and removed from the registry within an hour.
|
|
560
|
+
*
|
|
561
|
+
* minimumReleaseAge defines the minimum number of minutes that must pass
|
|
562
|
+
* after a version is published before pnpm will install it. This applies to
|
|
563
|
+
* all dependencies, including transitive ones.
|
|
564
|
+
*
|
|
565
|
+
* Note: this should match depsUpgradeOptions.cooldown in the project config.
|
|
566
|
+
*
|
|
567
|
+
* See: https://pnpm.io/settings#minimumreleaseage
|
|
568
|
+
*/
|
|
569
|
+
minimumReleaseAge: ValueOf<typeof MIMIMUM_RELEASE_AGE>;
|
|
570
|
+
/**
|
|
571
|
+
* If you set minimumReleaseAge but need certain dependencies to always
|
|
572
|
+
* install the newest version immediately, you can list them under
|
|
573
|
+
* minimumReleaseAgeExclude. The exclusion works by package name and applies
|
|
574
|
+
* to all versions of that package.
|
|
575
|
+
*
|
|
576
|
+
* See: https://pnpm.io/settings#minimumreleaseageexclude
|
|
577
|
+
*/
|
|
578
|
+
minimumReleaseAgeExclude: Array<string>;
|
|
579
|
+
/**
|
|
580
|
+
* A list of package names that are allowed to execute "preinstall",
|
|
581
|
+
* "install", and/or "postinstall" scripts during installation. Only the
|
|
582
|
+
* packages listed in this array will be able to run those lifecycle scripts.
|
|
583
|
+
* If onlyBuiltDependenciesFile and neverBuiltDependencies are omitted, this
|
|
584
|
+
* configuration option will default to blocking all install scripts.
|
|
585
|
+
*
|
|
586
|
+
* You may restrict allowances to specific versions (and lists of versions
|
|
587
|
+
* using a disjunction with ||). When versions are specified, only those
|
|
588
|
+
* versions of the package may run lifecycle scripts:
|
|
589
|
+
*
|
|
590
|
+
* See: https://pnpm.io/settings#onlybuiltdependencies
|
|
591
|
+
*/
|
|
592
|
+
onlyBuiltDependencies: Array<string>;
|
|
593
|
+
/**
|
|
594
|
+
* A list of package names that are NOT allowed to execute "preinstall",
|
|
595
|
+
* "install", and/or "postinstall" scripts during installation and will not
|
|
596
|
+
* warn or ask to be executed.
|
|
597
|
+
*
|
|
598
|
+
* This is useful when you want to hide the warning because you know the
|
|
599
|
+
* lifecycle scripts are not needed.
|
|
600
|
+
*
|
|
601
|
+
* https://pnpm.io/settings#ignoredbuiltdependencies
|
|
602
|
+
*/
|
|
603
|
+
ignoredBuiltDependencies: Array<string>;
|
|
604
|
+
/**
|
|
605
|
+
* Additional subproject paths to include in the workspace packages array.
|
|
606
|
+
* These will be combined with any subprojects discovered via projen's
|
|
607
|
+
* project.subprojects property.
|
|
608
|
+
*/
|
|
609
|
+
subprojects: Array<string>;
|
|
610
|
+
/**
|
|
611
|
+
* Default catalog of reusable dependency version ranges.
|
|
612
|
+
*
|
|
613
|
+
* The default catalog is used to define dependency versions as reusable constants
|
|
614
|
+
* that can be referenced in package.json files using the catalog: protocol.
|
|
615
|
+
*
|
|
616
|
+
* See:https://pnpm.io/catalogs
|
|
617
|
+
*/
|
|
618
|
+
defaultCatalog?: {
|
|
619
|
+
[key: string]: string;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Named catalogs of reusable dependency version ranges.
|
|
623
|
+
*
|
|
624
|
+
* Multiple named catalogs with arbitrarily chosen names can be configured under the namedCatalogs key.
|
|
625
|
+
*
|
|
626
|
+
* See: https://pnpm.io/catalogs
|
|
627
|
+
*/
|
|
628
|
+
namedCatalogs?: {
|
|
629
|
+
[catalogName: string]: {
|
|
630
|
+
[dependencyName: string]: string;
|
|
631
|
+
};
|
|
632
|
+
};
|
|
633
|
+
constructor(project: Project, options?: PnpmWorkspaceOptions);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/*******************************************************************************
|
|
637
|
+
*
|
|
638
|
+
* Reset Task Component
|
|
639
|
+
*
|
|
640
|
+
* Adds a "reset" task that deletes all build artifacts produced by the build
|
|
641
|
+
* process. This includes node_modules, lib, dist, coverage, test-reports,
|
|
642
|
+
* .turbo, and tsconfig.tsbuildinfo.
|
|
643
|
+
*
|
|
644
|
+
******************************************************************************/
|
|
645
|
+
interface ResetTaskOptions {
|
|
646
|
+
/**
|
|
647
|
+
* Custom output directory to delete (overrides tsconfig artifactsDirectory detection).
|
|
648
|
+
*
|
|
649
|
+
* @default - detected from typescript project.artifactsDirectory or "lib"
|
|
650
|
+
*/
|
|
651
|
+
readonly artifactsDirectory?: string;
|
|
652
|
+
/**
|
|
653
|
+
* Array of glob patterns for paths to remove.
|
|
654
|
+
* If empty, the artifactsDirectory will be added automatically.
|
|
655
|
+
*
|
|
656
|
+
* @default []
|
|
657
|
+
*/
|
|
658
|
+
readonly pathsToRemove?: string[];
|
|
659
|
+
/**
|
|
660
|
+
* Name of the task to create.
|
|
661
|
+
*
|
|
662
|
+
* @default "reset"
|
|
663
|
+
*/
|
|
664
|
+
readonly taskName?: string;
|
|
665
|
+
}
|
|
666
|
+
declare class ResetTask extends Component {
|
|
667
|
+
readonly project: Project;
|
|
668
|
+
/**
|
|
669
|
+
* Static method to discover reset task in a project.
|
|
670
|
+
*/
|
|
671
|
+
static of(project: Project): ResetTask | undefined;
|
|
672
|
+
/**
|
|
673
|
+
* The output directory to delete (from tsconfig or custom).
|
|
674
|
+
*/
|
|
675
|
+
readonly artifactsDirectory: string;
|
|
676
|
+
/**
|
|
677
|
+
* The final array of paths that will be removed by the reset task.
|
|
678
|
+
*/
|
|
679
|
+
readonly pathsToRemove: string[];
|
|
680
|
+
/**
|
|
681
|
+
* The name of the task that was created.
|
|
682
|
+
*/
|
|
683
|
+
readonly taskName: string;
|
|
684
|
+
constructor(project: Project, options?: ResetTaskOptions);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* Each of the below options corresponds to a task property found here:
|
|
689
|
+
* * https://turborepo.com/docs/reference/configuration#defining-tasks
|
|
690
|
+
*/
|
|
691
|
+
interface TurboRepoTaskOptions {
|
|
692
|
+
readonly name: string;
|
|
693
|
+
readonly dependsOn?: Array<string>;
|
|
694
|
+
readonly env?: Array<string>;
|
|
695
|
+
readonly passThroughEnv?: Array<string>;
|
|
696
|
+
readonly outputs?: Array<string>;
|
|
697
|
+
readonly cache?: boolean;
|
|
698
|
+
readonly inputs?: Array<string>;
|
|
699
|
+
readonly outputLogs?: "full" | "hash-only" | "new-only" | "errors-only" | "none";
|
|
700
|
+
readonly persistent?: boolean;
|
|
701
|
+
readonly interactive?: boolean;
|
|
702
|
+
}
|
|
703
|
+
declare class TurboRepoTask extends Component$1 {
|
|
704
|
+
readonly project: Project$1;
|
|
705
|
+
readonly name: string;
|
|
706
|
+
dependsOn: Array<string>;
|
|
707
|
+
readonly env: Array<string>;
|
|
708
|
+
readonly passThroughEnv: Array<string>;
|
|
709
|
+
outputs: Array<string>;
|
|
710
|
+
cache: boolean;
|
|
711
|
+
inputs: Array<string>;
|
|
712
|
+
readonly outputLogs: "full" | "hash-only" | "new-only" | "errors-only" | "none";
|
|
713
|
+
readonly persistent: boolean;
|
|
714
|
+
readonly interactive: boolean;
|
|
715
|
+
/**
|
|
716
|
+
* Include this task in turbo.json output?
|
|
717
|
+
*/
|
|
718
|
+
isActive: boolean;
|
|
719
|
+
constructor(project: Project$1, options: TurboRepoTaskOptions);
|
|
720
|
+
taskConfig(): Record<string, any>;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/*******************************************************************************
|
|
724
|
+
*
|
|
725
|
+
* Turbo Repo Config
|
|
726
|
+
*
|
|
727
|
+
******************************************************************************/
|
|
728
|
+
declare const ROOT_TURBO_TASK_NAME = "turbo:build";
|
|
729
|
+
declare const ROOT_CI_TASK_NAME = "build:all";
|
|
730
|
+
interface RemoteCacheOptions {
|
|
731
|
+
/**
|
|
732
|
+
* Local profile name to use when fetching the cache endpoint and token.
|
|
733
|
+
*/
|
|
734
|
+
readonly profileName: string;
|
|
735
|
+
/**
|
|
736
|
+
* OIDC role to assume when fetching the cache endpoint and token.
|
|
737
|
+
*/
|
|
738
|
+
readonly oidcRole: string;
|
|
739
|
+
/**
|
|
740
|
+
* Name for the params used to store the cache endpoint.
|
|
741
|
+
*/
|
|
742
|
+
readonly endpointParamName: string;
|
|
743
|
+
/**
|
|
744
|
+
* Name for the params used to store the cache's API token.
|
|
745
|
+
*/
|
|
746
|
+
readonly tokenParamName: string;
|
|
747
|
+
/**
|
|
748
|
+
* team name used in remote cache commands
|
|
749
|
+
*/
|
|
750
|
+
readonly teamName: string;
|
|
751
|
+
}
|
|
752
|
+
interface TurboRepoOptions {
|
|
753
|
+
/**
|
|
754
|
+
* Version of turborepo to use.
|
|
755
|
+
*
|
|
756
|
+
* @default: specified in versions file
|
|
757
|
+
*/
|
|
758
|
+
readonly turboVersion?: string;
|
|
759
|
+
/**
|
|
760
|
+
* Extend from the root turbo.json to create specific configuration for a package using Package Configurations.
|
|
761
|
+
*
|
|
762
|
+
* The only valid value for extends is ["//"] to inherit configuration from the root turbo.json.
|
|
763
|
+
* If extends is used in the root turbo.json, it will be ignored.
|
|
764
|
+
*
|
|
765
|
+
* https://turbo.build/repo/docs/reference/configuration#extends
|
|
766
|
+
*/
|
|
767
|
+
readonly extends?: Array<string>;
|
|
768
|
+
/**
|
|
769
|
+
* A list of globs that you want to include in all task hashes. If any file matching these globs changes, all tasks will miss cache. Globs are relative to the location of turbo.json.
|
|
770
|
+
*
|
|
771
|
+
* By default, all files in source control in the Workspace root are included in the global hash.
|
|
772
|
+
*
|
|
773
|
+
* Globs must be in the repository's source control root. Globs outside of the repository aren't supported.
|
|
774
|
+
*
|
|
775
|
+
* https://turbo.build/repo/docs/reference/configuration#globaldependencies
|
|
776
|
+
*/
|
|
777
|
+
readonly globalDependencies?: Array<string>;
|
|
778
|
+
/**
|
|
779
|
+
* A list of environment variables that you want to impact the hash of all tasks. Any change to these environment variables will cause all tasks to miss cache.
|
|
780
|
+
*
|
|
781
|
+
* For more on wildcard and negation syntax, see the env section.
|
|
782
|
+
*
|
|
783
|
+
* https://turbo.build/repo/docs/reference/configuration#globalenv
|
|
784
|
+
*/
|
|
785
|
+
readonly globalEnv?: Array<string>;
|
|
786
|
+
/**
|
|
787
|
+
* A list of environment variables that you want to make available to tasks.
|
|
788
|
+
* Using this key opts all tasks into Strict
|
|
789
|
+
* Environment Variable Mode.
|
|
790
|
+
*
|
|
791
|
+
* Additionally, Turborepo has a built-in set of global passthrough variables
|
|
792
|
+
* for common cases, like operating system environment variables. This
|
|
793
|
+
* includes variables like HOME, PATH, APPDATA, SHELL, PWD, and more. The full
|
|
794
|
+
* list can be found in the source code.
|
|
795
|
+
*
|
|
796
|
+
* Passthrough values do not contribute to hashes for caching
|
|
797
|
+
*
|
|
798
|
+
* If you want changes in these variables to cause cache misses, you will need
|
|
799
|
+
* to include them in env or globalEnv.
|
|
800
|
+
*
|
|
801
|
+
* https://turbo.build/repo/docs/reference/configuration#globalpassthroughenv
|
|
802
|
+
*/
|
|
803
|
+
readonly globalPassThroughEnv?: Array<string>;
|
|
804
|
+
/**
|
|
805
|
+
* @default: "stream"
|
|
806
|
+
*
|
|
807
|
+
* Select a terminal UI for the repository.
|
|
808
|
+
*
|
|
809
|
+
* "tui" allows for viewing each log at once and interacting with the task.
|
|
810
|
+
* "stream" outputs logs as they come in and is not interactive.
|
|
811
|
+
*
|
|
812
|
+
* https://turbo.build/repo/docs/reference/configuration#ui
|
|
813
|
+
*/
|
|
814
|
+
readonly ui?: "tui" | "stream";
|
|
815
|
+
/**
|
|
816
|
+
* @default: false
|
|
817
|
+
*
|
|
818
|
+
* Turborepo uses your repository's lockfile to determine caching behavior,
|
|
819
|
+
* Package Graphs, and more. Because of this, we use the packageManager field
|
|
820
|
+
* to help you stabilize your Turborepo.
|
|
821
|
+
*
|
|
822
|
+
* To help with incremental migration or in situations where you can't use
|
|
823
|
+
* the packageManager field, you may use
|
|
824
|
+
* --dangerously-disable-package-manager-check to opt out of this check and
|
|
825
|
+
* assume the risks of unstable lockfiles producing unpredictable behavior.
|
|
826
|
+
* When disabled, Turborepo will attempt a best-effort discovery of the
|
|
827
|
+
* intended package manager meant for the repository.
|
|
828
|
+
*
|
|
829
|
+
* https://turbo.build/repo/docs/reference/configuration#dangerouslydisablepackagemanagercheck
|
|
830
|
+
*/
|
|
831
|
+
readonly dangerouslyDisablePackageManagerCheck?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* @default: ".turbo/cache"
|
|
834
|
+
*
|
|
835
|
+
* Specify the filesystem cache directory.
|
|
836
|
+
*
|
|
837
|
+
* https://turbo.build/repo/docs/reference/configuration#cachedir
|
|
838
|
+
*/
|
|
839
|
+
readonly cacheDir?: string;
|
|
840
|
+
/**
|
|
841
|
+
* @default: true
|
|
842
|
+
*
|
|
843
|
+
* Turborepo runs a background process to pre-calculate some expensive
|
|
844
|
+
* operations. This standalone process (daemon) is a performance optimization,
|
|
845
|
+
* and not required for proper functioning of turbo.
|
|
846
|
+
*
|
|
847
|
+
* https://turbo.build/repo/docs/reference/configuration#daemon
|
|
848
|
+
*/
|
|
849
|
+
readonly daemon?: boolean;
|
|
850
|
+
/**
|
|
851
|
+
* @default: "strict"
|
|
852
|
+
*
|
|
853
|
+
* Turborepo's Environment Modes allow you to control which environment
|
|
854
|
+
* variables are available to a task at runtime:
|
|
855
|
+
*
|
|
856
|
+
*"strict": Filter environment variables to only those that are specified
|
|
857
|
+
* in the env and globalEnv keys in turbo.json.
|
|
858
|
+
*
|
|
859
|
+
* "loose": Allow all environment variables for the process to be available.
|
|
860
|
+
*
|
|
861
|
+
* https://turbo.build/repo/docs/reference/configuration#envmode
|
|
862
|
+
*/
|
|
863
|
+
readonly envMode?: string;
|
|
864
|
+
/*****************************************************************************
|
|
865
|
+
*
|
|
866
|
+
* Cache Settings
|
|
867
|
+
*
|
|
868
|
+
****************************************************************************/
|
|
869
|
+
/**
|
|
870
|
+
* Cache settings, if using remote cache.
|
|
871
|
+
*/
|
|
872
|
+
readonly remoteCacheOptions?: RemoteCacheOptions;
|
|
873
|
+
/**
|
|
874
|
+
* Env Args that will bre added to turbo's build:all task
|
|
875
|
+
*
|
|
876
|
+
* @default: {}
|
|
877
|
+
*/
|
|
878
|
+
readonly buildAllTaskEnvVars?: Record<string, string>;
|
|
879
|
+
/*****************************************************************************
|
|
880
|
+
*
|
|
881
|
+
* Tasks - Optionally define a different projen task for one of the lifecycle
|
|
882
|
+
* steps.
|
|
883
|
+
*
|
|
884
|
+
****************************************************************************/
|
|
885
|
+
/**
|
|
886
|
+
* Pre compile task
|
|
887
|
+
*
|
|
888
|
+
* @default: "pre-compile"
|
|
889
|
+
*/
|
|
890
|
+
readonly preCompileTask?: Task;
|
|
891
|
+
/**
|
|
892
|
+
* Compile task
|
|
893
|
+
*
|
|
894
|
+
* @default: "compile"
|
|
895
|
+
*/
|
|
896
|
+
readonly compileTask?: Task;
|
|
897
|
+
/**
|
|
898
|
+
* Post compile task
|
|
899
|
+
*
|
|
900
|
+
* @default: "post-compile"
|
|
901
|
+
*/
|
|
902
|
+
readonly postCompileTask?: Task;
|
|
903
|
+
/**
|
|
904
|
+
* Test task
|
|
905
|
+
*
|
|
906
|
+
* @default: "test"
|
|
907
|
+
*/
|
|
908
|
+
readonly testTask?: Task;
|
|
909
|
+
/**
|
|
910
|
+
* Package task
|
|
911
|
+
*
|
|
912
|
+
* @default: "package"
|
|
913
|
+
*/
|
|
914
|
+
readonly packageTask?: Task;
|
|
915
|
+
}
|
|
916
|
+
declare class TurboRepo extends Component$1 {
|
|
917
|
+
readonly project: NodeProject;
|
|
918
|
+
/**
|
|
919
|
+
* Static method to discovert turbo in a project.
|
|
920
|
+
*/
|
|
921
|
+
static of(project: Project$1): TurboRepo | undefined;
|
|
922
|
+
static buildWorkflowOptions: (remoteCacheOptions: RemoteCacheOptions) => Partial<BuildWorkflowOptions>;
|
|
923
|
+
/**
|
|
924
|
+
* Version of turborepo to use.
|
|
925
|
+
*/
|
|
926
|
+
readonly turboVersion: string;
|
|
927
|
+
/**
|
|
928
|
+
* Extend from the root turbo.json to create specific configuration for a package using Package Configurations.
|
|
929
|
+
*
|
|
930
|
+
* The only valid value for extends is ["//"] to inherit configuration from the root turbo.json.
|
|
931
|
+
* If extends is used in the root turbo.json, it will be ignored.
|
|
932
|
+
*
|
|
933
|
+
* https://turbo.build/repo/docs/reference/configuration#extends
|
|
934
|
+
*/
|
|
935
|
+
readonly extends: Array<string>;
|
|
936
|
+
/**
|
|
937
|
+
* A list of globs that you want to include in all task hashes. If any file matching these globs changes, all tasks will miss cache. Globs are relative to the location of turbo.json.
|
|
938
|
+
*
|
|
939
|
+
* By default, all files in source control in the Workspace root are included in the global hash.
|
|
940
|
+
*
|
|
941
|
+
* Globs must be in the repository's source control root. Globs outside of the repository aren't supported.
|
|
942
|
+
*
|
|
943
|
+
* https://turbo.build/repo/docs/reference/configuration#globaldependencies
|
|
944
|
+
*/
|
|
945
|
+
readonly globalDependencies: Array<string>;
|
|
946
|
+
/**
|
|
947
|
+
* A list of environment variables that you want to impact the hash of all tasks. Any change to these environment variables will cause all tasks to miss cache.
|
|
948
|
+
*
|
|
949
|
+
* For more on wildcard and negation syntax, see the env section.
|
|
950
|
+
*
|
|
951
|
+
* https://turbo.build/repo/docs/reference/configuration#globalenv
|
|
952
|
+
*/
|
|
953
|
+
readonly globalEnv: Array<string>;
|
|
954
|
+
/**
|
|
955
|
+
* A list of environment variables that you want to make available to tasks.
|
|
956
|
+
* Using this key opts all tasks into Strict
|
|
957
|
+
* Environment Variable Mode.
|
|
958
|
+
*
|
|
959
|
+
* Additionally, Turborepo has a built-in set of global passthrough variables
|
|
960
|
+
* for common cases, like operating system environment variables. This
|
|
961
|
+
* includes variables like HOME, PATH, APPDATA, SHELL, PWD, and more. The full
|
|
962
|
+
* list can be found in the source code.
|
|
963
|
+
*
|
|
964
|
+
* Passthrough values do not contribute to hashes for caching
|
|
965
|
+
*
|
|
966
|
+
* If you want changes in these variables to cause cache misses, you will need
|
|
967
|
+
* to include them in env or globalEnv.
|
|
968
|
+
*
|
|
969
|
+
* https://turbo.build/repo/docs/reference/configuration#globalpassthroughenv
|
|
970
|
+
*/
|
|
971
|
+
readonly globalPassThroughEnv: Array<string>;
|
|
972
|
+
/**
|
|
973
|
+
* @default: "stream"
|
|
974
|
+
*
|
|
975
|
+
* Select a terminal UI for the repository.
|
|
976
|
+
*
|
|
977
|
+
* "tui" allows for viewing each log at once and interacting with the task.
|
|
978
|
+
* "stream" outputs logs as they come in and is not interactive.
|
|
979
|
+
*
|
|
980
|
+
* https://turbo.build/repo/docs/reference/configuration#ui
|
|
981
|
+
*/
|
|
982
|
+
readonly ui: "tui" | "stream";
|
|
983
|
+
/**
|
|
984
|
+
* @default: false
|
|
985
|
+
*
|
|
986
|
+
* Turborepo uses your repository's lockfile to determine caching behavior,
|
|
987
|
+
* Package Graphs, and more. Because of this, we use the packageManager field
|
|
988
|
+
* to help you stabilize your Turborepo.
|
|
989
|
+
*
|
|
990
|
+
* To help with incremental migration or in situations where you can't use
|
|
991
|
+
* the packageManager field, you may use
|
|
992
|
+
* --dangerously-disable-package-manager-check to opt out of this check and
|
|
993
|
+
* assume the risks of unstable lockfiles producing unpredictable behavior.
|
|
994
|
+
* When disabled, Turborepo will attempt a best-effort discovery of the
|
|
995
|
+
* intended package manager meant for the repository.
|
|
996
|
+
*
|
|
997
|
+
* https://turbo.build/repo/docs/reference/configuration#dangerouslydisablepackagemanagercheck
|
|
998
|
+
*/
|
|
999
|
+
readonly dangerouslyDisablePackageManagerCheck: boolean;
|
|
1000
|
+
/**
|
|
1001
|
+
* @default: ".turbo/cache"
|
|
1002
|
+
*
|
|
1003
|
+
* Specify the filesystem cache directory.
|
|
1004
|
+
*
|
|
1005
|
+
* https://turbo.build/repo/docs/reference/configuration#cachedir
|
|
1006
|
+
*/
|
|
1007
|
+
readonly cacheDir: string;
|
|
1008
|
+
/**
|
|
1009
|
+
* @default: true
|
|
1010
|
+
*
|
|
1011
|
+
* Turborepo runs a background process to pre-calculate some expensive
|
|
1012
|
+
* operations. This standalone process (daemon) is a performance optimization,
|
|
1013
|
+
* and not required for proper functioning of turbo.
|
|
1014
|
+
*
|
|
1015
|
+
* https://turbo.build/repo/docs/reference/configuration#daemon
|
|
1016
|
+
*/
|
|
1017
|
+
readonly daemon: boolean;
|
|
1018
|
+
/**
|
|
1019
|
+
* @default: "strict"
|
|
1020
|
+
*
|
|
1021
|
+
* Turborepo's Environment Modes allow you to control which environment
|
|
1022
|
+
* variables are available to a task at runtime:
|
|
1023
|
+
*
|
|
1024
|
+
*"strict": Filter environment variables to only those that are specified
|
|
1025
|
+
* in the env and globalEnv keys in turbo.json.
|
|
1026
|
+
*
|
|
1027
|
+
* "loose": Allow all environment variables for the process to be available.
|
|
1028
|
+
*
|
|
1029
|
+
* https://turbo.build/repo/docs/reference/configuration#envmode
|
|
1030
|
+
*/
|
|
1031
|
+
readonly envMode: string;
|
|
1032
|
+
/*****************************************************************************
|
|
1033
|
+
*
|
|
1034
|
+
* Cache Settings
|
|
1035
|
+
*
|
|
1036
|
+
****************************************************************************/
|
|
1037
|
+
/**
|
|
1038
|
+
* Cache settings, if using remote cache.
|
|
1039
|
+
*/
|
|
1040
|
+
readonly remoteCacheOptions?: RemoteCacheOptions;
|
|
1041
|
+
/**
|
|
1042
|
+
* is this the root project?
|
|
1043
|
+
*/
|
|
1044
|
+
readonly isRootProject: boolean;
|
|
1045
|
+
/**
|
|
1046
|
+
* Turbo's build:all task at the root of the monorepo.
|
|
1047
|
+
*
|
|
1048
|
+
* This is a normal projen task that runs the root turbo task.
|
|
1049
|
+
*/
|
|
1050
|
+
readonly buildAllTask?: Task;
|
|
1051
|
+
/**
|
|
1052
|
+
* Main turbo:build task
|
|
1053
|
+
*
|
|
1054
|
+
* This is a special Turbo task
|
|
1055
|
+
*/
|
|
1056
|
+
readonly buildTask: TurboRepoTask;
|
|
1057
|
+
/**
|
|
1058
|
+
* pre compile task
|
|
1059
|
+
*/
|
|
1060
|
+
readonly preCompileTask?: TurboRepoTask;
|
|
1061
|
+
/**
|
|
1062
|
+
* compile task
|
|
1063
|
+
*/
|
|
1064
|
+
readonly compileTask?: TurboRepoTask;
|
|
1065
|
+
/**
|
|
1066
|
+
* post compile task
|
|
1067
|
+
*/
|
|
1068
|
+
readonly postCompileTask?: TurboRepoTask;
|
|
1069
|
+
/**
|
|
1070
|
+
* Test task
|
|
1071
|
+
*/
|
|
1072
|
+
readonly testTask?: TurboRepoTask;
|
|
1073
|
+
/**
|
|
1074
|
+
* Package task
|
|
1075
|
+
*/
|
|
1076
|
+
readonly packageTask?: TurboRepoTask;
|
|
1077
|
+
/**
|
|
1078
|
+
* Sub-Tasks to run
|
|
1079
|
+
*/
|
|
1080
|
+
readonly tasks: Array<TurboRepoTask>;
|
|
1081
|
+
/**
|
|
1082
|
+
* Env Args that will bre added to turbo's build:all task
|
|
1083
|
+
*/
|
|
1084
|
+
readonly buildAllTaskEnvVars: Record<string, string>;
|
|
1085
|
+
constructor(project: NodeProject, options?: TurboRepoOptions);
|
|
1086
|
+
/**
|
|
1087
|
+
* Add an env var to the global env vars for all tasks.
|
|
1088
|
+
* This will also become an input for the build:all task cache at the root.
|
|
1089
|
+
*/
|
|
1090
|
+
addGlobalEnvVar(name: string, value: string): void;
|
|
1091
|
+
activateBranchNameEnvVar(): void;
|
|
1092
|
+
preSynthesize(): void;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
/*******************************************************************************
|
|
1096
|
+
*
|
|
1097
|
+
* Monorepo Root Project
|
|
1098
|
+
*
|
|
1099
|
+
* This project should be used as the base project for other projects in a
|
|
1100
|
+
* monorepo. The Monorepo root project generally won't contain any code, but it
|
|
1101
|
+
* will contain configuration for the monorepo, such as package management,
|
|
1102
|
+
* linting, testing, and other project-wide settings.
|
|
1103
|
+
*
|
|
1104
|
+
******************************************************************************/
|
|
1105
|
+
interface IDependencyResolver {
|
|
1106
|
+
resolveDepsAndWritePackageJson(): boolean;
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Configuration options for the monorepo.
|
|
1110
|
+
*/
|
|
1111
|
+
interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defaultReleaseBranch"> {
|
|
1112
|
+
/**
|
|
1113
|
+
* Turn on Turborepo support.
|
|
1114
|
+
*
|
|
1115
|
+
* @default true
|
|
1116
|
+
*/
|
|
1117
|
+
turbo?: boolean;
|
|
1118
|
+
/**
|
|
1119
|
+
* Optionsal options for turborepo config
|
|
1120
|
+
*/
|
|
1121
|
+
turboOptions?: TurboRepoOptions;
|
|
1122
|
+
/**
|
|
1123
|
+
* Enable the reset task that deletes all build artifacts.
|
|
1124
|
+
*
|
|
1125
|
+
* @default true
|
|
1126
|
+
*/
|
|
1127
|
+
resetTask?: boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* Options for the reset task.
|
|
1130
|
+
*/
|
|
1131
|
+
resetTaskOptions?: ResetTaskOptions;
|
|
1132
|
+
/**
|
|
1133
|
+
* PNPM options for the monorepo.
|
|
1134
|
+
*/
|
|
1135
|
+
pnpmOptions?: {
|
|
1136
|
+
/**
|
|
1137
|
+
* The version of PNPM to use in the monorepo.
|
|
1138
|
+
* @default VERSION.PNPM_VERSION
|
|
1139
|
+
* @see {@link src/versions.ts}
|
|
1140
|
+
*/
|
|
1141
|
+
version?: string;
|
|
1142
|
+
/**
|
|
1143
|
+
* Optional pnpm options for the monorepo workspace file.
|
|
1144
|
+
*/
|
|
1145
|
+
pnpmWorkspaceOptions?: PnpmWorkspaceOptions;
|
|
1146
|
+
};
|
|
1147
|
+
/**
|
|
1148
|
+
* Turn on the upgrade configurator task that will attempt to upgrade the
|
|
1149
|
+
* @codedrifters/configulator package version nightly. This keeps the
|
|
1150
|
+
* project up-to-date with the latest official CodeDrifters configs..
|
|
1151
|
+
*
|
|
1152
|
+
* @default true
|
|
1153
|
+
*/
|
|
1154
|
+
readonly upgradeConfigulatorTask?: boolean;
|
|
1155
|
+
/**
|
|
1156
|
+
* Options for the upgrade configurator task.
|
|
1157
|
+
*
|
|
1158
|
+
* @default: daily schedule
|
|
1159
|
+
*/
|
|
1160
|
+
readonly upgradeConfigulatorTaskOptions?: UpgradeDependenciesOptions;
|
|
1161
|
+
}
|
|
1162
|
+
declare class MonorepoProject extends TypeScriptAppProject {
|
|
1163
|
+
/**
|
|
1164
|
+
* Version of PNPM which the whole monorepo should use.
|
|
1165
|
+
*/
|
|
1166
|
+
readonly pnpmVersion: string;
|
|
1167
|
+
/**
|
|
1168
|
+
* Optional task that will attempt to upgrade the @codedrifters/configulator
|
|
1169
|
+
* package version nightly. This keeps the project up-to-date with the latest
|
|
1170
|
+
* official CodeDrifters configs.
|
|
1171
|
+
*/
|
|
1172
|
+
readonly upgradeConfigulatorTask?: UpgradeDependencies;
|
|
1173
|
+
/**
|
|
1174
|
+
* List of functions to call after dependencies have been installed.
|
|
1175
|
+
*/
|
|
1176
|
+
private postInstallDependencies;
|
|
1177
|
+
constructor(userOptions: MonorepoProjectOptions);
|
|
1178
|
+
/**
|
|
1179
|
+
* Allows a sub project to request installation of dependency at the Monorepo root
|
|
1180
|
+
* They must provide a function that is executed after dependencies have been installed
|
|
1181
|
+
* If this function returns true, the install command is run for a second time after all sub project requests have run.
|
|
1182
|
+
* This is used to resolve dependency versions from `*` to a concrete version constraint.
|
|
1183
|
+
*/
|
|
1184
|
+
requestInstallDependencies(resolver: IDependencyResolver): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* Hooks into the install dependencies cycle
|
|
1187
|
+
*/
|
|
1188
|
+
postSynthesize(): void;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
/**
|
|
1192
|
+
* Configuration options for TypeScriptProject.
|
|
1193
|
+
*/
|
|
1194
|
+
interface TypeScriptProjectOptions extends Omit<typescript.TypeScriptProjectOptions, "defaultReleaseBranch"> {
|
|
1195
|
+
/**
|
|
1196
|
+
* Enable the reset task that deletes all build artifacts.
|
|
1197
|
+
*
|
|
1198
|
+
* @default true
|
|
1199
|
+
*/
|
|
1200
|
+
readonly resetTask?: boolean;
|
|
1201
|
+
/**
|
|
1202
|
+
* Options for the reset task.
|
|
1203
|
+
*/
|
|
1204
|
+
readonly resetTaskOptions?: ResetTaskOptions;
|
|
1205
|
+
}
|
|
1206
|
+
declare class TypeScriptProject extends typescript.TypeScriptProject {
|
|
1207
|
+
constructor(userOptions: TypeScriptProjectOptions);
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
/*******************************************************************************
|
|
1211
|
+
*
|
|
1212
|
+
* Update / customize typescript configs for a project.
|
|
1213
|
+
*
|
|
1214
|
+
* Update typescript paths in tsconfig so we don't have to compile packages to
|
|
1215
|
+
* dist in order to see changes.
|
|
1216
|
+
*
|
|
1217
|
+
******************************************************************************/
|
|
1218
|
+
declare class TypeScriptConfig extends Component {
|
|
1219
|
+
constructor(project: TypeScriptProject$1);
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
/*******************************************************************************
|
|
1223
|
+
*
|
|
1224
|
+
* Configure VSCode Settings
|
|
1225
|
+
*
|
|
1226
|
+
******************************************************************************/
|
|
1227
|
+
declare class VSCodeConfig extends Component {
|
|
1228
|
+
constructor(project: TypeScriptAppProject);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
declare const PROD_DEPLOY_NAME = "prod-deploy";
|
|
1232
|
+
interface DeployWorkflowOptions {
|
|
1233
|
+
/**
|
|
1234
|
+
* What type of deploy is this workflow for?
|
|
1235
|
+
*
|
|
1236
|
+
* @default AWS_STAGE_TYPE.DEV
|
|
1237
|
+
*/
|
|
1238
|
+
readonly awsStageType?: ValueOf<typeof AWS_STAGE_TYPE>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Optionally feed a list of targets to deploy to.
|
|
1241
|
+
*
|
|
1242
|
+
* @default discovers all targets using stageType
|
|
1243
|
+
*/
|
|
1244
|
+
readonly awsDeploymentTargets?: Array<AwsDeploymentTarget>;
|
|
1245
|
+
/**
|
|
1246
|
+
* Existing workflow, useful if we're tacking deployments onto an existing
|
|
1247
|
+
* build workflow
|
|
1248
|
+
*/
|
|
1249
|
+
readonly buildWorkflow?: BuildWorkflow;
|
|
1250
|
+
/**
|
|
1251
|
+
* Options for the build workflow, if no build workflow is provided.
|
|
1252
|
+
*/
|
|
1253
|
+
readonly buildWorkflowOptions?: Partial<BuildWorkflowOptions>;
|
|
1254
|
+
/**
|
|
1255
|
+
* Projects that should complete deployment before this one starts.
|
|
1256
|
+
*/
|
|
1257
|
+
readonly deployAfterTargets?: Array<AwsDeploymentTarget>;
|
|
1258
|
+
}
|
|
1259
|
+
declare class AwsDeployWorkflow extends Component {
|
|
1260
|
+
project: AwsCdkTypeScriptApp;
|
|
1261
|
+
static of(project: AwsCdkTypeScriptApp, buildWorkflow: BuildWorkflow): AwsDeployWorkflow | undefined;
|
|
1262
|
+
/**
|
|
1263
|
+
* The root project for this deploy workflow. Must be a monorepo project.
|
|
1264
|
+
*/
|
|
1265
|
+
private rootProject;
|
|
1266
|
+
/**
|
|
1267
|
+
* What type of deploy is this workflow for?
|
|
1268
|
+
*/
|
|
1269
|
+
awsStageType: AwsStageType;
|
|
1270
|
+
/**
|
|
1271
|
+
* AWS environment type, such as primary or secondary.
|
|
1272
|
+
*
|
|
1273
|
+
* @deprecated Use deployment target role terminology elsewhere. This property is maintained for backward compatibility.
|
|
1274
|
+
* @default 'primary' (this is the only type supported currently)
|
|
1275
|
+
*/
|
|
1276
|
+
awsEnvironmentType: DeploymentTargetRoleType;
|
|
1277
|
+
/**
|
|
1278
|
+
* The list of targets to deploy to.
|
|
1279
|
+
*/
|
|
1280
|
+
readonly awsDeploymentTargets: Array<AwsDeploymentTarget>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Hold the deploy workflow so we can add to it in preSynth
|
|
1283
|
+
*/
|
|
1284
|
+
buildWorkflow: BuildWorkflow;
|
|
1285
|
+
/**
|
|
1286
|
+
* Was this workflow created externally?
|
|
1287
|
+
*/
|
|
1288
|
+
externalWorkflow: boolean;
|
|
1289
|
+
/**
|
|
1290
|
+
* Projects that should complete deployment before this one starts.
|
|
1291
|
+
*/
|
|
1292
|
+
deployAfterTargets: Array<AwsDeploymentTarget>;
|
|
1293
|
+
constructor(project: AwsCdkTypeScriptApp, options?: DeployWorkflowOptions);
|
|
1294
|
+
setupNode: () => Array<JobStep>;
|
|
1295
|
+
setupPnpm: () => Array<JobStep>;
|
|
1296
|
+
/**
|
|
1297
|
+
* Builds a GitHub Actions condition string that checks if the current branch
|
|
1298
|
+
* matches any of the provided branch patterns.
|
|
1299
|
+
*
|
|
1300
|
+
* Handles both exact matches (e.g., "main") and glob patterns (e.g., "feature/*").
|
|
1301
|
+
* Also allows workflow_dispatch (manual runs) to proceed.
|
|
1302
|
+
*
|
|
1303
|
+
* @param branches Array of GitBranch objects with branch patterns
|
|
1304
|
+
* @returns Condition string or empty string if no branches provided
|
|
1305
|
+
*/
|
|
1306
|
+
private buildBranchFilterCondition;
|
|
1307
|
+
private deploySteps;
|
|
1308
|
+
preSynthesize(): void;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export { type AwsAccount, AwsDeployWorkflow, AwsDeploymentConfig, type AwsOrganization, type AwsRegion, type ClassTypeOptions, type DeployWorkflowOptions, type GitBranch, type IDependencyResolver, JsiiFaker, MIMIMUM_RELEASE_AGE, MonorepoProject, type MonorepoProjectOptions, PROD_DEPLOY_NAME, PnpmWorkspace, type PnpmWorkspaceOptions, ROOT_CI_TASK_NAME, ROOT_TURBO_TASK_NAME, type RemoteCacheOptions, ResetTask, type ResetTaskOptions, TurboRepo, type TurboRepoOptions, TurboRepoTask, type TurboRepoTaskOptions, TypeScriptConfig, TypeScriptProject, type TypeScriptProjectOptions, VSCodeConfig };
|