diff --git a/.gitignore b/.gitignore index eded32c..9990bda 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules *.sublime-workspace -*.sublime-project \ No newline at end of file +*.sublime-project + +dist \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..73d7493 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,33 @@ +'use strict' + +let gulp = require('gulp') +let browserify = require('browserify') +let source = require('vinyl-source-stream') +let buffer = require('vinyl-buffer') +let sourcemaps = require('gulp-sourcemaps') +let del = require('del') + +let path = { + dest: './dest/', +} + +gulp.task('clean', function () { + return del([path.dest]) +}) + +gulp.task('static', ['clean'], function () { + return gulp.src('./static/*') + .pipe(gulp.dest(path.dest)) +}) + +gulp.task('script', ['clean'], function () { + return browserify('./src/index.js', { debug: true }) + .bundle() + .pipe(source('matcg_fetch.js')) + .pipe(buffer()) + .pipe(sourcemaps.init({ loadMaps: true })) + .pipe(sourcemaps.write(path.dest)) + .pipe(gulp.dest(path.dest)) +}) + +gulp.task('build', ['clean', 'static', 'script']) diff --git a/index.html b/index.html deleted file mode 100644 index 26221b4..0000000 --- a/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -WIXOSS_Down - - - - - - - - - - \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..b1e9729 --- /dev/null +++ b/package.json @@ -0,0 +1,22 @@ +{ + "name": "wixoss-fetch", + "version": "0.0.1", + "description": "Fetch WIXOSS card data from the official site.", + "main": "index.js", + "scripts": { + "build": "gulp build" + }, + "keywords": [ + "wixoss", + "tcg" + ], + "author": "WEBXOSS (https://twitter.com/WEBXOSS)", + "license": "MIT", + "devDependencies": { + "browserify": "^13.0.0", + "del": "^2.2.0", + "gulp-sourcemaps": "^2.0.0-alpha", + "vinyl-buffer": "^1.0.0", + "vinyl-source-stream": "^1.1.0" + } +} diff --git a/index.js b/src/index.js similarity index 100% rename from index.js rename to src/index.js diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..12913be --- /dev/null +++ b/static/index.html @@ -0,0 +1,10 @@ + + + +WIXOSS_Fetch + + + + + + \ No newline at end of file diff --git a/manifest.json b/static/manifest.json similarity index 100% rename from manifest.json rename to static/manifest.json