Skip to content

Commit

Permalink
chore(dependencies): [RO-26514] Cleaned-up dependencies (#85)
Browse files Browse the repository at this point in the history
* chore(dependencies): [RO-26514] Removed colors dependency, lodash dependencies, and updated express dependency

* chore(dependencies): [RO-26514] Removed eslint-plugin-node dependency
  • Loading branch information
otrreeves authored Apr 8, 2024
1 parent 939d3fc commit 66fca97
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 268 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"node": true,
"es2021": true
},
"plugins": ["node"],
"parserOptions": {
"ecmaVersion": "latest"
},
Expand Down
47 changes: 22 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

Common node modules and express middleware that are designed to be the boilerplate of a node web app.

[![NPM Version][npm-version-image]][npm-url]
[![NPM Install Size][npm-install-size-image]][npm-install-size-url]
[![NPM Downloads][npm-downloads-image]][npm-downloads-url]
[![NPM Version][npm-version-image]][npm-url]
[![NPM Install Size][npm-install-size-image]][npm-install-size-url]
[![NPM Downloads][npm-downloads-image]][npm-downloads-url]

# About the Spur Framework

Expand All @@ -15,7 +15,7 @@ The Spur Framework is a collection of commonly used Node.JS libraries used to cr
# Topics

- [Quick start](#quick-start)
- [Usage](#usage)
- [Usage](#usage)
- [Available dependencies in injector](#available-dependencies-in-injector)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -57,7 +57,6 @@ module.exports = function () {
// Register configuration
registerConfig(ioc, path.join(__dirname, './config'));


ioc.merge(spurCommon());
ioc.merge(spurWeb());

Expand Down Expand Up @@ -110,7 +109,6 @@ module.exports = function (BaseController) {
getHello(req, res) {
res.send('hello');
}

}

return new HelloController();
Expand All @@ -131,9 +129,9 @@ injector().inject(function (UncaughtHandler, WebServer, Logger, config, configLo
Logger.info(`CONFIG: ${configLoader.configName}`);

WebServer.start()
.then(() => {
// Execute other logic after the server has started
});
.then(() => {
// Execute other logic after the server has started
});
});
```

Expand All @@ -160,49 +158,48 @@ List of external dependencies used and exposed by spur-web. They can be found at
| **bodyParser** | [body-parser](https://www.npmjs.org/package/body-parser) |
| **expressWinston** | [express-winston](https://www.npmjs.org/package/express-winston) |

### Local dependecies
### Local dependencies

All of the files under the `src/` directory are made available when this module is merged into another injector. The following list are the notable dependencies available.

#### Reusable

| Name | Source | Description |
| :---- | :---- | :---- |
| Name | Source | Description |
| :---- | :---- | :---- |
| **BaseController** | [code](src/webserver/BaseController.js) | A base class in order to be able to identify all of the controllers derived from it. |
| **BaseWebServer** | [code](src/webserver/BaseWebServer.js) | A base web server that sets all of the middleware mentioned here. |
| **ControllerRegistration** | [code](src/webserver/ControllerRegistration.js) | Registers all of the controllers based on the BaseController type and also files that end with `Controller` |
| **BaseMiddleware** | [code](src/middleware/BaseMiddleware.js) | A base class in order to be able to identify all of the middleware derived from it. |

#### Used internally, but can be used/replaced

| Name | Source | Description |
| :---- | :---- | :---- |
| **HtmlErrorRender** | [code](src/handlers/HtmlErrorRender.js) | Sets basic error rendering for uncaught errors. |
| **DefaultMiddleware** | [code](src/middleware/DefaultMiddleware.js) | Registers default express middleware: cookie parser, body parser, method override, and express device |
| **ErrorMiddleware** | [code](src/middleware/ErrorMiddleware.js) | Adds error handling for unhandled errors for requests. |
| **NoCacheMiddleware** | [code](src/middleware/NoCacheMiddleware.js) | Middleware for no cache headers |
| Name | Source | Description |
| :---- | :---- | :---- |
| **HtmlErrorRender** | [code](src/handlers/HtmlErrorRender.js) | Sets basic error rendering for uncaught errors. |
| **DefaultMiddleware** | [code](src/middleware/DefaultMiddleware.js) | Registers default express middleware: cookie parser, and body parser |
| **ErrorMiddleware** | [code](src/middleware/ErrorMiddleware.js) | Adds error handling for unhandled errors for requests. |
| **NoCacheMiddleware** | [code](src/middleware/NoCacheMiddleware.js) | Middleware for no cache headers |
| **PromiseMiddleware** | [code](src/middleware/PromiseMiddleware.js) | Extends the response object with functionality to be used through promises. It unwraps promises as they are being resolved. |
| **WinstonRequestLoggingMiddleware** | [code](src/middleware/WinstonRequestLoggingMiddleware.js) | Winston middleware for logging every request to the console log. |

| **WinstonRequestLoggingMiddleware** | [code](src/middleware/WinstonRequestLoggingMiddleware.js) | Winston middleware for logging every request to the console log. |

# Contributing

## We accept pull requests

Please send in pull requests and they will be reviewed in a timely manner. Please review this [generic guide to submitting a good pull requests](https://github.com/blog/1943-how-to-write-the-perfect-pull-request). The only things we ask in addition are the following:

* Please submit small pull requests
* Provide a good description of the changes
* Code changes must include tests
* Be nice to each other in comments. :innocent:
- Please submit small pull requests
- Provide a good description of the changes
- Code changes must include tests
- Be nice to each other in comments. :innocent:

## Style guide

The majority of the settings are controlled using an [EditorConfig](.editorconfig) configuration file. To use it [please download a plugin](http://editorconfig.org/#download) for your editor of choice.

## All tests should pass

To run the test suite, first install the dependancies, then run `npm test`
To run the test suite, first install the dependencies, then run `npm test`

```shell
$ npm install
Expand Down
Loading

0 comments on commit 66fca97

Please sign in to comment.