Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
root: true, // Tells eslint this is the root configuration and not to search any further up the filesystem
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
plugins: [
// Load the following plugin packages
'@typescript-eslint', // Plugin for working with Typescript
'import',
'mocha',
],
extends: [
// Extend the following configurations
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'airbnb-typescript/base',
'plugin:mocha/recommended',
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
'mocha/no-mocha-arrows': 'off',
},
};
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install Dependencies
run: npm ci

- name: Check formatting and linting
run: npm run lint

- name: Run Tests
run: npm run test

- name: Run Coverage
run: npm run coverage
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
cache: 'npm'
- name: Install Dependencies
run: npm ci

- name: Check formatting and linting
run: npm run lint

- name: Run Tests
run: npm run test

- name: Run Coverage
run: npm run coverage

- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Compiled Typescript
dist/

# Dependency directories
node_modules/

# Output of 'npm pack'
*.tgz

# Istanbul coverage output
.nyc_output

# OS specific files
.DS_Store
10 changes: 10 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
color: true,
extension: ['.test.ts'],
ignore: ['node_modules'],
recursive: true,
require: ['ts-node/register', 'source-map-support/register'],
testEnvironment: 'node',
ui: 'bdd',
'watch-files': ['src', 'test'],
};
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
tabWidth: 2,
semi: true,
singleQuote: true,
trailingComma: 'all'
}
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Workflow

- Fork and clone the project
- Install dependencies

```sh
npm install
```

- Run the lint and format checks

```sh
npm run lint
```

- Fix lint / format checks that can be repaired automatically

```sh
npm run lint-fix
```

- Make sure to add tests for your changes. Watch the tests

```sh
npm run test-watch
```

- When you're ready with your new changes, update the version in the
package.json file based on [SemVer standards][semver].


[semver]: https://semver.org/
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 Nicholas Cronquist

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.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# S3 Helper
# Node Library Module Template

This is a template project for creating other Node.js library modules and
publishing them to NPM.


## Installation

```sh
npm install --save-prod --save-exact node-library-module-template
```


## Contributing

See the [CONTRIBUTING](./CONTRIBUTING.md) guide to see the workflow for making
changes.
11 changes: 11 additions & 0 deletions nyc.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: '@istanbuljs/nyc-config-typescript',
all: true,
exclude: [
'.eslintrc.js',
'.mocharc.js',
'.prettierrc.js',
'nyc.config.js',
'test/**',
]
}
Loading