Skip to content

Commit

Permalink
Merge pull request project-chip#1 from sammachin/open-source
Browse files Browse the repository at this point in the history
  • Loading branch information
woody-apple authored Sep 21, 2023
2 parents 3ddeb29 + bc8c4d2 commit 18d7e84
Show file tree
Hide file tree
Showing 180 changed files with 37,907 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/typescript-node
{
"name": "Frontend: CHIP Test Harness",
"build": {
"dockerfile": "../Dockerfile",
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// The optional 'workspaceFolder' property is the path VS Code should open by default when
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
"workspaceFolder": "/app",

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-tslint-plugin",
"msjsdiag.debugger-for-chrome",
"Angular.ng-template",
"ms-vscode.vscode-typescript-tslint-plugin",
"esbenp.prettier-vscode",
"mikael.angular-beastcode",
"cyrilletuzi.angular-schematics",
"angular.ng-template"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [4200],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "npm install"
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
214 changes: 214 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"./tsconfig.json"
]
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"@angular-eslint/eslint-plugin",
"@typescript-eslint"
],
"rules": {
"@angular-eslint/component-class-suffix": "error",
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-class-suffix": "error",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/no-host-metadata-property": "error",
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-inputs-metadata-property": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/no-outputs-metadata-property": "error",
"@angular-eslint/use-lifecycle-interface": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": [
"error",
2
],
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": "error",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": [
"error",
{
"ignoreParameters": true
}
],
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"brace-style": [
"error",
"1tbs"
],
"constructor-super": "error",
"curly": "error",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "error",
"id-blacklist": "off",
"id-match": "off",
"indent": [
"error",
2
],
"max-len": [
"error",
{
"code": 140
}
],
"no-bitwise": "error",
"no-caller": "error",
"no-console": [
"error",
{
"allow": [
"log",
"warn",
"dir",
"timeLog",
"assert",
"clear",
"count",
"countReset",
"group",
"groupEnd",
"table",
"dirxml",
"error",
"groupCollapsed",
"Console",
"profile",
"profileEnd",
"timeStamp",
"context"
]
}
],
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new": "error",
"no-new-wrappers": "error",
"no-restricted-imports": "error",
"no-labels": "error",
"no-shadow": "error",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unused-expressions": "error",
"no-unused-labels": "error",
"no-use-before-define": "error",
"no-var": "error",
"no-irregular-whitespace": "error",
"prefer-const": "error",
"quotes": [
"error",
"single"
],
"object-curly-spacing": [
"error",
"always"
],
"radix": "error",
"semi": "error",
"spaced-comment": [
"error",
"always",
{
"markers": [
"/"
]
}
],
"valid-typeof": "error"
}
}
// the following rules from tslint can't be find on eslint rules
// member-ordering
// no-inputs-metadata-property
// no-outputs-metadata-property
// no-host-metadata-property
// no-input-rename
// no-output-rename
// use-lifecycle-interface
// use-pipe-transform-interface
// component-class-suffix
// directive-class-suffix
// no-access-missing-member
// templates-use-public
// invoke-injectable
29 changes: 29 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, 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:
- develop
pull_request:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build --if-present
24 changes: 24 additions & 0 deletions .github/workflows/npm-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: npm linting
on:
push:
branches:
- develop
pull_request:
branches:
- develop

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: setup-node
uses: actions/setup-python@v1
with:
node-version: 14.x
- name: Install Dependencies
run: |
npm install
- name: Code Linting
run: |
npm run lint
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
39 changes: 39 additions & 0 deletions .pullapprove.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

version: 3

# https://developer.github.com/v3/previews/#draft-pull-requests
github_api_version: "shadow-cat-preview"

pullapprove_conditions:
- "base.ref == 'develop'"

############################################################
# Notifications
############################################################

notifications:
############################################################
# New contributors
############################################################
- when: pull_request.opened
if: "author_association == 'FIRST_TIME_CONTRIBUTOR'"
comment: |
Hey @{{ author }}, thanks for the PR! The review will start once
the tests and CI checks have passed. If they don't, please review
the logs and try to fix the issues (ask for help if you can't
figure it out). A reviewer will be assigned once the tests are
passing and they'll walk you through getting the PR finished
and merged.
groups:
############################################################
# Shared Reviewer Groups
############################################################
dev-team-reviewers:
conditions:
- files.include('*')
reviewers:
teams: [test-harness-devs]
reviews:
request: 2
required: 2
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"angular.ng-template",
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [

]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// 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": [
{
"command": "npm start",
"name": "Run npm start",
"request": "launch",
"type": "node-terminal"
},
{
"type": "pwa-chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
Loading

0 comments on commit 18d7e84

Please sign in to comment.