Skip to content

Commit

Permalink
feat: Introducing "cdk8s+": high-level APIs for Kubernetes (#239)
Browse files Browse the repository at this point in the history
Introducing an initial version of high level abstractions on top of the imported resources.

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Elad Ben-Israel authored Jun 22, 2020
1 parent 9445358 commit 1b991f6
Show file tree
Hide file tree
Showing 64 changed files with 22,767 additions and 166 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,7 @@ typings/
# DynamoDB Local files
.dynamodb/

# utility scripts
!/tools/*.js

# End of https://www.gitignore.io/api/node
5 changes: 5 additions & 0 deletions .versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"skip": { "tag": true },
"packageFiles": [ { "filename": "lerna.json", "type": "json" } ],
"bumpFiles": [ { "filename": "lerna.json", "type": "json" } ]
}
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ This section includes information that is relevant for the maintainers of the pr

### Version

The current version of the project is mastered in the root `package.json` file. All other
package.json files (and lerna.json) files use `0.0.0`. This allows bumping a new version without
The current version of the project is mastered in the root `lerna.json` file. All other
package.json files use `0.0.0`. This allows bumping a new version without
needing to modify multiple files and avoid merge conflicts in post-release rebases.

### Release Protocol
Expand All @@ -202,7 +202,7 @@ To release a new version of cdk8s following these steps:
$ yarn bump
```

This will create a new CHANGELOG entry (from conventional commits), bump the version in
This will create a new CHANGELOG entry (from conventional commits), bump the version in
`package.json` and create a bump commit.

Now, push to `master` (in the future we will release from a release branch, but in the meantime we release directly from master):
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.0.0"
"version": "0.25.0"
}
28 changes: 25 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "root",
"version": "0.25.0",
"version": "0.0.0",
"private": true,
"scripts": {
"bump": "tools/bump.sh",
Expand All @@ -22,12 +22,34 @@
"cdk8s/json-stable-stringify",
"cdk8s/json-stable-stringify/**",
"cdk8s/follow-redirects",
"cdk8s/follow-redirects/**"
"cdk8s/follow-redirects/**",
"cdk8s-plus/minimatch",
"cdk8s-plus/minimatch/**"
]
},
"devDependencies": {
"changelog-parser": "^2.8.0",
"lerna": "^3.20.2",
"standard-version": "^7.1.0"
},
"jest": {
"clearMocks": true,
"collectCoverage": true,
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"preset": "ts-jest",
"testMatch": [
"**/__tests__/**/*.ts?(x)",
"**/?(*.)+(spec|test).ts?(x)"
],
"globals": {
"ts-jest": {
"tsConfig": "tsconfig.jest.json"
}
}
}
}
}
82 changes: 82 additions & 0 deletions packages/cdk8s-plus/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"env": {
"jest": true,
"node": true
},
"plugins": [
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "2018",
"sourceType": "module"
},
"extends": [
"plugin:import/typescript"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"node": {},
"typescript": {
"directory": "./tsconfig.json"
}
}
},
"ignorePatterns": [
"*.js",
"*.d.ts",
"node_modules/",
"*.generated.ts"
],
"rules": {
"@typescript-eslint/no-require-imports": [
"error"
],
"indent": [
"off"
],
"@typescript-eslint/indent": [
"error",
2
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"quote-props": [
"error",
"consistent-as-needed",
{
"unnecessary": true
}
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/build-tools/**",
"**/test/**"
],
"optionalDependencies": false,
"peerDependencies": true
}
],
"import/no-unresolved": [
"error"
]
}
}
64 changes: 64 additions & 0 deletions packages/cdk8s-plus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by projen. To modify, edit .projenrc.js and run "npx projen".
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript cache
*.tsbuildinfo
# Optional eslint cache
.eslintcache
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# parcel-bundler cache (https://parceljs.org/)
.cache
/lib
/coverage
# exclude jsii outputs
dist
.jsii
tsconfig.json
# exclude typescript compiler outputs
*.d.ts
*.js
!# synthesized by projen, (do not modify by hand)
!/package.json
!# synthesized by projen, (do not modify by hand)
!/.npmignore
!# synthesized by projen, (do not modify by hand)
!/LICENSE
!/.projenrc.js
!# always commit version file
!version.json
!# synthesized by projen, (do not modify by hand)
!/.versionrc.json
!/src
!/test
!# synthesized by projen, (do not modify by hand)
!/.eslintrc.json
!/API.md
!# synthesized by projen, (do not modify by hand)
!/tsconfig.jest.json
21 changes: 21 additions & 0 deletions packages/cdk8s-plus/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by projen. To modify, edit .projenrc.js and run "npx projen".
# exclude project definition from npm module
/.projenrc.js
# make sure to commit projen definition
# standard-version configuration
/.versionrc.json
/src
/test
/coverage
/.eslintrc.json
# exclude typescript sources and configuration
*.ts
tsconfig.json
# exclude jsii outdir
dist
!/lib
!# include javascript files and typescript declarations
!*.js
!*.d.ts
!# include .jsii manifest
!.jsii
51 changes: 51 additions & 0 deletions packages/cdk8s-plus/.projenrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const { JsiiProject, Semver } = require('projen');

const constructsDependency = Semver.caret('2.0.1')
const cdk8sDependency = Semver.caret('0.0.0')

const project = new JsiiProject({
name: 'cdk8s-plus',
buildWorkflow: false,
releaseWorkflow: false,
mergify: false,
commitPackageJson: true,
jsiiVersion: Semver.caret('1.6.0'),
description: 'High level abstractions on top of cdk8s',
repository: 'https://github.com/awslabs/cdk8s.git',
authorName: 'Amazon Web Services',
authorUrl: 'https://aws.amazon.com',
peerDependencies: {
constructs: constructsDependency,
cdk8s: cdk8sDependency,
},
dependencies: {
minimatch: Semver.caret('3.0.4'),
cdk8s: cdk8sDependency
},
bundledDependencies: [ 'minimatch' ],
devDependencies: {
'@types/minimatch': Semver.caret('3.0.3'),
},
stability: 'experimental',
java: {
javaPackage: 'org.cdk8s.plus',
mavenGroupId: 'org.cdk8s',
mavenArtifactId: 'cdk8s-plus'
},
python: {
distName: 'cdk8s-plus',
module: 'cdk8s_plus'
},
dotnet: {
dotNetNamespace: 'Org.Cdk8s.Plus',
packageId: 'Org.Cdk8s.Plus'
}
});

// override the default "build" from projen because currently in this
// repo it means "compile"
project.addScripts({
build: 'jsii --silence-warnings=reserved-word && yarn docgen'
});

project.synth();
18 changes: 18 additions & 0 deletions packages/cdk8s-plus/.versionrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"packageFiles": [
{
"filename": "version.json",
"type": "json"
}
],
"bumpFiles": [
{
"filename": "version.json",
"type": "json"
}
],
"commitAll": true,
"scripts": {
"postbump": "yarn projen && git add ."
}
}
Loading

0 comments on commit 1b991f6

Please sign in to comment.