Get gulp working

This commit is contained in:
Nathaniel van Diepen
2017-01-03 10:42:48 -07:00
parent 62de58d1ef
commit a4eed5da59
7 changed files with 97 additions and 71 deletions

2
.gitignore vendored
View File

@@ -26,7 +26,7 @@ node_modules
.DS_Store
vendor/
vendor/bower_components
.idea

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "vendor/webextension-polyfill"]
path = vendor/webextension-polyfill
url = https://github.com/mozilla/webextension-polyfill.git

View File

@@ -1,6 +1,8 @@
var del = require('del');
var gulp = require('gulp');
var elixir = require('laravel-elixir');
var exec = require('child_process').exec;
var fs = require('fs');
/*
|--------------------------------------------------------------------------
@@ -16,6 +18,19 @@ gulp.task('postinstall', function (cb) {
//so we remove them on postinstall
del('node_modules/**/*.pem', cb);
});
gulp.task('webextension',function(cb){
exec('npm install',{
cwd: 'vendor/webextension-polyfill/'
},function(){
exec('grunt',{
cwd: 'vendor/webextension-polyfill/'
},function(){
var stream = fs.createWriteStream('public/js/browser-polyfill.min.js');
stream.on('done',cb);
fs.createReadStream('vendor/webextension-polyfill/dist/browser-polyfill.min.js').pipe(stream);
});
});
});
/*
|--------------------------------------------------------------------------
@@ -30,14 +45,19 @@ gulp.task('postinstall', function (cb) {
elixir.config.assetsPath = 'assets/';
elixir.extend('webextension', function(){
return gulp.start('webextension');
});
elixir(function (mix) {
mix.webextension();
mix.copy('vendor/bower_components/bootstrap/less', 'assets/less/bootstrap');
mix.copy('vendor/bower_components/bootstrap/fonts', 'public/fonts');
/*mix.copy('vendor/bower_components/bootstrap/fonts', 'public/fonts');
mix.copy('vendor/bower_components/font-awesome/less', 'assets/less/font-awesome');
mix.copy('vendor/bower_components/font-awesome/fonts', 'public/fonts');
mix.less('app.less');
mix.browserify('app.jsx', 'public/js/app.js', 'assets/js');
mix.browserify('events.js', 'public/js/events.js', 'assets/js');
mix.browserify('options.jsx', 'public/js/options.js', 'assets/js');
mix.browserify('devtools.js', 'public/js/devtools.js', 'assets/js');
mix.browserify('devtools.js', 'public/js/devtools.js', 'assets/js');*/
});

View File

@@ -20,6 +20,7 @@
],
"background": {
"scripts": [
"public/js/browser-polyfill.min.js"
"public/js/events.js"
],
"persistent": false
@@ -36,7 +37,7 @@
"page": "options.html",
"chrome_style": false
},
"applicaitons": {
"applications": {
"gecko": {
"id": "addon@wakatime.com"
}

View File

@@ -1,67 +1,67 @@
{
"scripts": {
"test": "jest --verbose --coverage && mocha --compilers js:mocha-traceur tests/**/*.spec.js",
"test-react": "jest --verbose --coverage",
"test-js": "node_modules/.bin/phantomjs tests/run.js",
"start": "npm install && bower install && gulp",
"gulp": "gulp",
"watch": "gulp watch",
"lint": "jsxhint --jsx-only .",
"postinstall": "gulp postinstall",
"validate": "npm ls"
},
"pre-commit": [
"lint"
],
"jest": {
"testFileExtensions": [
"jest.js"
],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"testDirectoryName": "tests",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react"
]
},
"private": true,
"devDependencies": {
"babel-jest": "^13.0.0",
"bower": "^1.7.9",
"chai": "^3.5.0",
"del": "^2.2.1",
"gulp": "^3.9.1",
"jest-cli": "^13.0.0",
"jshint": "^2.9.2",
"jsxhint": "^0.15.1",
"laravel-elixir": "^5.0.0",
"mocha": "^2.5.3",
"mocha-sinon": "^1.1.5",
"mocha-traceur": "^2.1.0",
"precommit-hook": "^3.0.0",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"sinon-chrome": "^1.1.2",
"traceur": "^0.0.111"
},
"dependencies": {
"bootstrap": "^3.3.6",
"classnames": "^2.2.5",
"jquery": "^3.0.0",
"moment": "^2.13.0",
"react": "^15.1.0",
"react-addons-css-transition-group": "^15.1.0",
"react-dom": "^15.1.0"
},
"jshintConfig": {
"asi": false,
"browser": true,
"curly": false,
"expr": true,
"indent": 4,
"loopfunc": true,
"node": true,
"trailing": true,
"undef": true,
"white": true
}
}
{
"scripts": {
"test": "jest --verbose --coverage && mocha --compilers js:mocha-traceur tests/**/*.spec.js",
"test-react": "jest --verbose --coverage",
"test-js": "node_modules/.bin/phantomjs tests/run.js",
"start": "npm install && bower install && gulp",
"gulp": "gulp",
"watch": "gulp watch",
"lint": "jsxhint --jsx-only .",
"postinstall": "gulp postinstall",
"validate": "npm ls"
},
"pre-commit": [
"lint"
],
"jest": {
"testFileExtensions": [
"jest.js"
],
"scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
"testDirectoryName": "tests",
"unmockedModulePathPatterns": [
"<rootDir>/node_modules/react"
]
},
"private": true,
"devDependencies": {
"babel-jest": "^13.0.0",
"bower": "^1.7.9",
"chai": "^3.5.0",
"del": "^2.2.1",
"gulp": "^3.9.1",
"jest-cli": "^13.0.0",
"jshint": "^2.9.2",
"jsxhint": "^0.15.1",
"laravel-elixir": "^5.0.0",
"mocha": "^2.5.3",
"mocha-sinon": "^1.1.5",
"mocha-traceur": "^2.1.0",
"precommit-hook": "^3.0.0",
"sinon": "^1.17.4",
"sinon-chai": "^2.8.0",
"sinon-chrome": "^1.1.2",
"traceur": "^0.0.111"
},
"dependencies": {
"bootstrap": "^3.3.6",
"classnames": "^2.2.5",
"jquery": "^3.0.0",
"moment": "^2.13.0",
"react": "^15.1.0",
"react-addons-css-transition-group": "^15.1.0",
"react-dom": "^15.1.0"
},
"jshintConfig": {
"asi": false,
"browser": true,
"curly": false,
"expr": true,
"indent": 4,
"loopfunc": true,
"node": true,
"trailing": true,
"undef": true,
"white": true
}
}

View File

@@ -7,6 +7,7 @@
<title>WakaTime</title>
<link href="public/css/app.css" rel="stylesheet">
<script src="public/js/browser-polyfill.min.js"></script>
</head>
<body>

1
vendor/webextension-polyfill vendored Submodule