forked from lieuzhenghong/discord-spatial-layer
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
221 additions
and
239 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
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import nengi from "nengi"; | ||
import nengiConfig from "../common/nengiConfig"; | ||
import nengi from 'nengi' | ||
import nengiConfig from '../common/nengiConfig' | ||
|
||
function instantiateClient(secret) { | ||
return new Promise((resolve, reject) => { | ||
const client = new nengi.Client(nengiConfig) | ||
return new Promise((resolve, reject) => { | ||
const client = new nengi.Client(nengiConfig) | ||
|
||
client.onConnect(res => { | ||
console.log('onConnect response:', res) | ||
if (!res.accepted) { | ||
reject(res); | ||
} else { | ||
resolve(client); | ||
} | ||
}) | ||
client.connect('ws://localhost:8079', { secret }) | ||
}) | ||
client.onConnect(res => { | ||
console.log('onConnect response:', res) | ||
if (!res.accepted) { | ||
reject(res) | ||
} else { | ||
resolve(client) | ||
} | ||
}) | ||
|
||
client.connect('ws://localhost:8079', { secret }) | ||
}) | ||
} | ||
|
||
export default instantiateClient; | ||
export default instantiateClient |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ const config = { | |
MAP_IMAGE: './images/bg.png', | ||
} | ||
|
||
export default config | ||
export default config |
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,6 +1,6 @@ | ||
chrome.browserAction.onClicked.addListener(function (tab) { | ||
// for the current tab, inject the "inject.js" file & execute it | ||
chrome.tabs.executeScript(tab.ib, { | ||
file: 'inject.bundle.js' | ||
}); | ||
}); | ||
chrome.browserAction.onClicked.addListener(tab => { | ||
// for the current tab, inject the "inject.js" file & execute it | ||
chrome.tabs.executeScript(tab.ib, { | ||
file: 'inject.bundle.js', | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
var webpack = require("webpack"), | ||
config = require("../webpack.config"); | ||
const webpack = require('webpack') | ||
const config = require('../webpack.config') | ||
|
||
delete config.chromeExtensionBoilerplate; | ||
delete config.chromeExtensionBoilerplate | ||
|
||
webpack( | ||
config, | ||
function (err) { if (err) throw err; } | ||
); | ||
config, | ||
err => { if (err) throw err }, | ||
) |
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,5 +1,5 @@ | ||
// tiny wrapper with default env vars | ||
module.exports = { | ||
NODE_ENV: (process.env.NODE_ENV || "development"), | ||
PORT: (process.env.PORT || 3000) | ||
}; | ||
NODE_ENV: (process.env.NODE_ENV || 'development'), | ||
PORT: (process.env.PORT || 3000), | ||
} |
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,38 +1,35 @@ | ||
var WebpackDevServer = require("webpack-dev-server"), | ||
webpack = require("webpack"), | ||
config = require("../webpack.config"), | ||
env = require("./env"), | ||
path = require("path"); | ||
const WebpackDevServer = require('webpack-dev-server') | ||
const webpack = require('webpack') | ||
const path = require('path') | ||
const config = require('../webpack.config') | ||
const env = require('./env') | ||
|
||
var options = (config.chromeExtensionBoilerplate || {}); | ||
var excludeEntriesToHotReload = (options.notHotReload || []); | ||
const options = (config.chromeExtensionBoilerplate || {}) | ||
const excludeEntriesToHotReload = (options.notHotReload || []) | ||
|
||
for (var entryName in config.entry) { | ||
if (excludeEntriesToHotReload.indexOf(entryName) === -1) { | ||
config.entry[entryName] = | ||
[ | ||
("webpack-dev-server/client?http://localhost:" + env.PORT), | ||
"webpack/hot/dev-server" | ||
].concat(config.entry[entryName]); | ||
} | ||
for (const entryName in config.entry) { | ||
if (excludeEntriesToHotReload.indexOf(entryName) === -1) { | ||
config.entry[entryName] = [ | ||
(`webpack-dev-server/client?http://localhost:${env.PORT}`), | ||
'webpack/hot/dev-server', | ||
].concat(config.entry[entryName]) | ||
} | ||
} | ||
|
||
config.plugins = | ||
[new webpack.HotModuleReplacementPlugin()].concat(config.plugins || []); | ||
config.plugins = [new webpack.HotModuleReplacementPlugin()].concat(config.plugins || []) | ||
|
||
delete config.chromeExtensionBoilerplate; | ||
delete config.chromeExtensionBoilerplate | ||
|
||
var compiler = webpack(config); | ||
const compiler = webpack(config) | ||
|
||
var server = | ||
new WebpackDevServer(compiler, { | ||
const server = new WebpackDevServer(compiler, { | ||
hot: true, | ||
contentBase: path.join(__dirname, "../build"), | ||
contentBase: path.join(__dirname, '../build'), | ||
sockPort: env.PORT, | ||
headers: { | ||
"Access-Control-Allow-Origin": "*" | ||
'Access-Control-Allow-Origin': '*', | ||
}, | ||
disableHostCheck: true | ||
}); | ||
disableHostCheck: true, | ||
}) | ||
|
||
server.listen(env.PORT); | ||
server.listen(env.PORT) |
Oops, something went wrong.