Skip to content

Commit

Permalink
first commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsho committed Jun 10, 2023
0 parents commit 03d0e88
Show file tree
Hide file tree
Showing 18 changed files with 6,736 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
coverage/
dist/
webpack.config.js
18 changes: 18 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint"
],
rules: {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off"
},
};
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
21 changes: 21 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'

categories:
- title: '🚀 Features'
label: 'features'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '📝 Document'
label: 'documentation'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
template: |
## ✨Changes
$CHANGES
79 changes: 79 additions & 0 deletions .github/workflows/run-build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: build and publish

# Triggers when pushed to master branch
on:
push:
branches:
- main
tags:
- '!*'

jobs:
test:
name: check and test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- run: npm i
- run: npm run lint
- run: npm test
- name: Publish to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
coveralls-token: ${{ secrets.COVERALLS_REPO_TOKEN }}

release:
needs: test
name: release-npm-package
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'

# Get npm version of ninsho
- name: get-npm-version
id: npm-version
run: echo "npm_version=$(npm show ninsho-module-mailer version)" >> $GITHUB_ENV

# Get version from package.json
- name: get-package-version
id: package-version
run: echo "package_version=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

# Create tag with current package version
- name: current-package-version-to-git-tag
uses: pkgdeps/git-tag-action@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.sha }}
git_tag_prefix: ''
version: ${{ env.package_version }}

# Create release draft
- name: release-draft
uses: release-drafter/release-drafter@v5
with:
name: ${{ env.package_version }}
version: ${{ env.package_version }}
tag: ${{ env.package_version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Compare versions and publish if necessary
- name: compare-versions-and-publish
run: |
if [ "${{ env.npm_version }}" != "${{ env.package_version }}" ]; then
npm ci
npm run build
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
coverage
.env
.DS_Store
logs
dist
3 changes: 3 additions & 0 deletions .node-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"notify": false
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 ninsho

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ninsho-module-mailer

[![build and publish](https://github.com/ninsho/ninsho-module-mailer/actions/workflows/run-build-and-publish.yml/badge.svg)](https://github.com/ninsho/ninsho-module-mailer/actions/workflows/run-build-and-publish.yml)
[![Coverage Status](https://coveralls.io/repos/github/ninsho/ninsho-module-mailer/badge.svg?branch=main)](https://coveralls.io/github/ninsho/ninsho-module-mailer?branch=main)

A module for sending emails used on [ninsho](https://www.npmjs.com/package/ninsho).

## Development Warning

This project is in development. Features may change without notice.

<!-- README.md -->
14 changes: 14 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"roots": ["<rootDir>/src"],
"testMatch": [
"**/src/**/__tests__/**/?(*.)+(spec).+(ts)"
],
"transform": {
"^.+\\.(ts)$": "ts-jest"
},
"coveragePathIgnorePatterns": [
"node_modules"
],
"collectCoverage": true,
"coverageReporters": ["lcov"]
}

0 comments on commit 03d0e88

Please sign in to comment.