Skip to content

Commit

Permalink
Update to new template
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Nov 16, 2021
1 parent 7371c4b commit 0a60ff1
Show file tree
Hide file tree
Showing 26 changed files with 4,225 additions and 993 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
116 changes: 116 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
root: true

extends:
- plugin:node/recommended
- plugin:github/recommended
- plugin:promise/recommended
- plugin:regexp/recommended
- plugin:array-func/recommended
- plugin:optimize-regex/recommended
- plugin:import/recommended
- plugin:unicorn/recommended
- plugin:security/recommended
- plugin:sonarjs/recommended
- xo
- prettier

plugins:
- node
- github
- promise
- regexp
- array-func
- optimize-regex
- no-constructor-bind
- import
- unicorn
- security
- no-secrets
- sonarjs
- notice

parser: '@typescript-eslint/parser'

parserOptions:
ecmaVersion: 2020
project: './tsconfig.json'

overrides:
- files: '*.ts'
extends:
- plugin:github/typescript
- plugin:import/typescript
- xo-typescript
- prettier
rules:
'@typescript-eslint/naming-convention':
[
error,
{ selector: default, format: [camelCase] },
{ selector: objectLiteralProperty, format: null },
{ selector: typeProperty, format: null },

{
selector: variableLike,
format: [camelCase, UPPER_CASE],
leadingUnderscore: allow,
},
{
selector: parameter,
format: [camelCase],
leadingUnderscore: allow,
},

{
selector: memberLike,
modifiers: [private],
format: [camelCase],
leadingUnderscore: require,
},

{ selector: typeLike, format: [PascalCase] },
]
'@typescript-eslint/restrict-template-expressions': off
'@typescript-eslint/no-shadow': warn

rules:
notice/notice:
- error
- template: |
/**
* @license
* Copyright <%= YEAR %> Qlever LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
onNonMatchingHeader: append
nonMatchingTolerance: 0.7
sonarjs/no-duplicate-string: [warn, 5]
sonarjs/cognitive-complexity: warn
eslint-comments/no-unused-disable: off
import/extensions: off
node/no-unpublished-import: off
spaced-comment: [error, always, markers: [/, //]]
filenames/match-regex: off
unicorn/filename-case: off
i18n-text/no-en: off
eslint-comments/no-use: off
no-secrets/no-secrets: error
no-empty-label: off
no-warning-comments: off
node/no-missing-import: off
import/no-unresolved: off
unicorn/prefer-spread: off
no-constructor-bind/no-constructor-bind: error
no-constructor-bind/no-constructor-state: error
sort-imports: [warn, { allowSeparatedGroups: true }]
22 changes: 10 additions & 12 deletions .github/workflows/build-and-push-services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Parse Ref
id: ref
Expand Down Expand Up @@ -90,14 +90,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
with:
version: latest

Expand Down Expand Up @@ -156,8 +156,7 @@ jobs:
${{ steps.images.outputs.dockerhub }}
${{ steps.images.outputs.ghcr}}
# Don't update latest on prereleases?
flavor:
latest=${{ !!(needs.setup.outputs.release && !needs.setup.outputs.prerelease) }}
flavor: latest=${{ !!(needs.setup.outputs.release && !needs.setup.outputs.prerelease) }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
Expand All @@ -168,7 +167,7 @@ jobs:
type=sha
- name: Build and push images
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Dockerfile
Expand All @@ -182,8 +181,7 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

-
# Temp fix
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
Expand Down Expand Up @@ -217,14 +215,14 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

- name: Find Docker tag for Snyk
id: tag
run: |
# Doesn't like upper case
OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')
# Nameo on DockerHub (Doesn't like upper case)
# Name on DockerHub (Doesn't like upper case)
DOCKER_IMAGE=$(echo ${{ matrix.service }} | tr '[:upper:]' '[:lower:]')
# Name on GHCR
GHCR_IMAGE=ghcr.io/${DOCKER_IMAGE}
Expand Down Expand Up @@ -253,7 +251,7 @@ jobs:
- name: Monitor Service image with Snyk
uses: snyk/actions/docker@master
# Don't break workflow on errros?
# Don't break workflow on errors?
continue-on-error: true
with:
command: container monitor
Expand All @@ -262,7 +260,7 @@ jobs:

- name: Test current Service image with Snyk
uses: snyk/actions/docker@master
# Don't break workflow on errros?
# Don't break workflow on errors?
continue-on-error: true
with:
image: ${{ steps.tag.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2.3.4
uses: actions/checkout@v2.4.0

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package.lock

*.log
.DS_Store
.dccache
tags.*

# TypeScript
dist
Expand All @@ -22,5 +24,5 @@ act/
!.yarn/plugins
!.yarn/versions
.pnp.*
# ignore sdk stuff
# ignore sdk stuff?
.vim
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
19 changes: 19 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"runtimeExecutable": "yarn",
"runtimeArgs": ["node"],
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/dist/index.js",
"preLaunchTask": "npm: build",
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
}
]
}
55 changes: 55 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"search.exclude": {
"tags.*": true,
".dccache": true,
".history": true,
"node_modules": true,
"package.lock": true,
"*.log": true,
".DS_Store": true,
"dist": true,
"*.tsbuildinfo": true,
".actrc": true,
"act": true,
".yarn": true,
".pnp.*": true,
".vim": true,
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.nodePath": ".yarn/sdks",
"files.exclude": {
"tags.*": true,
".dccache": true,
".history": true,
"node_modules": true,
"package.lock": true,
"*.log": true,
".DS_Store": true,
"dist": true,
"*.tsbuildinfo": true,
".actrc": true,
"act": true,
".yarn": true,
".pnp.*": true,
".vim": true
},
"eslint.packageManager": "yarn",
"eslint.useESLintClass": true,
"licenser.author": "Qlever LLC",
"licenser.license": "AL2",
"cSpell.words": [
"ainz",
"buildx",
"codeql",
"cois",
"jobid",
"luxon",
"Snyk",
"sonarjs",
"trellisfw"
]
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [],
"label": "npm: build",
"detail": "yarn build"
}
]
}
631 changes: 0 additions & 631 deletions .yarn/releases/yarn-3.0.0.cjs

This file was deleted.

768 changes: 768 additions & 0 deletions .yarn/releases/yarn-3.1.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"

yarnPath: .yarn/releases/yarn-3.0.0.cjs
yarnPath: .yarn/releases/yarn-3.1.0.cjs
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2021 Qlever LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG NODE_VER=16-alpine
ARG SERVICE=trellisfw/ainz

Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<!--
Copyright 2021 Qlever LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

[![License](https://img.shields.io/github/license/trellisfw/ainz)](LICENSE)
[![Docker Pulls](https://img.shields.io/docker/pulls/trellisfw/ainz)][dockerhub]

Expand Down
14 changes: 14 additions & 0 deletions docker-compose.oada.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
// Copyright 2021 Qlever LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

# Thing for oadadeploy nonsense?
services:
ainz:
Expand Down
Loading

0 comments on commit 0a60ff1

Please sign in to comment.