-
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.
feat(eleventy-telegram-plugin): add package
- Loading branch information
Showing
47 changed files
with
32,259 additions
and
1 deletion.
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 @@ | ||
*.json linguist-language=JSON-with-Comments |
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,43 @@ | ||
name: 'CI' | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-test-release: | ||
name: Build & Test all packages on ${{ matrix.os }}, Node ${{ matrix.node }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: ['16.15.1'] | ||
steps: | ||
- name: 🛎️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⚙️ Setup Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 👀 Check npm version | ||
run: npm version | ||
|
||
- name: ⬇️ Install dependencies | ||
run: npm ci | ||
|
||
- name: 🔧 Build all libraries | ||
run: npm run build:libs | ||
|
||
- name: 🛡️ Audit security | ||
continue-on-error: true | ||
if: ${{ matrix.os }} == 'ubuntu-latest' | ||
run: npm audit --audit-level=moderate | ||
|
||
- name: 🔍 Test all libraries | ||
env: | ||
TELEGRAM: ${{ secrets.TELEGRAM }} | ||
run: npm run test:ci |
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,53 @@ | ||
name: 'Notify of workflow run conclusion' | ||
|
||
on: | ||
workflow_run: | ||
workflows: ['CI', 'release'] | ||
types: [completed] | ||
|
||
jobs: | ||
on-failure: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | ||
steps: | ||
- name: 💬 Notify Telegram of workflow run FAILURE | ||
# https://github.com/appleboy/telegram-action | ||
uses: appleboy/[email protected] | ||
# This is a container action, so it must run on Linux (it would fail if | ||
# `runs-on` is either `windows-latest` or `macOS-latest`) | ||
# https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action#introduction | ||
# https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson | ||
with: | ||
to: ${{ fromJSON(secrets.TELEGRAM).chat_id }} | ||
token: ${{ fromJSON(secrets.TELEGRAM).token }} | ||
format: html | ||
disable_web_page_preview: true | ||
# https://core.telegram.org/bots/api#formatting-options | ||
message: | | ||
<b>⚠️ GitHub workflow failure 💔</b> | ||
Repository: <a href="${{ github.event.repository.html_url }}">${{ github.event.repository.full_name }}</a> | ||
Workflow: <a href="${{ github.event.workflow_run.html_url }}">${{ github.event.workflow_run.name }}</a> | ||
Workflow Run ID: <a href="${{ github.event.workflow_run.html_url }}?check_suite_focus=true">${{ github.event.workflow_run.id }}</a> | ||
on-success: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: 💬 Notify Telegram of workflow run SUCCESS | ||
uses: appleboy/[email protected] | ||
with: | ||
to: ${{ fromJSON(secrets.TELEGRAM).chat_id }} | ||
token: ${{ fromJSON(secrets.TELEGRAM).token }} | ||
format: html | ||
disable_web_page_preview: true | ||
message: | | ||
<b>✅ GitHub workflow success 💖</b> | ||
Repository: <a href="${{ github.event.repository.html_url }}">${{ github.event.repository.full_name }}</a> | ||
Workflow: <a href="${{ github.event.workflow_run.html_url }}">${{ github.event.workflow_run.name }}</a> | ||
Workflow Run ID: <a href="${{ github.event.workflow_run.html_url }}?check_suite_focus=true">${{ github.event.workflow_run.id }}</a> |
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,57 @@ | ||
name: 'release' | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- alpha | ||
- beta | ||
|
||
jobs: | ||
build-test-release: | ||
name: Build & Test all packages on ${{ matrix.os }}, Node ${{ matrix.node }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node: ['16.15.1'] | ||
steps: | ||
- name: 🛎️ Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: ⚙️ Setup Node.js ${{ matrix.node }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 👀 Check npm version | ||
run: npm version | ||
|
||
- name: ⬇️ Install dependencies | ||
run: npm ci | ||
|
||
- name: 🔧 Build all libraries | ||
run: npm run build:libs | ||
|
||
- name: 🛡️ Audit security | ||
continue-on-error: true | ||
if: ${{ matrix.os }} == 'ubuntu-latest' | ||
run: npm audit --audit-level=moderate | ||
|
||
- name: 🔍 Test all libraries | ||
env: | ||
TELEGRAM: ${{ secrets.TELEGRAM }} | ||
run: npm run test:ci | ||
|
||
- name: 🚀 Release to npmjs | ||
env: | ||
# The github token must allow to push to this GitHub repository. | ||
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_BOT_NPM_TOKEN }} | ||
run: > | ||
npx multi-semantic-release | ||
--ignore-private | ||
--ignore-packages=packages/demo-app | ||
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 |
---|---|---|
@@ -1 +1,18 @@ | ||
node_modules/ | ||
# dependencies | ||
**/node_modules/ | ||
|
||
# environment variables | ||
**/.envrc | ||
|
||
# secrets | ||
secrets/* | ||
!secrets/README.md | ||
|
||
# test coverage | ||
**/coverage/ | ||
|
||
# Typescript compilation output files for libraries and applications | ||
packages/**/lib/ | ||
packages/**/dist/ | ||
packages/**/_site/ | ||
packages/**/tsconfig.tsbuildinfo |
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,19 @@ | ||
#!/bin/bash | ||
|
||
# Husky seems to run all hook scripts using sh, regardless of the shebang present | ||
# in the git hook. | ||
# https://github.com/typicode/husky/issues/971 | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
set -eu | ||
|
||
echo "PRE COMMIT HOOK" | ||
|
||
# https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables | ||
# https://stackoverflow.com/questions/18750808/difference-between-author-and-committer-in-git | ||
echo "about to author this commit as $GIT_AUTHOR_NAME ($GIT_AUTHOR_EMAIL)" | ||
# echo "about to apply the work as $GIT_COMMITTER_NAME ($GIT_COMMITTER_EMAIL)" | ||
|
||
echo "run precommit script in all packages" | ||
npm run precommit --workspaces --if-present |
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 @@ | ||
#!/bin/sh | ||
|
||
# Husky seems to run all hook scripts using sh, regardless of the shebang present | ||
# in the git hook. | ||
# https://github.com/typicode/husky/issues/971 | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
set -eu | ||
|
||
echo "PRE PUSH HOOK [destination remote: $1] [location remote: $2]" | ||
|
||
echo "run commitlint" | ||
npx commitlint --config ./config/commitlint.cjs --to HEAD |
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,10 @@ | ||
coverage/* | ||
node_modules/* | ||
*dist/* | ||
*lib/* | ||
*.d.ts | ||
*.min.js | ||
*.d.ts.map | ||
*.js.map | ||
*package-lock.json | ||
*tsbuildinfo |
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,8 @@ | ||
{ | ||
"recommendations": [ | ||
"eg2.vscode-npm-script", | ||
"esbenp.prettier-vscode", | ||
"pflannery.vscode-versionlens" | ||
] | ||
} | ||
|
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,25 @@ | ||
{ | ||
"editor.formatOnSave": false, | ||
"files.associations": { "*.json": "jsonc" }, | ||
"files.exclude": { | ||
"**/node_modules/": true | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"[json]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
"[markdown]": { | ||
"editor.suggestOnTriggerCharacters": false | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.formatOnSave": true | ||
}, | ||
// https://github.com/prettier/prettier-vscode#prettierconfigpath | ||
"prettier.configPath": "config/prettier.cjs", | ||
"prettier.requireConfig": true | ||
} |
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,7 @@ | ||
# undici | ||
|
||
Build all libraries and the demo 11ty site in watch mode: | ||
|
||
```sh | ||
npm run dev | ||
``` |
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 @@ | ||
# config | ||
|
||
Config files for building, testing, linting, formatting all packages in this monorepo. | ||
|
||
- `commitlint.cjs`: configuration for [commitlint](https://github.com/conventional-changelog/commitlint), to enforce [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). | ||
- `eslint.cjs`: configuration for [ESLint](https://eslint.org/). | ||
- `jest.cjs`: configuration for all `*.test.mjs` files. Use it with Jest [experimental support for ECMAScript Modules (ESM)](https://jestjs.io/docs/ecmascript-modules). | ||
- `lint-staged.cjs`: configuration for [lint-staged](https://github.com/okonet/lint-staged). | ||
- `prettier.cjs`: configuration for the [Prettier](https://prettier.io/) (code formatter). | ||
- `semantic-release.cjs`: common configuration for [semantic release](https://github.com/semantic-release/semantic-release) and [multi-semantic-release](https://github.com/qiwi/multi-semantic-release). | ||
- `tsconfig.base.json`: common configuration for tsc. All other tsc configuration files **extend** this file. | ||
- `tsconfig.base.json`: common configuration for tsc. All other tsc configuration files **extend** this file. | ||
- `tsconfig.nodejs-lib.json`: tsc configuration for Node.js **libraries**. | ||
- `tsconfig.nodejs-app.json`: tsc configuration for Node.js **applications**. |
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,29 @@ | ||
const config = { | ||
// https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional | ||
extends: ['@commitlint/config-conventional'], | ||
ignores: [ | ||
(message) => { | ||
return message.includes('initial commit') | ||
} | ||
], | ||
// https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md | ||
rules: { | ||
// I configured semantic-release git plugin to create a release commit | ||
// message containing release notes in the commit body. This would exceed | ||
// the limit set by the config-conventional preset. So I override the rule. | ||
// Level is [0..2]: 0 => disables the rule. 1 => warning. 2 => error | ||
'body-max-line-length': [2, 'always', Infinity] | ||
} | ||
} | ||
|
||
// see here for examples of conventional commit messages that trigger a | ||
// patch/minor/major release with semantic-release. | ||
// https://www.conventionalcommits.org/en/v1.0.0/#summary | ||
// | ||
// <type>[optional scope]: <description> | ||
// | ||
// [optional body] | ||
// | ||
// [optional footer(s)] | ||
|
||
module.exports = config |
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,22 @@ | ||
const prettier_config = require('./prettier.cjs') | ||
|
||
const config = { | ||
extends: [ | ||
// https://eslint.org/docs/rules/ | ||
'eslint:recommended', | ||
// https://typescript-eslint.io/docs/linting/ | ||
'plugin:@typescript-eslint/recommended', | ||
// plugin:prettier/recommended must be the last extension | ||
// https://github.com/prettier/eslint-plugin-prettier#recommended-configuration | ||
'plugin:prettier/recommended' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
rules: { | ||
'prettier/prettier': ['error', prettier_config] | ||
} | ||
} | ||
|
||
// console.log('=== ESLint config ===', config) | ||
|
||
module.exports = config |
Oops, something went wrong.