-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.projenrc.js
77 lines (65 loc) · 2.07 KB
/
.projenrc.js
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
const { typescript, javascript } = require('projen');
const project = new typescript.TypeScriptProject({
defaultReleaseBranch: 'main',
name: '@wheatstalk/aws-cdk-exec',
authorName: 'Josh Kellendonk',
authorEmail: '[email protected]',
repository: 'https://github.com/wheatstalk/aws-cdk-exec',
description: 'An AWS CDK Cloud Assembly-aware command to help find and execute lambda functions and state machines',
keywords: ['cdk', 'cdk-extension', 'cli', 'lambda', 'stepfunctions'],
deps: [
'aws-sdk@^2.0.0',
'yargs@^17.0.0',
'chalk@^4.0.0',
'aws-cdk-lib@^2.0.0',
],
peerDeps: [
'aws-cdk-lib@^2.0.0',
],
devDeps: [
'aws-sdk-mock',
'aws-cdk@^2.0.0',
'constructs@^10.0.0',
'@types/yargs@^17.0.0',
'ts-node',
],
releaseToNpm: true,
npmAccess: javascript.NpmAccess.PUBLIC,
depsUpgradeOptions: {
ignoreProjen: false,
},
autoApproveUpgrades: true,
autoApproveOptions: {
allowedUsernames: ['misterjoshua'],
},
});
project.addGitIgnore('/.idea');
project.package.addBin({
'cdk-exec': 'lib/cli/cdk-exec.js',
});
// Integration Test Setup
const tsNode = `ts-node -P ${project.tsconfigDev.fileName}`;
const appDir = 'test/exec.integ.snapshot';
const deployTask = project.addTask('integ:exec:deploy');
deployTask.exec(`rm -fr ${appDir}`);
deployTask.exec(`cdk --app "${tsNode} test/exec.integ.ts" deploy --output ${appDir}`);
const cliCmd = `${tsNode} src/cli/cdk-exec.ts --app ${appDir}`;
project.addTask('integ:exec:succeed', {
exec: `${cliCmd} -am integ --input '{"succeed":true}'`,
});
project.addTask('integ:exec:sfn:succeed', {
exec: `${cliCmd} -m integ=sfn --input '{"succeed":true}'`,
});
project.addTask('integ:exec:sfn:fail', {
exec: `${cliCmd} -t integ=sfn integ-cdk-exec/StateMachine`,
});
project.addTask('integ:exec:lambda:succeed', {
exec: `${cliCmd} -t integ=lambda --input '{"succeed":true}'`,
});
project.addTask('integ:exec:lambda:fail', {
exec: `${cliCmd} -m integ=lambda`,
});
project.addTask('integ:export-env', {
exec: `${cliCmd} --export-env integ-cdk-exec/Function`,
});
project.synth();