Skip to content
This repository has been archived by the owner on Apr 12, 2020. It is now read-only.

Commit

Permalink
Reworked package
Browse files Browse the repository at this point in the history
* Split up categories to seperate files
* All exports are now sorted to be alphabetical (excluding `constants`)
* Added some unit tests and CI pipeline
  • Loading branch information
South-Paw committed Apr 28, 2018
1 parent 9a48bfb commit 98a4c2d
Show file tree
Hide file tree
Showing 31 changed files with 9,303 additions and 3,929 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ module.exports = {
'max-len': ['error', 120],
'object-curly-newline': 'off',
},
overrides: {
files: ['**/__tests__/*.js'],
env: {
jest: true
},
},
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
coverage
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: node_js
node_js:
- "8"
script:
- npm run lint
- npm run test/coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
[![warframe-item-list on npm](https://nodei.co/npm/warframe-item-list.png)](https://www.npmjs.com/package/warframe-item-list)

[![warframe update](https://img.shields.io/badge/warframe_update-22.18.7-blue.svg)](http://warframe.wikia.com/wiki/Update_22#Hotfix_22.18.7)
[![CI Status](https://img.shields.io/travis/South-Paw/warframe-item-list.svg)](https://travis-ci.org/South-Paw/warframe-item-list)
[![Coveralls Status](https://img.shields.io/coveralls/github/South-Paw/warframe-item-list.svg)](https://coveralls.io/github/South-Paw/warframe-item-list)
[![Dependencies](https://david-dm.org/South-Paw/warframe-item-list/status.svg)](https://david-dm.org/South-Paw/warframe-item-list)
[![Dev Dependencies](https://david-dm.org/South-Paw/warframe-item-list/dev-status.svg)](https://david-dm.org/South-Paw/warframe-item-list?type=dev)

Expand All @@ -20,16 +22,21 @@ If you come across any missing items, problems or mistakes - please let me know

## Install

`yarn add warframe-item-list`

or

`npm i warframe-item-list`

## Usage

```js
const { array, objects, constants } = require('warframe-item-list');
const { version, array, objects, constants } = require('warframe-item-list');

console.log(version); // returns the warframe game version of the item list.
console.log(array); // returns a big list of every item.
console.log(objects); // returns an object containing named lists and objects for more specific uses.
console.log(constants); // returns the same lists used to define the `acquisition`, `category` and `type` keys.
console.log(constants); // returns the constant keys used to define keys in the `array` and `objects`.
```

## Objects
Expand All @@ -45,9 +52,9 @@ If you `console.log` the root object, you'll get the following:
ARCHWINGS: [...],
ARCHWING_GUNS: [...],
ARCHWING_MELEES: [...],
COMPANION_SENTINELS: [...],
COMPANION_KUBROWS: [...],
COMPANION_KAVATS: [...],
COMPANION_KUBROWS: [...],
COMPANION_SENTINELS: [...],
SENTINEL_WEAPONS: [...],
WARFRAMES: [...],
WEAPON_PRIMARIES: [...],
Expand All @@ -56,14 +63,12 @@ If you `console.log` the root object, you'll get the following:
ZAWS: [...],
},
constants: {
acquisitions: {...},
acquisitionQuests: {...},
acquisitionFactions: {...},
acquisitionEnemies: {...},
primaryCategories: {...},
secondaryCategories: {...},
meleeCategories: {...},
itemTypes: {...},
ACQUISITION: {...},
ITEM_TYPE: {...},
ITEM_TYPES: {...},
MELEE_CATEGORIES: {...},
PRIMARY_CATEGORIES: {...},
SECONDARY_CATEGORIES: {...},
},
};
```
Expand All @@ -72,24 +77,24 @@ Within each list, the objects are pretty similarly structured:

```js
{
name: 'string', // name of the item (required).
acquisition: 'string', // where to acquire the item (required).
category: 'string', // category of weapon - this is only used for primary/secondary/melee weapons.
masteryRank: 0, // the mastery rank required to craft (required).
type: 'string', // if the using the array export, items will have a type attached as well.
name: 'string', // name of the item.
acquisition: 'string', // where to acquire the item.
category: 'string', // category of weapon - this is only used in primary/secondary/melee and sentinel weapons.
masteryRank: 0, // the mastery rank required for the item.
type: 'string', // the type the item belongs to.
},
```

And the `constants` provided are the same that are used to define the `acquisition`, `type` and `group` in the item objects.
And the `constants` contains those that are provided to define the `acquisition`, `category` and `type` in the item objects.

## Contributing

Again, if you come across any missing items, problems or mistakes - please let me know by [creating an issue](https://github.com/South-Paw/warframe-item-list/issues/new) or feel free to have a shot at [fixing it yourself](https://github.com/South-Paw/warframe-item-list/pulls) with a pull-request.

Please ensure that any PRs are linted and keep with the general flow of things.
Please ensure that any PRs are linted + tested and keep with the general flow of things.

* Items should be grouped by `category` (categories follow the wiki order)
* Items are alphabetically sorted by `name` within each `category`
* Items should be grouped in files by `category` (categories follow the wiki order)
* Ideally; items are alphabetically sorted by `name` within each `category` file

## License

Expand Down
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testMatch: ['**/__tests__/**/*.js'],
};

0 comments on commit 98a4c2d

Please sign in to comment.