mirror of
https://github.com/Brandon-Rozek/php-workflow.git
synced 2024-09-07 19:12:29 -04:00
Replaced Typescript with JSHint
This commit is contained in:
parent
1459093c3d
commit
06a6970a85
7 changed files with 23 additions and 22 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
bin/css/*
|
8
README
8
README
|
@ -20,10 +20,10 @@ Browsersync [1]
|
|||
Website: https://www.browsersync.io/
|
||||
Install: npm install -g browser-sync
|
||||
|
||||
TypeScript [1]
|
||||
Purpose: Type checking and compilation to js
|
||||
Website: http://www.typescriptlang.org/
|
||||
Install: npm install -g typescript
|
||||
JSHint [1]
|
||||
Purpose: JS Syntax Checking
|
||||
Website: http://jshint.com/
|
||||
Install: npm install -g jshint
|
||||
|
||||
Docker
|
||||
Purpose: Apache-PHP5 server
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<title>Sample Page</title>
|
||||
<meta charset='utf-8'/>
|
||||
<meta name='viewport' content='initial-scale=1, width=device-width'/>
|
||||
<link rel='stylesheet' href='style.css'/>
|
||||
<link rel='stylesheet' href='css/style.css'/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script src='script.js'></script>
|
||||
<script src='js/script.js'></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
32
start.sh
32
start.sh
|
@ -3,10 +3,9 @@
|
|||
trap killgroup SIGINT
|
||||
|
||||
SCSSFILE=src/scss/style.scss
|
||||
TSFILE=src/ts/script.ts
|
||||
|
||||
CSSOUTFILE=bin/style.css
|
||||
JSOUTFILE=bin/script.js
|
||||
CSSOUTFILE=bin/css/style.css
|
||||
JSFILES=bin/js/*.js
|
||||
|
||||
HTTPSPORT=8443
|
||||
HTTPPORT=8080
|
||||
|
@ -36,11 +35,11 @@ installbrowsersync() {
|
|||
fi
|
||||
}
|
||||
|
||||
installtypescript() {
|
||||
#If npm is installed then install TypeScript
|
||||
installjshint() {
|
||||
#If npm is installed then install JSHint
|
||||
if command -v npm > /dev/null; then
|
||||
echo "Installing TypeScript"
|
||||
npm install -g typescript
|
||||
echo "Installing JSHint"
|
||||
npm install -g jshint
|
||||
else
|
||||
echo "npm is not installed"
|
||||
fi
|
||||
|
@ -68,15 +67,16 @@ startsassc() {
|
|||
fi
|
||||
}
|
||||
|
||||
# Watches tts files and compiles to js when changed
|
||||
starttypescript() {
|
||||
if command -v tsc > /dev/null; then
|
||||
./watch.sh --no-clear $TSFILE "tsc $TSFILE --outFile \"$JSOUTFILE\"" >> error.log
|
||||
# Watches js files and lints when changed
|
||||
startjshint() {
|
||||
if command -v jshint > /dev/null; then
|
||||
./watch.sh --no-clear $JSFILES "jshint $JSFILES >> error.log"
|
||||
else
|
||||
echo "TypeScript is not installed"
|
||||
echo "JSHint is not installed"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Starts up docker instance with apache and php installed (serves the bin folder)
|
||||
startdocker() {
|
||||
if command -v docker > /dev/null; then
|
||||
|
@ -97,13 +97,13 @@ if ! command -v browser-sync > /dev/null; then
|
|||
installbrowsersync
|
||||
fi
|
||||
|
||||
# Install TypeScript if it doesn't exist
|
||||
if ! command -v tsc > /dev/null; then
|
||||
installtypescript
|
||||
# Install JSHint if it doesn't exist
|
||||
if ! command -v jshint > /dev/null; then
|
||||
installjshint
|
||||
fi
|
||||
|
||||
|
||||
startdocker && (startbrowsersync & startsassc & starttypescript &
|
||||
startdocker && (startbrowsersync & startsassc & startjshint &
|
||||
|
||||
# Output all future errors
|
||||
tail -f -n 0 error.log)
|
||||
|
|
Loading…
Reference in a new issue