Skip to content

Commit

Permalink
feat(@whook/example): add AWS build to @whook/example
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Mar 12, 2020
1 parent 42e1d24 commit 9015a76
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 14 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

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

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions packages/whook-example/bin/build.js
@@ -0,0 +1,5 @@
#! /usr/bin/env node

const { runBuild } = require('../dist/index');

runBuild();
10 changes: 8 additions & 2 deletions packages/whook-example/package.json
Expand Up @@ -29,7 +29,8 @@
"childPackage": true,
"files": "'src/**/*.ts'",
"ignore": [
"dist"
"dist",
"builds"
],
"bundleFiles": [
"bin",
Expand All @@ -50,6 +51,7 @@
"precz": "npm run compile",
"prettier": "prettier --write 'src/**/*.ts'",
"preversion": "npm run compile",
"build": "NODE_ENV=${NODE_ENV:-development} node bin/build",
"start": "NODE_ENV=${NODE_ENV:-development} node bin/start",
"test": "npm run jest",
"types": "rimraf -f 'dist/**/*.d.ts' && tsc --project . --declaration --emitDeclarationOnly --outDir dist",
Expand All @@ -72,9 +74,11 @@
"homepage": "https://github.com/nfroidure/whook",
"dependencies": {
"@whook/authorization": "^3.1.3",
"@whook/aws-lambda": "^3.1.3",
"@whook/cli": "^3.1.3",
"@whook/cors": "^3.1.3",
"@whook/http-router": "^3.1.3",
"@whook/http-transaction": "^3.1.3",
"@whook/swagger-ui": "^3.1.3",
"@whook/whook": "^3.1.3",
"common-services": "^6.2.0",
Expand All @@ -94,11 +98,13 @@
"@babel/preset-typescript": "^7.8.3",
"@babel/register": "^7.8.3",
"@types/jest": "^24.9.0",
"babel-loader": "^8.0.6",
"babel-plugin-knifecycle": "^1.1.1",
"webpack": "4.41.5",
"@typescript-eslint/eslint-plugin": "^2.16.0",
"@typescript-eslint/parser": "^2.16.0",
"axios": "^0.19.0",
"babel-eslint": "^10.0.3",
"babel-plugin-knifecycle": "^1.1.1",
"eslint": "^6.8.0",
"eslint-plugin-prettier": "^3.1.2",
"jest": "^24.9.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/whook-example/src/__snapshots__/cli.test.ts.snap
Expand Up @@ -38,6 +38,12 @@ Object {
# Provided by \\"@whook/whook\\": none
# Provided by \\"@whook/aws-lambda\\": 3 commands
- testConsumerLambda: A command for testing AWS consumer lambda
- testCronLambda: A command for testing AWS cron lambda
- testHTTPLambda: A command for testing AWS HTTP lambda
",
}
`;
84 changes: 84 additions & 0 deletions packages/whook-example/src/__snapshots__/index.test.ts.snap
Expand Up @@ -152,6 +152,9 @@ Object {
Array [
"❤️ - Initializing the APM service.",
],
Array [
"➰ - Plugin \\"@whook/aws-lambda\\" resolved to: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist",
],
Array [
"➰ - Plugin \\"@whook/cli\\" resolved to: /home/whoiam/projects/whook/packages/whook-cli/dist",
],
Expand Down Expand Up @@ -291,6 +294,9 @@ Object {
Array [
"🚫 - Service \\"BUFFER_LIMIT\\" not found in: /home/whoiam/projects/whook/dist/services/BUFFER_LIMIT",
],
Array [
"🚫 - Service \\"BUFFER_LIMIT\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/BUFFER_LIMIT",
],
Array [
"🚫 - Service \\"BUFFER_LIMIT\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/BUFFER_LIMIT",
],
Expand All @@ -300,6 +306,9 @@ Object {
Array [
"🚫 - Service \\"DECODERS\\" not found in: /home/whoiam/projects/whook/dist/services/DECODERS",
],
Array [
"🚫 - Service \\"DECODERS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/DECODERS",
],
Array [
"🚫 - Service \\"DECODERS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/DECODERS",
],
Expand All @@ -309,6 +318,9 @@ Object {
Array [
"🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in: /home/whoiam/projects/whook/dist/services/DEFAULT_ERROR_CODE",
],
Array [
"🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/DEFAULT_ERROR_CODE",
],
Array [
"🚫 - Service \\"DEFAULT_ERROR_CODE\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/DEFAULT_ERROR_CODE",
],
Expand All @@ -318,6 +330,9 @@ Object {
Array [
"🚫 - Service \\"DEFAULT_MECHANISM\\" not found in: /home/whoiam/projects/whook/dist/services/DEFAULT_MECHANISM",
],
Array [
"🚫 - Service \\"DEFAULT_MECHANISM\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/DEFAULT_MECHANISM",
],
Array [
"🚫 - Service \\"DEFAULT_MECHANISM\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/DEFAULT_MECHANISM",
],
Expand All @@ -327,6 +342,9 @@ Object {
Array [
"🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in: /home/whoiam/projects/whook/dist/services/DEV_ACCESS_TOKEN",
],
Array [
"🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/DEV_ACCESS_TOKEN",
],
Array [
"🚫 - Service \\"DEV_ACCESS_TOKEN\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/DEV_ACCESS_TOKEN",
],
Expand All @@ -336,6 +354,9 @@ Object {
Array [
"🚫 - Service \\"ENCODERS\\" not found in: /home/whoiam/projects/whook/dist/services/ENCODERS",
],
Array [
"🚫 - Service \\"ENCODERS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/ENCODERS",
],
Array [
"🚫 - Service \\"ENCODERS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/ENCODERS",
],
Expand All @@ -345,6 +366,9 @@ Object {
Array [
"🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in: /home/whoiam/projects/whook/dist/services/IGNORED_FILES_PREFIXES",
],
Array [
"🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/IGNORED_FILES_PREFIXES",
],
Array [
"🚫 - Service \\"IGNORED_FILES_PREFIXES\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/IGNORED_FILES_PREFIXES",
],
Expand All @@ -354,6 +378,9 @@ Object {
Array [
"🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in: /home/whoiam/projects/whook/dist/services/IGNORED_FILES_SUFFIXES",
],
Array [
"🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/IGNORED_FILES_SUFFIXES",
],
Array [
"🚫 - Service \\"IGNORED_FILES_SUFFIXES\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/IGNORED_FILES_SUFFIXES",
],
Expand All @@ -363,6 +390,9 @@ Object {
Array [
"🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in: /home/whoiam/projects/whook/dist/services/KEEP_ALIVE_TIMEOUT",
],
Array [
"🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/KEEP_ALIVE_TIMEOUT",
],
Array [
"🚫 - Service \\"KEEP_ALIVE_TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/KEEP_ALIVE_TIMEOUT",
],
Expand All @@ -372,6 +402,9 @@ Object {
Array [
"🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in: /home/whoiam/projects/whook/dist/services/MAX_CLEAR_CHARS",
],
Array [
"🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/MAX_CLEAR_CHARS",
],
Array [
"🚫 - Service \\"MAX_CLEAR_CHARS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/MAX_CLEAR_CHARS",
],
Expand All @@ -381,6 +414,9 @@ Object {
Array [
"🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in: /home/whoiam/projects/whook/dist/services/MAX_CLEAR_RATIO",
],
Array [
"🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/MAX_CLEAR_RATIO",
],
Array [
"🚫 - Service \\"MAX_CLEAR_RATIO\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/MAX_CLEAR_RATIO",
],
Expand All @@ -390,6 +426,9 @@ Object {
Array [
"🚫 - Service \\"MAX_CONNECTIONS\\" not found in: /home/whoiam/projects/whook/dist/services/MAX_CONNECTIONS",
],
Array [
"🚫 - Service \\"MAX_CONNECTIONS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/MAX_CONNECTIONS",
],
Array [
"🚫 - Service \\"MAX_CONNECTIONS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/MAX_CONNECTIONS",
],
Expand All @@ -399,6 +438,9 @@ Object {
Array [
"🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in: /home/whoiam/projects/whook/dist/services/MAX_HEADERS_COUNT",
],
Array [
"🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/MAX_HEADERS_COUNT",
],
Array [
"🚫 - Service \\"MAX_HEADERS_COUNT\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/MAX_HEADERS_COUNT",
],
Expand All @@ -408,6 +450,9 @@ Object {
Array [
"🚫 - Service \\"PARSERS\\" not found in: /home/whoiam/projects/whook/dist/services/PARSERS",
],
Array [
"🚫 - Service \\"PARSERS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/PARSERS",
],
Array [
"🚫 - Service \\"PARSERS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/PARSERS",
],
Expand All @@ -417,6 +462,9 @@ Object {
Array [
"🚫 - Service \\"PROCESS_NAME\\" not found in: /home/whoiam/projects/whook/dist/services/PROCESS_NAME",
],
Array [
"🚫 - Service \\"PROCESS_NAME\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/PROCESS_NAME",
],
Array [
"🚫 - Service \\"PROCESS_NAME\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/PROCESS_NAME",
],
Expand All @@ -426,6 +474,9 @@ Object {
Array [
"🚫 - Service \\"PROTOCOL\\" not found in: /home/whoiam/projects/whook/dist/services/PROTOCOL",
],
Array [
"🚫 - Service \\"PROTOCOL\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/PROTOCOL",
],
Array [
"🚫 - Service \\"PROTOCOL\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/PROTOCOL",
],
Expand All @@ -435,6 +486,9 @@ Object {
Array [
"🚫 - Service \\"QUERY_PARSER\\" not found in: /home/whoiam/projects/whook/dist/services/QUERY_PARSER",
],
Array [
"🚫 - Service \\"QUERY_PARSER\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/QUERY_PARSER",
],
Array [
"🚫 - Service \\"QUERY_PARSER\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/QUERY_PARSER",
],
Expand All @@ -444,6 +498,9 @@ Object {
Array [
"🚫 - Service \\"SENSIBLE_HEADERS\\" not found in: /home/whoiam/projects/whook/dist/services/SENSIBLE_HEADERS",
],
Array [
"🚫 - Service \\"SENSIBLE_HEADERS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/SENSIBLE_HEADERS",
],
Array [
"🚫 - Service \\"SENSIBLE_HEADERS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/SENSIBLE_HEADERS",
],
Expand All @@ -453,6 +510,9 @@ Object {
Array [
"🚫 - Service \\"SENSIBLE_PROPS\\" not found in: /home/whoiam/projects/whook/dist/services/SENSIBLE_PROPS",
],
Array [
"🚫 - Service \\"SENSIBLE_PROPS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/SENSIBLE_PROPS",
],
Array [
"🚫 - Service \\"SENSIBLE_PROPS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/SENSIBLE_PROPS",
],
Expand All @@ -462,6 +522,9 @@ Object {
Array [
"🚫 - Service \\"SHIELD_CHAR\\" not found in: /home/whoiam/projects/whook/dist/services/SHIELD_CHAR",
],
Array [
"🚫 - Service \\"SHIELD_CHAR\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/SHIELD_CHAR",
],
Array [
"🚫 - Service \\"SHIELD_CHAR\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/SHIELD_CHAR",
],
Expand All @@ -471,6 +534,9 @@ Object {
Array [
"🚫 - Service \\"SIGNALS\\" not found in: /home/whoiam/projects/whook/dist/services/SIGNALS",
],
Array [
"🚫 - Service \\"SIGNALS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/SIGNALS",
],
Array [
"🚫 - Service \\"SIGNALS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/SIGNALS",
],
Expand All @@ -480,6 +546,9 @@ Object {
Array [
"🚫 - Service \\"SOCKET_TIMEOUT\\" not found in: /home/whoiam/projects/whook/dist/services/SOCKET_TIMEOUT",
],
Array [
"🚫 - Service \\"SOCKET_TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/SOCKET_TIMEOUT",
],
Array [
"🚫 - Service \\"SOCKET_TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/SOCKET_TIMEOUT",
],
Expand All @@ -489,6 +558,9 @@ Object {
Array [
"🚫 - Service \\"STRINGIFYERS\\" not found in: /home/whoiam/projects/whook/dist/services/STRINGIFYERS",
],
Array [
"🚫 - Service \\"STRINGIFYERS\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/STRINGIFYERS",
],
Array [
"🚫 - Service \\"STRINGIFYERS\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/STRINGIFYERS",
],
Expand All @@ -498,6 +570,9 @@ Object {
Array [
"🚫 - Service \\"TIMEOUT\\" not found in: /home/whoiam/projects/whook/dist/services/TIMEOUT",
],
Array [
"🚫 - Service \\"TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/TIMEOUT",
],
Array [
"🚫 - Service \\"TIMEOUT\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/TIMEOUT",
],
Expand All @@ -507,6 +582,9 @@ Object {
Array [
"🚫 - Service \\"readDir\\" not found in: /home/whoiam/projects/whook/dist/services/readDir",
],
Array [
"🚫 - Service \\"readDir\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/readDir",
],
Array [
"🚫 - Service \\"readDir\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/readDir",
],
Expand All @@ -516,6 +594,9 @@ Object {
Array [
"🚫 - Service \\"require\\" not found in: /home/whoiam/projects/whook/dist/services/require",
],
Array [
"🚫 - Service \\"require\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/require",
],
Array [
"🚫 - Service \\"require\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/require",
],
Expand All @@ -525,6 +606,9 @@ Object {
Array [
"🚫 - Service \\"uniqueId\\" not found in: /home/whoiam/projects/whook/dist/services/uniqueId",
],
Array [
"🚫 - Service \\"uniqueId\\" not found in: /home/whoiam/projects/whook/packages/whook-aws-lambda/dist/services/uniqueId",
],
Array [
"🚫 - Service \\"uniqueId\\" not found in: /home/whoiam/projects/whook/packages/whook-cli/dist/services/uniqueId",
],
Expand Down
2 changes: 2 additions & 0 deletions packages/whook-example/src/config/common/config.ts
Expand Up @@ -2,6 +2,7 @@ import { WhookAuthorizationConfig } from '@whook/authorization';
import { WhookSwaggerUIConfig } from '@whook/swagger-ui';
import { CORSConfig } from '@whook/cors';
import { WhookConfigs } from '@whook/whook';
import { WhookCompilerConfig } from '@whook/aws-lambda';
import { AuthenticationConfig } from '../../services/authentication';
import { APIConfig } from '../../services/API';
import { DEFAULT_ERRORS_DESCRIPTORS } from '@whook/http-router';
Expand All @@ -15,6 +16,7 @@ export type AppConfigs = WhookConfigs &
WhookAuthorizationConfig &
WhookSwaggerUIConfig &
CORSConfig &
WhookCompilerConfig &
APIConfig;

const CONFIG: AppConfigs = {
Expand Down

0 comments on commit 9015a76

Please sign in to comment.