Move all to webapp.

This commit is contained in:
Paulo Gustavo Veiga 2020-12-06 16:31:48 -08:00
parent 496455d1ea
commit e8d38678c7
38 changed files with 111 additions and 328 deletions

View File

@ -1,50 +0,0 @@
{
"name": "@wisemapping/login",
"version": "0.1.3",
"main": "app.jsx",
"scripts": {
"start": "webpack serve",
"build": "webpack --mode production",
"lint": "eslint src"
},
"repository": "http://www.wisemapping.com",
"author": "Paulo Veiga <pveiga@gmail.com>, Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>",
"license": "MIT",
"private": false,
"devDependencies": {
"@babel/preset-env": "^7.12.7",
"@babel/preset-react": "^7.12.7",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"babel-loader": "^8.2.2",
"brotli-webpack-plugin": "^1.1.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.1",
"eslint": "^7.14.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"html-webpack-plugin": "^4.5.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2",
"url-loader": "^4.1.1",
"webpack": "^5.6.0",
"webpack-bundle-analyzer": "^4.2.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"axios": "^0.21.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-google-recaptcha": "^2.1.0",
"react-intl": "^5.10.6",
"react-router-dom": "^5.2.0"
}
}

View File

@ -1,15 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import App from './app';
import { BrowserRouter as Router } from 'react-router-dom';
function bootstrapApplication() {
ReactDOM.render(
<Router>
<App />
</Router>,
document.getElementById('root') as HTMLElement
)
}
bootstrapApplication()

View File

@ -1,12 +0,0 @@
{
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"module": "commonjs",
"target": "es5",
"jsx": "react",
"allowJs": true,
"esModuleInterop": true
}
}

View File

@ -1,60 +0,0 @@
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
entry: {
app: path.join(__dirname, 'src', 'index.tsx')
},
target: 'web',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: '/node_modules/'
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
},
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [{
loader: 'file-loader',
options: {
esModule: false,
}
}, ],
}
]
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public/index.html')
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.PUBLIC_URL': 'http://localhost:3000'
})
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 3000,
hot: true
}
}

View File

@ -1,5 +0,0 @@
{
"plugins": [
"@babel/plugin-transform-runtime"
]
}

View File

@ -1 +0,0 @@
declare module '@wisemapping/login'; //FIXME: temporal hasta pasarlo a ts

View File

@ -1,13 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Wisemapping</title>
</head>
<body>
<!-- React app root element -->
<div id="root"></div>
</body>
</html>

View File

