Skip to content

Commit

Permalink
Replace formatter, bump version, add coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
craigdallimore committed Apr 11, 2022
1 parent bbf9ba9 commit 82726dc
Show file tree
Hide file tree
Showing 10 changed files with 2,100 additions and 166 deletions.
23 changes: 0 additions & 23 deletions .eslintrc.js

This file was deleted.

22 changes: 22 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: main
on:
- push
jobs:
main:
name: ${{matrix.node}}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: borales/actions-yarn@v2.3.0
with:
cmd: install # yarn install
- uses: borales/actions-yarn@v2.3.0
with:
cmd: test # yarn test
- uses: codecov/codecov-action@v2
strategy:
matrix:
node:
- lts/erbium
- node

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
dist
coverage
Empty file removed .npmignore
Empty file.
1 change: 0 additions & 1 deletion .prettierrc.json

This file was deleted.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Vector 2D

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

## Installation

```
npm install @decoy9697/vector
```
Expand All @@ -25,8 +29,28 @@ It exposes the following functions for working with these vectors:
| subtract | `(Vector, Vector) => Vector` |
| vectorToRadians | `(Vector) => number` |

## Development

This project uses [nix](https://nixos.org/) to install dependencies for the development shell.

### Commands

`nix-shell` - starts a development shell with system dependencies

#### Within the shell

`yarn` - install project dependencies

`yarn test` - run the tests

`yarn format` - run the linter

<!-- Definitions -->

[build-badge]: https://github.com/craigdallimore/vector/workflows/main/badge.svg
[build]: https://github.com/craigdallimore/vector/actions
[coverage-badge]: https://img.shields.io/codecov/c/github/craigdallimore/vector.svg
[coverage]: https://codecov.io/github/craigdallimore/vector
[downloads-badge]: https://img.shields.io/npm/dm/@decoy9697/vector.svg
[downloads]: https://www.npmjs.com/package/@decoy9697/vector
[size-badge]: https://img.shields.io/bundlephobia/minzip/@decoy9697/vector.svg
Expand Down
7 changes: 3 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
/* eslint @typescript-eslint/no-var-requires: "off" */

module.exports = {
rootDir: "src",
preset: "ts-jest",
testEnvironment: "jest-environment-jsdom",
rootDir: 'src',
preset: 'ts-jest',
testEnvironment: 'jest-environment-jsdom',
};
30 changes: 22 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@decoy9697/vector",
"version": "1.0.1",
"version": "1.0.2",
"description": "A 2d vector library",
"repository": "https://github.com/craigdallimore/vector",
"bugs": {
Expand All @@ -19,16 +19,30 @@
"types": "dist/index.d.ts",
"license": "MIT",
"scripts": {
"prepublish": "tsc",
"test": "jest"
"format": "xo --fix",
"prepublishOnly": "yarn test && tsc",
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov jest src",
"test": "yarn run format && jest && yarn run test-coverage"
},
"xo": {
"prettier": true,
"rules": {
"import/extensions": "off",
"unicorn/prefer-module": "off"
}
},
"prettier": {
"tabWidth": 2,
"useTabs": false
},
"devDependencies": {
"@types/jest": "^27.4.1",
"c8": "^7.11.0",
"fast-check": "^2.24.0",
"jest": "^27.5.1"
},
"dependencies": {
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typescript": "^4.6.3"
}
"typescript": "^4.6.3",
"xo": "^0.48.0"
},
"dependencies": {}
}
Loading

0 comments on commit 82726dc

Please sign in to comment.