Skip to content

Commit

Permalink
feat(@whook/graphiql): add GraphIQL to the build
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Mar 20, 2020
1 parent 05277d6 commit 1a22760
Show file tree
Hide file tree
Showing 54 changed files with 2,680 additions and 495 deletions.
3 changes: 2 additions & 1 deletion packages/whook-authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"childPackage": true,
"files": "'src/**/*.ts'",
"testsFiles": "'src/**/*.test.ts'",
"distFiles": "'dist/**/*.js'",
"ignore": [
"dist"
],
Expand Down Expand Up @@ -171,7 +172,7 @@
"cli": "env NODE_ENV=${NODE_ENV:-cli}",
"compile": "babel --extensions '.ts,.js' src --out-dir=dist --source-maps=true",
"cover": "npm run jest -- --coverage",
"doc": "echo \"# API\" > API.md; jsdoc2md undefined >> API.md && git add API.md",
"doc": "echo \"# API\" > API.md; jsdoc2md 'dist/**/*.js' >> API.md && git add API.md",
"jest": "NODE_ENV=test jest",
"lint": "eslint 'src/**/*.ts'",
"metapak": "metapak",
Expand Down
55 changes: 55 additions & 0 deletions packages/whook-aws-lambda/API.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# API
## Members

<dl>
<dt><a href="#default">default</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Wrap the ENV service in order to filter ENV vars for the build</p>
</dd>
</dl>

## Functions

<dl>
<dt><a href="#initBuildConstants">initBuildConstants(constants)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Allow to proxy constants directly by serializing it in the
build, saving some computing and increasing boot time of
lambdas.</p>
</dd>
</dl>

<a name="default"></a>

## default ⇒ <code>Promise.&lt;Object&gt;</code>
Wrap the ENV service in order to filter ENV vars for the build

**Kind**: global variable
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the reshaped env vars.

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> | | The services ENV depends on |
| services.NODE_ENV | <code>Object</code> | | The injected NODE_ENV value to add it to the build env |
| [services.PROXYED_ENV_VARS] | <code>Object</code> | <code>{}</code> | A list of environment variable names to proxy |
| [log] | <code>Object</code> | <code>noop</code> | An optional logging service |

<a name="initBuildConstants"></a>

## initBuildConstants(constants) ⇒ <code>Promise.&lt;Object&gt;</code>
Allow to proxy constants directly by serializing it in the
build, saving some computing and increasing boot time of
lambdas.

**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the gathered constants.

| Param | Type | Description |
| --- | --- | --- |
| constants | <code>Object</code> | The serializable constants to gather |

**Example**
```js
import { initBuildConstants } from '@whook/aws-lambda';
import { alsoInject } from 'knifecycle';

export default alsoInject(['MY_OWN_CONSTANT'], initBuildConstants);
```
56 changes: 56 additions & 0 deletions packages/whook-aws-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,62 @@ npm run whook -- testHTTPLambda --name getPing

