Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Jul 31, 2020
0 parents commit 3d692be
Show file tree
Hide file tree
Showing 20 changed files with 4,801 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
For **questions**, please use the repo's [GitHub Discussions](https://github.com/graphql-nexus/nexus/discussions)

---

For **feature requests**, please fill out the [feature request template](https://github.com/graphql-nexus/nexus/issues/new?template=1-feature.md)

---

For **bug reports**, please fill out the [bug report issue template](https://github.com/graphql-nexus/nexus/issues/new?template=2-bug.md)

---

For **documentation issues**, please fill out the [documentation issue template](https://github.com/graphql-nexus/nexus/issues/new?template=3-docs.md)

---

For **something else**, please fill out the [something else template](https://github.com/graphql-nexus/nexus/issues/new?template=5-other.md)
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/1-feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature
about: You have an idea for a new capability or a refinement to an existing one
title: ''
labels: type/feat
assignees: ''
---

<!-- Instructions -->
<!-- -->
<!-- 1. Remove sections/details you do not complete -->
<!-- 2. Add sections/details useful to you -->

#### Perceived Problem

#### Ideas / Proposed Solution(s)
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/2-bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug
about: You encountered something that is not working the way it should
title: ''
labels: type/bug
assignees: ''
---

<!-- Instructions -->
<!-- -->
<!-- 1. Remove sections/details you do not complete -->
<!-- 2. Add sections/details useful to you -->

#### Nexus Report <!-- Copy the result of `$ nexus report` to this section -->

#### Screenshot

#### Description <!-- If screenshot not obvious enough -->

#### Repro <!-- Steps or repo link -->
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/3-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Docs
about: Feedback or ideas about the documentation
title: ''
labels: type/docs
assignees: ''
---

<!-- Instructions -->
<!-- -->
<!-- 1. Remove sections/details you do not complete -->
<!-- 2. Add sections/details useful to you -->

#### What

#### Why

#### How
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/4-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Question
about: Question, need support, confused, unsure about something
title: 'Stop'
labels: ''
assignees: ''
---

# Stop!

Do not ask your question here.

Instead, please use the repo's native Discssions feature 🙏🏻

https://github.com/graphql-nexus/nexus/discussions
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/5-other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Something Else
about: Feedback, support, docs, performance, ...
title: ''
labels: ''
assignees: ''
---

<!-- Instructions -->
<!-- -->
<!-- 1. Remove sections/details you do not complete -->
<!-- 2. Add sections/details useful to you -->

#### What

#### Why

#### How
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
closes #...

#### TODO

- [ ] docs
- [ ] tests
3 changes: 3 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["github>prisma-labs/renovate-config"]
}
22 changes: 22 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: pr

on:
pull_request:
branches: [master]

jobs:
test:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node-version: [10.x, 12.x, 14.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn -s test
43 changes: 43 additions & 0 deletions .github/workflows/trunk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: trunk

on:
push:
branches: [master]

jobs:
test:
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
node-version: [10.x, 12.x, 14.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn -s test
#
# todo uncomment me
# publish:
# needs: [test]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Get all git commits and tags
# run: git fetch --prune --unshallow --tags
# - uses: actions/setup-node@v1
# - name: Install deps
# run: yarn --frozen-lockfile
# - name: Make release
# id: release
# env:
# NPM_TOKEN: ${{secrets.NPM_TOKEN}}
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# run: |
# yarn -s dripip preview --json > result.json
# echo '==> Publish Result'
# jq '.' < result.json
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# 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

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# template-typescript-lib

![trunk](https://github.com/prisma-labs/project-lib-typescript/workflows/trunk/badge.svg)

Project template for TypeScript libraries

#### Features

1. [TypeScript](https://www.typescriptlang.org/)
1. Strict mode
1. Target es2018 which Node as low as version 10 has good support for ([kangax compat table](https://node.green/#ES2018))
1. cache setup
1. test/src config split
1. [`jest`](https://jestjs.io) setup with `ts-jest` and handy watch plugins for testing
1. [`dripip`](https://github.com/prisma-labs/dripip) for release management
1. GitHub actions for:
1. Automated trunk and PR testing across matrix of mac/linux/windows OSes and Node 10/12/14
1. Automated preview releases on trunk commits
1. OS Matrix
1. Five issue templates: feature, bug, docs, question, other
1. [Renovate](https://github.com/renovatebot/renovate) configuration
1. npm scripts for development lifecycle

#### After starting a new project with this template

1. [Setup a repo secret ](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets) called `NPM_TOKEN` containing an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) for CI package publishing.
1. If your repo does not have GitHub discussions beta feature then adjust the question issue template to not mention them.
1. Update your GitHub org's label-sync repo to include config for your new repo, assuming your org has such a thing. For example for Prisma Labs: [prisma-labs/label-sync](https://github.com/prisma-labs/prisma-labs-labelsync/blob/master/labelsync.ts).
1. Uncomment the trunk publishing in `.github/workflows/trunk.yml`
1. Search replace all instances of `prisma-labs/project-lib-typescript` to `<your org>/<your repo>`
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "project-lib-typescript",
"version": "0.0.0",
"main": "dist/index.js",
"repository": "git@github.com:prisma-labs/project-lib-typescript.git",
"author": "Prisma Labs Team",
"license": "MIT",
"files": [
"dist"
],
"scripts": {
"format": "prettier --write .",
"dev": "tsc --build --watch",
"build": "tsc",
"test": "jest",
"clean": "rm -rf dist",
"release:stable": "dripip stable",
"release:preview": "dripip preview",
"release:pr": "dripip pr",
"prepublishOnly": "yarn -s build"
},
"devDependencies": {
"@prisma-labs/prettier-config": "0.1.0",
"@types/jest": "25.2.3",
"dripip": "0.9.0",
"jest": "25.5.4",
"jest-watch-typeahead": "0.6.0",
"prettier": "2.0.5",
"ts-jest": "25.5.1",
"typescript": "3.9.6"
},
"jest": {
"preset": "ts-jest",
"testEnvironment": "node",
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"prettier": "@prisma-labs/prettier-config"
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('hello world')
3 changes: 3 additions & 0 deletions tests/test.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
it('works', () => {
expect(true).toEqual(true)
})
5 changes: 5 additions & 0 deletions tests/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "../tsconfig.base.json",
"references": [{ "path": ".." }],
"include": ["."]
}
13 changes: 13 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"compilerOptions": {
"incremental": true,
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"importHelpers": true,
"module": "commonjs",
"esModuleInterop": true,
"strict": true,
"target": "ES2018"
}
}
Loading

0 comments on commit 3d692be

Please sign in to comment.