Skip to content

Commit

Permalink
build(devs-infra): refactor structure to be like master (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Mar 3, 2021
1 parent 04c0d32 commit 986b127
Show file tree
Hide file tree
Showing 183 changed files with 9,102 additions and 8,576 deletions.
68 changes: 0 additions & 68 deletions .circleci/config.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
src/build/
src/setup-jest.ts
build/
node_modules/
e2e/
src/setup-jest.ts
coverage/
docs/
.eslintrc.js
Expand Down
108 changes: 81 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,100 @@ module.exports = {
es6: true,
'jest/globals': true,
},
extends: [
'eslint:recommended',
'plugin:jest/recommended',
'plugin:prettier/recommended'
],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
overrides: [
{
"files": ["**/*.ts", "**/*.tsx"],
"extends": [
"eslint:recommended",
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
'plugin:jest/recommended',
'plugin:prettier/recommended'
],
files: ['*.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
ecmaVersion: 2018,
sourceType: 'module',
impliedStrict: true,
ecmaFeatures: {
jsx: true,
},
createDefaultProgram: true,
},
plugins: ['eslint-plugin-prefer-arrow', 'import', 'jsdoc'],
extends: [
'plugin:@angular-eslint/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:import/typescript',
'plugin:prettier/recommended',
],
rules: {
'@typescript-eslint/array-type': [
'error',
{
'default': 'array-simple',
}
],
'@angular-eslint/component-class-suffix': [
'error',
{
'suffixes': [
'Component',
'Container',
]
}
],
'@angular-eslint/component-selector': [
'error',
{
'type': 'element',
'prefix': 'kebab-case',
}
],
'@angular-eslint/directive-selector': [
'error',
{
'type': 'attribute',
'prefix': 'camelCase',
}
],
'@typescript-eslint/comma-spacing': 'error',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-unused-vars': ["error", { "argsIgnorePattern": "^_" }],
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/prefer-ts-expect-error': 'error',
'import/order': [
'error',
{
'alphabetize': {
'order': 'asc',
'caseInsensitive': true,
},
// this is the default order except for added `internal` in the middle
'groups': [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
],
'newlines-between': 'always',
}
],
'object-shorthand': 'error',
'padding-line-between-statements': [
'error',
{ 'blankLine': 'always', 'prev': '*', 'next': 'return' },
],
'prefer-object-spread': 'error',
},
plugins: ['@typescript-eslint', 'jest', 'jsdoc'],
}
},
],
plugins: ['jest', 'jsdoc'],
rules: {
'padding-line-between-statements': [
"error",
{ blankLine: "always", prev: "*", next: "return" }
],
'comma-spacing': 'off',
'no-redeclare': 'off',
'no-shadow': 'off',
'quotes': 'off',
},
settings: {},
}
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
# the repo. Unless a later match takes precedence,
# @global-owner1 and @global-owner2 will be requested for
# review when someone opens a pull request.
* @thymikee
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
schedule:
interval: 'daily'
reviewers:
- 'ahnpnl'
- 'wtho'
commit-message:
prefix: 'build(deps-dev)'
86 changes: 86 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

lint-and-typecheck:
name: Running ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ubuntu-latest-node-12.x-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
ubuntu-latest-node-12.x-yarn-
- uses: actions/setup-node@v2.1.2
with:
node-version: 12.x
- name: install
run: yarn
- name: build
run: yarn build
- name: run eslint
run: yarn lint

test:
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- name: Set git config
shell: bash
run: |
git config --global core.autocrlf false
git config --global core.symlinks true
if: runner.os == 'Windows'
- uses: actions/checkout@v2
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node-version }}
- name: install
run: yarn
- name: build
run: yarn build
- name: run unit tests with CommomJS
run: yarn test:ci
- name: run e2e tests
run: yarn test:e2e
env:
CI: true

0 comments on commit 986b127

Please sign in to comment.