Skip to content

Commit

Permalink
feat: Project setup
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Lanser <tom@devv.nl>
  • Loading branch information
Tommylans committed Jun 7, 2024
1 parent f5d6d51 commit 5cb9652
Show file tree
Hide file tree
Showing 21 changed files with 477 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: 'Pipeline'

on:
push:
branches: [main]

pull_request:
types: [opened, synchronize]

workflow_dispatch:
inputs:
release-type:
description: 'Type of release (major, minor, patch, alpha)'
required: true
default: alpha
type: choice
options:
- major
- minor
- patch
- alpha

jobs:
continous-integration:
name: 'Continuous Integration'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 9.1.0

- name: Install dependencies
run: pnpm install

- name: Check formatting
run: pnpm check-format:ci

- name: Build
run: pnpm build

- name: Check types
run: pnpm check-types

- name: Test
run: pnpm test

continious-deployment:
if: github.event_name == 'workflow_dispatch'

name: 'Continous Deployment'
runs-on: ubuntu-latest
needs: ['continous-integration']

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
with:
version: 9.1.0

- name: Install dependencies
run: pnpm i

- name: Build
run: pnpm build

- name: Initialise the NPM config
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN

- name: Publish
id: publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
echo ${{ inputs.release-type }}
git config --global user.email "development@animo.id"
git config --global user.name "Animo Development"
if [ ${{ inputs.release-type }} == 'alpha' ]; then
pnpm release prerelease --yes
else
pnpm release ${{ inputs.release-type }} --force-publish --no-private --yes
fi
version=$(node -p "require('./lerna.json').version")
echo "LERNA_VERSION=$version" >> "$GITHUB_OUTPUT"
- name: Create Github Release
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
prerelease: ${{ inputs.release-type == 'alpha' }}
token: ${{ secrets.GH_TOKEN }}
tag_name: v${{ steps.publish.outputs.LERNA_VERSION }}
name: Release v${{ steps.publish.outputs.LERNA_VERSION }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/node_modules
.DS_Store
**/build
*.tgz
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
41 changes: 41 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"files": {
"maxSize": 10000000
},
"formatter": {
"lineWidth": 120,
"indentStyle": "space"
},
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
},
"formatter": {
"semicolons": "asNeeded",
"quoteStyle": "single",
"trailingCommas": "es5",
"lineWidth": 120,
"indentStyle": "space"
}
},
"json": {
"parser": {
"allowComments": true
}
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
}
}
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"npmClient": "pnpm",
"version": "0.1.0",
"exact": true,
"message": "chore(release): %s"
}
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "openid-federation-ts",
"version": "0.1.0",
"description": "",
"main": "src/index.ts",
"keywords": [],
"author": "Animo Solutions",
"license": "(MIT OR Apache-2.0)",
"scripts": {
"clean": "rm -rf **/build",
"clean:deps": "pnpm clean && rm -rf node_modules",
"build": "pnpm -r build",
"biome": "biome",
"check-format": "pnpm biome check .",
"check-format:ci": "pnpm biome ci .",
"check-types": "pnpm build --noEmit",
"format": "pnpm check-format --write",
"test": "pnpm -r test",
"release": "lerna publish --pre-dist-tag alpha"
},
"devDependencies": {
"@biomejs/biome": "1.8.0"
},
"pnpm": {
"overrides": {
"typescript": "~5.3.2"
}
}
}
14 changes: 14 additions & 0 deletions packages/openid-federation-fetch/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@animo-id/openid-federation-fetch",
"version": "0.1.0",
"description": "The fetch implementation that is being used for the OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-fetch/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
15 changes: 15 additions & 0 deletions packages/openid-federation-policies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "@animo-id/openid-federation-policies",
"version": "0.1.0",
"private": true,
"description": "This will contain the common policies for the OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-policies/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
14 changes: 14 additions & 0 deletions packages/openid-federation-registry-policies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@animo-id/openid-federation-registry-policies",
"version": "0.1.0",
"description": "This will contain the registry policies for the OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-registry-policies/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
14 changes: 14 additions & 0 deletions packages/openid-federation-registry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@animo-id/openid-federation-registry",
"version": "0.1.0",
"description": "This will contain the registry builder for OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-registry/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
14 changes: 14 additions & 0 deletions packages/openid-federation-resolver-policies/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@animo-id/openid-federation-resolver-policies",
"version": "0.1.0",
"description": "This will contain the resolver policies for the OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-resolver-policies/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
14 changes: 14 additions & 0 deletions packages/openid-federation-resolver/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@animo-id/openid-federation-resolver",
"version": "0.1.0",
"description": "This will contain the resolver for the OpenID Federation",
"main": "src/index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "Animo Solutions",
"devDependencies": {
"typescript": "*"
}
}
7 changes: 7 additions & 0 deletions packages/openid-federation-resolver/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
}
}
Loading

0 comments on commit 5cb9652

Please sign in to comment.