Skip to content

Commit

Permalink
chore: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolongol committed Aug 6, 2024
0 parents commit 7ec7346
Show file tree
Hide file tree
Showing 253 changed files with 50,139 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {}
}
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
max_line_length = 87

[*.md]
max_line_length = off
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
/libs/common-ui/webviewer/src/assets/webviewer/**/*
129 changes: 129 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx"],
"extends": ["plugin:prettier/recommended"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"plugins": ["unused-imports", "sort-class-members"],
"extends": [
"eslint:recommended",
"plugin:import/recommended",
"plugin:unicorn/recommended"
],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"checkDynamicDependenciesExceptions": [
"@marcolongo.cloud/common-ui/components"
],
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
],
"import/no-extraneous-dependencies": "off",
"import/order": [
"error",
{
"alphabetize": {
"caseInsensitive": false,
"order": "asc"
},
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling", "index"]
],
"newlines-between": "always"
}
],
"no-underscore-dangle": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/prefer-event-target": "off",
"no-unused-vars": "warn",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"sort-class-members/sort-class-members": [
2,
{
"order": [
"[static-properties]",
"[static-methods]",
"[conventional-private-properties]",
"[properties]",
"constructor",
"[methods]",
"[conventional-private-methods]"
],
"accessorPairPositioning": "getThenSet"
}
]
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true,
"project": [
"tsconfig.*?.json",
"apps/*/tsconfig.*?.json",
"libs/*/tsconfig.*?.json"
]
}
}
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript", "plugin:import/typescript"],
"parserOptions": {
"project": [
"tsconfig.*?.json",
"apps/*/tsconfig.*?.json",
"libs/*/tsconfig.*?.json",
"apps/*/.storybook/tsconfig.json",
"libs/*/.storybook/tsconfig.json"
]
},
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
8 changes: 8 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>marcolongol/renovate-config:default.json5",
"github>marcolongol/renovate-config:automerge-minor.json5"
],
"gitAuthor": "marcolongol-bot <166586793+marcolongol-bot[bot]@users.noreply.github.com>"
}
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: CI

on:
push:
branches:
- main
pull_request:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE || 'false' }}

permissions:
actions: read
contents: read

jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: actions/checkout@v4
with:
fetch-depth: 0

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- run: npm ci

- uses: nrwl/nx-set-shas@v4

- run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}

- run: npx nx format:check
- run: npx nx affected -t lint stylelint test build --verbose
85 changes: 85 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: 'Container'

on:
schedule:
# Cron syntax:
# * * * * * *
# ┬ ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │ |
# │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
# │ │ │ │ └────── month (1 - 12)
# │ │ │ └────────── day of month (1 - 31)
# │ │ └─────────────── hour (0 - 23)
# │ └──────────────────── minute (0 - 59)
# └───────────────────────── second (0 - 59) #! optional
- cron: '35 0 * * *' # Run every day at 00:35 UTC
# NOTE: Github Scheduled Actions only run on the default branch!
workflow_dispatch:
inputs:
configuration:
type: choice
description: 'The configuration to use'
required: true
options:
- development
- production
default: 'production'
push:
tags:
- '*'
branches:
- main

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE || 'false' }}
CONFIGURATION: ${{ github.ref_name == 'main' && 'development' || 'production' }}

permissions:
contents: read
packages: write

jobs:
container:
runs-on: ubuntu-latest

steps:
- name: Dump GitHub context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Set up docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: nrwl/nx-set-shas@v4

- name: Build images
run: npx nx affected --target=container --verbose --configuration=${{ env.CONFIGURATION }}
env:
INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json

name: Release

on:
workflow_dispatch:
schedule:
# Cron syntax:
# * * * * * *
# ┬ ┬ ┬ ┬ ┬ ┬
# │ │ │ │ │ |
# │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)
# │ │ │ │ └────── month (1 - 12)
# │ │ │ └────────── day of month (1 - 31)
# │ │ └─────────────── hour (0 - 23)
# │ └──────────────────── minute (0 - 59)
# └───────────────────────── second (0 - 59) #! optional
- cron: '0 0/3 * * *' # Run every 3 hours
# NOTE: Github Scheduled Actions only run on the default branch!

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_SKIP_NX_CACHE: ${{ vars.NX_SKIP_NX_CACHE || 'false' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

permissions:
contents: write
pull-requests: write

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
run: echo "$GITHUB_CONTEXT"
env:
GITHUB_CONTEXT: ${{ toJson(github) }}

- name: Generate Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: '${{ secrets.BOT_APP_ID }}'
private-key: '${{ secrets.BOT_APP_PRIVATE_KEY }}'

- name: Checkout
uses: actions/checkout@v4
with:
token: '${{ steps.app-token.outputs.token }}'
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Install Dependencies
run: npm ci

- name: Setup Git
run: |
git config user.name "marcolongol-bot"
git config user.email "166586793+marcolongol-bot[bot]@users.noreply.github.com"
- name: Version
run: |
npx nx run-many --target=version --verbose --parallel=1 --all
Loading

0 comments on commit 7ec7346

Please sign in to comment.