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