Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Jul 16, 2021
1 parent 58bef3f commit 11605b3
Show file tree
Hide file tree
Showing 27 changed files with 18,599 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
public
coverage
src/serviceWorker.js
cypress/integration/examples
53 changes: 53 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"extends": ["react-app", "airbnb", "prettier"],
"plugins": ["import", "jsx-a11y", "react"],
"env": {
"browser": true,
"node": true,
"mocha": true,
"jest": true
},
"globals": {
"cy": true,
"Cypress": true
},
"parser": "babel-eslint",
"rules": {
"no-underscore-dangle": [
"error",
{
"allow": ["_id", "__REDUX_DEVTOOLS_EXTENSION__"]
}
],
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["to", "hrefLeft", "hrefRight"],
"aspects": ["noHref", "invalidHref", "preferButton"]
}
],
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx"]
}
],
"import/no-named-as-default": 0,
"react/static-property-placement": [
"error",
"property assignment",
{
"childContextTypes": "static public field",
"contextTypes": "static public field",
"contextType": "static public field",
"defaultProps": "static public field",
"displayName": "static public field",
"propTypes": "static public field"
}
],
"react/state-in-constructor": ["error", "never"],
"no-console": [1, { "allow": ["error"] }],
"no-restricted-syntax": "off"
}
}
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
/.pnp
.pnp.js

# production
/build
/dist

# misc
.DS_Store

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# environment files but not encrypted ones
.env*
!.env.*.encrypted

# cache
.eslintcache

# testing and coverage
cypress/screenshots
cypress/videos
/.nyc_output
/coverage


# jetbrains
.idea
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}
34 changes: 34 additions & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "test",
"section": "Tests"
},
{
"type": "build",
"section": "Build System"
},
{
"type": "docs",
"section": "Documentation"
},
{
"type": "ci",
"section": "Continuous Integration"
},
{
"type": "chore",
"section": "Chores",
"hidden": true
}
]
}

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Graasp Chatbox
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
5 changes: 5 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

It is linked to the @graasp/ui package in the parent directory for development purposes.

You can run `yarn install` and then `yarn start` to test your package.
48 changes: 48 additions & 0 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "graasp-chatbox-example",
"homepage": ".",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"dependencies": {
"@graasp/ui": "link:..",
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@material-ui/lab": "4.0.0-alpha.58",
"@testing-library/jest-dom": "link:../node_modules/@testing-library/jest-dom",
"@testing-library/react": "link:../node_modules/@testing-library/react",
"@testing-library/user-event": "link:../node_modules/@testing-library/user-event",
"@types/jest": "link:../node_modules/@types/jest",
"@types/node": "link:../node_modules/@types/node",
"@types/react": "link:../node_modules/@types/react",
"@types/react-dom": "link:../node_modules/@types/react-dom",
"immutable": "4.0.0-rc.12",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-scripts": "3.4.3",
"typescript": "link:../node_modules/typescript"
},
"devDependencies": {
"@babel/plugin-syntax-object-rest-spread": "^7.8.3"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
Binary file added example/public/favicon.ico
Binary file not shown.
48 changes: 48 additions & 0 deletions example/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />

<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Graasp Chatbox</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>

<div id="root"></div>

<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
15 changes: 15 additions & 0 deletions example/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"short_name": "graasp-ui",
"name": "graasp-ui",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
9 changes: 9 additions & 0 deletions example/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
ReactDOM.unmountComponentAtNode(div);
});
10 changes: 10 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React from 'react'
import Chatbox from '@graasp/ui'
// import '@graasp/ui/dist/index.css'

const App = () => {

return <Chatbox />
}

export default App
14 changes: 14 additions & 0 deletions example/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
7 changes: 7 additions & 0 deletions example/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import './index.css';

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';

ReactDOM.render(<App />, document.getElementById('root'));
1 change: 1 addition & 0 deletions example/src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="react-scripts" />
5 changes: 5 additions & 0 deletions example/src/setupTests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect'
38 changes: 38 additions & 0 deletions example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"compilerOptions": {
"outDir": "dist",
"module": "esnext",
"lib": [
"dom",
"esnext"
],
"moduleResolution": "node",
"jsx": "react",
"sourceMap": true,
"declaration": true,
"esModuleInterop": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"allowSyntheticDefaultImports": true,
"target": "es5",
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": [
"src"
],
"exclude": [
"node_modules",
"build"
]
}
Loading

0 comments on commit 11605b3

Please sign in to comment.