Skip to content

Commit

Permalink
Merge pull request #49 from samply/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
MatsJohansen87 authored Feb 8, 2024
2 parents d1c9bb2 + e2be0cf commit 6d34d64
Show file tree
Hide file tree
Showing 68 changed files with 29,148 additions and 61,757 deletions.
38 changes: 38 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc', 'jsdoc'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
'eslint-config-prettier',
'prettier',
"plugin:jsdoc/recommended-typescript-error",
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
extraFileExtensions: ['.svelte'],
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
}
}
],
settings: {
'svelte/typescript': import('typescript'),
},
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'svelte/no-at-html-tags': 'off',
'jsdoc/check-syntax': 2,
"jsdoc/check-param-names": 2,


},
ignorePatterns: ['**/dist/**'],
};
12 changes: 10 additions & 2 deletions .github/workflows/docker-develop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Push Develop Image samply/lens-web-components
name: Build and Push Develop Image samply/lens

on:
push:
Expand All @@ -9,13 +9,21 @@ on:
- develop
jobs:
build:
# Necessary after this repository was renamed from samply/lens-web-components to samply/lens
permissions:
contents: read
packages: write
pull-requests: read
security-events: write
statuses: read
# This workflow defines how a samply docker image is built, tested and published.
# Visit: https://github.com/samply/github-workflows/blob/main/.github/workflows/docker-ci.yml, for more information
uses: samply/github-workflows/.github/workflows/docker-ci.yml@main
with:
image-name: "samply/lens-web-components"
image-name: "samply/lens"
build-args: |
TARGET_ENVIRONMENT=staging
build-platforms: "linux/amd64"
# This passes the secrets from calling workflow to the called workflow
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build and Push Image samply/lens-web-components
name: Build and Push Image samply/lens

on:
push:
branches:
- main
# Build then a new version is tagged
tags:
- '*.*.*'
- 'v*.*.*'
pull_request:
branches:
- main
Expand All @@ -15,13 +15,21 @@ on:
- cron: '0 1 * * *'
jobs:
build:
# Necessary after this repository was renamed from samply/lens-web-components to samply/lens
permissions:
contents: read
packages: write
pull-requests: read
security-events: write
statuses: read
# This workflow defines how a samply docker image is built, tested and published.
# Visit: https://github.com/samply/github-workflows/blob/main/.github/workflows/docker-ci.yml, for more information
uses: samply/github-workflows/.github/workflows/docker-ci.yml@main
with:
image-name: "samply/lens-web-components"
image-name: "samply/lens"
build-args: |
TARGET_ENVIRONMENT=production
build-platforms: "linux/amd64"
# This passes the secrets from calling workflow to the called workflow
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Samply.Lens Github Workflow"
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
- run: npm ci
- name: "Build @samply/lens"
run: npm run build
- name: "Publish @samply/lens"
run: cd dist/ && npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

33 changes: 33 additions & 0 deletions .github/workflows/verify-new-code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Samply.Lens verify new Code"
on:
pull_request:
branches:
- main
- develop
push:
branches:
- develop

jobs:
verify-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm ci
# for now disable code format check, will be activated later
# name: "Check Code Format"
# run: npm run format:check
- name: "Check Security"
run: npm run security:check
# - name: "Verify Commit Messages"
# run: npm run lint:commits
# - name: "Svelte Check"
# run: npm run check
# for now disable linting, will be activated later
# run: npm run lint
22 changes: 22 additions & 0 deletions .github/workflows/verify-new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Samply.Lens verify new Release"
on:
pull_request:
branches:
- main

jobs:
verify-new-release:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git checkout --track origin/main
- run: git checkout --track origin/develop
- name: "Ensure Package Version changed"
run: |
if [ "$(git diff main develop -- package.json | grep version | wc -l)" -eq 0 ]; then \
echo "::error:: Please run `npm run version` before merging to main!"; \
exit 1; \
fi
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run lint
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"tabWidth": 4,
"plugins": [
"prettier-plugin-svelte"
],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
Loading

0 comments on commit 6d34d64

Please sign in to comment.