-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added bot chatbox component from sprint
- Loading branch information
1 parent
c3be767
commit 716510d
Showing
20 changed files
with
722 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
[*.{html,js,md}] | ||
block_comment_start = /** | ||
block_comment = * | ||
block_comment_end = */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
## editors | ||
/.idea | ||
/.vscode | ||
|
||
## system files | ||
.DS_Store | ||
|
||
## npm | ||
/node_modules/ | ||
/npm-debug.log | ||
|
||
## testing | ||
/coverage/ | ||
|
||
## temp folders | ||
/.tmp/ | ||
|
||
# build | ||
/_site/ | ||
/dist/ | ||
/out-tsc/ | ||
|
||
storybook-static | ||
custom-elements.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
./node_modules/.bin/lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = { | ||
stories: ['../**/dist/stories/*.stories.{js,md,mdx}'], | ||
framework: { | ||
name: '@web/storybook-framework-web-components', | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 chat-box | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# \<chat-box> | ||
|
||
This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i chat-box | ||
``` | ||
|
||
## Usage | ||
|
||
```html | ||
<script type="module"> | ||
import 'chat-box/chat-box.js'; | ||
</script> | ||
|
||
<chat-box></chat-box> | ||
``` | ||
|
||
## Linting and formatting | ||
|
||
To scan the project for linting and formatting errors, run | ||
|
||
```bash | ||
npm run lint | ||
``` | ||
|
||
To automatically fix linting and formatting errors, run | ||
|
||
```bash | ||
npm run format | ||
``` | ||
|
||
## Testing with Web Test Runner | ||
|
||
To execute a single test run: | ||
|
||
```bash | ||
npm run test | ||
``` | ||
|
||
To run the tests in interactive watch mode run: | ||
|
||
```bash | ||
npm run test:watch | ||
``` | ||
|
||
## Demoing with Storybook | ||
|
||
To run a local instance of Storybook for your component, run | ||
|
||
```bash | ||
npm run storybook | ||
``` | ||
|
||
To build a production version of Storybook, run | ||
|
||
```bash | ||
npm run storybook:build | ||
``` | ||
|
||
|
||
## Tooling configs | ||
|
||
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project. | ||
|
||
If you customize the configuration a lot, you can consider moving them to individual files. | ||
|
||
## Local Demo with `web-dev-server` | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
To run a local development server that serves the basic demo located in `demo/index.html` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!doctype html> | ||
<html lang="en-GB"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" /> | ||
<style> | ||
body { | ||
background: #fafafa; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="demo"></div> | ||
|
||
<script type="module"> | ||
import { html, render } from 'lit'; | ||
import '../dist/src/chat-box.js'; | ||
|
||
const header = 'Hello owc World!'; | ||
render( | ||
html` | ||
<chat-box .header=${header}> | ||
some light-dom | ||
</chat-box> | ||
`, | ||
document.querySelector('#demo') | ||
); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"name": "chat-box", | ||
"description": "Webcomponent chat-box following open-wc recommendations", | ||
"license": "MIT", | ||
"author": "chat-box", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"main": "dist/src/index.js", | ||
"module": "dist/src/index.js", | ||
"exports": { | ||
".": "./dist/src/index.js", | ||
"./chat-box.js": "./dist/src/chat-box.js" | ||
}, | ||
"scripts": { | ||
"analyze": "cem analyze --litelement", | ||
"start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"web-dev-server\"", | ||
"build": "tsc && npm run analyze -- --exclude dist", | ||
"prepublish": "tsc && npm run analyze -- --exclude dist", | ||
"lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore", | ||
"format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore", | ||
"prepare": "husky", | ||
"test": "tsc && wtr --coverage", | ||
"test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\"", | ||
"storybook": "tsc && npm run analyze -- --exclude dist && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"storybook dev -p 8080\"", | ||
"storybook:build": "tsc && npm run analyze -- --exclude dist && storybook build" | ||
}, | ||
"dependencies": { | ||
"@material/web": "^1.4.1", | ||
"firebase": "^10.12.0", | ||
"lit": "^3.0.2" | ||
}, | ||
"devDependencies": { | ||
"@custom-elements-manifest/analyzer": "^0.10.2", | ||
"@open-wc/eslint-config": "^12.0.3", | ||
"@open-wc/testing": "^4.0.0", | ||
"@storybook/addon-a11y": "^7.5.3", | ||
"@storybook/addon-essentials": "^7.5.3", | ||
"@storybook/addon-links": "^7.5.3", | ||
"@storybook/web-components": "^7.5.3", | ||
"@types/mocha": "^10.0.6", | ||
"@typescript-eslint/eslint-plugin": "^7.10.0", | ||
"@typescript-eslint/parser": "^7.10.0", | ||
"@web/dev-server": "^0.4.5", | ||
"@web/storybook-builder": "^0.1.16", | ||
"@web/storybook-framework-web-components": "^0.1.2", | ||
"@web/test-runner": "^0.18.2", | ||
"concurrently": "^8.2.2", | ||
"eslint": "^8.57.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"husky": "^9.0.11", | ||
"lint-staged": "^15.2.5", | ||
"prettier": "^3.2.5", | ||
"storybook": "^7.5.3", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.4.5" | ||
}, | ||
"customElements": "custom-elements.json", | ||
"eslintConfig": { | ||
"parser": "@typescript-eslint/parser", | ||
"extends": [ | ||
"@open-wc", | ||
"prettier" | ||
], | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error" | ||
], | ||
"import/no-unresolved": "off", | ||
"import/extensions": [ | ||
"error", | ||
"always", | ||
{ | ||
"ignorePackages": true | ||
} | ||
] | ||
} | ||
}, | ||
"prettier": { | ||
"singleQuote": true, | ||
"arrowParens": "avoid" | ||
}, | ||
"lint-staged": { | ||
"*.ts": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
] | ||
} | ||
} |
Oops, something went wrong.