-
Notifications
You must be signed in to change notification settings - Fork 23
/
.projenrc.ts
115 lines (98 loc) · 2.89 KB
/
.projenrc.ts
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
import { Cdk8sTeamTypeScriptProject } from '@cdk8s/projen-common';
import { DependencyType } from 'projen';
import { addIntegTests } from './projenrc/integ';
const project = new Cdk8sTeamTypeScriptProject({
projenrcTs: true,
release: true,
name: 'cdk8s-cli',
description: 'This is the command line tool for Cloud Development Kit (CDK) for Kubernetes (cdk8s).',
// no need, we are configuring explicit exports.
entrypoint: '',
keywords: [
'k8s',
'cdk8s',
'kubernetes',
'cli',
'tools',
'automation',
'containers',
],
workflowBootstrapSteps: [{ run: 'pip3 install pipenv' }],
defaultReleaseBranch: '2.x',
majorVersion: 2,
releaseBranches: {
'1.x': {
majorVersion: 1,
npmDistTag: 'latest-1',
},
},
bin: {
cdk8s: 'bin/cdk8s',
},
// note that 0.x dependencies are intentionally pinned because
// upgrading them may introduce breaking changes to our API.
deps: [
'cdk8s',
'cdk8s-plus-28',
'codemaker',
'constructs',
'fs-extra@^8',
'jsii-pacmak',
'jsii-rosetta',
'sscaff',
'yaml',
'yargs@^15',
'colors',
'ajv',
'table',
'semver',
],
devDeps: [
'@cdk8s/projen-common',
'@types/fs-extra@^8',
'@types/json-schema',
'@types/semver',
'glob',
'@types/glob',
'typescript-json-schema',
],
backport: true,
backportBranches: ['1.x'],
});
project.tsconfig?.addInclude('src/schemas/*.json');
project.tsconfigDev.addInclude('src/schemas/*.json');
//
// see https://nodejs.org/api/packages.html#exports
project.addFields({
exports: {
'./plugins': './lib/plugins/index.js',
'./package.json': './package.json',
},
});
// ignore integration tests since they need to executed after packaging
// and are defined in a separate tasks.
project.jest?.addIgnorePattern('/test/integ/');
project.gitignore.exclude('.vscode/');
// add @types/node as a regular dependency since it's needed to during "import"
// to compile the generated jsii code.
project.deps.removeDependency('@types/node', DependencyType.BUILD);
project.deps.addDependency('@types/node@^16', DependencyType.RUNTIME);
const schemas = project.addTask('schemas');
schemas.exec('ts-node scripts/crd.schema.ts');
const installHelm = project.addTask('install-helm', {
exec: 'curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash',
description: 'Install helm3',
// will exit with non-zero if helm is not installed or has the wrong version
condition: '! (helm version | grep "v3.")',
});
project.testTask.prependSpawn(installHelm);
project.compileTask.spawn(schemas);
// so that it works on windows as well
// default projen uses $(npm pack) which fails
project.packageTask.reset();
project.packageTask.exec('mkdir -p dist/js');
project.packageTask.exec('npm pack --pack-destination dist/js');
addIntegTests(project);
project.synth();