Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
songkeys committed Jun 15, 2022
0 parents commit 2274ca9
Show file tree
Hide file tree
Showing 13 changed files with 3,202 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
os: [ubuntu-latest]
node-version: [14.x, 16.x, 18.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: npm i
- name: Build and Test
run: npm run test

publish:
name: npm-publish
runs-on: ubuntu-latest
needs: ['test']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
- name: Create Release
if: steps.publish.outputs.type != 'none'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ steps.publish.outputs.version }}
release_name: v${{ steps.publish.outputs.version }}
body: v${{ steps.publish.outputs.version }}
draft: false
prerelease: false
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 16.x

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GH_TOKEN}}
104 changes: 104 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"semi": false,
"trailingComma": "all",
"endOfLine": "lf"
}
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) 2022 Songkeys

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.
111 changes: 111 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<div id="top"></div>

<!-- PROJECT SHIELDS -->

[![NPM Version][npm-version]][npm-url]
[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
[![Stargazers][stars-shield]][stars-url]
[![Issues][issues-shield]][issues-url]
[![MIT License][license-shield]][license-url]

[npm-version]: https://img.shields.io/npm/v/node-lib-template.svg?style=for-the-badge
[npm-url]: https://www.npmjs.com/package/node-lib-template
[contributors-shield]: https://img.shields.io/github/contributors/Songkeys/node-lib-template.svg?style=for-the-badge
[contributors-url]: https://github.com/Songkeys/node-lib-template/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Songkeys/node-lib-template.svg?style=for-the-badge
[forks-url]: https://github.com/Songkeys/node-lib-template/network/members
[stars-shield]: https://img.shields.io/github/stars/Songkeys/node-lib-template.svg?style=for-the-badge
[stars-url]: https://github.com/Songkeys/node-lib-template/stargazers
[issues-shield]: https://img.shields.io/github/issues/Songkeys/node-lib-template.svg?style=for-the-badge
[issues-url]: https://github.com/Songkeys/node-lib-template/issues
[license-shield]: https://img.shields.io/github/license/Songkeys/node-lib-template.svg?style=for-the-badge
[license-url]: https://github.com/Songkeys/node-lib-template/blob/master/LICENSE.txt

<!-- PROJECT LOGO -->

<br />
<div align="center">
<a href="https://github.com/Songkeys/node-lib-template">
<img src="images/logo.svg" alt="Logo" width="80" height="80">
</a>

<h2 align="center">Node.js-Library-Template</h2>

<p align="center">
A Node.js TypeScript library starter template to jumpstart your projects!
<br />
<a href="https://github.com/Songkeys/node-lib-template"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/Songkeys/node-lib-template">View Demo</a>
·
<a href="https://github.com/Songkeys/node-lib-template/issues">Report Bug</a>
·
<a href="https://github.com/Songkeys/node-lib-template/issues">Request Feature</a>
</p>
</div>

## About The Project

A Node.js TypeScript library starter template to jumpstart your projects!

<p align="right">(<a href="#top">back to top</a>)</p>

## Getting Started

1. Use this template to create your own library.
2. Replace all `node-lib-template` in the code with your project's name.
3. Replace all `Songkeys` in the code with your GitHub username.

Features and acknowledgements:

1. Pure TypeScript.
2. Bundling with [`tsup`](https://github.com/egoist/tsup).
3. Testing with [`vitest`](https://vitest.dev/)
4. Releasing with GitHub Action [`npm-publish`](https://github.com/JS-DevTools/npm-publish).
5. Automatically creating GitHub tags, releases and changelogs with [`changelogithub`](https://github.com/antfu/changelogithub).

> To use GitHub Actions to publish and release library, you need `GH_TOKEN` and `NPM_TOKEN` environment variables configured in your repository.
<p align="right">(<a href="#top">back to top</a>)</p>

## Usage

Use this space to show useful examples of how a project can be used. Additional screenshots, code examples and demos work well in this space. You may also link to more resources.

_For more examples, please refer to the [Documentation](https://example.com)_

<p align="right">(<a href="#top">back to top</a>)</p>

## Roadmap

- [ ] Add Changelog
- [ ] Multi-language Support
- [ ] Chinese
- [ ] Spanish

See the [open issues](https://github.com/Songkeys/node-lib-template/issues) for a full list of proposed features (and known issues).

<p align="right">(<a href="#top">back to top</a>)</p>

## Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

<p align="right">(<a href="#top">back to top</a>)</p>

## License

Distributed under the MIT License. See `LICENSE.txt` for more information.

<p align="right">(<a href="#top">back to top</a>)</p>
1 change: 1 addition & 0 deletions images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2274ca9

Please sign in to comment.