From 937f5ff9cbfb4167e50717a7aebd8ddc3937ce67 Mon Sep 17 00:00:00 2001 From: Ezequiel Bergamaschi Date: Sat, 5 Dec 2020 02:47:02 -0500 Subject: [PATCH] refactor: support lerna, include @wisemapping/login into webapp --- lerna.json | 8 + package.json | 70 +- packages/editor/index.html | 13 + packages/editor/package.json | 30 + .../editor/src/components/canvas/index.tsx | 8 + .../editor/src/components/canvas/styled.ts | 8 + .../editor/src/components/footer/index.tsx | 8 + .../editor/src/components/footer/styled.ts | 8 + .../editor/src/components/frame/index.tsx | 15 + .../editor/src/components/frame/styled.ts | 8 + .../editor/src/components/top-bar/index.tsx | 8 + .../editor/src/components/top-bar/styled.ts | 8 + packages/editor/src/index.tsx | 3 + packages/editor/src/size.ts | 9 + packages/editor/tsconfig.json | 12 + packages/editor/webpack.config.js | 44 + packages/editor/yarn.lock | 4699 +++++ README.md => packages/login/README.md | 14 +- packages/login/lang/en.json | 60 + {lang => packages/login/lang}/es.json | 0 packages/login/package.json | 57 + {public => packages/login/public}/favicon.ico | Bin {public => packages/login/public}/favicon.png | Bin {public => packages/login/public}/index.html | 0 .../login/public}/manifest.json | 0 {public => packages/login/public}/robots.txt | 0 packages/login/src/Footer.jsx | 28 + packages/login/src/Header.jsx | 57 + .../login/src/LoginPage.jsx | 16 +- .../login/src/RegistrationPage.jsx | 4 +- packages/login/src/app.jsx | 59 + .../login/src}/compiled-lang/en.json | 0 .../login/src}/compiled-lang/es.json | 0 {src => packages/login/src}/css/core.css | 0 {src => packages/login/src}/css/login.css | 0 .../login/src}/css/registration.css | 0 {src => packages/login/src}/favicon.png | Bin .../login/src}/images/header-logo.png | Bin .../login/src}/images/logo-text.svg | 0 packages/login/src/index.jsx | 12 + packages/webapp/.babelrc | 5 + packages/webapp/@types/index.d.ts | 1 + packages/webapp/index.html | 13 + packages/webapp/package.json | 49 + packages/webapp/src/index.tsx | 46 + packages/webapp/tsconfig.json | 12 + packages/webapp/webpack.config.js | 91 + src/App.js | 72 - src/Footer.js | 28 - src/Header.js | 57 - src/index.js | 51 - yarn.lock | 14898 ++++++++++++++++ 52 files changed, 20309 insertions(+), 280 deletions(-) create mode 100644 lerna.json create mode 100644 packages/editor/index.html create mode 100644 packages/editor/package.json create mode 100644 packages/editor/src/components/canvas/index.tsx create mode 100644 packages/editor/src/components/canvas/styled.ts create mode 100644 packages/editor/src/components/footer/index.tsx create mode 100644 packages/editor/src/components/footer/styled.ts create mode 100644 packages/editor/src/components/frame/index.tsx create mode 100644 packages/editor/src/components/frame/styled.ts create mode 100644 packages/editor/src/components/top-bar/index.tsx create mode 100644 packages/editor/src/components/top-bar/styled.ts create mode 100644 packages/editor/src/index.tsx create mode 100644 packages/editor/src/size.ts create mode 100644 packages/editor/tsconfig.json create mode 100644 packages/editor/webpack.config.js create mode 100644 packages/editor/yarn.lock rename README.md => packages/login/README.md (87%) create mode 100644 packages/login/lang/en.json rename {lang => packages/login/lang}/es.json (100%) create mode 100644 packages/login/package.json rename {public => packages/login/public}/favicon.ico (100%) rename {public => packages/login/public}/favicon.png (100%) rename {public => packages/login/public}/index.html (100%) rename {public => packages/login/public}/manifest.json (100%) rename {public => packages/login/public}/robots.txt (100%) create mode 100644 packages/login/src/Footer.jsx create mode 100644 packages/login/src/Header.jsx rename src/LoginPage.js => packages/login/src/LoginPage.jsx (93%) rename src/RegistrationPage.js => packages/login/src/RegistrationPage.jsx (98%) create mode 100644 packages/login/src/app.jsx rename {src => packages/login/src}/compiled-lang/en.json (100%) rename {src => packages/login/src}/compiled-lang/es.json (100%) rename {src => packages/login/src}/css/core.css (100%) rename {src => packages/login/src}/css/login.css (100%) rename {src => packages/login/src}/css/registration.css (100%) rename {src => packages/login/src}/favicon.png (100%) rename {src => packages/login/src}/images/header-logo.png (100%) rename {src => packages/login/src}/images/logo-text.svg (100%) create mode 100644 packages/login/src/index.jsx create mode 100644 packages/webapp/.babelrc create mode 100644 packages/webapp/@types/index.d.ts create mode 100644 packages/webapp/index.html create mode 100644 packages/webapp/package.json create mode 100644 packages/webapp/src/index.tsx create mode 100644 packages/webapp/tsconfig.json create mode 100644 packages/webapp/webpack.config.js delete mode 100644 src/App.js delete mode 100644 src/Footer.js delete mode 100644 src/Header.js delete mode 100644 src/index.js create mode 100644 yarn.lock diff --git a/lerna.json b/lerna.json new file mode 100644 index 00000000..dabb023c --- /dev/null +++ b/lerna.json @@ -0,0 +1,8 @@ +{ + "packages": [ + "packages/*" + ], + "version": "1.0.0", + "npmClient": "yarn", + "useWorkspaces": true +} diff --git a/package.json b/package.json index 1de73120..d5919fdd 100644 --- a/package.json +++ b/package.json @@ -1,57 +1,17 @@ { - "name": "wisemapping-react", - "version": "0.1.4", - "dependencies": { - "@testing-library/jest-dom": "^5.11.6", - "@testing-library/react": "^11.2.2", - "@testing-library/user-event": "^12.2.2", - "axios": "^0.21.0", - "cors": "^2.8.5", - "joi": "^17.3.0", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "react-google-recaptcha": "^2.1.0", - "react-intl": "^5.10.5", - "react-router-dom": "^5.2.0", - "react-scripts": "4.0.1", - "web-vitals": "^0.2.4" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", - "eject": "react-scripts eject", - "extract": "formatjs extract", - "compile": "formatjs compile" - }, - "author": { - "name": "Paulo Veiga", - "login.email": "pveiga@wisemapping.com" - }, - "contributors": [ - "Ezequiel Bergamaschi" - ], - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "homepage": "http://localhost:8080/react", - "license": "https://wisemapping.atlassian.net/wiki/spaces/WS/pages/524357/WiseMapping+Public+License+Version+1.0+WPL", - "devDependencies": { - "@formatjs/cli": "^2.13.14" - } + "name": "wisemapping-react", + "scripts": { + "bootstrap": "lerna bootstrap", + "build": "lerna run build", + "clean": "lerna clean && rm -rf node_modules", + "lint": "lerna run lint", + "test": "lerna run test" + }, + "private": true, + "devDependencies": { + "lerna": "^3.16.4" + }, + "workspaces": [ + "packages/*" + ] } diff --git a/packages/editor/index.html b/packages/editor/index.html new file mode 100644 index 00000000..453c01d8 --- /dev/null +++ b/packages/editor/index.html @@ -0,0 +1,13 @@ + + + + + + Wisemapping + + + + +
+ + diff --git a/packages/editor/package.json b/packages/editor/package.json new file mode 100644 index 00000000..bed76ce5 --- /dev/null +++ b/packages/editor/package.json @@ -0,0 +1,30 @@ +{ + "name": "@wisemapping/editor", + "version": "1.0.0", + "main": "src/index.tsx", + "scripts": { + "lint": "eslint src" + }, + "repository": "http://www.wisemapping.com", + "author": "Paulo Veiga , Ezequiel Bergamaschi ", + "license": "MIT", + "private": false, + "devDependencies": { + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.0", + "@typescript-eslint/eslint-plugin": "^4.8.1", + "@typescript-eslint/parser": "^4.8.1", + "eslint": "^7.14.0", + "eslint-plugin-react": "^7.21.5", + "eslint-plugin-react-hooks": "^4.2.0", + "ts-loader": "^8.0.11", + "ts-node": "^9.0.0", + "typescript": "^4.1.2" + }, + "dependencies": { + "@types/styled-components": "^5.1.4", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "styled-components": "^5.2.1" + } +} diff --git a/packages/editor/src/components/canvas/index.tsx b/packages/editor/src/components/canvas/index.tsx new file mode 100644 index 00000000..d6b06f40 --- /dev/null +++ b/packages/editor/src/components/canvas/index.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import { StyledCanvas } from './styled'; + +const Canvas = () => ( + canvas +); + +export default Canvas; diff --git a/packages/editor/src/components/canvas/styled.ts b/packages/editor/src/components/canvas/styled.ts new file mode 100644 index 00000000..7cc7eb85 --- /dev/null +++ b/packages/editor/src/components/canvas/styled.ts @@ -0,0 +1,8 @@ +import styled from 'styled-components'; + +export const StyledCanvas = styled.div` + height: 100% + width: 100%; + flex: 1; + +`; diff --git a/packages/editor/src/components/footer/index.tsx b/packages/editor/src/components/footer/index.tsx new file mode 100644 index 00000000..765db58d --- /dev/null +++ b/packages/editor/src/components/footer/index.tsx @@ -0,0 +1,8 @@ +import React from 'react'; +import { StyledFooter } from './styled'; + +const Footer = () => ( + footer +); + +export default Footer; diff --git a/packages/editor/src/components/footer/styled.ts b/packages/editor/src/components/footer/styled.ts new file mode 100644 index 00000000..fd557520 --- /dev/null +++ b/packages/editor/src/components/footer/styled.ts @@ -0,0 +1,8 @@ +import styled from 'styled-components'; +import { times } from '../../size'; + +export const StyledFooter = styled.div` + height: ${times(10)}; + width: 100%; + border: 1px solid black; +`; diff --git a/packages/editor/src/components/frame/index.tsx b/packages/editor/src/components/frame/index.tsx new file mode 100644 index 00000000..1f8a8974 --- /dev/null +++ b/packages/editor/src/components/frame/index.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import Footer from '../footer'; +import TopBar from '../top-bar'; +import Canvas from '../canvas'; +import { StyledFrame } from './styled'; + +const Frame = () => ( + + + +