Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hejny authored Sep 27, 2023
0 parents commit 76a8235
Show file tree
Hide file tree
Showing 97 changed files with 8,998 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*]
end_of_line = LF
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 17

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish new version

on:
push:
tags:
- 'v*'

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 17
- run: npm ci
- run: npm test

release:
name: Create Release
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
# Note: GITHUB_TOKEN and github.ref is provided by Actions, you do not need to care about it
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
# TODO: Figure out how to automate meaningfull body
body: |
Release ${{ github.ref }}
draft: false
prerelease: false

publish-npm:
name: Publish on NPM package registry
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 17
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-github:
name: Publish on GitHub package registry
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 17
registry-url: https://npm.pkg.github.com/
# Note: This is an awful solution to publish this package as "foo" on NPM and "@hejny/foo" on GitHub
- run: "sed -i -e 's/\\\"name\\\"\\: \\\"/\\\"name\\\": \\\"\\@hejny\\//g' ./package.json"
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 17

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

/node_modules
/dist
/coverage

/secrets.md
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


/.github
/.vscode
/.idea
/node_modules
/src
/coverage
/samples

/secrets.md
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"endOfLine": "lf",
"tabWidth": 4,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "always",
"printWidth": 80
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"files.eol": "\n",
"jestrunner.jestCommand": "npx jest",
"editor.formatOnSave": true,
"prettier.configPath": ".prettierrc",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"extensions.ignoreRecommendations": true,
"typescript.tsc.autoDetect": "off",
"npm.autoDetect": "on",
"debug.allowBreakpointsEverywhere": true,
"html.autoClosingTags": false,
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"search.exclude": {
"modules/sdk/types/**": true,
"*/**/node_modules/": true
},
"grammarly.domain": "technical"
}
35 changes: 35 additions & 0 deletions .vscode/terminals.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"autokill": true,
"terminals": [
{
"name": "🧪 Lint",
"command": "npm run lint",
"onlySingle": true,
"focus": true
},
{
"name": "🧪 Test",
"command": "npm run test",
"onlySingle": true,
"focus": true
},
{
"name": "🔼👑 Release major version",
"command": "npm version major",
"onlySingle": true,
"focus": true
},
{
"name": "🔼🚀 Release minor version",
"command": "npm version minor",
"onlySingle": true,
"focus": true
},
{
"name": "🔼🩹 Release patch version",
"command": "npm version patch",
"onlySingle": true,
"focus": true
}
]
}
12 changes: 12 additions & 0 deletions .whitesource
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"scanSettings": {
"baseBranches": []
},
"checkRunSettings": {
"vulnerableCheckRunConclusionLevel": "failure",
"displayMode": "diff"
},
"issueSettings": {
"minSeverityLevel": "LOW"
}
}
Loading

0 comments on commit 76a8235

Please sign in to comment.