Skip to content

Commit 98bbb0d

Browse files
authored
Merge pull request #3 from hlambda/release/0.0.7
feat: 🚀 Implement metadata versioning, new entrypoint file type
2 parents c5ce996 + af8bb4a commit 98bbb0d

File tree

21 files changed

+670
-291
lines changed

21 files changed

+670
-291
lines changed

.env.example

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,23 @@ SERVER_HEALTH="Healthy"
3939
HLAMBDA_ADMIN_SECRET=""
4040

4141
# Constant reference in code: ENV_HLAMBDA_DISABLE_ADMIN_SECRET | Default value: false
42-
# Is master password for API management enabled or disabled.
42+
# Disables or enables master password for API management.
4343
HLAMBDA_DISABLE_ADMIN_SECRET="false"
4444

4545
# Constant reference in code: ENV_HLAMBDA_DISABLE_CONSOLE | Default value: false
46-
# Is master password for API management enabled or disabled.
46+
# Completely disables Console and Console API thus any metadata update.
4747
HLAMBDA_DISABLE_CONSOLE="false"
4848

49+
# Constant reference in code: ENV_HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT | Default value: false
50+
# Disable 301 redirect from the root path to the `/console`.
51+
HLAMBDA_DISABLE_INITIAL_ROUTE_REDIRECT="false"
52+
4953
# Constant reference in code: ENV_HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS | Default value: 1331
5054
# Debounce ms time to wait before closing the server and reloading metadata.
5155
HLAMBDA_METADATA_RELOAD_DEBOUNCE_MS="1331"
5256

5357
# Constant reference in code: ENV_HLAMBDA_LOADED_APPS_PREFIX | Default value: /api/v1/
54-
# Debounce ms time to wait before closing the server and reloading metadata.
58+
# Prefix used for all the loaded router apps.
5559
HLAMBDA_LOADED_APPS_PREFIX="/api/v1/"
5660

5761
# Constant reference in code: ENV_HLAMBDA_ENABLE_PUBLIC_SWAGGER | Default value: false
@@ -60,5 +64,37 @@ HLAMBDA_ENABLE_PUBLIC_SWAGGER="false"
6064

6165
# Constant reference in code: ENV_HLAMBDA_PUBLIC_SWAGGER_ROUTE | Default value: /docs
6266
# Flag to map swagger route, default `/docs`.
63-
HLAMBDA_ENABLE_PUBLIC_SWAGGER="/docs"
67+
HLAMBDA_PUBLIC_SWAGGER_ROUTE="/docs"
68+
69+
# Constant reference in code: ENV_HLAMBDA_CONFIGURATION_LOADER_PREFIX | Default value: hlambda-config.yaml
70+
# Sets the value for the name of the configuration file that will be loaded.
71+
HLAMBDA_CONFIGURATION_LOADER_PREFIX="hlambda-config.yaml"
72+
73+
# Constant reference in code: ENV_HLAMBDA_EXPRESS_LOADER_PREFIX | Default value: router.
74+
# Sets the value for the prefix of the router files that will be loaded.
75+
HLAMBDA_EXPRESS_LOADER_PREFIX="router."
76+
77+
# Constant reference in code: ENV_HLAMBDA_ENTRYPOINT_LOADER_PREFIX | Default value: entrypoint.
78+
# Sets the value for the prefix of the entrypoint files that will be loaded.
79+
HLAMBDA_ENTRYPOINT_LOADER_PREFIX="entrypoint."
80+
81+
# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER | Default value: false
82+
# Enables environment banner.
83+
HLAMBDA_ENABLE_ENVIRONMENT_BANNER="false"
84+
85+
# Constant reference in code: ENV_HLAMBDA_ENVIRONMENT_BANNER_NAME | Default value:
86+
# Sets name to the environment banner.
87+
HLAMBDA_ENVIRONMENT_BANNER_NAME=""
88+
89+
# Constant reference in code: ENV_HLAMBDA_ENVIRONMENT_BANNER_MESSAGE | Default value:
90+
# Sets message to the environment banner.
91+
HLAMBDA_ENVIRONMENT_BANNER_MESSAGE=""
92+
93+
# Constant reference in code: ENV_HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR | Default value: #FF0000
94+
# Selects color of the environment banner.
95+
HLAMBDA_ENABLE_ENVIRONMENT_BANNER_COLOR="#FF0000"
96+
97+
# Constant reference in code: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES | Default value: ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES,HLAMBDA_DISABLE_CONSOLE,HLAMBDA_ADMIN_SECRET
98+
# List of the env variable names that are protected from hlambda config override.
99+
HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES="ENV_HLAMBDA_LIST_OF_PROTECTED_ENV_VARIABLES,HLAMBDA_DISABLE_CONSOLE,HLAMBDA_ADMIN_SECRET"
64100

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
]
66
},
77
"parserOptions": {
8-
"ecmaVersion": 2020,
8+
"ecmaVersion": 2022,
99
"sourceType": "module",
1010
"ecmaFeatures": {}
1111
},

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ watcher_trigger/
66

77
# development
88
metadata_tmp/
9+
10+
.DS_Store

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM node:16.13.1-alpine3.14
1+
FROM node:lts-alpine3.15
22

33
RUN apk -U upgrade \
44
&& apk add --no-cache \
5-
git \
6-
openssh
5+
git \
6+
openssh
77

88
RUN mkdir -p /usr/src/app
99

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Hlambda (/hlæmdə/; hλ;)
1+
# Hlambda (/hlæmdə/; hλ;) [Hyper Lambda]
22

3-
## What is Hlambda (/hlæmdə/)
3+
## What is Hlambda (/hlæmdə/) [Hyper Lambda]
44

55
Hlambda is ECMAScript meta API service. That means that it offers simple ways to deploy ECMAScript code to local or remote servers.
66

@@ -52,7 +52,7 @@ Exporting errors in hlambda if imported can also cause it to not be visible in t
5252

5353
Until addressed this has a simple hotfix to just remove that package from the list of dependencies in your hlambda app, before applying metadata.
5454

55-
## NOTICE
55+
## Notice
5656

5757
```
5858
Any contributions are greatly appreciated.

metadata/apps/bad-app/router.auth.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/*
2+
// Uncomment this file to test how Hlambda handles bad code with errors.
3+
14
import express from 'express';
25
import asyncHandler from 'express-async-handler';
36
@@ -22,3 +25,5 @@ router.get(
2225
aaa;
2326
2427
export default router;
28+
29+
*/

metadata/apps/example_demo_app/hlambda-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ env:
1010
HASURA_GRAPHQL_ADMIN_SECRET: "hlambda-test"
1111
YES: "yes"
1212
HAHAH: "YooY"
13+
HLAMBDA_DISABLE_CONSOLE: "false"
1314
envForce:
1415
HASURA_GRAPHQL_API_ENDPOINT: "http://graphql-engine:8099/v1/graphql"
1516
HASURA_GRAPHQL_ADMIN_SECRET: "realpassword"
1617
SPECIAL_PASSWORD: "realpz"
18+
HLAMBDA_DISABLE_CONSOLE: "false"

metadata/package-lock.json

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

metadata/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"type": "module",
33
"dependencies": {
44
"lodash": "^4.17.21",
5-
"luxon": "^2.2.0",
5+
"luxon": "^2.4.0",
6+
"node-forge": "^1.3.1",
67
"uuid": "^8.3.2"
78
}
89
}

0 commit comments

Comments
 (0)