Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
feat: create project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoscna committed Jul 13, 2021
0 parents commit ceb5dad
Show file tree
Hide file tree
Showing 33 changed files with 16,249 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "@sequeljs/omi",
"image": "sequeljs/devcontainer:latest",
"extensions": [
"christian-kohler.npm-intellisense",
"christian-kohler.path-intellisense",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"eg2.vscode-npm-script",
"esbenp.prettier-vscode",
"hbenl.vscode-test-explorer",
"kavod-io.vscode-jest-test-adapter",
"pflannery.vscode-versionlens",
"redhat.vscode-yaml",
"tyriar.sort-lines",
"visualstudioexptteam.vscodeintellicode",
"xyz.local-history"
],
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.npmrc,target=/home/node/.npmrc,type=bind",
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/node/.ssh,type=bind",
"source=sequeljs-omi-vscode,target=/node/.vscode-server/extensions,type=volume",
"source=sequeljs-omi-vscode-insiders,target=/node/.vscode-server-insiders/extensions,type=volume"
],
"postCreateCommand": "npm install",
"remoteUser": "node",
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"workspaceFolder": "/sequeljs/omi",
"workspaceMount": "source=${localWorkspaceFolder},target=/sequeljs/omi,type=bind,consistency=cached"
}
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# See https://editorconfig.org/ for more about editor config settings.

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
36 changes: 36 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
env:
jest: true
extends:
- airbnb-typescript/base
- plugin:@typescript-eslint/eslint-recommended
- plugin:@typescript-eslint/recommended
- prettier
ignorePatterns:
- jest.config.js
parser: '@typescript-eslint/parser'
parserOptions:
project:
- tsconfig.json
- tsconfig.eslint.json
sourceType: module
plugins:
- '@typescript-eslint'
root: true
rules:
'@typescript-eslint/explicit-module-boundary-types':
- off
'@typescript-eslint/no-empty-interface':
- off
'@typescript-eslint/no-explicit-any':
- off
'@typescript-eslint/no-unused-vars':
- error
- argsIgnorePattern: ^_
class-methods-use-this:
- off
import/extensions:
- error
- always
- ignorePackages: true
import/prefer-default-export:
- off
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
commit-message:
prefix: "ci(github-actions): "

- package-ecosystem: npm
directory: /
schedule:
interval: daily
commit-message:
prefix: "chore(dependencies): "
prefix-development: "chore(dev-dependencies): "

- package-ecosystem: docker
directory: /.devcontainer/
schedule:
interval: daily
commit-message:
prefix: "build(docker): "
Empty file added .github/linters/.gitkeep
Empty file.
62 changes: 62 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: build

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
module:
- cjs
- es
- types
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x

- name: Install npm dependencies
run: npm install

- name: Run build
run: npm run build:${{ matrix.module }}

- name: Upload build
uses: actions/upload-artifact@v2.2.4
with:
name: ${{ matrix.module }}
path: ./${{ matrix.module }}/

build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x

- name: Install npm dependencies
run: npm install

- name: Build docs
run: npm run docs:build

- name: Upload docs
uses: actions/upload-artifact@v2.2.4
with:
name: docs
path: ./docs/
29 changes: 29 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: codeql-analysis

on:
push:
branches-ignore:
- 'dependabot/**'
pull_request:
branches:
- main
schedule:
- cron: 0 12 * * 1

jobs:
codeql-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4
with:
fetch-depth: 2

- name: Initialize CodeQL
uses: github/codeql-action/init@v1

- name: Autobuild CodeQL
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v1
29 changes: 29 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: dependabot-automerge

on: pull_request_target

permissions:
contents: write
pull-requests: write

jobs:
dependabot-automerge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Fetch Dependabot metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Auto approve pull request
run: gh pr review --approve "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Auto merge pull request
run: gh pr merge --auto --delete-branch --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
39 changes: 39 additions & 0 deletions .github/workflows/graphs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: graphs

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
graphs:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Install Graphviz
run: sudo apt-get install -y graphviz

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x

- name: Install npm dependencies
run: npm install

- name: Cleanup graphs
run: npm run graphs:clean

- name: Build graphs
run: npm run graphs:build

- name: Upload build
uses: actions/upload-artifact@v2.2.4
with:
name: graphs
path: ./graphs/
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: publish

on:
push:
tags:
- v*.*.*

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x

- name: Install npm dependencies
run: npm install

- name: Run tests
run: npm run test

publish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x
registry-url: https://registry.npmjs.org/
scope: '@sequeljs'

- name: Install npm dependencies
run: npm install

- name: Publish project
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

publish-docs:
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Setup Node.js
uses: actions/setup-node@v2.2.0
with:
node-version: 14.x
registry-url: https://registry.npmjs.org/
scope: '@sequeljs'

- name: Install npm dependencies
run: npm install

- name: Build docs
run: npm run docs:build

- name: Publish docs
uses: peaceiris/actions-gh-pages@v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
25 changes: 25 additions & 0 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: super-linter

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
super-linter:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2.3.4

- name: Run Super-Linter
uses: github/super-linter@v4.3.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_JSON: true
VALIDATE_MD: true
VALIDATE_TYPESCRIPT_ES: true
VALIDATE_YAML: true

0 comments on commit ceb5dad

Please sign in to comment.