diff --git a/omega-target-chromium-extension/grunt/browserify.coffee b/omega-target-chromium-extension/grunt/browserify.coffee index 1381680..ab15d6c 100644 --- a/omega-target-chromium-extension/grunt/browserify.coffee +++ b/omega-target-chromium-extension/grunt/browserify.coffee @@ -5,7 +5,7 @@ module.exports = 'index.js': 'index.coffee' options: transform: ['coffeeify'] - exclude: ['bluebird', 'omega-pac'] + exclude: ['bluebird', 'omega-pac', 'omega-target'] browserifyOptions: extensions: '.coffee' builtins: [] @@ -30,7 +30,7 @@ module.exports = omega_webext_proxy_script: files: 'build/js/omega_webext_proxy_script.min.js': - 'omega_webext_proxy_script.js' + 'src/js/omega_webext_proxy_script.js' options: alias: 'omega-pac': 'omega-pac/omega_pac.min.js' diff --git a/omega-target-chromium-extension/grunt/coffee.coffee b/omega-target-chromium-extension/grunt/coffee.coffee index db255f8..f97255c 100644 --- a/omega-target-chromium-extension/grunt/coffee.coffee +++ b/omega-target-chromium-extension/grunt/coffee.coffee @@ -1,13 +1,7 @@ module.exports = - target_web: - files: - 'build/js/omega_target_web.js': 'omega_target_web.coffee' - background: - files: - 'build/js/background.js': 'background.coffee' - background_preload: - files: - 'build/js/background_preload.js': 'background_preload.coffee' - omega_debug: - files: - 'build/js/omega_debug.js': 'omega_debug.coffee' + coffee: + expand: true + cwd: 'src/coffee' + src: ['**/*.coffee'] + dest: 'build/js/' + ext: '.js' diff --git a/omega-target-chromium-extension/grunt/copy.coffee b/omega-target-chromium-extension/grunt/copy.coffee index cd4afff..39b1f62 100644 --- a/omega-target-chromium-extension/grunt/copy.coffee +++ b/omega-target-chromium-extension/grunt/copy.coffee @@ -12,6 +12,8 @@ module.exports = src: 'omega_target_chromium_extension.min.js' dest: 'build/js/' target_popup: + expand: true + cwd: 'src/js' src: 'omega_target_popup.js' dest: 'build/js/' overlay: diff --git a/omega-target-chromium-extension/grunt/watch.coffee b/omega-target-chromium-extension/grunt/watch.coffee index 2d18a99..80198ac 100644 --- a/omega-target-chromium-extension/grunt/watch.coffee +++ b/omega-target-chromium-extension/grunt/watch.coffee @@ -18,14 +18,11 @@ module.exports = files: ['overlay/**/*'] tasks: ['copy:overlay'] copy_target_popup: - files: ['omega_target_popup.js'] + files: ['src/js/omega_target_popup.js'] tasks: ['copy:target_popup'] - src: - files: ['src/**/*.coffee'] - tasks: ['coffeelint:src', 'browserify', 'copy:target_self'] - browserify_omega_webext_proxy_script: - files: ['omega_webext_proxy_script.js'] - tasks: ['browserify:omega_webext_proxy_script'] coffee: - files: ['src/**/*.coffee', '*.coffee'] - tasks: ['coffeelint:src', 'coffee', 'copy:target_self'] + files: ['src/**/*.coffee'] + tasks: ['coffeelint:src', 'browserify', 'coffee', 'copy:target_self'] + browserify_omega_webext_proxy_script: + files: ['src/js/omega_webext_proxy_script.js'] + tasks: ['browserify:omega_webext_proxy_script'] diff --git a/omega-target-chromium-extension/index.coffee b/omega-target-chromium-extension/index.coffee index 18adbdb..f900980 100644 --- a/omega-target-chromium-extension/index.coffee +++ b/omega-target-chromium-extension/index.coffee @@ -1,12 +1 @@ -module.exports = - Storage: require('./src/storage') - Options: require('./src/options') - ChromeTabs: require('./src/tabs') - SwitchySharp: require('./src/switchysharp') - ExternalApi: require('./src/external_api.coffee') - WebRequestMonitor: require('./src/web_request_monitor') - Inspect: require('./src/inspect') - Url: require('url') - -for name, value of require('omega-target') - module.exports[name] ?= value +module.exports = require('./src/module') diff --git a/omega-target-chromium-extension/background.coffee b/omega-target-chromium-extension/src/coffee/background.coffee similarity index 100% rename from omega-target-chromium-extension/background.coffee rename to omega-target-chromium-extension/src/coffee/background.coffee diff --git a/omega-target-chromium-extension/background_preload.coffee b/omega-target-chromium-extension/src/coffee/background_preload.coffee similarity index 100% rename from omega-target-chromium-extension/background_preload.coffee rename to omega-target-chromium-extension/src/coffee/background_preload.coffee diff --git a/omega-target-chromium-extension/omega_debug.coffee b/omega-target-chromium-extension/src/coffee/omega_debug.coffee similarity index 100% rename from omega-target-chromium-extension/omega_debug.coffee rename to omega-target-chromium-extension/src/coffee/omega_debug.coffee diff --git a/omega-target-chromium-extension/omega_target_web.coffee b/omega-target-chromium-extension/src/coffee/omega_target_web.coffee similarity index 100% rename from omega-target-chromium-extension/omega_target_web.coffee rename to omega-target-chromium-extension/src/coffee/omega_target_web.coffee diff --git a/omega-target-chromium-extension/omega_target_popup.js b/omega-target-chromium-extension/src/js/omega_target_popup.js similarity index 100% rename from omega-target-chromium-extension/omega_target_popup.js rename to omega-target-chromium-extension/src/js/omega_target_popup.js diff --git a/omega-target-chromium-extension/omega_webext_proxy_script.js b/omega-target-chromium-extension/src/js/omega_webext_proxy_script.js similarity index 100% rename from omega-target-chromium-extension/omega_webext_proxy_script.js rename to omega-target-chromium-extension/src/js/omega_webext_proxy_script.js diff --git a/omega-target-chromium-extension/src/chrome_api.coffee b/omega-target-chromium-extension/src/module/chrome_api.coffee similarity index 100% rename from omega-target-chromium-extension/src/chrome_api.coffee rename to omega-target-chromium-extension/src/module/chrome_api.coffee diff --git a/omega-target-chromium-extension/src/chrome_port.coffee b/omega-target-chromium-extension/src/module/chrome_port.coffee similarity index 100% rename from omega-target-chromium-extension/src/chrome_port.coffee rename to omega-target-chromium-extension/src/module/chrome_port.coffee diff --git a/omega-target-chromium-extension/src/external_api.coffee b/omega-target-chromium-extension/src/module/external_api.coffee similarity index 100% rename from omega-target-chromium-extension/src/external_api.coffee rename to omega-target-chromium-extension/src/module/external_api.coffee diff --git a/omega-target-chromium-extension/src/fetch_url.coffee b/omega-target-chromium-extension/src/module/fetch_url.coffee similarity index 100% rename from omega-target-chromium-extension/src/fetch_url.coffee rename to omega-target-chromium-extension/src/module/fetch_url.coffee diff --git a/omega-target-chromium-extension/src/module/index.coffee b/omega-target-chromium-extension/src/module/index.coffee new file mode 100644 index 0000000..cc69cf9 --- /dev/null +++ b/omega-target-chromium-extension/src/module/index.coffee @@ -0,0 +1,12 @@ +module.exports = + Storage: require('./storage') + Options: require('./options') + ChromeTabs: require('./tabs') + SwitchySharp: require('./switchysharp') + ExternalApi: require('./external_api') + WebRequestMonitor: require('./web_request_monitor') + Inspect: require('./inspect') + Url: require('url') + +for name, value of require('omega-target') + module.exports[name] ?= value diff --git a/omega-target-chromium-extension/src/inspect.coffee b/omega-target-chromium-extension/src/module/inspect.coffee similarity index 100% rename from omega-target-chromium-extension/src/inspect.coffee rename to omega-target-chromium-extension/src/module/inspect.coffee diff --git a/omega-target-chromium-extension/src/options.coffee b/omega-target-chromium-extension/src/module/options.coffee similarity index 100% rename from omega-target-chromium-extension/src/options.coffee rename to omega-target-chromium-extension/src/module/options.coffee diff --git a/omega-target-chromium-extension/src/parse_external_profile.coffee b/omega-target-chromium-extension/src/module/parse_external_profile.coffee similarity index 100% rename from omega-target-chromium-extension/src/parse_external_profile.coffee rename to omega-target-chromium-extension/src/module/parse_external_profile.coffee diff --git a/omega-target-chromium-extension/src/proxy_auth.coffee b/omega-target-chromium-extension/src/module/proxy_auth.coffee similarity index 100% rename from omega-target-chromium-extension/src/proxy_auth.coffee rename to omega-target-chromium-extension/src/module/proxy_auth.coffee diff --git a/omega-target-chromium-extension/src/storage.coffee b/omega-target-chromium-extension/src/module/storage.coffee similarity index 100% rename from omega-target-chromium-extension/src/storage.coffee rename to omega-target-chromium-extension/src/module/storage.coffee diff --git a/omega-target-chromium-extension/src/switchysharp.coffee b/omega-target-chromium-extension/src/module/switchysharp.coffee similarity index 100% rename from omega-target-chromium-extension/src/switchysharp.coffee rename to omega-target-chromium-extension/src/module/switchysharp.coffee diff --git a/omega-target-chromium-extension/src/tabs.coffee b/omega-target-chromium-extension/src/module/tabs.coffee similarity index 100% rename from omega-target-chromium-extension/src/tabs.coffee rename to omega-target-chromium-extension/src/module/tabs.coffee diff --git a/omega-target-chromium-extension/src/upgrade.coffee b/omega-target-chromium-extension/src/module/upgrade.coffee similarity index 100% rename from omega-target-chromium-extension/src/upgrade.coffee rename to omega-target-chromium-extension/src/module/upgrade.coffee diff --git a/omega-target-chromium-extension/src/web_request_monitor.coffee b/omega-target-chromium-extension/src/module/web_request_monitor.coffee similarity index 100% rename from omega-target-chromium-extension/src/web_request_monitor.coffee rename to omega-target-chromium-extension/src/module/web_request_monitor.coffee