Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
name: Test and lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
# with:
# node-version: '14'
- uses: actions/checkout@v2
# node-version: '22'
- uses: actions/checkout@v4
- run: |
npm install
npm ci
npm run test
npm run lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ jspm_packages

# artifacts
coverage
dist
build

# Serverless directories
.serverless
Expand Down
20 changes: 20 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Maintenance:
✔ switch to `nodejs22.x` @done(25-08-12 18:33)
✔ add bundler ( `@vercel/ncc` ? or `vite` or `esbuild` inside serverless) @done(25-08-13 07:03)
✔ update serverless @done(25-08-12 18:33)
☐ switch config to abap-version-shield.sbcg.com.ua (+ certificate)
✔ add `version` endpoint @done(25-08-13 06:16)
☐ or `about` endpoint (name, version, web-url)

Update dependencies:
✘ The querystring API is considered Legacy. new code should use the URLSearchParams API instead @cancelled(25-01-18 20:23)
✘ Upgrade to v7.0.2+ of superagent @cancelled(25-01-18 20:23)

Updates:
✔ Upgrade to esm @done(25-01-18 20:22)
✔ Switch to vitest @done(25-01-18 20:22)
☐ Maybe switch to TS + esbuild
☐ remove root path (version-shield-json) - if possible?
☐ But keep version-shield-json as a redirect
☐ support VERSION_CONSTANT in abapgit json
Not that easy: .abapgit contains object name, not the filename
4 changes: 2 additions & 2 deletions bin/deploy-dev.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
STAGE=dev

echo "Creating $STAGE domain ..."
serverless create_domain --stage $STAGE
# echo "Creating $STAGE domain ..."
# serverless create_domain --stage $STAGE

echo "Deploying $STAGE lambda ..."
serverless deploy --stage $STAGE
4 changes: 2 additions & 2 deletions bin/deploy-prod.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
STAGE=prod

echo "Creating $STAGE domain ..."
serverless create_domain --stage $STAGE
# echo "Creating $STAGE domain ..."
# serverless create_domain --stage $STAGE

echo "Deploying $STAGE lambda ..."
serverless deploy --stage $STAGE
4 changes: 2 additions & 2 deletions bin/deploy-qa.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
STAGE=qa

echo "Creating $STAGE domain ..."
serverless create_domain --stage $STAGE
# echo "Creating $STAGE domain ..."
# serverless create_domain --stage $STAGE

echo "Deploying $STAGE lambda ..."
serverless deploy --stage $STAGE
4 changes: 2 additions & 2 deletions bin/remove-dev.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
STAGE=dev

echo "Deleting $STAGE domain ..."
serverless delete_domain --stage $STAGE
# echo "Deleting $STAGE domain ..."
# serverless delete_domain --stage $STAGE

echo "Deleting $STAGE lambda ..."
serverless remove --stage $STAGE
4 changes: 2 additions & 2 deletions bin/remove-qa.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
STAGE=qa

echo "Deleting $STAGE domain ..."
serverless delete_domain --stage $STAGE
# echo "Deleting $STAGE domain ..."
# serverless delete_domain --stage $STAGE

echo "Deleting $STAGE lambda ..."
serverless remove --stage $STAGE
12 changes: 9 additions & 3 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ Legend
+ : added
- : removed

Important dev notes
-------------------
- node-fetch bind to version @2 due to ESM only support in version 3
v1.1.0, 2025-08-13
------------------
! move to abap-version-shield.sbcg.com.ua domain
! migrate to ESM
! migrate to vitest
! upgrade all packages
! bundling the build (esbuild)
! move to nodejs22.x
+ added fixed param /version to get own version

v1.0.3, 2022-03-21
------------------
Expand Down
13 changes: 11 additions & 2 deletions dev-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<!-- markdownlint-disable no-bare-urls -->
# Dev notes

## Useful

- https://stackify.com/aws-lambda-with-node-js-a-complete-getting-started-guide/
- https://postman-echo.com/get?foo1=bar1

Expand All @@ -11,7 +13,12 @@
- https://stackoverflow.com/questions/46956660/how-to-set-up-different-domains-based-on-stage-with-serverless-domain-manager-pl
- http://www.piotrnowicki.com/2019/06/aws-serverless-stage-promotion/

## Credentials

- https://www.serverless.com/framework/docs/providers/aws/guide/credentials

## Deployment

- `serverless config credentials --provider aws --key <your_access_key_id> --secret <your_access_key_secret>`
- `serverless deploy`
- `serverless logs -f getAbapVersionShieldJson --stage dev`
Expand All @@ -20,10 +27,12 @@
- `bin/deploy-dev.sh`
- `bin/deploy-prod.sh`

## Useful
## Prebuild

- `serverless package` - check what will be in zip package (built in .serverless dir)

## redirect
## Redirect

- https://alestic.com/2015/11/amazon-api-gateway-aws-cli-redirect/
- https://medium.com/@lakshmanLD/lambda-proxy-vs-lambda-integration-in-aws-api-gateway-3a9397af0e6d
- https://github.com/jnupponen/apigw-redirect/blob/master/template.yaml
Expand Down
23 changes: 23 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import { globalIgnores } from 'eslint/config';

export default [
pluginJs.configs.recommended,
globalIgnores(['dist', 'node_modules', '.serverless']),
{
files: ["src/**/*.js"],
languageOptions: {
globals: {
...globals.node,
},
},
rules: {
"quotes": ["error", "single", { "avoidEscape": true }],
"semi": ["error", "always", { "omitLastInOneLineBlock": true}],
"no-console": "off",
"no-trailing-spaces": ["error"],
"indent": ["error", 4, { "SwitchCase": 1 }]
}
}
];
Loading