Skip to content

Commit 4335319

Browse files
authored
Merge pull request #76 from shiftcode/#254-integrate-libs
#254 integrate libs
2 parents 20d92fc + 39cfde3 commit 4335319

311 files changed

Lines changed: 16529 additions & 7759 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.commitlintrc.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 12 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,22 @@ on:
1616
tags-ignore:
1717
- '**'
1818
jobs:
19-
checkExecution:
20-
runs-on: ubuntu-latest
21-
outputs:
22-
shouldExecute: ${{ steps.stepCheckExecution.outputs.shouldExecute }}
23-
steps:
24-
- name: Dump GitHub context
25-
run: |
26-
echo "::group::github context"
27-
echo "$GITHUB_CONTEXT"
28-
echo "::endgroup::"
29-
env:
30-
GITHUB_CONTEXT: ${{ toJson(github) }}
31-
- id: stepCheckExecution
32-
name: Check for execution
33-
uses: shiftcode/github-action-skip@v4.0.0
34-
with:
35-
skipOnCommitMsg: '[skip_build]'
36-
githubToken: ${{ secrets.GITHUB_TOKEN }}
3719
test:
3820
runs-on: ubuntu-latest
39-
needs: checkExecution
40-
# only execute if not skipped by commit message
41-
if: needs.checkExecution.outputs.shouldExecute == 'true'
4221
strategy:
4322
matrix:
44-
# Test with Node.js v20 and v22
23+
# Test with Node.js 24 and v25
4524
node:
46-
- 20
47-
- 22
25+
- 24
26+
- 25
4827
name: Node.js v${{ matrix.node }}
4928
steps:
5029
# checkout branch
5130
- name: Checkout
52-
uses: actions/checkout@v4
53-
with:
54-
# 0 indicates all history, because publish requires tag information
55-
fetch-depth: 0
56-
# we need privileged access to publish to protected branch
57-
token: ${{ secrets.GH_TOKEN_PUBLIC_REPO }}
31+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd #v5.0.1
5832
# setup node and dependency cache
5933
- name: Setup Node and NPM Cache
60-
uses: actions/setup-node@v4
34+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
6135
with:
6236
node-version: ${{ matrix.node }}
6337
cache: 'npm'
@@ -69,21 +43,20 @@ jobs:
6943
run: npm run test:ci
7044
build:
7145
runs-on: ubuntu-latest
72-
needs: [checkExecution, test]
73-
# only execute if not skipped by commit message
74-
if: needs.checkExecution.outputs.shouldExecute == 'true'
46+
permissions:
47+
contents: write
48+
packages: write
49+
needs: test
7550
steps:
7651
# checkout branch
7752
- name: Checkout
78-
uses: actions/checkout@v4
53+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd #v5.0.1
7954
with:
8055
# 0 indicates all history, because publish requires tag information
8156
fetch-depth: 0
82-
# we need privileged access to publish to protected branch
83-
token: ${{ secrets.GH_TOKEN_PUBLIC_REPO }}
8457
# setup node and dependency cache
8558
- name: Setup Node and NPM Cache
86-
uses: actions/setup-node@v4
59+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
8760
with:
8861
node-version-file: .nvmrc
8962
cache: 'npm'
@@ -105,11 +78,9 @@ jobs:
10578
# publish
10679
- name: Publish
10780
run: |
108-
npm config set //npm.pkg.github.com/:_authToken=$REGISTRY_TOKEN
81+
npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}
10982
git config user.email "actions@github.com"
11083
git config user.name "Github Actions"
11184
npm run publish-libs
11285
env:
11386
GITHUB_CONTEXT: ${{ toJson(github) }}
114-
REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115-
GH_TOKEN: ${{ secrets.GH_TOKEN_PUBLIC_REPO }} # necessary for publish-libs script

.lintstagedrc.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/jod
1+
lts/krypton

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,43 @@
22

33
Public helper packages with commonly used utilities / helpers.
44

