|
1 | 1 | const { awscdk, DependencyType } = require("projen"); |
| 2 | + |
2 | 3 | const CDK_VERSION = "1.123.0"; |
3 | 4 | const CONSTRUCTS_VERSION = "3.3.69"; |
| 5 | + |
4 | 6 | const project = new awscdk.AwsCdkConstructLibrary({ |
| 7 | + name: "cdk-monitoring-constructs", |
| 8 | + repositoryUrl: "[email protected]:cdklabs/cdk-monitoring-constructs.git", |
5 | 9 | author: "CDK Monitoring Constructs Team", |
6 | 10 | authorAddress: "[email protected]", |
| 11 | + defaultReleaseBranch: "main", |
| 12 | + |
7 | 13 | cdkVersion: CDK_VERSION, |
8 | 14 | cdkVersionPinning: true, |
9 | | - defaultReleaseBranch: "main", |
10 | | - name: "cdk-monitoring-constructs", |
11 | | - repositoryUrl: "[email protected]:cdklabs/cdk-monitoring-constructs.git", |
| 15 | + |
12 | 16 | cdkDependencies: ["monocdk"], |
13 | 17 | cdkTestDependencies: ["@monocdk-experiment/assert"], |
| 18 | + |
| 19 | + srcdir: "lib", |
| 20 | + testdir: "test", |
| 21 | + |
| 22 | + // Artifact config |
| 23 | + publishToPypi: { |
| 24 | + distName: "cdk-monitoring-constructs", |
| 25 | + module: "cdk_monitoring_constructs", |
| 26 | + }, |
| 27 | + |
| 28 | + // Code linting config |
14 | 29 | prettier: true, |
15 | 30 | prettierOptions: { |
16 | 31 | arrowParens: "always", |
@@ -52,28 +67,28 @@ const project = new awscdk.AwsCdkConstructLibrary({ |
52 | 67 | "prettier/prettier": "error", |
53 | 68 | }, |
54 | 69 | }, |
55 | | - srcdir: "lib", |
56 | | - testdir: "test", |
57 | | - publishToPypi: { |
58 | | - distName: "cdk-monitoring-constructs", |
59 | | - module: "cdk_monitoring_constructs", |
60 | | - }, |
61 | 70 | }); |
62 | | -// these deps are still coming up, removing them manually |
| 71 | + |
| 72 | +// Projen doesn't handle monocdk properly; remove @aws-cdk manually |
63 | 73 | project.deps.removeDependency("@aws-cdk/core", DependencyType.PEER); |
64 | 74 | project.deps.removeDependency("@aws-cdk/core", DependencyType.RUNTIME); |
65 | 75 | project.deps.removeDependency("@aws-cdk/assert"); |
66 | 76 | project.deps.removeDependency("@aws-cdk/assertions"); |
| 77 | + |
| 78 | +// Declare monocdk and constructs as peer dependencies |
67 | 79 | project.deps.removeDependency("monocdk", DependencyType.RUNTIME); |
68 | 80 | project.deps.removeDependency("constructs", DependencyType.RUNTIME); |
69 | | -project.deps.addDependency(`monocdk@${CDK_VERSION}`, DependencyType.DEVENV); |
70 | | -project.deps.addDependency( |
71 | | - `constructs@${CONSTRUCTS_VERSION}`, |
72 | | - DependencyType.DEVENV |
73 | | -); |
74 | 81 | project.deps.addDependency(`monocdk@^${CDK_VERSION}`, DependencyType.PEER); |
75 | 82 | project.deps.addDependency( |
76 | 83 | `constructs@^${CONSTRUCTS_VERSION}`, |
77 | 84 | DependencyType.PEER |
78 | 85 | ); |
| 86 | + |
| 87 | +// Pin to lowest version in dev dependencies to ensure compatability |
| 88 | +project.deps.addDependency(`monocdk@${CDK_VERSION}`, DependencyType.DEVENV); |
| 89 | +project.deps.addDependency( |
| 90 | + `constructs@${CONSTRUCTS_VERSION}`, |
| 91 | + DependencyType.DEVENV |
| 92 | +); |
| 93 | + |
79 | 94 | project.synth(); |
0 commit comments