Skip to content

Commit

Permalink
Initial commit from yeoman-generator-artsy
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfurrow committed Oct 13, 2018
0 parents commit ea9ca70
Show file tree
Hide file tree
Showing 14 changed files with 6,629 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

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

# node-waf configuration
.lock-wscript

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

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Jest cache
.jest

# TS build files
build
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.editorconfig
.travis.yml
node_modules/
src/
dangerfile.ts
tsconfig.json
tslint.json
.gitignore
wallaby.js
yarn.lock
.jest
.vscode

12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: node_js

cache:
yarn: true
directories:
- node_modules
- .jest

script:
- yarn lint
- yarn jest
- yarn danger
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Master

* Initial setup - [@ashfurrow][]

[@ashfurrow]: https://github.com/ashfurrow
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Ash Furrow <ash@ashfurrow.com> and Artsy Inc. <engineering@artsymail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
tslint-plugin-relay

[Your README here]

## How do I work on this?

```sh
git clone https://github.com/ashfurrow/tslint-plugin-relay.git
cd tslint-plugin-relay
yarn install

# Open VS Code with `code .`

# Run tests
yarn jest
```

## How do I deploy this?

```sh
yarn release
```
30 changes: 30 additions & 0 deletions dangerfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { danger, fail, warn } from "danger"
import * as fs from "fs"

// Setup
const pr = danger.github.pr
const modified = danger.git.modified_files
const newFiles = danger.git.created_files
const bodyAndTitle = (pr.body + pr.title).toLowerCase()

// Custom modifiers for people submitting PRs to be able to say "skip this"
const trivialPR = bodyAndTitle.includes("trivial")
const acceptedNoTests = bodyAndTitle.includes("skip new tests")

const filesOnly = (file: string) => fs.existsSync(file) && fs.lstatSync(file).isFile()

// Custom subsets of known files
const modifiedAppFiles = modified.filter(p => p.includes("lib/")).filter(p => filesOnly(p))
const modifiedTestFiles = modified.filter(p => p.includes("_tests")).filter(p => filesOnly(p))

// When there are app-changes and it's not a PR marked as trivial, expect
// there to be CHANGELOG changes.
const changelogChanges = modified.includes("CHANGELOG.md")
if (modifiedAppFiles.length > 0 && !trivialPR && !changelogChanges) {
fail("No CHANGELOG added.")
}

// No PR is too small to warrant a paragraph or two of summary
if (pr.body.length === 0) {
fail("Please add a description to your PR.")
}
52 changes: 52 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "tslint-plugin-relay",
"version": "0.0.1",
"description": "",
"main": "build/index.js",
"author": "Ash Furrow <ash@ashfurrow.com> & Art.sy Inc",
"license": "MIT",
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/node": "^10.11.0",
"danger": "^4.0.2",
"husky": "^1.0.0",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
"prettier": "^1.14.3",
"release-it": "^7.6.1",
"ts-jest": "^23.10.1",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "^3.0.3"
},
"scripts": {
"type-check": "tsc --noEmit",
"build": "tsc",
"lint": "tslint 'src/**/*.{ts,tsx}'",
"release": "release-it"
},
"jest": {
"preset": "ts-jest"
},
"prettier": {
"printWidth": 115,
"semi": false,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"proseWrap": "always"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "yarn build"
}
},
"lint-staged": {
"*.@(ts|tsx)": [
"tslint --fix",
"yarn prettier --write",
"git add"
]
}
}
7 changes: 7 additions & 0 deletions src/_tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import hello from "../"

describe("hello", () => {
it("does something", () => {
hello()
})
})
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function hello() {
console.log("Hello World") // tslint:disable-line
}
23 changes: 23 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"rootDir": "src",
"outDir": "build",
"allowJs": false,
"pretty": true,
"strictNullChecks": true,
"declaration": true
},
"lib":["es2017"],
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"dangerfile.ts"
],
"exclude": [
"dangerfile.ts",
"node_modules",
"build"
]
}
34 changes: 34 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": [
"tslint:recommended"
],
"rules": {
"arrow-parens": false,
"interface-name": [
true,
"never-prefix"
],
"max-classes-per-file": [
false
],
"member-access": [
false,
"check-accessor",
"check-constructor"
],
// Disabled till there’s an auto-fixer for this.
// https://github.com/palantir/tslint/blob/master/src/rules/objectLiteralSortKeysRule.ts
"object-literal-sort-keys": false,
"semicolon": [
true,
"never",
"ignore-interfaces",
"ignore-bound-class-methods"
],
"switch-default": false,
"trailing-comma": [
true,
{ "multiline": "always", "singleline": "never" }
]
}
}
19 changes: 19 additions & 0 deletions wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = function(wallaby) {
return {
files: [
"tsconfig.json",
"src/**/*.ts?(x)",
"src/**/*.snap",
"src/**/*.json",
"!src/**/*.test.ts?(x)",
],
tests: ["src/**/*.test.ts?(x)"],

env: {
type: "node",
runner: "node",
},

testFramework: "jest",
}
}
Loading

0 comments on commit ea9ca70

Please sign in to comment.