Added a prototype of a Visual Console library

Former-commit-id: 662c61498778a14f1cf6509b38564a19668bf56e
This commit is contained in:
Alejandro Gallardo Escobar 2019-01-30 12:06:35 +01:00
parent 6485de04fd
commit a80372fda8
10 changed files with 4597 additions and 0 deletions

12
visual_console/.eslintrc Normal file
View File

@ -0,0 +1,12 @@
{
"env": {
"browser": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
]
}

24
visual_console/.gitignore vendored Normal file
View File

@ -0,0 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
/dist
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*

View File

@ -0,0 +1,37 @@
{
"name": "pandora-fms-visual-console",
"version": "1.0.0",
"description": "Visual Console",
"scripts": {
"test": "echo \"Not implemented\" && exit 1",
"build": "webpack --mode=production",
"build:dev": "webpack --mode=development",
"build:watch": "webpack --mode=development --watch",
"start": "webpack-dev-server --color --mode=development",
"format": "prettier"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pandorafms/pandorafms.git"
},
"author": "Alejandro Gallardo Escobar <alejandro.gallardo@artica.es>",
"license": "GPL2",
"private": true,
"bugs": {
"url": "https://github.com/pandorafms/pandorafms/issues"
},
"homepage": "https://github.com/pandorafms/pandorafms#readme",
"dependencies": {
"@typescript-eslint/eslint-plugin": "^1.1.1",
"@typescript-eslint/parser": "^1.1.1",
"awesome-typescript-loader": "^5.2.1",
"eslint": "^5.12.1",
"eslint-config-prettier": "^4.0.0",
"eslint-plugin-prettier": "^3.0.1",
"prettier": "^1.16.1",
"typescript": "^3.2.4",
"webpack": "^4.29.0",
"webpack-cli": "^3.2.1",
"webpack-dev-server": "^3.1.14"
}
}

View File

View File

@ -0,0 +1,40 @@
// interface VisualConsoleElement<VCItemProps> extends EventEmitter {
// private itemProps: VCItemProps extends VCGenericItemProps:
// private containerRef: HTMLElement;
// private itemBoxRef: HTMLElement;
// protected elementRef: HTMLElement;
// new (container: HTMLElement, props: VCItemProps): VisualConsoleElement;
// get props (): VCItemProps;
// set props (newProps: VCItemProps): void;
// protected shouldBeUpdated (newProps: VCItemProps): boolean;
// abstract createDomElement (): HTMLElement;
// render (lastProps: VCItemProps): void;
// remove (): void;
// move (x: number, y: number): void;
// resize (width: number, height: number): void;
// }
class EventEmitter {}
type VisualConsoleItemProps = {};
abstract class VisualConsoleItem extends EventEmitter {
private itemProps: VisualConsoleItemProps;
private containerRef: HTMLElement;
private itemBoxRef: HTMLElement;
protected elementRef: HTMLElement;
constructor(container: HTMLElement, props: VisualConsoleItemProps) {
super();
this.containerRef = container;
this.itemProps = props;
}
get props(): VisualConsoleItemProps {
return this.itemProps;
}
}
export default VisualConsoleItem;

View File

@ -0,0 +1,5 @@
function hello(): void {
console.log("Hello world!");
}
const asd: string = "";
hello();

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Page Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="visual-console.bundle.js"></script>
</head>
<body>
This is the body
</body>
</html>

View File

@ -0,0 +1,22 @@
{
"compilerOptions": {
"target": "es5",
"module": "es6",
"strict": true,
"alwaysStrict": true,
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"sourceMap": true,
// "isolatedModules": true,
"noEmit": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"pretty": true
},
"include": ["**/*.ts"],
"exclude": ["node_modules"]
}

View File

@ -0,0 +1,21 @@
module.exports = {
mode: process.env.NODE_ENV,
entry: __dirname + "/src/index.ts",
devtool: "inline-source-map",
module: {
rules: [
{
test: /\.ts$/,
loader: "awesome-typescript-loader"
}
]
},
output: {
path: __dirname + "/dist",
filename: "visual-console.bundle.js"
},
devServer: {
open: true,
contentBase: "static"
}
};

4422
visual_console/yarn.lock Normal file

File diff suppressed because it is too large Load Diff