-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from insitu-project/develop
First Public Release
- Loading branch information
Showing
44 changed files
with
751 additions
and
1,547 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,48 @@ | ||
import gulp from 'gulp'; | ||
import gutil from 'gulp-util'; | ||
import webpack from 'webpack'; | ||
import path from 'path'; | ||
|
||
import devConfig from '../../webpack/dev.config'; | ||
import stagingConfig from '../../webpack/staging.config'; | ||
import extConfig from '../../webpack/production.config'; | ||
|
||
const build = (config, callback) => { | ||
let myConfig = Object.create(config); | ||
webpack(myConfig, (err, stats) => { | ||
if (err) { | ||
throw new gutil.PluginError('webpack:build', err); | ||
} | ||
gutil.log('[webpack:build]', stats.toString({ colors: true })); | ||
function compiler(config) { | ||
return webpack(Object.create(config)); | ||
} | ||
|
||
function staticCompiler(config) { | ||
if (!staticCompiler.instance) { | ||
staticCompiler.instance = compiler(config); | ||
} | ||
return staticCompiler.instance; | ||
} | ||
|
||
function build(compiler, callback) { | ||
compiler.run((err, stats) => { | ||
if (err) throw new gutil.PluginError('webpack:build', err); | ||
gutil.log('[webpack:build]', stats.toString({ | ||
chunks: false, | ||
colors: true, | ||
})); | ||
callback(); | ||
}); | ||
}; | ||
} | ||
|
||
gulp.task('webpack:watch', () => { | ||
const globs = [ | ||
path.join(__dirname, '../../src/') + '**/*', | ||
path.join(__dirname, '../../test/') + '**/*', | ||
]; | ||
return gulp.watch(globs, ['webpack:build:dev']); | ||
}); | ||
gulp.task('webpack:build:dev', (callback) => { | ||
build(devConfig, callback); | ||
// Instance webpack compiler once over multiple times (watch) | ||
build(staticCompiler(devConfig), callback); | ||
}); | ||
gulp.task('webpack:build:staging', (callback) => { | ||
build(stagingConfig, callback); | ||
build(compiler(stagingConfig), callback); | ||
}); | ||
gulp.task('webpack:build:production', (callback) => { | ||
build(extConfig, callback); | ||
build(compiler(extConfig), callback); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { INSTALLED } from '../constants/ActionTypes'; | ||
|
||
// Promise constructed when the module is first imported (very early) | ||
// in order to not miss the "install" event. | ||
const onInstalledPromise = new Promise(resolve => { | ||
chrome.runtime.onInstalled.addListener(details => { | ||
if (details.reason !== 'install') return; | ||
|
||
resolve(Object.assign({}, details, { | ||
datetime: new Date(), | ||
version: chrome.runtime.getManifest().version, | ||
})); | ||
}); | ||
}); | ||
|
||
export default function () { | ||
return dispatch => { | ||
onInstalledPromise.then(onInstalledDetails => dispatch({ | ||
type: INSTALLED, | ||
onInstalledDetails | ||
})); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.