Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit e9cf7bd

Browse files
🎉 Init new @koj-co project
0 parents  commit e9cf7bd

21 files changed

+12057
-0
lines changed

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"

.github/labeler.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
config:
2+
- ./*
3+
tooling:
4+
- tooling/**/*.*
5+
assets:
6+
- static/**/*.*
7+
tests:
8+
- any: ["src/**/*.spec.js", "cypress/**/*"]
9+
package:
10+
- any: ["package.json", "package-lock.json"]
11+
source:
12+
- src/**/*

.github/licensed.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
sources:
2+
npm: true
3+
allowed:
4+
- apache-2.0
5+
- bsd-2-clause
6+
- bsd-3-clause
7+
- isc
8+
- mit
9+
- cc0-1.0
10+
- unlicense
11+
reviewed:
12+
npm:

.github/workflows/automerge.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Merge PRs
2+
on:
3+
pull_request:
4+
types:
5+
- labeled
6+
- synchronize
7+
- opened
8+
- edited
9+
- ready_for_review
10+
- reopened
11+
- unlocked
12+
pull_request_review:
13+
types:
14+
- submitted
15+
jobs:
16+
automerge:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Automerge
20+
uses: pascalgn/[email protected]
21+
env:
22+
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"
23+
MERGE_LABELS: "merge,!work in progress,!wip"
24+
MERGE_REMOVE_LABELS: "merge"
25+
MERGE_METHOD: "merge"
26+
MERGE_COMMIT_MESSAGE: ":twisted_rightwards_arrows: Merge #{pullRequest.number} ({pullRequest.title})"
27+
MERGE_FORKS: false
28+
UPDATE_LABELS: "merge"
29+
UPDATE_METHOD: "merge"
30+
- name: Delete merged branch
31+
uses: koj-co/delete-merged-action@master
32+
with:
33+
branches: "!master, !production, *"
34+
env:
35+
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"

.github/workflows/cla.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CLA Assistant
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened, closed, synchronize]
7+
jobs:
8+
claAssistant:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check signed CLA
12+
if: (github.event.comment.body == 'recheckcla' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
13+
uses: cla-assistant/github-action@master
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
16+
PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PAT }}
17+
with:
18+
path-to-signatures: cla-signatures.json
19+
path-to-cla-document: https://github.com/koj-co/.github/blob/master/CLA.md
20+
allowlist: dependabot-preview[bot], dependabot[bot], greenkeeper[bot], *bot, bot*
21+
remote-organization-name: koj-co
22+
remote-repository-name: .github
23+
signed-commit-message: ":wrench: @$contributorName has signed the CLA in #$pullRequestNo"
24+
create-file-commit-message: ":wrench: Creating a file for storing CLA signatures"
25+
custom-allsigned-prcomment: "✍️ All contributors have signed the CLA"
26+
custom-notsigned-prcomment: "Thanks for your submission! We ask that $you sign our [Contributor License Agreement]($pathToCLADocument) before we can accept your contribution. You can sign the CLA by adding a comment below using this text:"

.github/workflows/feature-pr.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Feature Branch Pull Request
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
- production
7+
jobs:
8+
auto-pull-request:
9+
name: PullRequestAction
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: pull-request-action
13+
uses: vsoch/[email protected]
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
16+
BRANCH_PREFIX: "feature-"
17+
PULL_REQUEST_BRANCH: "master"
18+
PULL_REQUEST_BODY: "🚀 Opening a pull request for this branch"
19+
PULL_REQUEST_REVIEWERS: "AnandChowdhary"
20+
PULL_REQUEST_DRAFT: true

.github/workflows/hotfix-pr.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Hotfix Branch Pull Request
2+
on:
3+
push:
4+
branches-ignore:
5+
- master
6+
- production
7+
jobs:
8+
auto-pull-request:
9+
name: PullRequestAction
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: pull-request-action
13+
uses: vsoch/[email protected]
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
16+
BRANCH_PREFIX: "hotfix-"
17+
PULL_REQUEST_BRANCH: "production"
18+
PULL_REQUEST_BODY: "🚀 Opening a pull request for this branch"
19+
PULL_REQUEST_REVIEWERS: "AnandChowdhary"

.github/workflows/labeler.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Pull Request Labeler
2+
on:
3+
- pull_request
4+
- pull_request_review
5+
jobs:
6+
triage:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Label all PRs
10+
uses: actions/labeler@master
11+
with:
12+
repo-token: "${{ secrets.GH_PAT }}"
13+
- name: Label approved PRs
14+
uses: koj-co/label-approved-action@master
15+
with:
16+
labels: "merge"
17+
env:
18+
GITHUB_TOKEN: "${{ secrets.GH_PAT }}"

