diff --git a/packages/lesspass-web-component/.gitignore b/packages/lesspass-web-component/.gitignore new file mode 100644 index 0000000..4d29575 --- /dev/null +++ b/packages/lesspass-web-component/.gitignore @@ -0,0 +1,23 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/packages/lesspass-web-component/package.json b/packages/lesspass-web-component/package.json new file mode 100644 index 0000000..39bd957 --- /dev/null +++ b/packages/lesspass-web-component/package.json @@ -0,0 +1,39 @@ +{ + "name": "lesspass-web-component", + "version": "0.1.0", + "private": true, + "dependencies": { + "@testing-library/jest-dom": "^4.2.4", + "@testing-library/react": "^9.3.2", + "@testing-library/user-event": "^7.1.2", + "@types/jest": "^24.0.0", + "@types/node": "^12.0.0", + "@types/react": "^16.9.0", + "@types/react-dom": "^16.9.0", + "react": "^16.13.1", + "react-dom": "^16.13.1", + "react-scripts": "3.4.1", + "typescript": "~3.7.2" + }, + "scripts": { + "start": "react-scripts start", + "build": "react-scripts build", + "test": "react-scripts test", + "eject": "react-scripts eject" + }, + "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" + ] + } +} diff --git a/packages/lesspass-web-component/public/favicon.ico b/packages/lesspass-web-component/public/favicon.ico new file mode 100644 index 0000000..9c83c73 Binary files /dev/null and b/packages/lesspass-web-component/public/favicon.ico differ diff --git a/packages/lesspass-web-component/public/index.html b/packages/lesspass-web-component/public/index.html new file mode 100644 index 0000000..b75a22d --- /dev/null +++ b/packages/lesspass-web-component/public/index.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + LessPass + + + +
+ + + diff --git a/packages/lesspass-web-component/public/logo192.png b/packages/lesspass-web-component/public/logo192.png new file mode 100644 index 0000000..db188e5 Binary files /dev/null and b/packages/lesspass-web-component/public/logo192.png differ diff --git a/packages/lesspass-web-component/public/logo512.png b/packages/lesspass-web-component/public/logo512.png new file mode 100644 index 0000000..8c6fbf0 Binary files /dev/null and b/packages/lesspass-web-component/public/logo512.png differ diff --git a/packages/lesspass-web-component/public/manifest.json b/packages/lesspass-web-component/public/manifest.json new file mode 100644 index 0000000..59301e7 --- /dev/null +++ b/packages/lesspass-web-component/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "LessPass", + "name": "LessPass web component", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#3366cc", + "background_color": "#ffffff" +} diff --git a/packages/lesspass-web-component/public/robots.txt b/packages/lesspass-web-component/public/robots.txt new file mode 100644 index 0000000..b21f088 --- /dev/null +++ b/packages/lesspass-web-component/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: / diff --git a/packages/lesspass-web-component/src/App.css b/packages/lesspass-web-component/src/App.css new file mode 100644 index 0000000..e69de29 diff --git a/packages/lesspass-web-component/src/App.test.tsx b/packages/lesspass-web-component/src/App.test.tsx new file mode 100644 index 0000000..4db7ebc --- /dev/null +++ b/packages/lesspass-web-component/src/App.test.tsx @@ -0,0 +1,9 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import App from './App'; + +test('renders learn react link', () => { + const { getByText } = render(); + const linkElement = getByText(/learn react/i); + expect(linkElement).toBeInTheDocument(); +}); diff --git a/packages/lesspass-web-component/src/App.tsx b/packages/lesspass-web-component/src/App.tsx new file mode 100644 index 0000000..b09ea70 --- /dev/null +++ b/packages/lesspass-web-component/src/App.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +function App() { + return
App
; +} + +export default App; diff --git a/packages/lesspass-web-component/src/index.tsx b/packages/lesspass-web-component/src/index.tsx new file mode 100644 index 0000000..846ed2c --- /dev/null +++ b/packages/lesspass-web-component/src/index.tsx @@ -0,0 +1,11 @@ +import React from "react"; +import ReactDOM from "react-dom"; +import "./index.css"; +import App from "./App"; + +ReactDOM.render( + + + , + document.getElementById("root") +); diff --git a/packages/lesspass-web-component/src/setupTests.ts b/packages/lesspass-web-component/src/setupTests.ts new file mode 100644 index 0000000..74b1a27 --- /dev/null +++ b/packages/lesspass-web-component/src/setupTests.ts @@ -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'; diff --git a/packages/lesspass-web-component/tsconfig.json b/packages/lesspass-web-component/tsconfig.json new file mode 100644 index 0000000..f2850b7 --- /dev/null +++ b/packages/lesspass-web-component/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "dom", + "dom.iterable", + "esnext" + ], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react" + }, + "include": [ + "src" + ] +}