Added gulp to auto-compile dist/tts.php on changes.

main
Robert 3 years ago
parent 45048d9bb6
commit 8b1ba8c9b4
  1. 2
      .gitignore
  2. 11
      README
  3. 30
      gulpfile.js
  4. 18
      package.json

2
.gitignore vendored

@ -2,3 +2,5 @@ composer.lock
/vendor/
/nbproject/
/src/dist/
/node_modules/
package-lock.json

@ -25,12 +25,21 @@ cd /var/www/frames/tts_framework/vendor/ezyang/htmlpurifier/library
sudo chgrp www-data HTMLPurifier/DefinitionCache/Serializer
```
### Compile the framework!!!
### Manually Compile the framework!!!
```
cd /var/www/frames/tts_framework/src
php compiler.php
```
### Auto-Watch Compile the framework on PHP changes!!!
```
cd /var/www/frames/tts_framework
# Install nodejs, npm, then if gulp-cli not installed yet:
sudo npm install --global gulp-cli
npm install
gulp
```
### Install JavaScript Lib:
```
cd /var/www/frames/

@ -0,0 +1,30 @@
/**
* @author Robert Strutts <Robert@TryingToScale.com>
* @copyright Copyright (c) 2022, Robert Strutts.
* @license https://mit-license.org/
*/
const { src, dest, series, parallel, watch } = require('gulp');
const exec = require('child_process').exec;
const php_source_files = [
'**/*.php',
'!**/dist/*.php'
];
function compile_php_files() {
return new Promise(function(resolve, reject) {
exec('php -f compiler.php', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
resolve(stdout);
});
});
}
function watch_php() {
process.chdir('src');
watch(php_source_files, compile_php_files);
}
exports.default = series(watch_php);

@ -0,0 +1,18 @@
{
"name": "tts_watch_php_compiler",
"version": "1.0.0",
"description": "TTS Framework PHP Compiler.",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Robert Strutts",
"license": "MIT",
"devDependencies": {
"gulp": "^4.0.2"
},
"overrides": {
"chokidar": "3.5.3",
"glob-parent": "6.0.2"
}
}
Loading…
Cancel
Save