remove bower dependancy and covert packages to npm

This commit is contained in:
Vu Nguyen
2021-01-14 20:11:23 -06:00
parent 9ef655ac3b
commit 8f68fedaf9
6 changed files with 18 additions and 34 deletions

View File

@@ -1,3 +0,0 @@
{
"directory": "vendor/bower_components"
}

View File

@@ -1,8 +0,0 @@
{
"name": "WakaTime",
"ignore": ["**/.*", "node_modules", "bower_components", "test", "tests"],
"dependencies": {
"font-awesome": "~4.6.3",
"bootstrap": "~3.3.4"
}
}

View File

@@ -18,6 +18,7 @@ gulp.task('postinstall', function (cb) {
//so we remove them on postinstall //so we remove them on postinstall
del('node_modules/**/*.pem', cb); del('node_modules/**/*.pem', cb);
}); });
gulp.task('webextension', function (cb) { gulp.task('webextension', function (cb) {
if (!fs.existsSync('public/js')) { if (!fs.existsSync('public/js')) {
!fs.existsSync('public') && fs.mkdirSync('public'); !fs.existsSync('public') && fs.mkdirSync('public');
@@ -53,10 +54,10 @@ elixir.extend('webextension', function () {
elixir(function (mix) { elixir(function (mix) {
mix.webextension(); mix.webextension();
mix.copy('vendor/bower_components/bootstrap/less', 'assets/less/bootstrap'); mix.copy('node_modules/bootstrap/less', 'assets/less/bootstrap');
mix.copy('vendor/bower_components/bootstrap/fonts', 'public/fonts'); mix.copy('node_modules/bootstrap/fonts', 'public/fonts');
mix.copy('vendor/bower_components/font-awesome/less', 'assets/less/font-awesome'); mix.copy('node_modules/font-awesome/less', 'assets/less/font-awesome');
mix.copy('vendor/bower_components/font-awesome/fonts', 'public/fonts'); mix.copy('node_modules/font-awesome/fonts', 'public/fonts');
mix.less('app.less'); mix.less('app.less');
mix.browserify('app.jsx', 'public/js/app.js', 'assets/js'); mix.browserify('app.jsx', 'public/js/app.js', 'assets/js');
mix.browserify('events.js', 'public/js/events.js', 'assets/js'); mix.browserify('events.js', 'public/js/events.js', 'assets/js');

11
package-lock.json generated
View File

@@ -2123,9 +2123,9 @@
} }
}, },
"bootstrap": { "bootstrap": {
"version": "4.5.3", "version": "3.3.7",
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.3.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz",
"integrity": "sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ==" "integrity": "sha1-WjiTlFSfIzMIdaOxUGVldPip63E="
}, },
"bower": { "bower": {
"version": "1.8.8", "version": "1.8.8",
@@ -5255,6 +5255,11 @@
"integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==", "integrity": "sha512-tW+UkmtNg/jv9CSofAKvgVcO7c2URjhTdW1ZTkcAritblu8tajiYy7YisnIflEwtKssCtOxpnBRoCB7iap0/TA==",
"dev": true "dev": true
}, },
"font-awesome": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/font-awesome/-/font-awesome-4.6.3.tgz",
"integrity": "sha1-hpM2UVQO4Ah0xmQBf1DyFy9lMaI="
},
"for-in": { "for-in": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",

View File

@@ -70,26 +70,15 @@
"typescript": "^4.1.3" "typescript": "^4.1.3"
}, },
"dependencies": { "dependencies": {
"bootstrap": "^4.0.0", "bootstrap": "3.3.7",
"classnames": "^2.2.5", "classnames": "^2.2.5",
"create-react-class": "^15.6.3", "create-react-class": "^15.6.3",
"font-awesome": "4.6.3",
"jquery": "^3.0.0", "jquery": "^3.0.0",
"moment": "^2.13.0", "moment": "^2.13.0",
"react": "^16.2.0", "react": "^16.2.0",
"react-dom": "^16.2.0", "react-dom": "^16.2.0",
"react-transition-group": "^1.0.0", "react-transition-group": "^1.0.0",
"webextension-polyfill": "^0.4.0" "webextension-polyfill": "^0.4.0"
},
"jshintConfig": {
"asi": false,
"browser": true,
"curly": false,
"expr": true,
"indent": 4,
"loopfunc": true,
"node": true,
"trailing": true,
"undef": true,
"white": true
} }
} }

View File

@@ -2,11 +2,11 @@ const { load, exec, concurrent, serial } = require('@xarc/run');
load({ load({
build: ['postinstall', exec('gulp'), 'prettier'], build: ['postinstall', exec('gulp'), 'prettier'],
'bower:install': [exec('bower install'), 'prettier'],
clean: exec('rimraf public coverage vendor'), clean: exec('rimraf public coverage vendor'),
prettier: exec('prettier --write .'), // Temp run prettier twice to format some of bootstrap less files
prettier: [exec('prettier --write .'), exec('prettier --write .')],
lint: ['prettier'], lint: ['prettier'],
postinstall: ['clean', exec('gulp postinstall'), 'bower:install'], postinstall: ['clean', exec('gulp postinstall')],
test: ['build', 'lint', 'test-jest', 'test-js'], test: ['build', 'lint', 'test-jest', 'test-js'],
'test-jest': [exec('jest --clearCache'), exec('jest --verbose --coverage')], 'test-jest': [exec('jest --clearCache'), exec('jest --verbose --coverage')],
'test-js': 'phantomjs tests/run.js', 'test-js': 'phantomjs tests/run.js',