Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuller88 committed Jan 13, 2021
0 parents commit 6921fa4
Show file tree
Hide file tree
Showing 19 changed files with 5,773 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".

version: 2
updates:
- package-ecosystem: npm
versioning-strategy: lockfile-only
directory: /
schedule:
interval: daily
ignore:
- dependency-name: projen
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixes #
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Build
on:
pull_request: {}
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Anti-tamper check
run: git diff --exit-code
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- name: Build
run: npx projen build
- name: Anti-tamper check
run: git diff --exit-code
57 changes: 57 additions & 0 deletions .github/workflows/rebuild-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: rebuild-bot
on:
issue_comment:
types:
- created
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body,
'@projen rebuild') }}
steps:
- name: Post comment to issue
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: "_projen_: Rebuild started"
- name: Get pull request branch
id: query_pull_request
env:
PULL_REQUEST_URL: ${{ github.event.issue.pull_request.url }}
run: |-
rm -f /tmp/pr.json
curl --silent $PULL_REQUEST_URL > /tmp/pr.json
BRANCH_STR=$(cat /tmp/pr.json | jq ".head.ref")
REPO_NAME=$(cat /tmp/pr.json | jq ".head.repo.full_name")
echo "::set-output name=branch::$(node -p $BRANCH_STR)"
echo "::set-output name=repo::$(node -p $REPO_NAME)"
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.query_pull_request.outputs.branch }}
repository: ${{ steps.query_pull_request.outputs.repo }}
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- name: Build
run: npx projen build
- name: Commit changes
run: 'git commit -am "chore: update generated files"'
- name: Push changes
run: git push --follow-tags origin $BRANCH
env:
BRANCH: ${{ steps.query_pull_request.outputs.branch }}
- name: Post comment to issue
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: "_projen_: Rebuild complete. Updates pushed to pull request branch."
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
name: Release
on:
push:
branches: main
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Anti-tamper check
run: git diff --exit-code
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- name: Bump to next version
run: npx projen bump
- name: Build
run: npx projen build
- name: Anti-tamper check
run: git diff --exit-code
- name: Push changes
run: git push --follow-tags origin $BRANCH
env:
BRANCH: ${{ github.ref }}
- name: Upload artifact
uses: actions/[email protected]
with:
name: dist
path: dist
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
*.lcov
*.log
*.pid
*.pid.lock
*.seed
*.tgz
*.tsbuildinfo
.cache
.eslintcache
.nyc_output
.yarn-integrity
/coverage
/test-reports/
build/Release
coverage
jspm_packages/
junit.xml
lerna-debug.log*
lib-cov
logs
node_modules/
npm-debug.log*
pids
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
yarn-debug.log*
yarn-error.log*
!/.github/dependabot.yml
!/.github/pull_request_template.md
!/.github/workflows/build.yml
!/.github/workflows/rebuild-bot.yml
!/.github/workflows/release.yml
!/.mergify.yml
!/.npmignore
!/.projen/deps.json
!/.projen/tasks.json
!/.projenrc.js
!/.versionrc.json
!/LICENSE
!/package.json
!version.json
33 changes: 33 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".

pull_request_rules:
- name: Automatic merge on approval and successful build
actions:
merge:
method: squash
commit_message: title+body
strict: smart
strict_method: merge
delete_head_branch: {}
conditions:
- "#approved-reviews-by>=1"
- status-success=build
- name: Automatic merge PRs with auto-merge label upon successful build
actions:
merge:
method: squash
commit_message: title+body
strict: smart
strict_method: merge
delete_head_branch: {}
conditions:
- label=auto-merge
- status-success=build
- name: Merge pull requests from dependabot if CI passes
conditions:
- author=dependabot[bot]
- status-success=build
actions:
merge:
method: merge
commit_message: title+body
8 changes: 8 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
/.mergify.yml
/.projen
/.projenrc.js
/.versionrc.json
/coverage
/test-reports/
junit.xml
24 changes: 24 additions & 0 deletions .projen/deps.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"dependencies": [
{
"name": "jest",
"type": "build"
},
{
"name": "jest-junit",
"version": "^12",
"type": "build"
},
{
"name": "projen",
"version": "^0.14.6",
"type": "build"
},
{
"name": "standard-version",
"version": "^9.0.0",
"type": "build"
}
],
"//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
}
127 changes: 127 additions & 0 deletions .projen/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"tasks": {
"clobber": {
"name": "clobber",
"category": "30.maintain",
"description": "hard resets to HEAD of origin and cleans the local repo",
"env": {
"BRANCH": "$(git branch --show-current)"
},
"steps": [
{
"exec": "git checkout -b scratch",
"name": "save current HEAD in \"scratch\" branch"
},
{
"exec": "git checkout $BRANCH"
},
{
"exec": "git fetch origin",
"name": "fetch latest changes from origin"
},
{
"exec": "git reset --hard origin/$BRANCH",
"name": "hard reset to origin commit"
},
{
"exec": "git clean -fdx",
"name": "clean all untracked files"
},
{
"say": "ready to rock! (unpushed commits are under the \"scratch\" branch)"
}
],
"condition": "git diff --exit-code > /dev/null"
},
"compile": {
"name": "compile",
"category": "00.build",
"description": "Only compile"
},
"test:compile": {
"name": "test:compile",
"category": "10.test",
"description": "compiles the test code"
},
"test": {
"name": "test",
"category": "10.test",
"description": "Run tests",
"steps": [
{
"spawn": "test:compile"
},
{
"exec": "jest --passWithNoTests --all --updateSnapshot"
}
]
},
"build": {
"name": "build",
"category": "00.build",
"description": "Full release build (test+compile)"
},
"bump": {
"name": "bump",
"category": "20.release",
"description": "Commits a bump to the package version based on conventional commits",
"steps": [
{
"exec": "standard-version"
}
],
"condition": "! git log --oneline -1 | grep -q \"chore(release):\""
},
"release": {
"name": "release",
"category": "20.release",
"description": "Bumps version & push to master",
"steps": [
{
"spawn": "bump"
},
{
"exec": "git push --follow-tags origin master"
}
],
"condition": "! git log --oneline -1 | grep -q \"chore(release):\""
},
"test:watch": {
"name": "test:watch",
"category": "10.test",
"description": "Run jest in watch mode",
"steps": [
{
"exec": "jest --watch"
}
]
},
"test:update": {
"name": "test:update",
"category": "10.test",
"description": "Update jest snapshots",
"steps": [
{
"exec": "jest --updateSnapshot"
}
]
},
"projen:upgrade": {
"name": "projen:upgrade",
"category": "30.maintain",
"description": "upgrades projen to the latest version",
"steps": [
{
"exec": "yarn upgrade -L projen"
},
{
"exec": "CI=\"\" yarn projen"
}
]
}
},
"env": {
"PATH": "$(npx -c \"node -e \\\"console.log(process.env.PATH)\\\"\")"
},
"//": "~~ Generated by projen. To modify, edit .projenrc.js and run \"npx projen\"."
}
12 changes: 12 additions & 0 deletions .projenrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { NodeProject, ProjectType, SampleReadme } = require('projen');

const project = new NodeProject({
authorAddress: '[email protected]',
authorName: 'Martin Mueller',
name: 'influxdb-s3-backup',
releaseBranches: 'main',
projectType: ProjectType.LIB,

});

project.synth();
Loading

0 comments on commit 6921fa4

Please sign in to comment.