Browse Source

typescript configuration

master
Youen Toupin 3 years ago
parent
commit
aea4314d82
  1. 3
      .gitignore
  2. 3
      simulator/build.sh
  3. 14
      simulator/package-lock.json
  4. 21
      simulator/package.json
  5. 3
      simulator/src/test.ts
  6. 11
      simulator/src/tsconfig.json
  7. 7
      simulator/www/simulator.html

3
.gitignore vendored

@ -179,4 +179,5 @@ local.properties
# Uncomment this line if you wish to ignore the project description file. # Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations: # Typically, this file would be tracked if it contains build/dependency configurations:
#.project #.project
/simulator/www/simulator.js
*.js.map

3
simulator/build.sh

@ -0,0 +1,3 @@
#!/bin/bash
cd src
../node_modules/typescript/bin/tsc

14
simulator/package-lock.json generated

@ -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
}
}
}

21
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"
}

3
simulator/src/test.ts

@ -0,0 +1,3 @@
document.addEventListener("DOMContentLoaded", function() {
document.getElementById('test').innerText = "Hello world!";
});

11
simulator/src/tsconfig.json

@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "system",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"outFile": "../www/simulator.js",
"sourceMap": true
},
"include": ["./**/*"]
}

7
simulator/www/simulator.html

@ -0,0 +1,7 @@
<html>
<body>
<p id="test"></p>
<script type="text/javascript" src="simulator.js"></script>
</body>
</html>
Loading…
Cancel
Save