Skip to content

Commit

Permalink
Reorganize src (#21)
Browse files Browse the repository at this point in the history
* Move html files into own directory

* Reorganize src
  • Loading branch information
SimenB authored and adriancole committed Sep 5, 2017
1 parent 2c6354a commit 58c1ed7
Show file tree
Hide file tree
Showing 22 changed files with 23 additions and 27 deletions.
11 changes: 4 additions & 7 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"browser": true,
"shared-node-browser": true
},
"globals": {
"browser": false
},
"rules": {
"react/jsx-filename-extension": "off",
"class-methods-use-this": "off",
Expand All @@ -16,17 +19,11 @@
"prettier/prettier": ["error", { "singleQuote": true, "trailingComma": "all" }]
},
"overrides": [
{
"files": "vendor/**/*",
"globals": {
"browser": false
}
},
{
"files": "test/**/*",
"env": {
"jest": true
}
}
]
}
}
11 changes: 5 additions & 6 deletions vendor/background.js → src/background.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import ExtensionToPanelPubsub from './ExtensionToPanelPubsub';
import { RemoteStorageClient } from './RemoteStorage';
import { RemoteSetIntervalClient } from './RemoteSetInterval';
import ZipkinPlugin from '../js/ZipkinPlugin';
import ExtensionToPanelPubsub from './lib/ExtensionToPanelPubsub';
import { RemoteStorageClient } from './lib/RemoteStorage';
import { RemoteSetIntervalClient } from './lib/RemoteSetInterval';
import ZipkinPlugin from './lib/ZipkinPlugin';

import attachBeforeSendHeadersListener from '../js/attachBeforeSendHeadersListener';
import attachBeforeSendHeadersListener from './lib/attachBeforeSendHeadersListener';

attachBeforeSendHeadersListener(browser.webRequest);

const pubsub = new ExtensionToPanelPubsub(browser.runtime);
const storage = new RemoteStorageClient(pubsub);
const remoteSetInterval = new RemoteSetIntervalClient(pubsub);

// eslint-disable-next-line no-new
new ZipkinPlugin({
pubsub,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Pubsub from '../js/Pubsub';
import Pubsub from './Pubsub';

export default class ExtensionToPanelPubsub extends Pubsub {
constructor(browserRuntime) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Pubsub from '../js/Pubsub';
import Pubsub from './Pubsub';

export default class PanelToExtensionPubsub extends Pubsub {
constructor() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions vendor/panel.js → src/panel.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';
import { render } from 'react-dom';
import ZipkinPanel from '../js/ZipkinPanel';
import PanelToExtensionPubsub from './PanelToExtensionPubsub';
import PluginStorage from './PluginStorage';
import { RemoteStorageServer } from './RemoteStorage';
import addNetworkEvents from '../js/addNetworkEvents';
import { RemoteSetIntervalServer } from './RemoteSetInterval';
import ZipkinPanel from './lib/ZipkinPanel';
import PanelToExtensionPubsub from './lib/PanelToExtensionPubsub';
import PluginStorage from './lib/PluginStorage';
import { RemoteStorageServer } from './lib/RemoteStorage';
import addNetworkEvents from './lib/addNetworkEvents';
import { RemoteSetIntervalServer } from './lib/RemoteSetInterval';

const pubsub = new PanelToExtensionPubsub();
addNetworkEvents(browser.devtools.network, pubsub);
Expand Down
2 changes: 1 addition & 1 deletion test/matchUrl.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const matchUrl = require('../js/matchUrl');
const matchUrl = require('../src/lib/matchUrl');

describe('urlMatcher', () => {
it('should return null when no match is found', () => {
Expand Down
10 changes: 5 additions & 5 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const ZipPlugin = require('zip-webpack-plugin');

module.exports = {
entry: {
background: './vendor/background.js',
devtools: './vendor/devtools.js',
panel: './vendor/panel.js',
background: './src/background.js',
devtools: './src/devtools.js',
panel: './src/panel.js',
},
output: {
filename: '[name].bundle.js',
Expand All @@ -27,8 +27,8 @@ module.exports = {
plugins: [
new ChromeDevPlugin(),
new CopyWebpackPlugin([
{ context: path.join(__dirname, 'vendor'), from: '*.html' },
{ context: path.join(__dirname, 'img'), from: '*' },
{ context: path.join(__dirname, 'src/html'), from: '*' },
{ context: path.join(__dirname, 'src/img'), from: '*' },
{ from: require.resolve('webextension-polyfill') },
]),
new ZipPlugin({
Expand Down

0 comments on commit 58c1ed7

Please sign in to comment.