[//]: # (::contents:end)

# API
## Members

<dl>
<dt><a href="#default">default</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Wrap the ENV service in order to filter ENV vars for the build</p>
</dd>
</dl>

## Functions

<dl>
<dt><a href="#initBuildConstants">initBuildConstants(constants)</a> ⇒ <code>Promise.&lt;Object&gt;</code></dt>
<dd><p>Allow to proxy constants directly by serializing it in the
build, saving some computing and increasing boot time of
lambdas.</p>
</dd>
</dl>

<a name="default"></a>

## default ⇒ <code>Promise.&lt;Object&gt;</code>
Wrap the ENV service in order to filter ENV vars for the build

**Kind**: global variable
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the reshaped env vars.

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| services | <code>Object</code> | | The services ENV depends on |
| services.NODE_ENV | <code>Object</code> | | The injected NODE_ENV value to add it to the build env |
| [services.PROXYED_ENV_VARS] | <code>Object</code> | <code>{}</code> | A list of environment variable names to proxy |
| [log] | <code>Object</code> | <code>noop</code> | An optional logging service |

<a name="initBuildConstants"></a>

## initBuildConstants(constants) ⇒ <code>Promise.&lt;Object&gt;</code>
Allow to proxy constants directly by serializing it in the
build, saving some computing and increasing boot time of
lambdas.

**Kind**: global function
**Returns**: <code>Promise.&lt;Object&gt;</code> - A promise of an object containing the gathered constants.

| Param | Type | Description |
| --- | --- | --- |
| constants | <code>Object</code> | The serializable constants to gather |

**Example**
```js
import { initBuildConstants } from '@whook/aws-lambda';
import { alsoInject } from 'knifecycle';

export default alsoInject(['MY_OWN_CONSTANT'], initBuildConstants);
```

# Authors
- [Nicolas Froidure](http://insertafter.com/en/index.html)

Expand Down
3 changes: 2 additions & 1 deletion packages/whook-aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"childPackage": true,
"files": "'src/**/*.ts'",
"testsFiles": "'src/**/*.test.ts'",
"distFiles": "'dist/**/*.js'",
"ignore": [
"dist"
],
Expand Down Expand Up @@ -177,7 +178,7 @@
"cli": "env NODE_ENV=${NODE_ENV:-cli}",
"compile": "babel --extensions '.ts,.js' src --out-dir=dist --source-maps=true",
"cover": "npm run jest -- --coverage",
"doc": "echo \"# API\" > API.md; jsdoc2md undefined >> API.md && git add API.md",
"doc": "echo \"# API\" > API.md; jsdoc2md 'dist/**/*.js' >> API.md && git add API.md",
"jest": "NODE_ENV=test jest",
"lint": "eslint 'src/**/*.ts'",
"metapak": "metapak",
Expand Down
22 changes: 22 additions & 0 deletions packages/whook-cli/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file is automatically generated by a `metapak`
# module. Do not change it elsewhere, changes would
# be overridden.

# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
# 2 space indentation
[*.{js,css}]
charset = utf-8
indent_style = space
trim_trailing_whitespace = true
indent_size = 2
3 changes: 3 additions & 0 deletions packages/whook-cli/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.md text eol=lf
*.html text eol=lf
*.js text eol=lf
9 changes: 9 additions & 0 deletions packages/whook-cli/.github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Code of Conduct

Be kind, except if I behave like an asshole, if so, tell me by linking to this
file.

I try hard to document and automate things so that you cannot create noises
without really willing to do so.

This is why I'll just delete issues/comments making be sad.
8 changes: 8 additions & 0 deletions packages/whook-cli/.github/CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Contributing to this project requires you to be
a gentleman.

By contributing you must agree with publishing your
changes into the same license that apply to the current code.

You will find the license in the LICENSE file at
the root of this repository.
59 changes: 59 additions & 0 deletions packages/whook-cli/.github/ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
## Issue
<!--

Thanks for reporting an issue.

Before doing so, there are a few checks to do in
order to optimize its resolution. Just fill in the
following template.

Beware that you also can create a pull request
if you know how to solve the issue.

Finally scroll down if you are asking for a new feature ;)

-->

I'm a gentledev I:
- [ ] fully read the README recently
- [ ] searched for existing issues
- [ ] checked I'm up to date with the latest version of the project

### Expected behavior

### Actual behavior

### Steps to reproduce the behavior

### Debugging informations
- `node -v` result:
```
<paste here>
```

- `npm -v` result:
```
<paste here>
```
If the result is lower than 10.19.0, there is
poor chances I even have a look to it. Please,
use the last [NodeJS LTS version](https://nodejs.org/en/).

## Feature request
<!--

If you think a feature need to be added, your suggestions
are welcome. Beware though that:
- I try to keep my modules simple so please ensure the requested
feature is really related to this module. If not, you may
instead create a module that augment/work with this one,
- I am not your employee so keep calm and be aware that your
request may stay incomplete for ever. Nothing impeach you
to implement the feature and get it merged though.
-->

### Feature description

### Use cases

- [ ] I will/did implement the feature
51 changes: 51 additions & 0 deletions packages/whook-cli/.github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<!--

Thanks for improving this project!

Before doing so, there are a few checks to do in
order to get your PR merged asap. Just fill in the
following template.

-->

Fixes #

### Proposed changes
-
-

<!-- Check the boxes with a `x` like so `[x]` -->

### Code quality
- [ ] I made some tests for my changes
- [ ] I added my name in the
[contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors)
field of the `package.json` file. Beware to use the same format than for the author field
for the entries so that you'll get a mention in the `README.md` with a link to your website.

### License
To get your contribution merged, you must check the following.

- [ ] I read the project license in the LICENSE file
- [ ] I agree with publishing under this project license

<!--

If you already maintain several NPM modules / NodeJS
project, making significant changes on one of my modules
automatically legitimates you as a core developer.

This is because I could die or even not give a shit to
this project someday and I don't want people to get
stuck in such cases.

If you want to help, fill the following with to get
GitHub/NPM r/w access.

-->
### Join
- [ ] I wish to join the core team
- [ ] I agree that with great powers comes responsibilities
- [ ] I'm a nice person

My NPM username:
Loading

0 comments on commit 1a22760

Please sign in to comment.