Skip to content

Commit

Permalink
refactor(build): move the common build libs in Whook's core
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Mar 28, 2020
1 parent cac0452 commit f36f9c1
Show file tree
Hide file tree
Showing 28 changed files with 412 additions and 143 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,9 @@ Temporary Items

# Project custom ignored file
dist
builds
.bin
.terraform
*.plan
*.tfstate.d
*.credentials.json
23 changes: 8 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
[![Coverage Status](https://coveralls.io/repos/nfroidure/whook/badge.svg?branch=master)](https://coveralls.io/r/nfroidure/whook?branch=master)

Why write code when you have an OpenAPI definition?
[Check this deck](https://slides.com/nfroidure/introducing-whook)
for a complete introduction to Whook's principles!

# Summary
## Summary

Whook eats your documentation and provide you with a
performant router that take care of running the right
Expand All @@ -28,7 +30,7 @@ By using the OpenAPI standard and the dependency injection
pattern, Whook provides a convenient, highly modular and easily
testable back end framework.

# Quickstart
## Quickstart

To start a new Whook project:

Expand All @@ -44,21 +46,12 @@ DRY_RUN=1 npm run start
npm t
```


**Work in progress:** Despite I use it in production already,
the Whook's API may change.

Using it right now, will imply making changes when the next
major release will happen. If you would like to get involved
in its early development, feel free to add issues / comments
or to improve the code.

# Usage
## Usage

The documentation and a tutorial are still to be written but
the code is easy to read so let's dive in in the meanwhile.

# Principles
## Principles
This projects aims to make creating well documented and highly
customizable REST APIs a breeze. It is the final outcome of my experience
[building REST APIs with NodeJS](https://insertafter.com/en/blog/http_rest_apis_with_nodejs.html).
Expand Down Expand Up @@ -100,7 +93,7 @@ And that's it, you have your REST API. We have
You may add global wrappers to change every handlers input/output on the
fly or add a local wrapper specifically to one of a few handlers.

# Contributing
## Contributing

Clone this project's repository and run:

Expand All @@ -115,7 +108,7 @@ The repository is based on LernaJS that allows to host several NPM
Install those [VSCode extensions](https://insertafter.com/en/blog/my_vscode_configuration.html)
to get a smooth developer experience.

# Publishing
## Publishing

```sh
NODE_ENV=cli npm run lerna -- publish
Expand Down
93 changes: 52 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
],
"data": {
"ignore": [
"dist"
"dist",
"builds",
".bin",
".terraform",
"*.plan",
"*.tfstate.d",
"*.credentials.json"
],
"rootPackage": true
}
Expand Down
6 changes: 4 additions & 2 deletions packages/whook-aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@whook/http-router": "^3.1.3",
"@whook/whook": "^3.1.3",
"ajv": "^6.11.0",
"bytes": "^3.1.0",
"camel-case": "^4.1.1",
"common-services": "^7.0.0",
"cpr": "3.0.1",
Expand All @@ -60,8 +61,9 @@
"memory-fs": "0.5.0",
"openapi-types": "^1.3.5",
"qs": "^6.9.1",
"strict-qs": "^6.0.1",
"yerror": "^5.0.0"
"strict-qs": "^6.0.2",
"yerror": "^5.0.0",
"yhttperror": "^5.0.0"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
Expand Down
3 changes: 0 additions & 3 deletions packages/whook-aws-lambda/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import initCompiler, {
DEFAULT_COMPILER_OPTIONS,
} from './services/compiler';
import initBuildAutoloader from './services/_autoload';
import initBuildConstants from './services/BUILD_CONSTANTS';
import Knifecycle, { SPECIAL_PROPS, constant, Autoloader } from 'knifecycle';
import { WhookAPIOperationAddition } from '@whook/whook';
import {
Expand Down Expand Up @@ -93,8 +92,6 @@ const BUILD_DEFINITIONS: {
},
};

export { initBuildConstants };

export async function prepareBuildEnvironment(
$: Knifecycle = new Knifecycle(),
): Promise<Knifecycle> {
Expand Down
Loading

0 comments on commit f36f9c1

Please sign in to comment.