generated from MysteryCode/node-red-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9f9fb05
Showing
25 changed files
with
7,076 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "diff", | ||
"pattern": [ | ||
{ | ||
"regexp": "--- a/(.*)", | ||
"file": 1, | ||
"message": 1 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"problemMatcher": [ | ||
{ | ||
"owner": "node -c", | ||
"pattern": [ | ||
{ | ||
"regexp": "^(./\\S+):(\\d+) - (.*)$", | ||
"file": 1, | ||
"line": 2, | ||
"message": 3 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Code Style | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
ts: | ||
name: TS Prettier | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
cache: "npm" | ||
- run: npm install | ||
- name: Run prettier | ||
run: | | ||
shopt -s globstar | ||
npx prettier -w src/**/*.ts | ||
- run: echo "::add-matcher::.github/diff.json" | ||
- name: Show diff | ||
run: | | ||
git checkout -- package-lock.json | ||
git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: JavaScript | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
syntax: | ||
name: "Check Syntax" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- name: Set up node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
- uses: actions/checkout@v4 | ||
- run: echo "::add-matcher::.github/javascript-syntax.json" | ||
- name: Remove files to be ignored | ||
run: | | ||
true | ||
- run: | | ||
! find dist/ -type f -name '*.js' -exec node -c '{}' \; 2>&1 \ | ||
|awk 'BEGIN {m=0} /(.js):[0-9]+$/ {m=1; printf "%s - ",$0} m==1 && /^SyntaxError/ { m=0; print }' \ | ||
|sed "s@$(pwd)@.@" \ | ||
|grep '^' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Pull Requests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
- review_requested | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
jobs: | ||
commit_message: | ||
name: Check Commit Message | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check for GitHub's default message. | ||
uses: gsactions/commit-message-checker@8c8c0d18ba9b1fcfed6e7385fd2bf357dfc8dccb | ||
with: | ||
pattern: '^(?!Update\s+\S*$).*$' | ||
error: "Please use a meaningful commit message." | ||
excludeDescription: "true" | ||
excludeTitle: "true" | ||
checkAllCommitMessages: "true" | ||
accessToken: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Check for unsquashed `fixup!` commits. | ||
if: ${{ ! github.event.pull_request.draft }} | ||
uses: gsactions/commit-message-checker@8c8c0d18ba9b1fcfed6e7385fd2bf357dfc8dccb | ||
with: | ||
pattern: '^(?!fixup!(\s|$))' | ||
error: "A `fixup!` commit was found." | ||
excludeDescription: "true" | ||
excludeTitle: "true" | ||
checkAllCommitMessages: "true" | ||
accessToken: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: [ '*' ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
registry-url: "https://registry.npmjs.com/" | ||
- run: npm ci | ||
- name: Publish to npmjs.com | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: npm publish --provenance --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
- name: Pack | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: "*.tar.gz" | ||
- name: Create package | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
rm -rf *.tgz | ||
npm pack | ||
- name: Check file existence | ||
id: check_files | ||
uses: andstor/file-existence-action@v3 | ||
with: | ||
files: "*.tgz" | ||
- name: On Build Failure | ||
if: steps.check_files.outputs.files_exists == 'false' | ||
run: | | ||
echo "Packaging FAILED" && exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: TypeScript | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tsc: | ||
name: "TSC" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
cache: "npm" | ||
- run: npm install | ||
- run: | | ||
npx tsc --noEmit | ||
eslint: | ||
name: "eslint" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
cache: "npm" | ||
- run: npm install | ||
- run: npx eslint . | ||
javascript_sync: | ||
name: "Check for outdated JavaScript" | ||
needs: tsc | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "22" | ||
cache: "npm" | ||
- run: npm install | ||
- run: rm -R dist/**/*.js | ||
- run: | | ||
npx tsc | ||
- run: echo "::add-matcher::.github/diff.json" | ||
- name: Show diff | ||
run: | | ||
git checkout -- package-lock.json | ||
git diff --exit-code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
trailingComma: all | ||
printWidth: 120 |
Oops, something went wrong.