Skip to content

Commit 1479073

Browse files
committed
feat: initial commit
Extracted from hello.nrfcloud.com/backend
0 parents  commit 1479073

32 files changed

+5248
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @coderbyheart
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Test and Release
2+
3+
on: push
4+
5+
permissions:
6+
contents: write
7+
issues: write
8+
9+
env:
10+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
13+
jobs:
14+
tests:
15+
runs-on: ubuntu-22.04
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: "20.x"
22+
cache: "npm"
23+
- name: Authenticate with NPM registry
24+
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
25+
- name: Install dependencies
26+
run: npm ci --no-audit
27+
- name: Compile
28+
run: npx tsc
29+
- name: Check source code with eslint
30+
run: npx eslint .
31+
- name: Check if source code is properly formatted
32+
run: npx prettier -c ./
33+
- name: Test
34+
run: npm test
35+
- name: Semantic release
36+
continue-on-error: true
37+
run: npx semantic-release
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sync repository info from package.json
2+
3+
env:
4+
GITHUB_TOKEN: ${{ secrets.UPDATE_REPO_INFO_PAT }}
5+
6+
on:
7+
push:
8+
branches:
9+
- saga
10+
paths:
11+
- "package.json"
12+
- ".github/workflows/update-repo-info.yaml"
13+
workflow_dispatch:
14+
15+
jobs:
16+
update_repo_info:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Sync repository description
23+
run:
24+
gh repo edit --description "`cat package.json | jq -r '.description'`"
25+
26+
- name: Sync repository topics
27+
run:
28+
cat package.json | jq '.keywords[]' | xargs -I'{}' gh repo edit
29+
--add-topic {}
30+
31+
- name: Sync homepage
32+
run: gh repo edit --homepage "`cat package.json | jq -r '.homepage'`"

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
npm-debug.log
3+
dist/

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx commitlint --edit $1

.husky/pre-commit

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
npx lint-staged
2+
npm test

.prettierignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
package-lock.json

CODE_OF_CONDUCT.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See <https://github.com/bifravst/.github/blob/saga/CODE_OF_CONDUCT.md>

CONTRIBUTING.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
See <https://github.com/bifravst/.github/blob/saga/CONTRIBUTING.md>

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2024, Nordic Semiconductor ASA | nordicsemi.no
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AWS Lambda Helpers [![npm version](https://img.shields.io/npm/v/@hello.nrfcloud.com/lambda-helpers.svg)](https://www.npmjs.com/package/@hello.nrfcloud.com/lambda-helpers)
2+
3+
[![GitHub Actions](https://github.com/hello-nrfcloud/lambda-helpers/workflows/Test%20and%20Release/badge.svg)](https://github.com/hello-nrfcloud/lambda-helpers/actions)
4+
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
5+
[![Renovate](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)
6+
[![@commitlint/config-conventional](https://img.shields.io/badge/%40commitlint-config--conventional-brightgreen)](https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional)
7+
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier/)
8+
[![ESLint: TypeScript](https://img.shields.io/badge/ESLint-TypeScript-blue.svg)](https://github.com/typescript-eslint/typescript-eslint)
9+
10+
Helper functions for AWS lambdas written in TypeScript.
11+
12+
## Installation
13+
14+
npm i --save --save-exact @hello.nrfcloud.com/lambda-helpers
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ADR 001: Use saga as the name for the main branch
2+
3+
Historically, Git and other software use terms such as `master/slave`,
4+
`whitelist/blacklist`, which are based on racial concepts. Their continued use
5+
maintains the racial stereotypes they depict. Better alternatives in meaning and
6+
technical correctness exist, like `leader/follower`, `blocklist/allowlist`.
7+
8+
In the Nordic mythology, a `saga` is a long, continuous recollection of stories
9+
about the history of humans, legends, and Gods. The term `saga` reflects very
10+
well what happens in a Git repository. Changes happen in branches (some teams
11+
tie them to _User Stories_, which are sometimes directly or loosely coupled to
12+
the main branch). Once the changes are finalized, they get added to the main
13+
branch, or get appended in the case of a rebase. The mental model of a big book
14+
of stories fits this process very well.
15+
16+
Therefore, the main branch in this project is named `saga`. `master` must not be
17+
used.

adr/002-clean-gitignore.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ADR 002: Clean `.gitignore` file
2+
3+
A `.gitignore` file in a project must only cover the artifacts caused by the
4+
contained source code and not those caused by the personal choice of editor or
5+
the environment of a developer.
6+
7+
This is explained in detail
8+
[here](https://github.com/coderbyheart/first-principles/issues/30).

adr/003-use-of-typescript.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ADR 003: use of TypeScript
2+
3+
This project is developed using [TypeScript](https://www.typescriptlang.org/) (a
4+
typed superset of JavaScript).
5+
6+
JavaScript is the most popular language according to the
7+
[2019 Stack Overflow survey](https://insights.stackoverflow.com/survey/2019#technology)
8+
and it is therefore likely that many developers using the project will be
9+
familiar with the language concepts and how to use and run it.
10+
11+
Virtually all cloud providers provide their SDKs in JavaScript or TypeScript
12+
which this project can integrate natively.

adr/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Architecture decision records
2+
3+
This folder contains the architecture decision records (ADRs) for this project.
4+
5+
To know more about ADRs, see
6+
[Documenting architecture decisions](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions)
7+
and the video on
8+
[Communicating and documenting architectural decisions](https://www.youtube.com/watch?v=rwfXkSjFhzc).

commitlint.config.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ["@commitlint/config-conventional"] };

eslint.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import config from '@bifravst/eslint-config-typescript'
2+
export default config

0 commit comments

Comments
 (0)