-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy path.projenrc.ts
More file actions
159 lines (134 loc) · 5.12 KB
/
Copy path.projenrc.ts
File metadata and controls
159 lines (134 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import { Changesets } from "@floydspace/projen-components";
import { YamlFile } from "projen";
import { BuildUtils, Docgen, Eslint, MonorepoProject, TypeScriptLibProject, Vitest } from "./projenrc/index.js";
import { Readme } from "./projenrc/readme.js";
import singularities from "./scripts/client-singularities.js";
import { normalizePackageName } from "./scripts/utils.js";
const org = "floydspace";
const name = "effect-aws";
const repo = `${org}/${name}`;
const project = new MonorepoProject({
name,
description: "Effectful AWS",
repository: `github:${repo}`,
homepage: `https://${org}.github.io/${name}`,
authorEmail: "ifloydrose@gmail.com",
authorName: "Victor Korzunin",
typescriptVersion: "^5.4.2",
devDeps: ["@floydspace/projen-components@next", "aws-sdk-client-mock-vitest"],
});
new YamlFile(project, ".github/FUNDING.yml", { obj: { github: org } });
new BuildUtils(project);
new Changesets(project, {
repo,
onlyUpdatePeerDependentsWhenOutOfRange: true,
linked: [`@${name}/client-*`, `@${name}/lib-*`],
});
project.package.manifest.pnpm.patchedDependencies = {
"@changesets/assemble-release-plan": "patches/@changesets__assemble-release-plan.patch",
};
new Docgen(project);
new Readme(project, { org });
new Eslint(project);
new Vitest(project, { sharedSetupFiles: ["vitest.setup.ts"] });
project.addDevDeps("vitest-mock-extended@^2.0.2");
const effectDeps = ["effect@3.10.16"];
project.addScripts({ "codegen-client": "tsx ./scripts/codegen-cli.ts" });
project.addDeps(...effectDeps, "@effect/cli@0.48.25", "@effect/platform@0.69.25", "@effect/platform-node@0.64.27");
project.addDevDeps("@effect/language-service", "@effect/vitest@0.13.16");
project.tsconfigBase?.file.addOverride("compilerOptions.plugins", [
{ name: "@effect/language-service" },
]);
const commonDevDeps = [...effectDeps, "aws-sdk-client-mock", "aws-sdk-client-mock-vitest"];
const commonPeerDeps = ["effect@>=3.0.4 <4.0.0"];
const commons = new TypeScriptLibProject({
parent: project,
name: "commons",
description: "Effectful AWS common library",
deps: ["@smithy/types", "@smithy/smithy-client"],
devDeps: [...effectDeps, "@aws-sdk/middleware-logger"],
peerDeps: commonPeerDeps,
});
new TypeScriptLibProject({
parent: project,
name: "client-s3",
description: singularities["client-s3"].description,
deps: ["@aws-sdk/client-s3@^3", "@aws-sdk/s3-request-presigner@^3", "@aws-sdk/types@^3"],
devDeps: commonDevDeps,
peerDeps: commonPeerDeps,
workspaceDeps: [commons],
});
const allClients = Object.keys(singularities).filter((sn) => sn !== "client-s3");
allClients.forEach((name) => {
new TypeScriptLibProject({
parent: project,
name,
description: singularities[name].description,
deps: [`@aws-sdk/${normalizePackageName(name)}@^3`],
devDeps: commonDevDeps,
peerDeps: commonPeerDeps,
workspaceDeps: [commons],
});
});
const dynamodbClient = TypeScriptLibProject.childOf(project, "client-dynamodb");
const secretsManagerClient = TypeScriptLibProject.childOf(project, "client-secrets-manager");
const ssmClient = TypeScriptLibProject.childOf(project, "client-ssm");
new TypeScriptLibProject({
parent: project,
name: "lib-dynamodb",
description: "Effectful AWS DynamoDB library",
deps: ["@aws-sdk/client-dynamodb@^3", "@aws-sdk/lib-dynamodb@^3"],
devDeps: commonDevDeps,
peerDeps: commonPeerDeps,
workspaceDeps: [commons],
workspacePeerDeps: [dynamodbClient],
});
new TypeScriptLibProject({
parent: project,
name: "lambda",
description: "Effectful AWS Lambda handler",
devDeps: [...effectDeps, "@types/aws-lambda"],
peerDeps: commonPeerDeps,
});
new TypeScriptLibProject({
parent: project,
name: "powertools-logger",
description: "Effectful AWS Lambda Powertools Logger",
devDeps: [...effectDeps, "@aws-lambda-powertools/commons@2.0.0", "@aws-lambda-powertools/logger@2.0.0"],
peerDeps: [...commonPeerDeps, "@aws-lambda-powertools/logger@>=2.0.0"],
});
new TypeScriptLibProject({
parent: project,
name: "secrets-manager",
description: "Effectful AWS Secrets Manager functions",
devDeps: [...effectDeps, "@aws-sdk/client-secrets-manager@^3", "@fluffy-spoon/substitute"],
peerDeps: commonPeerDeps,
workspacePeerDeps: [secretsManagerClient],
});
const proj = new TypeScriptLibProject({
parent: project,
name: "signature-v4",
description: "AWS Signature V4 for Effect HttpClientRequest",
peerDeps: [...commonPeerDeps, "@smithy/signature-v4@^5", "@smithy/types@^4", "aws4fetch@^1", "@aws-crypto/sha256-js@^5"]
});
proj.addFields({
peerDependenciesMeta: {
'@smithy/signature-v4': { optional: true },
'@smithy/types': { optional: true },
'aws4fetch': { optional: true },
'@aws-crypto/sha256-js': { optional: true },
}
})
new TypeScriptLibProject({
parent: project,
name: "ssm",
description: "Effectful AWS SSM functions",
devDeps: [...effectDeps, "@aws-sdk/client-ssm@^3", "@fluffy-spoon/substitute"],
peerDeps: commonPeerDeps,
workspacePeerDeps: [ssmClient],
});
project.addGitIgnore(".direnv/"); // flake environment creates .direnv folder
project.addGitIgnore("docs/"); // docs are generated
project.addGitIgnore(".idea");
project.addGitIgnore(".DS_Store");
project.synth();