Skip to content

Commit

Permalink
feat: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Beesley committed Aug 10, 2021
1 parent f855e9f commit cdf3c43
Show file tree
Hide file tree
Showing 22 changed files with 185,762 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: ['airbnb-typescript/base', 'plugin:prettier/recommended'],
plugins: ['jest'],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
extraFileExtensions: ['.cjs', '.mjs'],
},
ignorePatterns: ['node_modules/', 'dist/', '.vscode/', 'src/generated/'],
rules: {
'no-console': 'off',
'no-undef': 'error',
'import/prefer-default-export': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/no-extraneous-dependencies': 'off',
},
overrides: [
{
files: '**/*.test.*',
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
},
},
],
env: {
'jest/globals': true,
es6: true,
node: true,
},
};
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @bbeesley
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
timezone: Europe/London
open-pull-requests-limit: 10
commit-message:
prefix: chore
include: scope
34 changes: 34 additions & 0 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test-and-publish
on:
push:
pull_request_target:
types: [opened, synchronize, edited]
status: {}
jobs:
build-test-merge-publish:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: '14.17'
- uses: bbeesley/build-test-merge-publish@main
env:
GITHUB_TOKEN: ${{ secrets.GH_PA_TOKEN }}
lint-commits:
runs-on: ubuntu-latest
if: ${{ (github.actor == 'dependabot[bot]' && github.event_name == 'pull_request_target') || (github.ref != 'refs/heads/main' && github.event_name == 'push') }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
- name: install
run: npm ci
- name: commitlint
run: ./node_modules/.bin/commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.vscode
.webpackCache
9 changes: 9 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: gha-auto-dependabot-rebase
author: Bill Beesley <bill@beesley.dev>
description: Github Action to automatically request dependabot rebases
branding:
icon: box
color: blue
runs:
using: 'node12'
main: 'dist/main.cjs'
25 changes: 25 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = function configureBabel(api) {
api.cache(true); // this tells babel to cache it's transformations, it's pretty good at checking file hashes and invalidating it's cache, but if you have problems with changes not being reflected you can set false here.

const presets = [
[
'@babel/preset-env', // this plugin tells babel to transpile your code for a specific runtime environment, we'll use node
{
targets: {
node: '12.13.0', // this means transpile everything that node 12.13 (the version you get in lambda with node12) doesn't support
},
modules: 'cjs',
},
],
[
'@babel/preset-typescript', // this plugin allows babel to work with typescript (bear in mind it will only transpile it, it doesn't care if you have type errors)
],
];

const plugins = [];

return {
presets,
plugins,
};
};
11 changes: 11 additions & 0 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
overwrite: true
schema: 'node_modules/@octokit/graphql-schema/schema.graphql'
documents:
- src/queries/*.graphql
generates:
src/generated/graphql.ts:
plugins:
- 'typescript'
- 'typescript-resolvers'
- 'typescript-document-nodes'
- 'typescript-operations'
9 changes: 9 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { types } = require('conventional-commit-types');

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', Object.keys(types)],
'body-max-line-length': [0, 'always', 100],
},
};
Loading

0 comments on commit cdf3c43

Please sign in to comment.