Skip to content

Commit 314802f

Browse files
author
Eugene Cheung
authored
chore: fix project build (#10)
1 parent 78bf9a1 commit 314802f

File tree

4 files changed

+75
-21
lines changed

4 files changed

+75
-21
lines changed

.projenrc.js

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
11
const { awscdk, DependencyType } = require("projen");
2+
23
const CDK_VERSION = "1.123.0";
34
const CONSTRUCTS_VERSION = "3.3.69";
5+
46
const project = new awscdk.AwsCdkConstructLibrary({
7+
name: "cdk-monitoring-constructs",
8+
repositoryUrl: "[email protected]:cdklabs/cdk-monitoring-constructs.git",
59
author: "CDK Monitoring Constructs Team",
610
authorAddress: "[email protected]",
11+
defaultReleaseBranch: "main",
12+
713
cdkVersion: CDK_VERSION,
814
cdkVersionPinning: true,
9-
defaultReleaseBranch: "main",
10-
name: "cdk-monitoring-constructs",
11-
repositoryUrl: "[email protected]:cdklabs/cdk-monitoring-constructs.git",
15+
1216
cdkDependencies: ["monocdk"],
1317
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
1429
prettier: true,
1530
prettierOptions: {
1631
arrowParens: "always",
@@ -52,28 +67,28 @@ const project = new awscdk.AwsCdkConstructLibrary({
5267
"prettier/prettier": "error",
5368
},
5469
},
55-
srcdir: "lib",
56-
testdir: "test",
57-
publishToPypi: {
58-
distName: "cdk-monitoring-constructs",
59-
module: "cdk_monitoring_constructs",
60-
},
6170
});
62-
// these deps are still coming up, removing them manually
71+
72+
// Projen doesn't handle monocdk properly; remove @aws-cdk manually
6373
project.deps.removeDependency("@aws-cdk/core", DependencyType.PEER);
6474
project.deps.removeDependency("@aws-cdk/core", DependencyType.RUNTIME);
6575
project.deps.removeDependency("@aws-cdk/assert");
6676
project.deps.removeDependency("@aws-cdk/assertions");
77+
78+
// Declare monocdk and constructs as peer dependencies
6779
project.deps.removeDependency("monocdk", DependencyType.RUNTIME);
6880
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-
);
7481
project.deps.addDependency(`monocdk@^${CDK_VERSION}`, DependencyType.PEER);
7582
project.deps.addDependency(
7683
`constructs@^${CONSTRUCTS_VERSION}`,
7784
DependencyType.PEER
7885
);
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+
7994
project.synth();

API.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# API Reference <a name="API Reference" id="api-reference"></a>
2+
3+
4+
5+
## Classes <a name="Classes" id="Classes"></a>
6+
7+
### Hello <a name="Hello" id="cdk-monitoring-constructs.Hello"></a>
8+
9+
#### Initializers <a name="Initializers" id="cdk-monitoring-constructs.Hello.Initializer"></a>
10+
11+
```typescript
12+
import { Hello } from 'cdk-monitoring-constructs'
13+
14+
new Hello()
15+
```
16+
17+
| **Name** | **Type** | **Description** |
18+
| --- | --- | --- |
19+
20+
---
21+
22+
#### Methods <a name="Methods" id="Methods"></a>
23+
24+
| **Name** | **Description** |
25+
| --- | --- |
26+
| <code><a href="#cdk-monitoring-constructs.Hello.sayHello">sayHello</a></code> | *No description.* |
27+
28+
---
29+
30+
##### `sayHello` <a name="sayHello" id="cdk-monitoring-constructs.Hello.sayHello"></a>
31+
32+
```typescript
33+
public sayHello(): string
34+
```
35+
36+
37+
38+
39+

lib/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export class Hello {
22
public sayHello() {
3-
return 'hello, world!';
3+
return "hello, world!";
44
}
5-
}
5+
}

test/hello.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Hello } from '../src';
1+
import { Hello } from "../lib";
22

3-
test('hello', () => {
4-
expect(new Hello().sayHello()).toBe('hello, world!');
5-
});
3+
test("hello", () => {
4+
expect(new Hello().sayHello()).toBe("hello, world!");
5+
});

0 commit comments

Comments
 (0)