diff --git a/gulpfile.js b/gulpfile.js index b48a1fea7f..40c94371d0 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -206,21 +206,6 @@ gulp.task('dist:move', function () { return merge(tasks); }); -gulp.task('dist:edge', ['dist'], function () { - var moves = [ - { - src: ['src/edge/**/*'], - dest: paths.dist + 'edge' - } - ]; - - var tasks = moves.map(function (move) { - return gulp.src(move.src).pipe(gulp.dest(move.dest)); - }); - - return merge(tasks); -}); - gulp.task('dist', ['build'], function (cb) { return runSequence( 'dist:clean', @@ -243,17 +228,73 @@ gulp.task('dist-firefox', ['dist'], function (cb) { return zipDist('dist-firefox'); }); -gulp.task('dist-edge', ['dist:edge'], function (cb) { - gulp.src(paths.dist + 'manifest.json') - .pipe(jeditor(function (manifest) { - manifest['-ms-preload'] = { - backgroundScript: 'edge/backgroundScriptsAPIBridge.js', - contentScript: 'edge/contentScriptsAPIBridge.js' - }; - return manifest; - })) - .pipe(gulp.dest(paths.dist)); - return zipDist('dist-edge'); +gulp.task('dist-edge', ['dist'], function (cb) { + // move dist to temp extension folder + new Promise(function (resolve, reject) { + gulp.src(paths.dist + '**/*') + .on('error', reject) + .pipe(gulp.dest('temp/Extension/')) + .on('end', resolve); + }).then(function () { + // move windows store files to temp folder + return new Promise(function (resolve, reject) { + gulp.src('store/windows/**/*') + .on('error', reject) + .pipe(gulp.dest('temp/')) + .on('end', resolve); + }); + }).then(function () { + // delete dist folder + return new Promise(function (resolve, reject) { + rimraf(paths.dist, function () { + resolve(); + }) + }); + }).then(function () { + // move temp back to dist + return new Promise(function (resolve, reject) { + gulp.src('temp/**/*') + .on('error', reject) + .pipe(gulp.dest(paths.dist)) + .on('end', resolve); + }); + }).then(function () { + // delete temp folder + return new Promise(function (resolve, reject) { + rimraf('temp', function () { + resolve(); + }) + }); + }).then(function () { + // move src edge folder to dist + return new Promise(function (resolve, reject) { + gulp.src('src/edge/**/*') + .on('error', reject) + .pipe(gulp.dest(paths.dist + 'Extension/edge')) + .on('end', resolve); + }); + }).then(function () { + // modify manifest with edge preload stuff + return new Promise(function (resolve, reject) { + gulp.src(paths.dist + 'Extension/manifest.json') + .pipe(jeditor(function (manifest) { + manifest['-ms-preload'] = { + backgroundScript: 'edge/backgroundScriptsAPIBridge.js', + contentScript: 'edge/contentScriptsAPIBridge.js' + }; + return manifest; + })) + .on('error', reject) + .pipe(gulp.dest(paths.dist + 'Extension')) + .on('end', resolve); + }); + }).then(function () { + // makeappx.exe must be in your system's path already + child.spawn('makeappx.exe', ['pack', '/h', 'SHA256', '/d', paths.dist, '/p', paths.dist + 'bitwarden.appx']); + cb(); + }, function () { + cb(); + }); }); gulp.task('dist-other', ['dist'], function (cb) { diff --git a/store/windows/AppxManifest.xml b/store/windows/AppxManifest.xml new file mode 100644 index 0000000000..55eb08e538 --- /dev/null +++ b/store/windows/AppxManifest.xml @@ -0,0 +1,50 @@ + + + + + + + bitwarden - Free Password Manager + 8bit Solutions LLC + Assets/icon_50.png + + + + + + + + + + + + + + + + + + + + + + + diff --git a/store/windows/Assets/icon_150.png b/store/windows/Assets/icon_150.png new file mode 100644 index 0000000000..668244a56b Binary files /dev/null and b/store/windows/Assets/icon_150.png differ diff --git a/store/windows/Assets/icon_44.png b/store/windows/Assets/icon_44.png new file mode 100644 index 0000000000..b08bf7fa77 Binary files /dev/null and b/store/windows/Assets/icon_44.png differ diff --git a/store/windows/Assets/icon_50.png b/store/windows/Assets/icon_50.png new file mode 100644 index 0000000000..6bf4752aa3 Binary files /dev/null and b/store/windows/Assets/icon_50.png differ