Skip to content

Commit 99f5886

Browse files
committed
feat(webchat): initial commit
0 parents  commit 99f5886

22 files changed

+32178
-0
lines changed

.commitlintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": ["@commitlint/config-conventional"],
3+
"rules": {
4+
"type-enum": [2, "always", ["ci", "chore", "docs", "feat", "fix", "perf", "refactor", "revert", "style"]]
5+
}
6+
}

.eslintrc.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* (C) Copyright IBM Corp. 2021.
3+
*
4+
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with
5+
* the License. You may obtain a copy of the License at
6+
*
7+
* https://opensource.org/licenses/MIT
8+
*
9+
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10+
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11+
* specific language governing permissions and limitations under the License.
12+
*
13+
*/
14+
15+
module.exports = {
16+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
17+
parserOptions: {
18+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
19+
sourceType: 'module', // Allows for the use of imports
20+
ecmaFeatures: {
21+
jsx: true, // Allows for the parsing of JSX
22+
},
23+
},
24+
settings: {
25+
react: {
26+
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
27+
},
28+
'import/resolver': {
29+
node: {
30+
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts'],
31+
},
32+
},
33+
},
34+
extends: [
35+
'airbnb',
36+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
37+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
38+
],
39+
plugins: ['jsdoc', 'simple-import-sort'],
40+
rules: {
41+
'no-use-before-define': 'off',
42+
'import/extensions': 'off',
43+
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
44+
},
45+
};

.github/workflows/build-test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support documentation.
4+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
5+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
6+
7+
name: Build and Test
8+
9+
on:
10+
push:
11+
branches: [ '**' ]
12+
pull_request:
13+
branches: [ main ]
14+
15+
# Allows you to run this workflow manually from the Actions tab
16+
workflow_dispatch:
17+
18+
jobs:
19+
build_test:
20+
name: Build and Test on Node ${{ matrix.node-version }} and ${{ matrix.os }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
matrix:
24+
node-version: ['14.x', '16.x']
25+
os: [ubuntu-latest]
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
- name: Set up Node
30+
uses: actions/setup-node@v2
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
- name: Execute build and unit tests
34+
run: |
35+
npm ci
36+
npm run build
37+
npm run test

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support documentation.
4+
# This workflow will download a prebuilt Node version, install dependencies, build and deploy/publish a new release
5+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
6+
7+
name: Deploy and Publish
8+
9+
on:
10+
workflow_run:
11+
workflows: ["Build and Test"]
12+
branches: [ main ]
13+
types:
14+
- completed
15+
16+
# Allows you to run this workflow manually from the Action tab
17+
workflow_dispatch:
18+
19+
jobs:
20+
deploy:
21+
if: "!contains(github.event.head_commit.message, 'skip ci')"
22+
name: Deploy and Publish
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
persist-credentials: false
29+
- name: Set up Node
30+
uses: actions/setup-node@v2
31+
with:
32+
node-version: 14
33+
- name: Install Semantic Release dependencies
34+
run: |
35+
sudo apt-get install bumpversion
36+
npm install -g semantic-release
37+
npm install -g @semantic-release/changelog
38+
npm install -g @semantic-release/exec
39+
npm install -g @semantic-release/git
40+
npm install -g @semantic-release/github
41+
npm install -g @semantic-release/commit-analyzer
42+
npm install -g @semantic-release/release-notes-generator
43+
npm install
44+
- name: Publish to Git Releases and Tags
45+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
48+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
49+
run: npx semantic-release # --dry-run

.gitignore

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
.DS_Store
10+
11+
# Directory for instrumented libs generated by jscoverage/JSCover
12+
lib-cov
13+
14+
# Coverage directory used by tools like istanbul
15+
coverage
16+
*.lcov
17+
18+
# nyc test coverage
19+
.nyc_output
20+
21+
# node-waf configuration
22+
.lock-wscript
23+
24+
# Compiled binary addons (https://nodejs.org/api/addons.html)
25+
build/Release
26+
27+
# Dependency directories
28+
node_modules/
29+
jspm_packages/
30+
31+
# TypeScript v1 declaration files
32+
typings/
33+
34+
# TypeScript cache
35+
*.tsbuildinfo
36+
37+
# Optional npm cache directory
38+
.npm
39+
.npmrc
40+
41+
# Optional eslint cache
42+
.eslintcache
43+
44+
# Output of 'npm pack'
45+
*.tgz
46+
47+
# Yarn Integrity file
48+
.yarn-integrity
49+
50+
# generate output
51+
dist

.husky/commit-msg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm test

.lintstagedrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"src/**/*.+(js,jsx,ts,tsx,json,css,scss,md)": ["eslint"],
3+
}

.npmignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
dist
2+
.babelrc
3+
.storybook
4+
.gitignore
5+
.prettierrc
6+
rollup.config.js
7+
tsconfig.json
8+
.DS_Store

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"singleQuote": true,
3+
"printWidth": 120,
4+
"trailingComma": "all"
5+
}

0 commit comments

Comments
 (0)