.github/workflows/licensed.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: License CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
name: Check licenses
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Setup license
14+
uses: jonabc/[email protected]
15+
with:
16+
version: 2.x
17+
- run: npm ci
18+
- id: licensed
19+
uses: jonabc/licensed-ci@v1
20+
with:
21+
config_file: .github/licensed.yml
22+
github_token: ${{ secrets.GH_PAT }}
23+
user_name: "Koj Bot"
24+
user_email: "[email protected]"
25+
commit_message: ":page_facing_up: Update dependency license file"
26+
- uses: actions/github-script@v3
27+
if: always() && steps.licensed.outputs.pr_number
28+
with:
29+
github-token: ${{ secrets.GH_PAT }}
30+
script: |
31+
github.issues.createComment({
32+
...context.repo,
33+
issue_number: ${{ steps.licensed.outputs.pr_number }}
34+
body: "I've checked the license of your new dependency and it looks good!"
35+
})

.github/workflows/node.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Node CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
release:
8+
name: Build, test, and release
9+
runs-on: ubuntu-18.04
10+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
11+
steps:
12+
- name: Checkout
13+
uses: actions/[email protected]
14+
- name: Setup Node.js
15+
uses: actions/[email protected]
16+
with:
17+
node-version: 14
18+
- name: Install dependencies
19+
run: npm ci
20+
- name: Build TypeScript
21+
run: npm run build
22+
- name: Run tests
23+
run: npm run test
24+
- name: Release
25+
run: npx semantic-release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
GIT_AUTHOR_NAME: "Koj Bot"
30+
GIT_AUTHOR_EMAIL: "[email protected]"
31+
GIT_COMMITTER_NAME: "Koj Bot"
32+
GIT_COMMITTER_EMAIL: "[email protected]"

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules/
2+
dist/
3+
.env
4+
.DS_Store

.prettierrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require("@koj/config").prettier;

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# v1.0.0 (2020-09-26)
2+
3+
## ✨ New features
4+
5+
- [`ce05011`](https://github.com/koj-co/template/commit/ce05011) Release v1

README.md

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# 🖌️ Template
2+
3+
This is a starter repository for building Node.js projects at Koj.
4+
5+
<!-- prettier-ignore-start -->
6+
| | Status |
7+
| - | - |
8+
| Build | [![Node CI](https://github.com/koj-co/template/workflows/Node%20CI/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22Node+CI%22) [![Dependencies](https://img.shields.io/librariesio/github/koj-co/template)](https://libraries.io/github/koj-co/template) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/koj-co/template)](https://github.com/koj-co/template/releases) [![Snyk Vulnerabilities for GitHub Repo](https://img.shields.io/snyk/vulnerabilities/github/koj-co/template)](https://snyk.io/test/github/koj-co/template) |
9+
| Health | [![License CI](https://github.com/koj-co/template/workflows/License%20CI/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22License+CI%22) [![CLA Assistant](https://github.com/koj-co/template/workflows/CLA%20Assistant/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22CLA+Assistant%22) [![Pull Request Labeler](https://github.com/koj-co/template/workflows/Pull%20Request%20Labeler/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22Pull+Request+Labeler%22) |
10+
| PRs | [![Feature Branch Pull Request](https://github.com/koj-co/template/workflows/Feature%20Branch%20Pull%20Request/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22Feature+Branch+Pull+Request%22) [![Hotfix Branch Pull Request](https://github.com/koj-co/template/workflows/Hotfix%20Branch%20Pull%20Request/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22Hotfix+Branch+Pull+Request%22) [![Merge PRs](https://github.com/koj-co/template/workflows/Merge%20PRs/badge.svg)](https://github.com/koj-co/template/actions?query=workflow%3A%22Merge+PRs%22) |
11+
<!-- prettier-ignore-end -->
12+
13+
## ⭐️ Features
14+
15+
- [Semantic Release with Gitmoji](./release.config.js)
16+
- [Koj's Prettier configuration](./.prettierrc.cjs)
17+
- [Dependabot configuration](./.github/dependabot.yml)
18+
- [CI for open-source licenses](./.github/workflows/licensed.yml)
19+
- [Pull request labeler](./.github/labeler.yml)
20+
- [Merge PRs on approved reviews](./github/workflows/automerge.yml)
21+
- [CLA enforcement for new contributors](./github/workflows/cla.yml)
22+
- [Create PRs from feature/hotfix branches](./github/workflows/feature-pr.yml)
23+
- [Write code in TypeScript](./src/index.ts)
24+
- [Tests using Jest](./src/index.spec.ts)
25+
26+
## 💻 Getting started
27+
28+
1. [Create a new repository from this template](https://github.com/koj-co/template/generate)
29+
2. Install dependencies using `npm install`
30+
3. Update package details in `package.json` and `README.md`
31+
1. Find and replace `koj-co/template` with `user/repository`
32+
2. Find and replace `@koj/template` with npm project name
33+
34+
## 📄 License
35+
36+
[MIT](./LICENSE) © [Koj](https://koj.co)
37+
38+
<p align="center">
39+
<a href="https://koj.co">
40+
<img width="44" alt="Koj" src="https://kojcdn.com/v1598284251/website-v2/koj-github-footer_m089ze.svg">
41+
</a>
42+
</p>
43+
<p align="center">
44+
<sub>An open source project by <a href="https://koj.co">Koj</a>. <br> <a href="https://koj.co">Furnish your home in style, for as low as CHF175/month →</a></sub>
45+
</p>

jest.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node",
4+
};

0 commit comments

Comments
 (0)