Skip to content

Commit

Permalink
feat: 2048 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelhenke committed Jan 19, 2024
0 parents commit 8f42886
Show file tree
Hide file tree
Showing 54 changed files with 20,619 additions and 0 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["@commitlint/config-conventional"] }
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig is awesome: http://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{py,java,r,R}]
indent_size = 4

[*.md]
max_line_length = off
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
docs/
dist/
lib-esm/
lib-cjs/
node_modules/
coverage/
53 changes: 53 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"root": true,
"env": {
"browser": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"requireConfigFile": true,
"sourceType": "module"
},
"extends": [
"airbnb-base",
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"@open-wc",
"plugin:lit/recommended",
"plugin:lit-a11y/recommended",
"plugin:sonarjs/recommended",
"plugin:unicorn/recommended",
"plugin:prettier/recommended"
],
"plugins": ["html", "no-only-tests", "no-secrets"],
"rules": {
"import/extensions": "off",
"import/no-unresolved": "off",
"import/prefer-default-export": "off",
"no-console": "off",
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"no-only-tests/no-only-tests": "error",
"no-secrets/no-secrets": "error",
"unicorn/no-array-for-each": "off",
"unicorn/filename-case": [
"error",
{
"cases": {
"kebabCase": true,
"pascalCase": true
}
}
]
},
"settings": {
"import/resolver": {
"alias": {
"map": [["@", "./src"]],
"extensions": [".ts", ".js", ".jsx", ".json"]
}
}
}
}
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
# Fetch and update latest `npm` packages
- package-ecosystem: npm
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- manuelhenke
commit-message:
prefix: fix
prefix-development: chore
include: scope
# Fetch and update latest `github-actions` pkgs
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: daily
time: '00:00'
open-pull-requests-limit: 10
reviewers:
- manuelhenke
commit-message:
prefix: ci
include: scope
98 changes: 98 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: 'Continuous Integration'

on:
push:
branches: ['main']
paths-ignore:
- '.husky/**'
- '.gitignore'
- 'LICENSE'
- 'README.md'
pull_request:
branches: ['main']
paths-ignore:
- '.husky/**'
- '.gitignore'
- 'LICENSE'
- 'README.md'

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4

- name: Setup node env πŸ—
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: npm ci

- name: Build πŸ› 
run: npm run build

- uses: actions/upload-artifact@v3
with:
name: build-bundle
path: dist/
if-no-files-found: error

lint:
name: Lint
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4

- name: Setup node env πŸ—
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: npm ci
- uses: actions/download-artifact@v3
with:
name: build-bundle
path: dist/

- name: Run linter ✨
run: npm run lint

test:
name: Test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4

- name: Setup node env πŸ—
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: npm ci

- uses: actions/download-artifact@v3
with:
name: build-bundle
path: dist/

- name: Run tests πŸ‘€
run: npm run test

- name: Archive code coverage report πŸ’Ύ
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: 'CodeQL'

on:
push:
branches: ['main']
pull_request:
branches: ['main']
schedule:
- cron: '34 20 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['javascript']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# πŸ“š See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
11 changes: 11 additions & 0 deletions .github/workflows/dependabot-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependabot Automation

on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
uses: manuelhenke/.github/.github/workflows/dependabot-automation.yml@main
7 changes: 7 additions & 0 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
uses: manuelhenke/.github/.github/workflows/greetings.yml@main
53 changes: 53 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: release-please

on:
push:
branches: ['main']

jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
upload_url: ${{ steps.release.outputs.upload_url }}
major: ${{ steps.release.outputs.major }}
minor: ${{ steps.release.outputs.minor }}
path: ${{ steps.release.outputs.path }}

steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: node
package-name: 2048-webcomponent

publish:
if: ${{ needs.create-release.outputs.release_created }}
needs: create-release
name: Publish to npm
runs-on: ubuntu-latest
environment:
name: npm
url: https://www.npmjs.com/package/2048-webcomponent

steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4

- name: Setup node env πŸ—
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
run: npm ci

- name: Build πŸ› 
run: npm run build

- name: Publish to npm πŸ“©
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: '35 14 * * *'

jobs:
stale:
uses: manuelhenke/.github/.github/workflows/stale.yml@main
Loading

0 comments on commit 8f42886

Please sign in to comment.