From 038d15ecf3679a60acaee5c9eb9ea2d03c9449a6 Mon Sep 17 00:00:00 2001 From: Jiiks Date: Mon, 19 Mar 2018 19:02:44 -0300 Subject: [PATCH] add release gulpfile and deps for it --- .gitignore | 1 + core/index.js | 24 +-------- gulpfile.js | 47 ++++++++++++++++++ .../darwin-x64-53/binding.node | Bin .../linux-x64-53/binding.node | Bin .../win32-ia32-53/binding.node | Bin package.json | 11 +++- 7 files changed, 59 insertions(+), 24 deletions(-) create mode 100644 gulpfile.js rename other/{node-sass bindings => node_sass_bindings}/darwin-x64-53/binding.node (100%) rename other/{node-sass bindings => node_sass_bindings}/linux-x64-53/binding.node (100%) rename other/{node-sass bindings => node_sass_bindings}/win32-ia32-53/binding.node (100%) diff --git a/.gitignore b/.gitignore index c902f0de..ea11a01e 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ dist/ user.config.json tests/data /tests/themes/SimplerFlat +release \ No newline at end of file diff --git a/core/index.js b/core/index.js index 1a3833cd..19fd23d9 100644 --- a/core/index.js +++ b/core/index.js @@ -1,23 +1 @@ -class BetterDiscord { - - constructor() {} - - async asyncTest() { - return new Promise((resolve, reject) => { - setTimeout(() => { - resolve("asyncTest!"); - }, 3000); - }); - } - - async asyncTest2() { - const at = await this.asyncTest(); - console.log(at); - console.log("Finished!"); - } - -} - -module.exports = { - BetterDiscord -}; \ No newline at end of file +module.exports = require('./main.js'); diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..ee328ad7 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,47 @@ +const + gulp = require('gulp'), + pump = require('pump'), + merge = require('gulp-merge'), + copy = require('gulp-copy'), + copydeps = require('gulp-npm-copy-deps'); + +const client = function() { + return pump([ + gulp.src('./client/dist/*.client.js'), + copy('release/', { prefix: 2 }) + ]); +} + +const core = function() { + return pump([ + gulp.src('./core/dist/**/*'), + copy('release/', { prefix: 2 }) + ]); +} + +const core2 = function() { + return pump([ + gulp.src('./core/index.js'), + copy('release/', { prefix: 1 }) + ]); +} + +const cssEditor = function() { + return pump([ + gulp.src('./csseditor/dist/**/*'), + copy('release/csseditor', { prefix: 2 }) + ]); +} + +const deps = function() { + return copydeps('./', './release'); +} + +const bindings = function() { + return pump([ + gulp.src('./other/node_sass_bindings/**/*'), + copy('release/node_modules/node-sass/vendor', { prefix: 2 }) + ]); +} + +gulp.task('release', function () { return merge(client(), core(), core2(), cssEditor(), deps(), bindings())}); diff --git a/other/node-sass bindings/darwin-x64-53/binding.node b/other/node_sass_bindings/darwin-x64-53/binding.node similarity index 100% rename from other/node-sass bindings/darwin-x64-53/binding.node rename to other/node_sass_bindings/darwin-x64-53/binding.node diff --git a/other/node-sass bindings/linux-x64-53/binding.node b/other/node_sass_bindings/linux-x64-53/binding.node similarity index 100% rename from other/node-sass bindings/linux-x64-53/binding.node rename to other/node_sass_bindings/linux-x64-53/binding.node diff --git a/other/node-sass bindings/win32-ia32-53/binding.node b/other/node_sass_bindings/win32-ia32-53/binding.node similarity index 100% rename from other/node-sass bindings/win32-ia32-53/binding.node rename to other/node_sass_bindings/win32-ia32-53/binding.node diff --git a/package.json b/package.json index 515c5c57..a658dbf8 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,10 @@ "url": "https://github.com/Jiiks/BetterDiscordApp.git" }, "private": false, + "dependencies": { + "node-sass": "^4.7.2", + "nedb": "^1.8.0" + }, "devDependencies": { "babel-core": "^6.26.0", "babel-loader": "^7.1.2", @@ -32,11 +36,15 @@ "filewatcher": "^3.0.1", "gulp": "^3.9.1", "gulp-babel": "^7.0.0", + "gulp-copy": "^1.1.0", + "gulp-merge": "^0.1.1", + "gulp-npm-copy-deps": "^1.0.2", "gulp-plumber": "^1.2.0", "gulp-watch": "^5.0.0", "html-webpack-plugin": "^3.0.6", "jquery": "^3.2.1", "lodash": "^4.17.4", + "merge-stream": "^1.0.1", "nedb": "^1.8.0", "node-gyp": "^3.6.2", "node-sass": "^4.7.2", @@ -63,6 +71,7 @@ "watch_installer": "npm run watch --prefix installer", "lint": "eslint -f unix client/src core/src csseditor/src", "test": "npm run build && npm run lint", - "build_node-sass": "node scripts/build-node-sass.js" + "build_node-sass": "node scripts/build-node-sass.js", + "release": "npm run build && gulp release" } }