From f4af5cd8f4c2617c242c5426e894cb8223efe70d Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 29 Jun 2019 13:26:43 +0100 Subject: [PATCH] Init ts script setup --- .gitignore | 2 + index.ts | 20 ++++ package-lock.json | 228 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 23 ++++- src/index.scss | 12 +++ src/template.html | 7 ++ tsconfig.json | 20 ++++ tslint.json | 9 ++ 8 files changed, 316 insertions(+), 5 deletions(-) create mode 100644 index.ts create mode 100644 src/index.scss create mode 100644 src/template.html create mode 100644 tsconfig.json create mode 100644 tslint.json diff --git a/.gitignore b/.gitignore index 96a8d31..41fb9a2 100644 --- a/.gitignore +++ b/.gitignore @@ -93,3 +93,5 @@ typings/ .dynamodb/ # End of https://www.gitignore.io/api/node + +build/ diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..7149b10 --- /dev/null +++ b/index.ts @@ -0,0 +1,20 @@ +import Bundler from 'parcel-bundler'; +import { join } from 'path'; +import rimraf from 'rimraf'; + +const BUILD_DIR = join(__dirname, 'build'); +const SRC_DIR = join(__dirname, 'src'); + +const BUNDLER_OPTIONS = { + outDir: BUILD_DIR, + watch: false, + minify: true, +}; + +(async function() { + rimraf.sync(BUILD_DIR); + + const bundler = new Bundler(join(SRC_DIR, 'template.html'), BUNDLER_OPTIONS); + + await bundler.bundle(); +})(); diff --git a/package-lock.json b/package-lock.json index f4c8867..de68349 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1024,11 +1024,67 @@ "physical-cpu-count": "^2.0.0" } }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" + }, + "@types/express-serve-static-core": { + "version": "4.16.7", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.16.7.tgz", + "integrity": "sha512-847KvL8Q1y3TtFLRTXcVakErLJQgdpFSaq+k043xefz9raEf0C7HalpSY7OW5PyjCnY8P7bPW5t/Co9qqp+USg==", + "requires": { + "@types/node": "*", + "@types/range-parser": "*" + } + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" + }, + "@types/node": { + "version": "12.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", + "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==" + }, + "@types/parcel-bundler": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@types/parcel-bundler/-/parcel-bundler-1.12.0.tgz", + "integrity": "sha512-25U2PLViO4rmT3XO3Mf5pSddLVr+ey5AzX9PgGzIvvMbzxkzdRGvcxb55n8W7CmYEdc9QQHRJR++a7aMSkcAzQ==", + "requires": { + "@types/express-serve-static-core": "*" + } + }, "@types/q": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/@types/q/-/q-1.5.2.tgz", "integrity": "sha512-ce5d3q03Ex0sy4R14722Rmt6MT07Ua+k4FwDfdcToYJcMKNtRVQvJ6JCAPdAmAnbRb6CsX6aYb9m96NGod9uTw==" }, + "@types/range-parser": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.3.tgz", + "integrity": "sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==" + }, + "@types/rimraf": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/rimraf/-/rimraf-2.0.2.tgz", + "integrity": "sha512-Hm/bnWq0TCy7jmjeN5bKYij9vw5GrDFWME4IuxV08278NtU/VdGbzsBohcCUJ7+QMqmUq5hpRKB39HeQWJjztQ==", + "requires": { + "@types/glob": "*", + "@types/node": "*" + } + }, "abab": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", @@ -1126,6 +1182,11 @@ } } }, + "arg": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.0.tgz", + "integrity": "sha512-ZWc51jO3qegGkVh8Hwpv636EkbesNV5ZNQPCtRa+0qytRYPEs9IYT9qITY9buezqUH5uqyzlWLcufrzU2rffdg==" + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -1542,6 +1603,12 @@ "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", @@ -2341,6 +2408,11 @@ "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==" + }, "diffie-hellman": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", @@ -2351,6 +2423,30 @@ "randombytes": "^2.0.0" } }, + "doctrine": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", + "integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=", + "dev": true, + "requires": { + "esutils": "^1.1.6", + "isarray": "0.0.1" + }, + "dependencies": { + "esutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "dom-serializer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.1.tgz", @@ -4065,6 +4161,11 @@ "vlq": "^0.2.2" } }, + "make-error": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.5.tgz", + "integrity": "sha512-c3sIjNUow0+8swNwVpqoH4YCShKNFkMaw6oH1mNS2haDZQqkeZFlHS3dhoeEbKKmJB4vXpJucU6oH75aDYeE9g==" + }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -5487,6 +5588,14 @@ "clones": "^1.2.0" } }, + "sass": { + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.22.1.tgz", + "integrity": "sha512-VsWrNdfIzCLbD2TO2bq9tCaUzEE0UUSGtP3r9IhHi8ypAPCb3FOVP99kMRil+ZROEcTnKReZcQP9vk6ArV2eLw==", + "requires": { + "chokidar": ">=2.0.0 <4.0.0" + } + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -6085,6 +6194,115 @@ "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, + "ts-node": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.3.0.tgz", + "integrity": "sha512-dyNS/RqyVTDcmNM4NIBAeDMpsAdaQ+ojdf0GOLqE6nwJOgzEkdRNzJywhDfwnuvB10oa6NLVG1rUJQCpRN7qoQ==", + "requires": { + "arg": "^4.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.6", + "yn": "^3.0.0" + } + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "tslint": { + "version": "5.18.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz", + "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "tslint-config-dabapps": { + "version": "github:dabapps/tslint-config-dabapps#546a63ee197f4feb799c28ecafa5b96dd2d32a1c", + "from": "github:dabapps/tslint-config-dabapps#v0.5.1", + "dev": true, + "requires": { + "tslint-config-prettier": "1.8.0", + "tslint-eslint-rules": "4.0.0", + "tslint-react": "3.2.0" + } + }, + "tslint-config-prettier": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.8.0.tgz", + "integrity": "sha512-4e8G6Q3bSnmKNd9zteu5DchUPcXGp+rmV4UbdMW0zwcX8nSFzfoSseyRwnyvkfPJ+gttZy7xGHecJVfD/oPRQQ==", + "dev": true + }, + "tslint-eslint-rules": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-4.0.0.tgz", + "integrity": "sha1-Tg5Z7NVwHJpIxm7Ue9yvscY10ns=", + "dev": true, + "requires": { + "doctrine": "^0.7.2", + "tslib": "^1.0.0", + "tsutils": "^1.4.0" + } + }, + "tslint-react": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.2.0.tgz", + "integrity": "sha1-hR+1BSAcY9A0PFFybmNk9+mtLpk=", + "dev": true, + "requires": { + "tsutils": "^2.8.0" + }, + "dependencies": { + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "tsutils": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-1.9.1.tgz", + "integrity": "sha1-ufmrROVa+WgYMdXyjQrur1x1DLA=", + "dev": true + }, "tty-browserify": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", @@ -6116,6 +6334,11 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, + "typescript": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.2.tgz", + "integrity": "sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==" + }, "uncss": { "version": "0.16.2", "resolved": "https://registry.npmjs.org/uncss/-/uncss-0.16.2.tgz", @@ -6436,6 +6659,11 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yn": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.0.tgz", + "integrity": "sha512-kKfnnYkbTfrAdd0xICNFw7Atm8nKpLcLv9AZGEt+kczL/WQVai4e2V6ZN8U/O+iI6WrNuJjNNOyu4zfhl9D3Hg==" } } } diff --git a/package.json b/package.json index 97e110b..0833ad6 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,10 @@ "name": "givemoneyto.me", "version": "1.0.0", "main": "index.js", - "scripts": {}, + "scripts": { + "build": "ts-node index.ts", + "lint": "tsc --noEmit --project tsconfig.json && tslint --project tsconfig.json index.ts" + }, "repository": { "type": "git", "url": "git+https://github.com/RealOrangeOne/givemoneyto.me.git" @@ -13,10 +16,20 @@ }, "homepage": "https://github.com/RealOrangeOne/givemoneyto.me#readme", "dependencies": { - "@fortawesome/fontawesome-free": "^5.7.1", - "animate.css": "^3.7.0", + "@fortawesome/fontawesome-free": "5.7.1", + "@types/node": "^12.0.10", + "@types/parcel-bundler": "^1.12.0", + "@types/rimraf": "^2.0.2", + "animate.css": "3.7.0", "bootstrap": "4.2.1", - "parcel-bundler": "^1.12.3" + "parcel-bundler": "1.12.3", + "rimraf": "^2.6.3", + "sass": "^1.22.1", + "ts-node": "8.3.0", + "typescript": "3.5.2" }, - "devDependencies": {} + "devDependencies": { + "tslint-config-dabapps": "github:dabapps/tslint-config-dabapps#v0.5.1", + "tslint": "5.18.0" + } } diff --git a/src/index.scss b/src/index.scss new file mode 100644 index 0000000..bb818a3 --- /dev/null +++ b/src/index.scss @@ -0,0 +1,12 @@ +@import "node_modules/bootstrap/scss/bootstrap"; + +.vertical-center { + display: flex; + align-items: center; +} + +@include media-breakpoint-up(lg) { + .jumbotron { + height: 50vh; + } +} diff --git a/src/template.html b/src/template.html new file mode 100644 index 0000000..b430036 --- /dev/null +++ b/src/template.html @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..3ab52c3 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "noImplicitAny": true, + "skipLibCheck": true, + "pretty": true, + "strict": true, + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + "allowJs": false, + "checkJs": false, + "noUnusedLocals": true, + "noUnusedParameters": true, + "moduleResolution": "node", + "target": "es6", + "baseUrl": "./", + "typeRoots" : [ + "node_modules/@types/" + ] + }, + } diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..3c3a4aa --- /dev/null +++ b/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": [ + "tslint-config-dabapps" + ], + "rules": { + "no-console": false, + "only-arrow-functions": false + } + }