From aea4314d82dbe24ff13aaf15d75c394860958430 Mon Sep 17 00:00:00 2001 From: Youen Toupin Date: Sat, 2 Oct 2021 12:19:07 +0200 Subject: [PATCH] typescript configuration --- .gitignore | 3 ++- simulator/build.sh | 3 +++ simulator/package-lock.json | 14 ++++++++++++++ simulator/package.json | 21 +++++++++++++++++++++ simulator/src/test.ts | 3 +++ simulator/src/tsconfig.json | 11 +++++++++++ simulator/www/simulator.html | 7 +++++++ 7 files changed, 61 insertions(+), 1 deletion(-) create mode 100755 simulator/build.sh create mode 100644 simulator/package-lock.json create mode 100644 simulator/package.json create mode 100644 simulator/src/test.ts create mode 100644 simulator/src/tsconfig.json create mode 100644 simulator/www/simulator.html diff --git a/.gitignore b/.gitignore index 62bfdb8..2147cb6 100644 --- a/.gitignore +++ b/.gitignore @@ -179,4 +179,5 @@ local.properties # Uncomment this line if you wish to ignore the project description file. # Typically, this file would be tracked if it contains build/dependency configurations: #.project - +/simulator/www/simulator.js +*.js.map diff --git a/simulator/build.sh b/simulator/build.sh new file mode 100755 index 0000000..f4f98ae --- /dev/null +++ b/simulator/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd src +../node_modules/typescript/bin/tsc diff --git a/simulator/package-lock.json b/simulator/package-lock.json new file mode 100644 index 0000000..48a3573 --- /dev/null +++ b/simulator/package-lock.json @@ -0,0 +1,14 @@ +{ + "name": "simulator", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "typescript": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz", + "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==", + "dev": true + } + } +} diff --git a/simulator/package.json b/simulator/package.json new file mode 100644 index 0000000..fc0a48c --- /dev/null +++ b/simulator/package.json @@ -0,0 +1,21 @@ +{ + "name": "simulator", + "version": "1.0.0", + "description": "Vehicle energy consumption and production simulator", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "typescript": "^4.4.3" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [ + "vehicle", + "energy", + "simulator", + "simulation" + ], + "author": "vhelio", + "license": "ISC" +} diff --git a/simulator/src/test.ts b/simulator/src/test.ts new file mode 100644 index 0000000..bfb261d --- /dev/null +++ b/simulator/src/test.ts @@ -0,0 +1,3 @@ +document.addEventListener("DOMContentLoaded", function() { + document.getElementById('test').innerText = "Hello world!"; +}); diff --git a/simulator/src/tsconfig.json b/simulator/src/tsconfig.json new file mode 100644 index 0000000..92316fa --- /dev/null +++ b/simulator/src/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "system", + "noImplicitAny": true, + "removeComments": true, + "preserveConstEnums": true, + "outFile": "../www/simulator.js", + "sourceMap": true + }, + "include": ["./**/*"] +} diff --git a/simulator/www/simulator.html b/simulator/www/simulator.html new file mode 100644 index 0000000..357e01e --- /dev/null +++ b/simulator/www/simulator.html @@ -0,0 +1,7 @@ + + +

+ + + +