Reorganize top level directory

This commit is contained in:
2021-01-03 14:43:49 -06:00
parent 9fd36d8d53
commit bebb356425
841 changed files with 0 additions and 0 deletions

6
uhabits-web/.babelrc Normal file
View File

@@ -0,0 +1,6 @@
{
"presets": [
["env", { "modules": false }],
"react"
]
}

34
uhabits-web/Makefile Normal file
View File

@@ -0,0 +1,34 @@
test_bundle := build/test.js
node_modules := node_modules/.bin/mocha
all: $(test_bundle)
$(node_modules):
npm install
core:
cd ../core; ./gradlew --quiet jsMainClasses jsTestClasses
cp ../core/build/classes/kotlin/js/*/*.js node_modules/
mkdir -p build/assets
rsync -a ../core/assets/main/ build/assets/
rsync -a ../core/assets/test/ build/assets/
$(test_bundle): src/test/index.js core
mkdir -p build/lib build/test build/css
npx webpack -d --mode development --target web --output $@ $<
cp src/test/*html build/test
cp node_modules/mocha/mocha.css build/lib
cp node_modules/mocha/mocha.js build/lib
cp node_modules/sql.js/js/sql.js build/lib
cp node_modules/sprintf-js/dist/sprintf.min.js build/lib
serve:
npx serve build/
clean:
rm -rf build
distclean: clean
rm -rf node_modules
.PHONY: test clean distclean core

6080
uhabits-web/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

34
uhabits-web/package.json Normal file
View File

@@ -0,0 +1,34 @@
{
"name": "loop-habit-tracker",
"version": "2.0.0",
"description": "App for creating and maintaining good habits",
"repository": {
"type": "git",
"url": "git@github.com:iSoron/uhabits.git"
},
"main": "index.js",
"scripts": {
"compile": "webpack",
"test": "mocha"
},
"keywords": [],
"author": "",
"license": "GPL-3.0-or-later",
"dependencies": {
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"kotlin": "^1.3.41",
"kotlin-test": "^1.3.41",
"kotlinx-coroutines-core": "^1.2.2",
"sprintf-js": "^1.1.2",
"sql.js": "^0.5.0"
},
"devDependencies": {
"babel-loader": "^7.1.5",
"mocha": "^6.2.0",
"serve": "^11.1.0",
"webpack": "^4.39.1",
"webpack-cli": "^3.3.6"
}
}

View File

@@ -0,0 +1 @@
console.log('Hello World!');

View File

@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<title>Mocha Tests</title>
<link rel="stylesheet" href="../lib/mocha.css">
<script src="../lib/sprintf.min.js"></script>
<script src="../lib/sql.js"></script>
<script src="../lib/mocha.js"></script>
<style>
@font-face {
font-family: "FontAwesome";
src: url(../assets/fonts/FontAwesome.ttf) format("truetype");
}
@font-face {
font-family: "NotoRegular";
src: url(../assets/fonts/NotoSans-Regular.ttf) format("truetype");
}
@font-face {
font-family: "NotoBold";
src: url(../assets/fonts/NotoSans-Bold.ttf) format("truetype");
}
.export {
text-align: center;
}
.export canvas {
border: 1px solid #000;
margin: 10px;
}
</style>
</head>
<body>
<!-- Preload fonts for canvas. See https://stackoverflow.com/questions/2756575/ -->
<span style="font-family: FontAwesome">&nbsp;</span>
<span style="font-family: NotoRegular">&nbsp;</span>
<span style="font-family: NotoBold">&nbsp;</span>
<div id="mocha"></div>
<script>
mocha.setup('bdd');
testElement = document.createElement("script");
testElement.src = "../test.js";
testElement.onload = function() {
mocha.run();
}
document.body.appendChild(testElement);
</script>
</body>
</html>

View File

@@ -0,0 +1,3 @@
let assert = require('assert');
let coreTest = require('core_test');
document.coreTest = coreTest;