Skip to content

Commit

Permalink
refactor(env): refactor attempt for app env
Browse files Browse the repository at this point in the history
Integrating new `application-services` fix #123 .
  • Loading branch information
nfroidure committed Aug 16, 2023
1 parent 8bc933a commit 2126f07
Show file tree
Hide file tree
Showing 81 changed files with 1,494 additions and 2,094 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Node.js CI

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
build:
Expand Down
1,131 changes: 536 additions & 595 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"metapak": {
"configs": [
"main",
"readme"
"readme",
"ghactions"
],
"data": {
"ignore": [
Expand Down Expand Up @@ -61,8 +62,8 @@
"coveralls": "^3.0.4",
"cz-conventional-changelog": "^3.3.0",
"lerna": "^6.1.0",
"metapak": "^5.1.3",
"metapak-nfroidure": "15.0.1"
"metapak": "^5.1.6",
"metapak-nfroidure": "15.0.2"
},
"contributors": [
{
Expand Down
7 changes: 4 additions & 3 deletions packages/whook-authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ declare module '@whook/whook' {

// ...

export interface WhookConfigs
export interface AppConfig
- extends WhookBaseConfigs {}
+ extends WhookBaseConfigs, WhookAuthorizationConfig {}

Expand All @@ -130,15 +130,16 @@ declare module '@whook/whook' {
Then add the config and the errors descriptors or provide your
own (usually in `src/config/common/config.js`):
```diff
// ...
import { DEFAULT_ERRORS_DESCRIPTORS } from '@whook/http-router';
+ import {
+ AUTHORIZATION_ERRORS_DESCRIPTORS,
+ } from '@whook/authorization';
import type { WhookConfigs } from '@whook/whook';
import type { AppConfig } from 'application-services';

// ...

const CONFIG: WhookConfigs = {
const CONFIG: AppConfig = {
// ...
- ERRORS_DESCRIPTORS: DEFAULT_ERRORS_DESCRIPTORS,
+ ERRORS_DESCRIPTORS: {
Expand Down
24 changes: 12 additions & 12 deletions packages/whook-authorization/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@
"homepage": "https://github.com/nfroidure/whook",
"dependencies": {
"@whook/whook": "^12.0.2",
"common-services": "^13.0.0",
"http-auth-utils": "^5.0.0",
"knifecycle": "^15.0.1",
"common-services": "^14.0.0",
"http-auth-utils": "^5.0.1",
"knifecycle": "^16.0.1",
"yerror": "^8.0.0",
"yhttperror": "^7.0.0"
"yhttperror": "^8.0.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.76",
"@swc/core": "^1.3.77",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.28",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"@swc/jest": "^0.2.29",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.2",
"jsdoc-to-markdown": "^8.0.0",
"metapak": "^5.1.3",
"metapak-nfroidure": "15.0.1",
"prettier": "^3.0.1",
"metapak": "^5.1.6",
"metapak-nfroidure": "15.0.2",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
},
Expand Down
13 changes: 8 additions & 5 deletions packages/whook-aws-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,20 @@ Declare this module types in your `src/whook.d.ts` type definitions:
+ WhookAPIOperationAWSLambdaConfig
+ } from '@whook/aws-lambda';

declare module '@whook/whook' {
declare module 'application-services' {

// ...

export interface WhookConfigs
export interface AppConfig
- extends WhookBaseConfigs {}
+ extends WhookBaseConfigs,
+ WhookAWSLambdaBuildConfig,
+ WhookCompilerConfig {}
}

// ...
// ...

declare module '@whook/whook' {
export interface WhookAPIHandlerDefinition<
T extends Record<string, unknown> = Record<string, unknown>,
U extends {
Expand All @@ -137,11 +139,12 @@ declare module '@whook/whook' {
And add the AWS Lambda config (usually in `src/config/common/config.js`):

```diff
import type { WhookConfigs } from '@whook/whook';
// ...
import type { AppConfig } from 'application-services';

// ...

const CONFIG: WhookConfigs = {
const CONFIG: AppConfig = {
// ...
+ COMPILER_OPTIONS: {
+ externalModules: [],
Expand Down
24 changes: 12 additions & 12 deletions packages/whook-aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,34 +53,34 @@
"ajv-formats": "^2.1.1",
"bytes": "^3.1.2",
"camelcase": "^8.0.0",
"common-services": "^13.0.0",
"common-services": "^14.0.0",
"cpr": "3.0.1",
"knifecycle": "^15.0.1",
"knifecycle": "^16.0.1",
"mkdirp": "^3.0.1",
"openapi-types": "^12.1.3",
"qs": "^6.11.2",
"strict-qs": "^8.0.0",
"strict-qs": "^8.0.1",
"type-fest": "^4.2.0",
"uuid": "^9.0.0",
"yerror": "^8.0.0",
"yhttperror": "^7.0.0"
"yhttperror": "^8.0.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.76",
"@swc/core": "^1.3.77",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.28",
"@swc/jest": "^0.2.29",
"@types/mkdirp": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.2",
"jsdoc-to-markdown": "^8.0.0",
"metapak": "^5.1.3",
"metapak-nfroidure": "15.0.1",
"prettier": "^3.0.1",
"metapak": "^5.1.6",
"metapak-nfroidure": "15.0.2",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
},
Expand Down
13 changes: 9 additions & 4 deletions packages/whook-cors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ Declare this module types in your `src/whook.d.ts` type
+ WhookAPIOperationCORSConfig,
+ } from '@whook/cors';

declare module '@whook/whook' {
declare module 'application-services' {

// ...

export interface WhookConfigs
export interface AppConfig
- extends WhookBaseConfigs {}
+ extends WhookBaseConfigs, CORSConfig {}

// ...
}

// ...

declare module '@whook/whook' {
export interface WhookAPIHandlerDefinition<
T extends Record<string, unknown> = Record<string, unknown>,
U extends {
Expand All @@ -72,9 +76,10 @@ declare module '@whook/whook' {
And add the CORS config (usually in `src/config/common/config.js`):

```diff
import type { WhookConfigs } from '@whook/whook';
// ...
import type { AppConfig } from 'application-services';

const CONFIG: WhookConfigs = {
const CONFIG: AppConfig = {
// ...
+ CORS: {
+ 'Access-Control-Allow-Origin': '*',
Expand Down
20 changes: 10 additions & 10 deletions packages/whook-cors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,25 @@
"@apidevtools/swagger-parser": "^10.1.0",
"@whook/http-router": "^12.0.1",
"@whook/whook": "^12.0.2",
"knifecycle": "^15.0.1",
"knifecycle": "^16.0.1",
"openapi-types": "^12.1.3",
"yhttperror": "^7.0.0"
"yhttperror": "^8.0.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.76",
"@swc/core": "^1.3.77",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.28",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"@swc/jest": "^0.2.29",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.2",
"jsdoc-to-markdown": "^8.0.0",
"metapak": "^5.1.3",
"metapak-nfroidure": "15.0.1",
"prettier": "^3.0.1",
"metapak": "^5.1.6",
"metapak-nfroidure": "15.0.2",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
},
Expand Down
20 changes: 10 additions & 10 deletions packages/whook-create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,28 +69,28 @@
"dependencies": {
"@whook/example": "^12.1.0",
"axios": "^1.4.0",
"common-services": "^13.0.0",
"common-services": "^14.0.0",
"debug": "^4.3.4",
"fs-extra": "^11.1.1",
"inquirer": "^9.2.10",
"knifecycle": "^15.0.1",
"knifecycle": "^16.0.1",
"ora": "^7.0.1",
"yerror": "^8.0.0"
},
"devDependencies": {
"@swc/cli": "^0.1.62",
"@swc/core": "^1.3.76",
"@swc/core": "^1.3.77",
"@swc/helpers": "^0.5.1",
"@swc/jest": "^0.2.28",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"eslint": "^8.46.0",
"@swc/jest": "^0.2.29",
"@typescript-eslint/eslint-plugin": "^6.4.0",
"@typescript-eslint/parser": "^6.4.0",
"eslint": "^8.47.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.2",
"metapak": "^5.1.3",
"metapak-nfroidure": "15.0.1",
"prettier": "^3.0.1",
"metapak": "^5.1.6",
"metapak-nfroidure": "15.0.2",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"typescript": "^5.1.6"
},
Expand Down
Loading

0 comments on commit 2126f07

Please sign in to comment.