Skip to content

Commit

Permalink
fix: webpack running
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed May 2, 2022
1 parent 0673452 commit 247938a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 37 deletions.
26 changes: 0 additions & 26 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI

-----

The following software may be included in this product: app-root-path. A copy of the source code may be downloaded from https://github.com/inxilpro/node-app-root-path.git. This software contains the following license and notice below:

The MIT License (MIT)

Copyright (c) 2014 Chris Morrell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

-----

The following software may be included in this product: aproba, wide-align. A copy of the source code may be downloaded from https://github.com/iarna/aproba (aproba), https://github.com/iarna/wide-align (wide-align). This software contains the following license and notice below:

Copyright (c) 2015, Rebecca Turner <[email protected]>
Expand Down
7 changes: 5 additions & 2 deletions lib/Instance/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import fs from 'fs-extra'
import shortid from 'shortid'
import appRootPath from 'app-root-path'
import { from15to32, rgb, rgbRev, sendResult } from '../Resources/Util.js'
import CoreBase from '../Core/Base.js'
import InstancePreset from './Preset.js'
Expand Down Expand Up @@ -117,7 +116,11 @@ class Instance extends CoreBase {
async initInstances() {
this.debug('instance_init', this.store.db)

const rootPath = appRootPath.toString()
const rootPath =
typeof __webpack_require__ === 'function'
? path.join(__dirname, '..')
: fileURLToPath(new URL('../../', import.meta.url))

const searchDirs = [
// Paths to look for modules, in order of priority
path.join(rootPath, '/module-local-dev'),
Expand Down
2 changes: 1 addition & 1 deletion lib/Registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class Registry extends EventEmitter {
if (logToFile) {
debug('Going into headless mode. Logs will be written to companion.log')

setInterval(function () {
setInterval(() => {
if (logbuffer.length > 0 && logwriting == false) {
var writestring = logbuffer.join('\n')
logbuffer = []
Expand Down
2 changes: 1 addition & 1 deletion lib/UI/Express.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class UIExpress extends Express {
* We don't want to ship hundreds of loose files, so instead we can serve them from a zip file
*/
const resourcesDir =
typeof __webpack_require__ === 'function' ? './' : fileURLToPath(new URL('../../', import.meta.url))
typeof __webpack_require__ === 'function' ? __dirname : fileURLToPath(new URL('../../', import.meta.url))

const webuiServer = createServeStatic(path.join(resourcesDir, 'webui.zip'), [
path.join(resourcesDir, 'static'),
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
"@elgato-stream-deck/node": "^5.3.1",
"@estilles/expression-parser": "^1.0.0",
"@sentry/electron": "^2.5.4",
"app-root-path": "^3.0.0",
"archiver": "^5.3.1",
"debug": "^4.3.4",
"electron-store": "^8.0.1",
Expand Down
5 changes: 4 additions & 1 deletion webpack.config.js → webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ module.exports = {
// },
// },
externals: {
// 'node-hid': 'commonjs2 node-hid',
'node-hid': 'commonjs2 node-hid',
sharp: 'commonjs2 sharp',
},
experiments: {
topLevelAwait: true,
},
}
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1475,11 +1475,6 @@ [email protected]:
semver "^7.3.5"
temp-file "^3.4.0"

app-root-path@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/app-root-path/-/app-root-path-3.0.0.tgz#210b6f43873227e18a4b810a032283311555d5ad"
integrity sha512-qMcx+Gy2UZynHjOHOIXPNvpf+9cjvk3cWrBBK7zg4gH9+clobJRb9NGzcT7mQTcV/6Gm/1WelUtqxVXnNlrwcw==

aproba@^1.0.3:
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
Expand Down

0 comments on commit 247938a

Please sign in to comment.