@ -1,49 +1,50 @@
{
"name": "@wisemapping/webapp",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "webpack serve",
"build": "webpack --mode production",
"lint": "eslint src"
},
"repository": "http://www.wisemapping.com",
"author": "Paulo Veiga <pveiga@gmail.com>, Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>",
"license": "MIT",
"private": false,
"devDependencies": {
"@babel/preset-env": "^7.12.7",
"@babel/preset-react": "^7.12.7",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"babel-loader": "^8.2.2",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.1",
"eslint": "^7.14.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"html-webpack-plugin": "^4.5.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2",
"url-loader": "^4.1.1",
"webpack": "^5.6.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"@types/styled-components": "^5.1.4",
"@wisemapping/editor": "1.0.0",
"@wisemapping/login": "0.1.3",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router-dom": "^5.2.0",
"styled-components": "^5.2.1"
}
}
"name": "@wisemapping/webapp",
"version": "0.1.3",
"main": "app.jsx",
"scripts": {
"start": "webpack serve",
"build": "webpack --mode production",
"lint": "eslint src"
},
"repository": "http://www.wisemapping.com",
"author": "Paulo Veiga <pveiga@gmail.com>, Ezequiel Bergamaschi <ezequielbergamaschi@gmail.com>",
"license": "MIT",
"private": false,
"devDependencies": {
"@babel/preset-env": "^7.12.7",
"@babel/preset-react": "^7.12.7",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-router-dom": "^5.1.6",
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"babel-loader": "^8.2.2",
"brotli-webpack-plugin": "^1.1.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^5.0.1",
"eslint": "^7.14.0",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"html-webpack-plugin": "^4.5.0",
"sass-loader": "^10.1.0",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"ts-loader": "^8.0.11",
"ts-node": "^9.0.0",
"typescript": "^4.1.2",
"url-loader": "^4.1.1",
"webpack": "^5.6.0",
"webpack-bundle-analyzer": "^4.2.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0"
},
"dependencies": {
"axios": "^0.21.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-google-recaptcha": "^2.1.0",
"react-intl": "^5.10.6",
"react-router-dom": "^5.2.0"
}
}

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -1,46 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { createGlobalStyle } from 'styled-components';
import {
Switch,
Route,
Link,
BrowserRouter as Router,
} from "react-router-dom";
import Editor from '@wisemapping/editor';
import Login from '@wisemapping/login';
import App from './app';
import { BrowserRouter as Router } from 'react-router-dom';
const GlobalStyle = createGlobalStyle`
body {
margin: 0;
}
`;
const Component = () => (
<React.Fragment>
function bootstrapApplication() {
ReactDOM.render(
<Router>
<GlobalStyle />
<Switch>
<Route path="/login">
<Login />
</Route>
<Route path="/editor">
<Editor />
</Route>
<Route path="/">
<ul>
<li>
<Link to='/login'>/login</Link>
</li>
<li>
<Link to='/editor'>/editor</Link>
</li>
</ul>
</Route>
</Switch>
</Router>
<App />
</Router>,
document.getElementById('root') as HTMLElement
)
}
</React.Fragment>
);
ReactDOM.render(<Component />, document.querySelector('#root'));
bootstrapApplication()

View File

@ -7,6 +7,6 @@
"target": "es5",
"jsx": "react",
"allowJs": true,
"esModuleInterop": true
"esModuleInterop": true
}
}

View File

@ -4,88 +4,57 @@ const webpack = require('webpack');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
mode: 'development',
devtool: 'eval-source-map',
entry: {
app: [path.join(__dirname, 'src', 'index.tsx')]
},
target: 'web',
resolve: {
extensions: ['.ts', '.tsx', '.js']
},
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: '/node_modules/'
},
{
test: /\.jsx?$/,
exclude: '/node_modules/',
resolve: {
extensions: [".js", ".jsx"]
},
use: {
loader: 'babel-loader',
options: {
presets: [
[
"@babel/preset-env",
{
"targets": {
"esmodules": true
}
}
],
'@babel/preset-react',
],
}
},
},
{
test: /\.svg$/,
exclude: /\.x.svg$/,
loader: 'svg-url-loader',
},
mode: 'development',
devtool: 'eval-source-map',
entry: {
app: path.join(__dirname, 'src', 'index.tsx')
},
target: 'web',
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx']
},
module: {
rules: [
// Inline PNGs in Base64 if it is smaller than 10KB; otherwise, emmit files using file-loader.
{
test: /\.png$/,
loader: 'url-loader',
options: { mimetype: 'image/png', limit: 10000, name: '[name]-[hash:6].[ext]' },
},
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: '/node_modules/'
},
{
test: /\.css$/,
use: ["style-loader", "css-loader"]
// Style loader
{
test: /\.css$/i,
use: [{
loader: 'style-loader',
}, {
loader: 'css-loader',
}],
},
},
{
test: /\.(png|jpe?g|gif|svg)$/,
use: [{
loader: 'file-loader',
options: {
esModule: false,
}
}, ],
}
]
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist')
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'public/index.html')
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
'process.env.PUBLIC_URL': 'http://localhost:3000'
})
],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
template: path.join(__dirname, 'index.html')
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
}),
],
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 9000,
hot: true,
historyApiFallback: true,
}
}
devServer: {
contentBase: path.join(__dirname, 'dist'),
compress: true,
port: 3000,
hot: true
}
}