Skip to content

Commit d292637

Browse files
committed
Initial commit
0 parents  commit d292637

28 files changed

+39995
-0
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dist/
2+
lib/
3+
node_modules/
4+
jest.config.js
5+
**/*.test.ts

.eslintrc.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"plugins": [
3+
"jest",
4+
"@typescript-eslint"
5+
],
6+
"extends": [
7+
"prettier",
8+
"plugin:github/recommended"
9+
],
10+
"parser": "@typescript-eslint/parser",
11+
"parserOptions": {
12+
"ecmaVersion": 9,
13+
"sourceType": "module",
14+
"project": "./tsconfig.json"
15+
},
16+
"rules": {
17+
"camelcase": "off",
18+
"filenames/match-regex": "off",
19+
"i18n-text/no-en": "off",
20+
"import/named": "off",
21+
"import/no-namespace": "off",
22+
"sort-imports": "off"
23+
},
24+
"env": {
25+
"node": true,
26+
"es6": true,
27+
"jest/globals": true
28+
}
29+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/** -diff linguist-generated=true

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Build"
2+
3+
on: # rebuild any PRs and main branch changes
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- "releases/*"
9+
10+
jobs:
11+
build: # make sure build/ci work properly
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set Node.js 18
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
- run: |
21+
npm install
22+
- run: |
23+
npm run all

.github/workflows/check-dist.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# `dist/index.js` is a special file in Actions.
2+
# When you reference an action with `uses:` in a workflow,
3+
# `index.js` is the code that will run.
4+
# For our project, we generate this file through a build process from other source files.
5+
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
6+
name: Check dist/
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
paths-ignore:
13+
- "**.md"
14+
pull_request:
15+
paths-ignore:
16+
- "**.md"
17+
workflow_dispatch:
18+
19+
jobs:
20+
check-dist:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
26+
- name: Set Node.js 18
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 18
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Rebuild the dist/ directory
35+
run: |
36+
npm run build
37+
npm run package
38+
39+
- name: Compare the expected and actual dist/ directories
40+
run: |
41+
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
42+
echo "Detected uncommitted changes after build. See status below:"
43+
git diff
44+
exit 1
45+
fi
46+
id: diff
47+
48+
# If index.js was different than expected, upload the expected version as an artifact
49+
- uses: actions/upload-artifact@v3
50+
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
51+
with:
52+
name: dist
53+
path: dist/

.github/workflows/test.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Test Deepbits Scan Action"
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches:
10+
- main
11+
- "releases/*"
12+
13+
jobs:
14+
deepbits-scan:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
SCAN_BADGE: ${{ steps.deepbits-scan.outputs.DEEPBITS_BADGE }}
18+
DEEPBITS_LINK: ${{ steps.deepbits-scan.outputs.DEEPBITS_COMMIT }}
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- uses: ./
23+
id: deepbits-scan
24+
25+
comment-on-commit:
26+
needs: deepbits-scan
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Create commit comment
30+
uses: peter-evans/commit-comment@v2
31+
with:
32+
body: |
33+
Scan finished. Click [here](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}#artifacts) to see the results.
34+
35+
---
36+
37+
Powered by [**Deepbits**](https://deepbits.com):
38+
- Scan Details: ${{ needs.deepbits-scan.outputs.DEEPBITS_LINK }}
39+
- Badge: ${{ needs.deepbits-scan.outputs.SCAN_BADGE }}
40+
41+
download-artifact:
42+
needs: deepbits-scan
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- uses: actions/download-artifact@v3
48+
with:
49+
name: DEEPBITS_SCAN_RESULTS
50+
51+
- name: Display structure of downloaded files
52+
run: ls -R

.gitignore

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Dependency directory
2+
node_modules
3+
4+
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
jspm_packages/
46+
47+
# TypeScript v1 declaration files
48+
typings/
49+
50+
# TypeScript cache
51+
*.tsbuildinfo
52+
53+
# Optional npm cache directory
54+
.npm
55+
56+
# Optional eslint cache
57+
.eslintcache
58+
59+
# Optional REPL history
60+
.node_repl_history
61+
62+
# Output of 'npm pack'
63+
*.tgz
64+
65+
# Yarn Integrity file
66+
.yarn-integrity
67+
68+
# dotenv environment variables file
69+
.env
70+
.env.test
71+
72+
# parcel-bundler cache (https://parceljs.org/)
73+
.cache
74+
75+
# next.js build output
76+
.next
77+
78+
# nuxt.js build output
79+
.nuxt
80+
81+
# vuepress build output
82+
.vuepress/dist
83+
84+
# Serverless directories
85+
.serverless/
86+
87+
# FuseBox cache
88+
.fusebox/
89+
90+
# DynamoDB Local files
91+
.dynamodb/
92+
93+
# OS metadata
94+
.DS_Store
95+
Thumbs.db
96+
97+
# Ignore built ts files
98+
__tests__/runner/*
99+
lib/**/*

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
lib/
3+
node_modules/

.prettierrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"printWidth": 80,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"trailingComma": "es5",
8+
"bracketSpacing": false,
9+
"arrowParens": "avoid"
10+
}

LICENSE

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

0 commit comments

Comments
 (0)