Initial commit of a skeleton typescript project
This commit is contained in:
commit
48dd461f77
|
@ -0,0 +1,3 @@
|
|||
build/
|
||||
node_modules/
|
||||
*.sw*
|
|
@ -0,0 +1,32 @@
|
|||
# Root Makefile to make the building and testing of this project easier
|
||||
# regardless of *nix based platform
|
||||
PATH:=./node_modules/.bin:./tools:$(PATH)
|
||||
|
||||
all: build check
|
||||
|
||||
depends: package.json package-lock.json
|
||||
if [ ! -d node_modules ]; then \
|
||||
npm install; \
|
||||
fi;
|
||||
|
||||
build: depends
|
||||
tsc
|
||||
|
||||
check: depends
|
||||
jest
|
||||
|
||||
clean:
|
||||
rm -rf node_modules
|
||||
|
||||
debug-jest:
|
||||
node --inspect-brk=0.0.0.0:9229 ./node_modules/.bin/jest
|
||||
|
||||
watch:
|
||||
jest --watchAll
|
||||
|
||||
watch-compile:
|
||||
tsc -w
|
||||
|
||||
.PHONY: all depends build clean check watch
|
||||
|
||||
# vim: set et
|
|
@ -0,0 +1,4 @@
|
|||
= Uplink
|
||||
|
||||
`uplink` is a simple web application to receive short bursts of anonymous
|
||||
telemetry data from Jenkins instances.
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
export PATH=./node_modules/.bin:${PWD}/tools:${PATH}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"name": "uplink",
|
||||
"version": "1.0.0",
|
||||
"description": "Uplink receives bursts of Jenkins telemetry",
|
||||
"main": "src/index.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "jest"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jenkins-infra/uplink.git"
|
||||
},
|
||||
"author": "R Tyler Croy",
|
||||
"license": "AGPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jenkins-infra/uplink/issues"
|
||||
},
|
||||
"homepage": "https://github.com/jenkins-infra/uplink#readme",
|
||||
"devDependencies": {
|
||||
"@types/winston": "^2.4.4",
|
||||
"jest": "^23.5.0",
|
||||
"ts-jest": "^23.1.4",
|
||||
"typescript": "^3.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"tslib": "^1.9.3",
|
||||
"uuid": "^3.3.2",
|
||||
"winston": "^3.1.0"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
"^.+\\.tsx?$": "ts-jest"
|
||||
},
|
||||
"testRegex": "(/test/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
|
||||
"moduleFileExtensions": [
|
||||
"ts",
|
||||
"tsx",
|
||||
"js",
|
||||
"jsx",
|
||||
"json",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# If we're executing from a normal shell, allow input. If we're in a
|
||||
# subprocess, like under Jenkins Pipeline, don't allow it
|
||||
tty -s
|
||||
if [ $? -eq 0 ]; then
|
||||
TTY_ARGS="-ti"
|
||||
fi;
|
||||
|
||||
COMMAND=$@
|
||||
|
||||
# The caller is passing in some custom paraneters to the `node` binary, so we
|
||||
# need to override the entrypoint to explicitly call node
|
||||
if [[ "${1}" =~ "--" ]]; then
|
||||
COMMAND="node $@";
|
||||
fi;
|
||||
|
||||
exec docker run --rm ${TTY_ARGS} --net host \
|
||||
-u $(id -u):$(id -g) \
|
||||
-w ${PWD} \
|
||||
--mount type=tmpfs,destination=/.npm \
|
||||
--mount type=tmpfs,destination=/.config \
|
||||
-v ${PWD}:${PWD} \
|
||||
-e PATH=$PWD/node_modules/.bin:/usr/local/bin:$PATH \
|
||||
-e LANG=C.UTF-8 \
|
||||
-e LOG_LEVEL=$LOG_LEVEL \
|
||||
$(printenv | grep -i \^node | awk '{ print "-e", $1 }') \
|
||||
node:10-alpine \
|
||||
${COMMAND}
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"alwaysStrict" : true,
|
||||
"outDir": "./build",
|
||||
"module" : "commonjs",
|
||||
"skipLibCheck": true,
|
||||
"lib" : ["es2017"],
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"importHelpers" : true,
|
||||
"target": "es2015",
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": [
|
||||
"./common/**/*",
|
||||
"./crawl/**/*",
|
||||
"./processor/**/*"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue