Skip to content

Commit

Permalink
initial code
Browse files Browse the repository at this point in the history
  • Loading branch information
Matticusau committed Feb 7, 2021
1 parent b1a5694 commit 8e3f10a
Show file tree
Hide file tree
Showing 49 changed files with 20,460 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
58 changes: 58 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"plugins": ["jest", "@typescript-eslint"],
"extends": ["plugin:github/es6"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true,
"jest/globals": true
}
}
52 changes: 52 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: "\U0001F41B Bug Report"
about: "If something isn't working as expected \U0001F914."
title: ''
labels: 'bug, needs triage'
assignees: ''

---

## Bug Report

**Current Behavior**
A clear and concise description of the behavior.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Input Code**
- REPL or Repo link if applicable:

```js
var your => (code) => here;
```

**Expected behavior/code**
A clear and concise description of what you expected to happen (or code).

**GitHub Action Configuration (.yml, etc)**

```yaml
yaml
action config
here
```

**Environment**
- version(s): [e.g. v6.0.0, v7.0.0-beta.34]
- Node/npm version: [e.g. Node 8/npm 5]
- OS: [e.g. OSX 10.13.4, Windows 10]
- Monorepo: [e.g. yes/no/Lerna]
- How you are using package: [e.g. `cli`, `register`, `loader`]

**Possible Solution**
<!--- Only if you have suggestions on a fix for the bug -->

**Additional context/Screenshots**
Add any other context about the problem here. If applicable, add screenshots to help explain.
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: "\U0001F680 Feature Request"
about: "I have a suggestion (and may want to implement it \U0001F642)!"
title: ''
labels: enhancement, needs triage
assignees: ''

---

## Feature Request

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I have an issue when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen. Add any considered drawbacks.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Teachability, Documentation, Adoption, Migration Strategy**
If you can, explain how users will be able to use this and possibly write out a version the docs.
Maybe a screenshot or design?
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "\U0001F4AC Question or Discussion"
about: I have a question about this project I would like to discuss.
title: ''
labels: 'question, needs triage'
assignees: ''

---

## Question

Before you post:

- Have you read the [readme](https://www.github.com/matticusau/pr-helper/blob/main/README.md)?

**What is your question?**
Provide your question here. Be as clear and concise as possible on the ask. Use this next section for providing deeper context

**Background information**
Describe the background of your question. Problems you are trying to solve, the reason for reaching out, etc.
34 changes: 34 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR Helper

on:
pull_request:
branches:
- main
pull_request_review:
branches:
- main
issue_comment:
branches:
- main
jobs:
prhelper_job:
runs-on: ubuntu-latest
steps:
- name: Run PR Helper
id: runprhelper
uses: Matticusau/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
enable-prmerge-automation: false
enable-prcomment-automation: true
enable-prlabel-automation: true
enable-welcomemessage: true
welcome-message: "Thanks for opening an issue! Make sure you've followed CONTRIBUTING.md."
prmerge-requireallchecks: true
prmerge-requirereviewcount: 1
prmerge-method: 'merge'
prlabel-default: 'pr-onhold'
prlabel-ready: 'pr-ready'
prlabel-onhold: 'pr-onhold'
prlabel-reviewrequired: 'review-required'
prlabel-automerge: 'auto-merge'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ bower_components
build/Release

# Dependency directories
node_modules/
# node_modules/
jspm_packages/

# for GH Actions you need to push this folder to check in @actions/core & @actions/github modules
# alternatively for typescript build the js files and then you dont need the modules dir, so it can be excluded again
node_modules/

# TypeScript v1 declaration files
typings/

Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\lib\\main.js",
"outFiles": [
"${workspaceFolder}/**/*.js"
]
}
]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Changelog

TBA
63 changes: 63 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributions

We welcome contributions in the form of issues and pull requests. We view the contributions and process as the same for internal and external contributors.

## Issues

Log issues for both bugs and enhancement requests. Logging issues are important for the open community.

## Enhancements and Feature Requests

Before significant effort is put into code changes, ensure you have raised a feature request/bug via an Issue. This helps to ensure that there is not an overlap in work and that others may collaborate where interested.

## Code Contributions and Development References

### Compiling the javascript

To avoid needing to package the node_modules with the action, we have used **ncc** to compile the typescript into a single js file. A build step has been added to the package.json to facilitate this.

```json
"scripts": {
"build": "ncc build -o lib src/index.ts",
```

So to build the javascript package file just run

```bash
npm run-script build
```

Reference [https://help.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github](https://help.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github)

### Releases

When time comes for a release assign a tag

```bash
git tag -a v0.1 -m "Release v0.1"
git push --follow-tags
```

The RELEASES.md should also be updated to describe the change log.

### Change Log

To generate the change log use the github-changelog-generator(https://github.com/github-changelog-generator/github-changelog-generator)

Install the gem like:

```bash
$ gem install github_changelog_generator
```

Running with CLI:

```bash
github_changelog_generator -u github_username -p github_project
```

## Related resources

These resources were referenced in the creation of this package.

- tba
Loading

0 comments on commit 8e3f10a

Please sign in to comment.