Skip to content

Commit b3c9d88

Browse files
committed
Added base files
1 parent f6e60c1 commit b3c9d88

17 files changed

Lines changed: 8901 additions & 0 deletions

File tree

.eslintrc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"jest/globals": true
5+
},
6+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
7+
"overrides": [
8+
{
9+
"env": {
10+
"node": true
11+
},
12+
"files": [".eslintrc.{js,cjs}"],
13+
"parserOptions": {
14+
"sourceType": "script"
15+
}
16+
}
17+
],
18+
"parser": "@typescript-eslint/parser",
19+
"parserOptions": {
20+
"ecmaVersion": "latest",
21+
"sourceType": "module"
22+
},
23+
"plugins": ["jest", "@typescript-eslint"],
24+
"rules": {
25+
"@typescript-eslint/no-var-requires": "off",
26+
"@typescript-eslint/no-explicit-any": "off",
27+
"semi": ["warn", "always"]
28+
},
29+
"ignorePatterns": ["*.test.ts"]
30+
}

.github/workflows/node.js.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Build Status
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
node-version: [14.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
25+
- run: npm ci
26+
- run: npm run lint
27+
- run: npm t
28+
29+
- if: ${{ matrix.node-version == '14.x' }}
30+
name: Get Coverage for badge
31+
run: |
32+
# var SUMMARY = [
33+
# '',
34+
# '=============================== Coverage summary ===============================',
35+
# 'Statements : 32.5% ( 39/120 )',
36+
# 'Branches : 38.89% ( 21/54 )',
37+
# 'Functions : 21.74% ( 5/23 )',
38+
# 'Lines : 31.93% ( 38/119 )',
39+
# '================================================================================',
40+
# ''
41+
# ];
42+
# SUMMARY = SUMMARY.split('\n')[5]; // 'Lines : 31.93% ( 38/119 )'
43+
# SUMMARY = SUMMARY.split(':')[1].split('(')[0].trim(); // '31.93%'
44+
SUMMARY="$(npm test -- --coverageReporters='text-summary' | tail -2 | head -1)"
45+
TOKENS=($SUMMARY)
46+
# process.env.COVERAGE = '31.93%';
47+
echo "COVERAGE=$(echo ${TOKENS[2]})" >> $GITHUB_ENV
48+
49+
# var REF = 'refs/pull/27/merge.json';
50+
REF=${{ github.ref }}
51+
# console.log('github.ref: ' + REF);
52+
echo "github.ref: $REF"
53+
# var PATHS = REF.split('/');
54+
IFS='/' read -ra PATHS <<< "$REF"
55+
# var BRANCH_NAME = PATHS[1] + '_' + PATHS[2];
56+
BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
57+
# console.log(BRANCH_NAME); // 'pull_27'
58+
echo $BRANCH_NAME
59+
# process.env.BRANCH = 'pull_27';
60+
echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
61+
- if: ${{ matrix.node-version == '14.x' }}
62+
name: Create the Badge
63+
uses: schneegans/dynamic-badges-action@v1.0.0
64+
with:
65+
auth: ${{ secrets.GIST_SECRET }}
66+
gistID: 10f0b77400703c4a65f38434106adf2d
67+
filename: discussion-auto-responder__${{ env.BRANCH }}.json
68+
label: Test Coverage
69+
message: ${{ env.COVERAGE }}
70+
color: green
71+
namedLogo: jest

.github/workflows/respond.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Name Your Action
2+
3+
on:
4+
discussion:
5+
types: [created]
6+
7+
jobs:
8+
autorespond:
9+
name: Your Action Name
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v3
14+
- name: Your Action Name
15+
id: youraction
16+
uses: ./
17+
with:
18+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
19+
- name: Show Output
20+
run: |
21+
echo "output1 = ${{ steps.autorespond.outputs.output1 }}"
22+
echo "output2 = ${{ steps.autorespond.outputs.output2 }}"
23+

.gitignore

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
lib
22+
23+
# Coverage directory used by tools like istanbul
24+
coverage
25+
*.lcov
26+
27+
# nyc test coverage
28+
.nyc_output
29+
30+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
31+
.grunt
32+
33+
# Bower dependency directory (https://bower.io/)
34+
bower_components
35+
36+
# node-waf configuration
37+
.lock-wscript
38+
39+
# Compiled binary addons (https://nodejs.org/api/addons.html)
40+
build/Release
41+
42+
# Dependency directories
43+
node_modules/
44+
jspm_packages/
45+
46+
# Snowpack dependency directory (https://snowpack.dev/)
47+
web_modules/
48+
49+
# TypeScript cache
50+
*.tsbuildinfo
51+
52+
# Optional npm cache directory
53+
.npm
54+
55+
# Optional eslint cache
56+
.eslintcache
57+
58+
# Optional stylelint cache
59+
.stylelintcache
60+
61+
# Microbundle cache
62+
.rpt2_cache/
63+
.rts2_cache_cjs/
64+
.rts2_cache_es/
65+
.rts2_cache_umd/
66+
67+
# Optional REPL history
68+
.node_repl_history
69+
70+
# Output of 'npm pack'
71+
*.tgz
72+
73+
# Yarn Integrity file
74+
.yarn-integrity
75+
76+
# dotenv environment variable files
77+
.env
78+
.env.development.local
79+
.env.test.local
80+
.env.production.local
81+
.env.local
82+
83+
# parcel-bundler cache (https://parceljs.org/)
84+
.cache
85+
.parcel-cache
86+
87+
# Next.js build output
88+
.next
89+
out
90+
91+
# Nuxt.js build / generate output
92+
.nuxt
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*

.husky/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm test
5+
npm run build
6+
npx lint-staged

.lintstagedrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"./src/**/*.{js,ts}": ["prettier --write", "eslint --max-warnings 3"]
3+
}

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"printWidth": 120,
4+
"tabWidth": 2
5+
}

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "ts-node",
6+
"type": "node",
7+
"request": "launch",
8+
"args": ["./src/index.ts"],
9+
"runtimeArgs": ["-r", "ts-node/register"],
10+
"cwd": "${workspaceRoot}",
11+
"internalConsoleOptions": "openOnSessionStart"
12+
}
13+
]
14+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Wesley Scholl
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)