5+
<div align="center">
6+
<img src="https://www.shiftcode.ch/assets/svg/logo_shiftcode.svg" width="216" alt="shiftcode logo" />
7+
</div>
8+
9+
> [![@shiftcode/airtable-mapper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fairtable-mapper%2Fpackage.json&label=%40shiftcode%2Fairtable-mapper)](packages/airtable-mapper) \
10+
> interfaces and classes for airtable mapping
11+
12+
> [![@shiftcode/airtable-syncer](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fairtable-syncer%2Fpackage.json&label=%40shiftcode%2Fairtable-syncer)](packages/airtable-syncer) \
13+
> base utils and services to export airtable and upload to S3
14+
515
> [![@shiftcode/branch-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fbranch-utilities%2Fpackage.json&label=%40shiftcode%2Fbranch-utilities)](packages/branch-utilities) \
616
> functions to read information about the current branch either locally or inside Github actions.
717
18+
> [![@shiftcode/cdk-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fcdk-utilities%2Fpackage.json&label=%40shiftcode%2Fcdk-utilities)](packages/cdk-utilities) \
19+
> Constructs for iac with aws-cdk-lib
20+
821
> [![@shiftcode/eslint-config-recommended](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-config-recommended%2Fpackage.json&label=%40shiftcode%2Feslint-config-recommended)](packages/eslint-config-recommended) \
922
> Our recommended config for eslint. We provide two versions, one for usage in node projects and one for Angular.
1023
1124
> [![@shiftcode/eslint-plugin-rules](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Feslint-plugin-rules%2Fpackage.json&label=%40shiftcode%2Feslint-plugin-rules)](packages/eslint-plugin-rules) \
1225
> Contains some custom es lint rules. Those are used in our recommended eslint config.
1326
27+
> [![@shiftcode/logger](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Flogger%2Fpackage.json&label=%40shiftcode%2Flogger)](packages/logger)\
28+
> A logging library configurable with different/multiple transports for your needs.
29+
30+
> [![@shiftcode/inversify-logger](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Finversify-logger%2Fpackage.json&label=%40shiftcode%2Finversify-logger)](packages/inversify-logger)\
31+
> Inversify LogTransport to use with the @shiftcode/logger package.
32+
33+
> [![@shiftcode/iac-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fiac-utilities%2Fpackage.json&label=%40shiftcode%2Fiac-utilities)](packages/iac-utilities)\
34+
> scripts and util functions for aws iac
35+
36+
> [![@shiftcode/lambda-utilities](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Flambda-utilities%2Fpackage.json&label=%40shiftcode%2Flambda-utilities)](packages/lambda-utilities)\
37+
> Utils for lambda functions
38+
39+
> [![@shiftcode/nest-logger](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fnest-logger%2Fpackage.json&label=%40shiftcode%2Fnest-logger)](packages/nest-logger)\
40+
> NestJS LogTransport to use with the @shiftcode/logger package.
41+
1442
> [![@shiftcode/publish-helper](https://img.shields.io/github/package-json/v/shiftcode/sc-commons-public?filename=packages%2Fpublish-helper%2Fpackage.json&label=%40shiftcode%2Fpublish-helper)](packages/publish-helper)\
1543
> scripts to prepare and publish libs inside mono-repos with lerna
1644
@@ -69,3 +97,11 @@ Polyfill can be found here: https://www.npmjs.com/package/regexp-match-indices.
6997

7098
For modern browsers the latest fully supported version is `es2023` (see [can-i-use](https://caniuse.com/?search=es2023))
7199
which therefore is the target for `@shiftcode/utilities` package (see [package README](./packages/utilities/README.md)).
100+
101+
## Utility commands:
102+
103+
Clean up all `dist` folders:
104+
105+
```bash
106+
find ./packages -type d -name "dist" -exec rm -rf {} +
107+
```

commitlint.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @see https://commitlint.js.org/reference/configuration.html
3+
* @type { import('@commitlint/types').UserConfig }
4+
*/
5+
const config = {
6+
extends: ['@commitlint/config-conventional'],
7+
rules: {
8+
'header-max-length': [2, 'always', 100],
9+
},
10+
}
11+
12+
export default config

lint-staged.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @see https://github.com/lint-staged/lint-staged?tab=readme-ov-file#typescript
3+
* @type { import('lint-staged').Configuration }
4+
*/
5+
const config = {
6+
'package.json': ['npx sort-package-json'],
7+
'*': ['npx prettier --write --ignore-unknown'],
8+
}
9+
10+
export default config

0 commit comments

Comments
 (0)