Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Commit

Permalink
release: v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Snazzah committed Apr 5, 2021
0 parents commit 85e988c
Show file tree
Hide file tree
Showing 19 changed files with 572 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs
lib
.husky
46 changes: 46 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
globals: {
NodeJS: true
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 6,
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
rules: {
'prettier/prettier': 'warn',
'no-cond-assign': [2, 'except-parens'],
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': 1,
'no-empty': [
'error',
{
allowEmptyCatch: true
}
],
'prefer-const': [
'warn',
{
destructuring: 'all'
}
],
'spaced-comment': 'warn'
},
overrides: [
{
files: ['test/**/*.ts'],
globals: {
describe: true,
it: true,
beforeEach: true
}
}
]
};
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
patreon: Snazzah
ko_fi: Snazzah
github: Snazzah
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ESLint
on:
push:
branches:
- "*"
- "!docs"
paths:
- "src/**"
- ".eslintignore"
- ".eslintrc.*"
- ".prettierrc"
- ".github/workflows/lint.yml"
workflow_dispatch:

jobs:
lint:
name: Lint source code
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node v12
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install dependencies
run: npm install

- name: Run ESLint
run: npm run lint:fix

- name: Commit changes
uses: EndBug/add-and-commit@v4
with:
add: src
message: "chore(lint): auto-lint source code"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release
on:
release:
types: [published]

jobs:
tag:
name: Add/update 'latest' tag
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Run latest-tag
uses: EndBug/latest-tag@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# docs:
# name: Update docs
# runs-on: ubuntu-18.04
# needs: tag
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v2
#
# - name: Setup Node 12.x
# uses: actions/setup-node@v1
# with:
# node-version: 12.x
#
# - name: Install dependencies
# run: npm install
#
# - name: Build documentation
# run: npm run docs
#
# - name: Deploy documentation
# uses: dbots-pkg/action-docs@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm:
name: Publish on NPM
runs-on: ubuntu-latest
# needs: docs

steps:
- uses: actions/checkout@v2

- name: Set up Node.js for NPM
uses: actions/setup-node@v1
with:
registry-url: 'https://registry.npmjs.org'

- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-gpr:
name: Publish on GPR
runs-on: ubuntu-latest
# needs: docs

steps:
- uses: actions/checkout@v2

- name: Set up Node.js for GPR
uses: actions/setup-node@v1
with:
registry-url: 'https://npm.pkg.github.com/'
scope: '@dexare'

- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Packages
node_modules/
yarn.lock
package-lock.json

# Log files
logs/
*.log

# Miscellaneous
.tmp/
.vscode/
docs/docs.json
webpack/
testing/
.husky/_/
lib/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npm run build
33 changes: 33 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Packages
node_modules/
yarn.lock
package-lock.json

# Log files
logs/
*.log

# Authentication
deploy/

# Miscellaneous
.tmp/
.vscode/
.idea/
scripts/
static/
docs/

# NPM ignore
.eslintignore
.eslintrc.js
.gitattributes
.gitignore
.editorconfig
.prettierrc
.github/
.dependabot/
test/
testing/
tsconfig.json
.husky/_/
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"endOfLine": "lf",
"trailingComma": "none",
"printWidth": 110
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [1.0.0] - 2021-04-05
- Initial release.

[Unreleased]: https://github.com/Dexare/dbots/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/Dexare/dbots/releases/tag/v1.0.0
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) 2021 Snazzah

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.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @dexare/dbots
A [Dexare](https://github.com/Dexare/Dexare) module for [dbots](https://dbots.js.org).

```sh
npm install @dexare/dbots
```

```js
const { DexareClient } = require('dexare');
const DBotsModule = require('@dexare/dbots');

const config = {
// All props in this config are optional, defaults are shown unless told otherwise
dbots: {
// The keys to use for the supported services, the default is an empty object
keys: {
discordbotsgg: '',
topgg: '',
lsterminalink: '',
carbon: ''
},
// How often (in milliseconds) the poster should post its stats
interval: 1800000,
// Whether to autopost when the client is ready
autopost: true,
// The custom services to post to: https://dbots.js.org/#/docs/main/latest/examples/custom-service
customServices: []
}
}

const client = new DexareClient(config);
client.loadModules(DBotsModule);
// ...
```
51 changes: 51 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"name": "@dexare/dbots",
"version": "1.0.0",
"description": "A Dexare module for the NPM package dbots",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"author": "Snazzah",
"license": "MIT",
"repository": "https://github.com/Dexare/dbots",
"bugs": {
"url": "https://github.com/Dexare/dbots/issues"
},
"funding": {
"url": "https://github.com/sponsors/Snazzah"
},
"keywords": [
"dexare",
"dexare-module"
],
"scripts": {
"build": "([ ! -d \"lib/\" ] || rm -r lib/*) && npx tsc",
"build:prepare": "[ -d \"lib/\" ] || npm run build",
"changelog": "ts-node scripts/changelog",
"lint": "npx eslint --ext .ts ./src",
"lint:fix": "npx eslint --ext .ts ./src --fix",
"test": "mocha -r ts-node/register --extension ts",
"prepare": "npx husky install && npm run build:prepare",
"prepublishOnly": "([ -d \"lib/\" ] || (echo \"lib folder does not exist\" && exit 1)) && npm run lint:fix"
},
"lint-staged": {
"*.ts": "eslint --fix"
},
"dependencies": {
"dbots": "^8.0.2",
"dexare": "^1.3.0"
},
"devDependencies": {
"@types/node": "^14.14.22",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"eslint": "^7.18.0",
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"ts-node": "^9.1.1",
"typescript": "^4.1.3",
"yarn": "^1.22.10"
}
}
Loading

0 comments on commit 85e988c

Please sign in to comment.