@codedrifters/configulator 0.0.129 → 0.0.131
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/README.md +0 -18
- package/lib/index.d.mts +11 -20
- package/lib/index.d.ts +11 -20
- package/lib/index.js +33 -17
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +33 -18
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -532,28 +532,10 @@ interface MonorepoProjectOptions {
|
|
|
532
532
|
version?: string;
|
|
533
533
|
pnpmWorkspaceOptions?: PnpmWorkspaceOptions;
|
|
534
534
|
};
|
|
535
|
-
upgradeConfigulatorTask?: boolean; // Default: false — see below
|
|
536
|
-
upgradeConfigulatorTaskOptions?: UpgradeDependenciesOptions;
|
|
537
535
|
// ... all TypeScriptProjectOptions
|
|
538
536
|
}
|
|
539
537
|
```
|
|
540
538
|
|
|
541
|
-
#### Configulator upgrade workflow (default: off)
|
|
542
|
-
|
|
543
|
-
By default, `MonorepoProject` does **not** add a separate workflow that upgrades only `@codedrifters/configulator`. Monorepos that use configulator should rely on projen's built-in **upgrade** workflow for all dependency upgrades (including configulator), so there is one source of truth and no duplicate or conflicting automation.
|
|
544
|
-
|
|
545
|
-
To opt in to a dedicated scheduled workflow that upgrades only `@codedrifters/configulator` (e.g. nightly), set `upgradeConfigulatorTask: true` and optionally customize with `upgradeConfigulatorTaskOptions` (schedule, etc.):
|
|
546
|
-
|
|
547
|
-
```typescript
|
|
548
|
-
const project = new MonorepoProject({
|
|
549
|
-
name: 'my-monorepo',
|
|
550
|
-
upgradeConfigulatorTask: true,
|
|
551
|
-
upgradeConfigulatorTaskOptions: {
|
|
552
|
-
workflowOptions: { schedule: UpgradeDependenciesSchedule.DAILY },
|
|
553
|
-
},
|
|
554
|
-
});
|
|
555
|
-
```
|
|
556
|
-
|
|
557
539
|
### TypeScriptProjectOptions
|
|
558
540
|
|
|
559
541
|
Extends Projen's `TypeScriptProjectOptions` with CodeDrifters defaults. See the [TypeScriptProject](#typescriptproject) section for details.
|
package/lib/index.d.mts
CHANGED
|
@@ -4,9 +4,9 @@ import { AwsStageType, DeploymentTargetRoleType, AwsEnvironmentType, AWS_STAGE_T
|
|
|
4
4
|
import * as spec from '@jsii/spec';
|
|
5
5
|
import { TypeScriptProject as TypeScriptProject$1, TypeScriptAppProject, TypeScriptProjectOptions as TypeScriptProjectOptions$1 } from 'projen/lib/typescript';
|
|
6
6
|
import { ValueOf } from 'type-fest';
|
|
7
|
-
import { NodeProject, UpgradeDependencies, UpgradeDependenciesOptions } from 'projen/lib/javascript';
|
|
8
7
|
import { Component as Component$1, Project as Project$1, Task } from 'projen/lib';
|
|
9
8
|
import { BuildWorkflowOptions, BuildWorkflow } from 'projen/lib/build';
|
|
9
|
+
import { NodeProject } from 'projen/lib/javascript';
|
|
10
10
|
import { JobStep } from 'projen/lib/github/workflows-model';
|
|
11
11
|
|
|
12
12
|
/*******************************************************************************
|
|
@@ -1301,21 +1301,6 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
1301
1301
|
*/
|
|
1302
1302
|
pnpmWorkspaceOptions?: PnpmWorkspaceOptions;
|
|
1303
1303
|
};
|
|
1304
|
-
/**
|
|
1305
|
-
* Turn on a dedicated workflow that upgrades only
|
|
1306
|
-
* @codedrifters/configulator on a schedule (e.g. nightly). When false or
|
|
1307
|
-
* unset, rely on projen's default upgrade workflow for all dependency
|
|
1308
|
-
* upgrades instead.
|
|
1309
|
-
*
|
|
1310
|
-
* @default false
|
|
1311
|
-
*/
|
|
1312
|
-
readonly upgradeConfigulatorTask?: boolean;
|
|
1313
|
-
/**
|
|
1314
|
-
* Options for the upgrade configurator task.
|
|
1315
|
-
*
|
|
1316
|
-
* @default: daily schedule
|
|
1317
|
-
*/
|
|
1318
|
-
readonly upgradeConfigulatorTaskOptions?: UpgradeDependenciesOptions;
|
|
1319
1304
|
/**
|
|
1320
1305
|
* When set, adds the approve-and-merge-upgrade workflow (ADR 0001 §2).
|
|
1321
1306
|
* Uses a second GitHub App to approve and merge the dependency-upgrade PR
|
|
@@ -1325,6 +1310,14 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
1325
1310
|
* @see ApproveMergeUpgradeOptions
|
|
1326
1311
|
*/
|
|
1327
1312
|
readonly approveMergeUpgradeOptions?: ApproveMergeUpgradeOptions;
|
|
1313
|
+
/**
|
|
1314
|
+
* Whether this monorepo consumes @codedrifters/configulator from a registry (npm).
|
|
1315
|
+
* When true, the upgrade workflow adds steps to sync configulator and synthesize.
|
|
1316
|
+
* Set to false when configulator is developed in this repo (e.g. workspace dependency).
|
|
1317
|
+
*
|
|
1318
|
+
* @default true
|
|
1319
|
+
*/
|
|
1320
|
+
readonly configulatorRegistryConsumer?: boolean;
|
|
1328
1321
|
}
|
|
1329
1322
|
declare class MonorepoProject extends TypeScriptAppProject {
|
|
1330
1323
|
/**
|
|
@@ -1332,11 +1325,9 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
1332
1325
|
*/
|
|
1333
1326
|
readonly pnpmVersion: string;
|
|
1334
1327
|
/**
|
|
1335
|
-
*
|
|
1336
|
-
* package version nightly. This keeps the project up-to-date with the latest
|
|
1337
|
-
* official CodeDrifters configs.
|
|
1328
|
+
* Whether this monorepo consumes configulator from a registry (drives upgrade workflow steps).
|
|
1338
1329
|
*/
|
|
1339
|
-
readonly
|
|
1330
|
+
readonly configulatorRegistryConsumer: boolean;
|
|
1340
1331
|
constructor(userOptions: MonorepoProjectOptions);
|
|
1341
1332
|
/**
|
|
1342
1333
|
* Allows a sub project to request installation of dependency at the Monorepo root
|
package/lib/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { AwsCdkTypeScriptApp } from 'projen/lib/awscdk';
|
|
|
3
3
|
import * as spec from '@jsii/spec';
|
|
4
4
|
import { TypeScriptProject as TypeScriptProject$1, TypeScriptAppProject, TypeScriptProjectOptions as TypeScriptProjectOptions$1 } from 'projen/lib/typescript';
|
|
5
5
|
import { ValueOf } from 'type-fest';
|
|
6
|
-
import { UpgradeDependencies, UpgradeDependenciesOptions, NodeProject } from 'projen/lib/javascript';
|
|
7
6
|
import { Task, Component as Component$1, Project as Project$1 } from 'projen/lib';
|
|
8
7
|
import { BuildWorkflow, BuildWorkflowOptions } from 'projen/lib/build';
|
|
8
|
+
import { NodeProject } from 'projen/lib/javascript';
|
|
9
9
|
import { JobStep } from 'projen/lib/github/workflows-model';
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -1350,21 +1350,6 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
1350
1350
|
*/
|
|
1351
1351
|
pnpmWorkspaceOptions?: PnpmWorkspaceOptions;
|
|
1352
1352
|
};
|
|
1353
|
-
/**
|
|
1354
|
-
* Turn on a dedicated workflow that upgrades only
|
|
1355
|
-
* @codedrifters/configulator on a schedule (e.g. nightly). When false or
|
|
1356
|
-
* unset, rely on projen's default upgrade workflow for all dependency
|
|
1357
|
-
* upgrades instead.
|
|
1358
|
-
*
|
|
1359
|
-
* @default false
|
|
1360
|
-
*/
|
|
1361
|
-
readonly upgradeConfigulatorTask?: boolean;
|
|
1362
|
-
/**
|
|
1363
|
-
* Options for the upgrade configurator task.
|
|
1364
|
-
*
|
|
1365
|
-
* @default: daily schedule
|
|
1366
|
-
*/
|
|
1367
|
-
readonly upgradeConfigulatorTaskOptions?: UpgradeDependenciesOptions;
|
|
1368
1353
|
/**
|
|
1369
1354
|
* When set, adds the approve-and-merge-upgrade workflow (ADR 0001 §2).
|
|
1370
1355
|
* Uses a second GitHub App to approve and merge the dependency-upgrade PR
|
|
@@ -1374,6 +1359,14 @@ interface MonorepoProjectOptions extends Omit<TypeScriptProjectOptions$1, "defau
|
|
|
1374
1359
|
* @see ApproveMergeUpgradeOptions
|
|
1375
1360
|
*/
|
|
1376
1361
|
readonly approveMergeUpgradeOptions?: ApproveMergeUpgradeOptions;
|
|
1362
|
+
/**
|
|
1363
|
+
* Whether this monorepo consumes @codedrifters/configulator from a registry (npm).
|
|
1364
|
+
* When true, the upgrade workflow adds steps to sync configulator and synthesize.
|
|
1365
|
+
* Set to false when configulator is developed in this repo (e.g. workspace dependency).
|
|
1366
|
+
*
|
|
1367
|
+
* @default true
|
|
1368
|
+
*/
|
|
1369
|
+
readonly configulatorRegistryConsumer?: boolean;
|
|
1377
1370
|
}
|
|
1378
1371
|
declare class MonorepoProject extends TypeScriptAppProject {
|
|
1379
1372
|
/**
|
|
@@ -1381,11 +1374,9 @@ declare class MonorepoProject extends TypeScriptAppProject {
|
|
|
1381
1374
|
*/
|
|
1382
1375
|
readonly pnpmVersion: string;
|
|
1383
1376
|
/**
|
|
1384
|
-
*
|
|
1385
|
-
* package version nightly. This keeps the project up-to-date with the latest
|
|
1386
|
-
* official CodeDrifters configs.
|
|
1377
|
+
* Whether this monorepo consumes configulator from a registry (drives upgrade workflow steps).
|
|
1387
1378
|
*/
|
|
1388
|
-
readonly
|
|
1379
|
+
readonly configulatorRegistryConsumer: boolean;
|
|
1389
1380
|
constructor(userOptions: MonorepoProjectOptions);
|
|
1390
1381
|
/**
|
|
1391
1382
|
* Allows a sub project to request installation of dependency at the Monorepo root
|
package/lib/index.js
CHANGED
|
@@ -1457,6 +1457,7 @@ function addBuildCompleteJob(buildWorkflow) {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
|
|
1459
1459
|
// src/projects/monorepo-project.ts
|
|
1460
|
+
var CONFIGULATOR_PACKAGE_NAME = "@codedrifters/configulator";
|
|
1460
1461
|
var postInstallDependenciesMap = /* @__PURE__ */ new WeakMap();
|
|
1461
1462
|
var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
|
|
1462
1463
|
constructor(userOptions) {
|
|
@@ -1528,6 +1529,10 @@ var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
|
|
|
1528
1529
|
* Default PNPM version to use in the monorepo.
|
|
1529
1530
|
*/
|
|
1530
1531
|
pnpmVersion: VERSION.PNPM_VERSION,
|
|
1532
|
+
/**
|
|
1533
|
+
* By default treat as a registry consumer (upgrade workflow syncs configulator).
|
|
1534
|
+
*/
|
|
1535
|
+
configulatorRegistryConsumer: true,
|
|
1531
1536
|
/**
|
|
1532
1537
|
* We don't want sample code generated for the root project.
|
|
1533
1538
|
*/
|
|
@@ -1542,9 +1547,12 @@ var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
|
|
|
1542
1547
|
release: false,
|
|
1543
1548
|
/**
|
|
1544
1549
|
* Uppgrade dependencies automatically unless otherwise instructed.
|
|
1550
|
+
* Exclude @codedrifters/configulator so the default upgrade task does not
|
|
1551
|
+
* upgrade it (version is often managed in-repo or via a separate sync step).
|
|
1545
1552
|
*/
|
|
1546
1553
|
depsUpgrade: true,
|
|
1547
1554
|
depsUpgradeOptions: {
|
|
1555
|
+
exclude: ["@codedrifters/configulator"],
|
|
1548
1556
|
workflowOptions: {
|
|
1549
1557
|
schedule: import_javascript3.UpgradeDependenciesSchedule.DAILY
|
|
1550
1558
|
},
|
|
@@ -1631,6 +1639,7 @@ var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
|
|
|
1631
1639
|
super({ ...options });
|
|
1632
1640
|
postInstallDependenciesMap.set(this, []);
|
|
1633
1641
|
this.pnpmVersion = options.pnpmVersion;
|
|
1642
|
+
this.configulatorRegistryConsumer = options.configulatorRegistryConsumer ?? true;
|
|
1634
1643
|
new VSCodeConfig(this);
|
|
1635
1644
|
new PnpmWorkspace(this, options.pnpmOptions?.pnpmWorkspaceOptions);
|
|
1636
1645
|
if (options.turbo) {
|
|
@@ -1675,29 +1684,36 @@ var MonorepoProject = class extends import_typescript.TypeScriptAppProject {
|
|
|
1675
1684
|
);
|
|
1676
1685
|
this.gitignore?.addPatterns(".DS_Store", "test-reports");
|
|
1677
1686
|
this.addDevDeps("constructs@catalog:");
|
|
1678
|
-
if (options.upgradeConfigulatorTask === true) {
|
|
1679
|
-
this.upgradeConfigulatorTask = new import_javascript3.UpgradeDependencies(
|
|
1680
|
-
this,
|
|
1681
|
-
(0, import_ts_deepmerge2.merge)(
|
|
1682
|
-
{
|
|
1683
|
-
include: ["@codedrifters/configulator"],
|
|
1684
|
-
taskName: `upgrade-codedrifters-configulator`,
|
|
1685
|
-
workflowOptions: {
|
|
1686
|
-
schedule: import_javascript3.UpgradeDependenciesSchedule.DAILY
|
|
1687
|
-
}
|
|
1688
|
-
},
|
|
1689
|
-
options.upgradeConfigulatorTaskOptions ?? {}
|
|
1690
|
-
)
|
|
1691
|
-
);
|
|
1692
|
-
}
|
|
1693
1687
|
if (options.approveMergeUpgradeOptions) {
|
|
1694
1688
|
addApproveMergeUpgradeWorkflow(this, options.approveMergeUpgradeOptions);
|
|
1695
1689
|
}
|
|
1696
1690
|
if (this.buildWorkflow) {
|
|
1697
1691
|
addBuildCompleteJob(this.buildWorkflow);
|
|
1698
1692
|
}
|
|
1699
|
-
this.
|
|
1700
|
-
|
|
1693
|
+
const upgradeWorkflow = this.github?.tryFindWorkflow("upgrade");
|
|
1694
|
+
const upgradeJob = upgradeWorkflow?.getJob("upgrade");
|
|
1695
|
+
const jobWithSteps = upgradeJob && "steps" in upgradeJob ? upgradeJob : void 0;
|
|
1696
|
+
if (jobWithSteps?.steps && Array.isArray(jobWithSteps.steps)) {
|
|
1697
|
+
const insertIndex = 4;
|
|
1698
|
+
if (this.configulatorRegistryConsumer) {
|
|
1699
|
+
jobWithSteps.steps.splice(insertIndex, 0, {
|
|
1700
|
+
name: `Sync ${CONFIGULATOR_PACKAGE_NAME} in workspace`,
|
|
1701
|
+
run: `pnpm update -r ${CONFIGULATOR_PACKAGE_NAME}`
|
|
1702
|
+
});
|
|
1703
|
+
jobWithSteps.steps.splice(insertIndex + 1, 0, {
|
|
1704
|
+
name: "Synthesize",
|
|
1705
|
+
run: this.runTaskCommand(this.defaultTask)
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1708
|
+
jobWithSteps.steps.splice(
|
|
1709
|
+
insertIndex + (this.configulatorRegistryConsumer ? 2 : 0),
|
|
1710
|
+
0,
|
|
1711
|
+
{
|
|
1712
|
+
name: "Run subproject upgrades",
|
|
1713
|
+
run: "pnpm -r run upgrade"
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
}
|
|
1701
1717
|
}
|
|
1702
1718
|
/**
|
|
1703
1719
|
* Allows a sub project to request installation of dependency at the Monorepo root
|