diff --git a/shared/js/ui/modal/video-source/Controller.tsx b/shared/js/ui/modal/video-source/Controller.tsx index e640b313..94c65317 100644 --- a/shared/js/ui/modal/video-source/Controller.tsx +++ b/shared/js/ui/modal/video-source/Controller.tsx @@ -103,7 +103,7 @@ export async function spawnVideoSourceSelectModal(type: VideoBroadcastType, mode }); } - modal.events.one(["destroy", "close"], resolve); + modal.getEvents().one(["destroy", "close"], resolve); }); controller.destroy(); diff --git a/tools/trgen/ts_generator.ts b/tools/trgen/ts_generator.ts index ee2d8bf4..fa0911b4 100644 --- a/tools/trgen/ts_generator.ts +++ b/tools/trgen/ts_generator.ts @@ -1,6 +1,6 @@ import * as ts from "typescript"; import {SyntaxKind} from "typescript"; -import * as sha256 from "sha256"; +import sha256 from "sha256"; import {TranslationEntry} from "./generator"; export function generate(file: ts.SourceFile, config: Configuration) : TranslationEntry[] { diff --git a/tools/trgen/ts_transformer.ts b/tools/trgen/ts_transformer.ts index 5b00475a..096c2ec2 100644 --- a/tools/trgen/ts_transformer.ts +++ b/tools/trgen/ts_transformer.ts @@ -41,8 +41,7 @@ export default function(program: ts.Program, config?: Config) : (context: ts.Tra let processed = []; const translations: TranslationEntry[] = []; -const transformer = (context: ts.TransformationContext) => -(rootNode: ts.Node) => { +const transformer = (context: ts.TransformationContext) => (rootNode: ts.Node) => { const handler = (rootNode: ts.Node) => { if(rootNode.kind == ts.SyntaxKind.Bundle) { const bundle = rootNode as ts.Bundle; diff --git a/tools/trgen/tsconfig.json b/tools/trgen/tsconfig.json index 0229e46b..d4815f28 100644 --- a/tools/trgen/tsconfig.json +++ b/tools/trgen/tsconfig.json @@ -6,7 +6,9 @@ "lib": ["es6"], "typeRoots": [], - "types": [] + "types": [], + + "esModuleInterop": true }, "files": [ "generator.ts", diff --git a/tsbaseconfig.json b/tsbaseconfig.json index 99f06205..8252103a 100644 --- a/tsbaseconfig.json +++ b/tsbaseconfig.json @@ -5,7 +5,8 @@ "module": "commonjs", "sourceMap": true, "lib": ["es6", "dom"], - "removeComments": false + "removeComments": false, + "esModuleInterop": true }, "include": [ "webpack.config.ts", diff --git a/web/app/index.ts b/web/app/index.ts index 1e389d0e..53b343d5 100644 --- a/web/app/index.ts +++ b/web/app/index.ts @@ -4,8 +4,6 @@ import "webcrypto-liner"; import "./index.scss"; import "./FileTransfer"; -import "./legacy/audio-lib"; - import "./hooks/ServerConnection"; import "./hooks/ExternalModal"; import "./hooks/AudioRecorder"; diff --git a/webpack.config.ts b/webpack.config.ts index 3d610a2d..850eb891 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -20,23 +20,28 @@ const { WebpackManifestPlugin } = require('webpack-manifest-plugin'); export let isDevelopment = process.env.NODE_ENV === 'development'; console.log("Webpacking for %s (%s)", isDevelopment ? "development" : "production", process.env.NODE_ENV || "NODE_ENV not specified"); + const generateDefinitions = async (target: string) => { - const git_rev = fs.readFileSync(path.join(__dirname, ".git", "HEAD")).toString(); + const gitRevision = fs.readFileSync(path.join(__dirname, ".git", "HEAD")).toString(); let version; - if(git_rev.indexOf("/") === -1) - version = (git_rev || "0000000").substr(0, 7); - else - version = fs.readFileSync(path.join(__dirname, ".git", git_rev.substr(5).trim())).toString().substr(0, 7); + if(gitRevision.indexOf("/") === -1) { + version = (gitRevision || "0000000").substr(0, 7); + } else { + version = fs.readFileSync(path.join(__dirname, ".git", gitRevision.substr(5).trim())).toString().substr(0, 7); + } let timestamp; try { const { stdout } = await util.promisify(exec)("git show -s --format=%ct"); timestamp = parseInt(stdout.toString()); - if(isNaN(timestamp)) throw "failed to parse timestamp '" + stdout.toString() + "'"; + if(isNaN(timestamp)) { + throw "failed to parse timestamp '" + stdout.toString() + "'"; + } } catch (error) { console.error("Failed to get commit timestamp: %o", error); throw "failed to get commit timestamp"; } + return { "__build": { target: JSON.stringify(target), @@ -45,7 +50,7 @@ const generateDefinitions = async (target: string) => { timestamp: timestamp, entry_chunk_name: JSON.stringify(target === "web" ? "shared-app" : "client-app") } as BuildDefinitions - } as any; + }; }; const isLoaderFile = (file: string) => { @@ -58,11 +63,11 @@ const isLoaderFile = (file: string) => { return false; }; -export const config = async (target: "web" | "client"): Promise => { return { +export const config = async (target: "web" | "client"): Promise => ({ entry: { "loader": "./loader/app/index.ts", "modal-external": "./shared/js/ui/react-elements/external-modal/PopoutEntrypoint.ts", - "devel-main": "./shared/js/devel_main.ts" + //"devel-main": "./shared/js/devel_main.ts" }, devtool: isDevelopment ? "inline-source-map" : undefined, @@ -133,14 +138,7 @@ export const config = async (target: "web" | "client"): Promise = test: /\.(s[ac]|c)ss$/, loader: [ 'style-loader', - /* - { - loader: MiniCssExtractPlugin.loader, - options: { - esModule: true, - }, - }, - */ + //MiniCssExtractPlugin.loader, { loader: 'css-loader', options: { @@ -180,12 +178,6 @@ export const config = async (target: "web" | "client"): Promise = }, transpileOnly: isDevelopment } - }, - { - loader: "./webpack/DevelBlocks.js", - options: { - enabled: true - } } ] }, @@ -258,4 +250,4 @@ export const config = async (target: "web" | "client"): Promise = minimize: !isDevelopment, minimizer: [new TerserPlugin()] } -}}; \ No newline at end of file +}); \ No newline at end of file