Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core module should reference/import the other scope packages #43

Merged
merged 2 commits into from
Aug 30, 2020
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> Reliable algotrading utilities written in node

![CI Tests](https://github.com/nielse63/stonksjs/workflows/CI%20Tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/nielse63/stonksjs/badge.svg?branch=master)](https://coveralls.io/github/nielse63/stonksjs?branch=master)
![Coveralls github](https://img.shields.io/coveralls/github/nielse63/stonksjs?style=flat-square)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nielse63/stonksjs?style=flat-square)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
> Reliable algotrading utilities written in node

![CI Tests](https://github.com/nielse63/stonksjs/workflows/CI%20Tests/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/nielse63/stonksjs/badge.svg?branch=master)](https://coveralls.io/github/nielse63/stonksjs?branch=master)
![Coveralls github](https://img.shields.io/coveralls/github/nielse63/stonksjs?style=flat-square)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/nielse63/stonksjs?style=flat-square)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

Expand Down
21 changes: 9 additions & 12 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ module.exports = {
collectCoverage: false,

// An array of glob patterns indicating a set of files for which coverage information should be collected
collectCoverageFrom: [
// '<rootDir>/lib/**/*.{js,jsx}',
'<rootDir>/packages/**/*.{js,jsx}',
'!**/node_modules/**',
'!**/vendor/**',
'!**/typedef/**',
'!<rootDir>/**/index.js',
],
// collectCoverageFrom: [
// // '<rootDir>/lib/**/*.{js,jsx}',
// '<rootDir>/**/*.{js,jsx}',
// '!**/node_modules/**',
// '!**/vendor/**',
// '!**/typedef/**',
// '!<rootDir>/**/index.js',
// ],

// The directory where Jest should output its coverage files
coverageDirectory: 'coverage',
Expand Down Expand Up @@ -138,10 +138,7 @@ module.exports = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
'<rootDir>/packages/**/__tests__/**/*.[jt]s?(x)',
'<rootDir>/packages/**/?(*.)+(spec|test).[tj]s?(x)',
],
testMatch: ['<rootDir>/**/__tests__/**/*.[jt]s?(x)', '<rootDir>/**/?(*.)+(spec|test).[tj]s?(x)'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
testPathIgnorePatterns: [
Expand Down
43 changes: 32 additions & 11 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,47 @@

> Core library for stonksjs

- [Installation](#installation)
- [API](#api)
- [@stonksjs/core : <code>object</code>](#stonksjscore--object)
- [stonks.finviz](#stonksfinviz)
- [stonks.quote](#stonksquote)
- [stonks.stockScreener](#stonksstockscreener)
- [stonks.robinhoodCollections](#stonksrobinhoodcollections)

`@stonksjs/core` references all public packages from stonksjs. This is a convenient way to import
all functionality from stonksjs without having to install each scoped module individually.

## Installation

```bash
npm install --save @stonksjs/core
```

## Usage
## API

```js
const StonksCollection = require('@stonksjs/core');
### @stonksjs/core : <code>object</code>

const collection = new StonksCollection('reit');
an object containing all public stonksjs modules

// get list of symbols from the collection
const symbols = await collection.getSymbols();
### stonks.finviz

// get object of with fundamental data for each item in collection
const symbols = await collection.getQuotes();
```
References the [`@stonksjs/finviz`](https://nielse63.github.io/stonksjs/tree/master/packages/finviz)
module

## API
### stonks.quote

References the [`@stonksjs/quote`](https://nielse63.github.io/stonksjs/tree/master/packages/quote)
module

### stonks.stockScreener

References the
[`@stonksjs/stock-screener`](https://nielse63.github.io/stonksjs/tree/master/packages/stock-screener)
module

### stonks.robinhoodCollections

Full API docs can be found in the [`docs/`](./docs/api.md) folder
References the
[`@stonksjs/robinhood-collections`](https://nielse63.github.io/stonksjs/tree/master/packages/robinhood-collections)
module
11 changes: 11 additions & 0 deletions packages/core/__tests__/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const core = require('..');

describe('@stonksjs/core', () => {
it('should be an object', () => {
expect(core).toBeObject();
});

it('should include all packages', () => {
expect(core).toContainKeys(['finviz', 'quote', 'stockScreener', 'robinhoodCollections']);
});
});
75 changes: 0 additions & 75 deletions packages/core/docs/api.md

This file was deleted.

12 changes: 11 additions & 1 deletion packages/core/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
module.exports = require('./lib/StonksCollection');
const finviz = require('@stonksjs/finviz');
const quote = require('@stonksjs/quote');
const stockScreener = require('@stonksjs/stock-screener');
const robinhoodCollections = require('@stonksjs/robinhood-collections');

module.exports = {
finviz,
quote,
stockScreener,
robinhoodCollections,
};
84 changes: 0 additions & 84 deletions packages/core/lib/StonksCollection.js

This file was deleted.

78 changes: 0 additions & 78 deletions packages/core/lib/StonksRequest.js

This file was deleted.

Loading