mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
include file extensions on imports (#599)
* include file extensions on imports * missed two
This commit is contained in:
parent
871202aad1
commit
36e5f95705
17 changed files with 45 additions and 61 deletions
|
@ -7,7 +7,7 @@
|
|||
"node": ">=18.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc && copyfiles -u 1 src/**/*.html src/**/**/*.css src/**/**/*.js ts-out/ && copyfiles package.json ts-out/ && copyfiles assets/**/** ts-out/ && npm run fixEsmImportPath",
|
||||
"build": "tsc && copyfiles -u 1 src/**/*.html src/**/**/*.css src/**/**/*.js ts-out/ && copyfiles package.json ts-out/ && copyfiles assets/**/** ts-out/",
|
||||
"watch": "tsc -w",
|
||||
"start": "npm run build && electron ./ts-out/main.js",
|
||||
"startThemeManager": "npm run build && electron ./ts-out/main.js themes",
|
||||
|
@ -16,7 +16,6 @@
|
|||
"package": "npm run build && electron-builder",
|
||||
"packageQuick": "npm run build && electron-builder --dir",
|
||||
"format": "prettier --write src *.json",
|
||||
"fixEsmImportPath": "fix-esm-import-path ts-out/main.js",
|
||||
"lint": "eslint src --ext .js,.jsx,.ts,.tsx --ignore-path .gitignore",
|
||||
"CIbuild": "npm run build && electron-builder --linux zip && electron-builder --windows zip && electron-builder --macos zip",
|
||||
"prepare": "git config --local core.hooksPath .hooks/"
|
||||
|
@ -44,7 +43,6 @@
|
|||
"eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"fix-esm-import-path": "github:smartfrigde/fix-esm-import-path",
|
||||
"prettier": "^2.7.1",
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
|
|
|
@ -60,9 +60,6 @@ importers:
|
|||
eslint-plugin-prettier:
|
||||
specifier: ^4.2.1
|
||||
version: 4.2.1(eslint@8.40.0)(prettier@2.7.1)
|
||||
fix-esm-import-path:
|
||||
specifier: github:smartfrigde/fix-esm-import-path
|
||||
version: https://codeload.github.com/smartfrigde/fix-esm-import-path/tar.gz/71f374903884f2da21aad60b8c6a34c144523bbf
|
||||
prettier:
|
||||
specifier: ^2.7.1
|
||||
version: 2.7.1
|
||||
|
@ -766,11 +763,6 @@ packages:
|
|||
resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
fix-esm-import-path@https://codeload.github.com/smartfrigde/fix-esm-import-path/tar.gz/71f374903884f2da21aad60b8c6a34c144523bbf:
|
||||
resolution: {tarball: https://codeload.github.com/smartfrigde/fix-esm-import-path/tar.gz/71f374903884f2da21aad60b8c6a34c144523bbf}
|
||||
version: 1.5.0
|
||||
hasBin: true
|
||||
|
||||
flat-cache@3.0.4:
|
||||
resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==}
|
||||
engines: {node: ^10.12.0 || >=12.0.0}
|
||||
|
@ -2513,12 +2505,6 @@ snapshots:
|
|||
locate-path: 6.0.0
|
||||
path-exists: 4.0.0
|
||||
|
||||
fix-esm-import-path@https://codeload.github.com/smartfrigde/fix-esm-import-path/tar.gz/71f374903884f2da21aad60b8c6a34c144523bbf:
|
||||
dependencies:
|
||||
debug: 4.3.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
flat-cache@3.0.4:
|
||||
dependencies:
|
||||
flatted: 3.2.7
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {app, dialog} from "electron";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import {getWindowStateLocation} from "./windowState";
|
||||
import {getWindowStateLocation} from "./windowState.js";
|
||||
export let firstRun: boolean;
|
||||
export function checkForDataFolder(): void {
|
||||
const dataPath = path.join(path.dirname(app.getPath("exe")), "armcord-data");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {app} from "electron";
|
||||
import {getConfig} from "./config";
|
||||
import {getConfig} from "./config.js";
|
||||
|
||||
export let transparency: boolean;
|
||||
export async function injectElectronFlags(): Promise<void> {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import electron from "electron";
|
||||
import {getConfig} from "../../common/config";
|
||||
import {getConfig} from "../../common/config.js";
|
||||
|
||||
const unstrictCSP = (): void => {
|
||||
console.log("Setting up CSP unstricter...");
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {app, dialog} from "electron";
|
||||
import extract from "extract-zip";
|
||||
import path from "path";
|
||||
import {getConfig} from "../../common/config";
|
||||
import {getConfig} from "../../common/config.js";
|
||||
import fs from "fs";
|
||||
import {promisify} from "node:util";
|
||||
import {pipeline} from "stream";
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
//ipc stuff
|
||||
import {app, clipboard, desktopCapturer, ipcMain, nativeImage, shell} from "electron";
|
||||
import {mainWindow} from "./window";
|
||||
import {mainWindow} from "./window.js";
|
||||
|
||||
import os from "os";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import {getConfig, setConfigBulk, getConfigLocation, Settings} from "../common/config";
|
||||
import {setLang, getLang, getLangName} from "../common/lang";
|
||||
import {sleep} from "../common/sleep";
|
||||
import {getVersion, getDisplayVersion} from "../common/version";
|
||||
import {customTitlebar} from "../main";
|
||||
import {createSettingsWindow} from "../settings/main";
|
||||
import {splashWindow} from "../splash/main";
|
||||
import {createTManagerWindow} from "../themeManager/main";
|
||||
import {modInstallState} from "./extensions/mods";
|
||||
import {getConfig, setConfigBulk, getConfigLocation, Settings} from "../common/config.js";
|
||||
import {setLang, getLang, getLangName} from "../common/lang.js";
|
||||
import {sleep} from "../common/sleep.js";
|
||||
import {getVersion, getDisplayVersion} from "../common/version.js";
|
||||
import {customTitlebar} from "../main.js";
|
||||
import {createSettingsWindow} from "../settings/main.js";
|
||||
import {splashWindow} from "../splash/main.js";
|
||||
import {createTManagerWindow} from "../themeManager/main.js";
|
||||
import {modInstallState} from "./extensions/mods.js";
|
||||
|
||||
const userDataPath = app.getPath("userData");
|
||||
const storagePath = path.join(userDataPath, "/storage/");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import {BrowserWindow, Menu, app, clipboard} from "electron";
|
||||
import {mainWindow} from "./window";
|
||||
import {createSettingsWindow} from "../settings/main";
|
||||
import {mainWindow} from "./window.js";
|
||||
import {createSettingsWindow} from "../settings/main.js";
|
||||
|
||||
function paste(contents: any): void {
|
||||
const contentTypes = clipboard.availableFormats().toString();
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
// I'm sorry for this mess but I'm not sure how to fix it.
|
||||
import {BrowserWindow, MessageBoxOptions, app, dialog, nativeImage, shell} from "electron";
|
||||
import path from "path";
|
||||
import {registerIpc} from "./ipc";
|
||||
import {setMenu} from "./menu";
|
||||
import {registerIpc} from "./ipc.js";
|
||||
import {setMenu} from "./menu.js";
|
||||
import * as fs from "fs";
|
||||
import contextMenu from "electron-context-menu";
|
||||
import os from "os";
|
||||
import RPCServer from "arrpc";
|
||||
import {tray} from "../tray";
|
||||
import {iconPath} from "../main";
|
||||
import {getConfig, setConfig, firstRun} from "../common/config";
|
||||
import {getWindowState, setWindowState} from "../common/windowState";
|
||||
import {tray} from "../tray.js";
|
||||
import {iconPath} from "../main.js";
|
||||
import {getConfig, setConfig, firstRun} from "../common/config.js";
|
||||
import {getWindowState, setWindowState} from "../common/windowState.js";
|
||||
export let mainWindow: BrowserWindow;
|
||||
export let inviteWindow: BrowserWindow;
|
||||
let forceQuit = false;
|
||||
|
|
20
src/main.ts
20
src/main.ts
|
@ -1,14 +1,14 @@
|
|||
// Modules to control application life and create native browser window
|
||||
import {BrowserWindow, app, crashReporter, session} from "electron";
|
||||
import "v8-compile-cache";
|
||||
import "./discord/extensions/csp";
|
||||
import "./tray";
|
||||
import "./discord/extensions/csp.js";
|
||||
import "./tray.js";
|
||||
import fs from "fs";
|
||||
import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./discord/window";
|
||||
import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./discord/window.js";
|
||||
import path from "path";
|
||||
import {createTManagerWindow} from "./themeManager/main";
|
||||
import {createSplashWindow} from "./splash/main";
|
||||
import {createSetupWindow} from "./setup/main";
|
||||
import {createTManagerWindow} from "./themeManager/main.js";
|
||||
import {createSplashWindow} from "./splash/main.js";
|
||||
import {createSetupWindow} from "./setup/main.js";
|
||||
import {
|
||||
setConfig,
|
||||
getConfigSync,
|
||||
|
@ -19,10 +19,10 @@ import {
|
|||
firstRun,
|
||||
Settings,
|
||||
getConfigLocation
|
||||
} from "./common/config";
|
||||
import {injectElectronFlags} from "./common/flags";
|
||||
import {setLang} from "./common/lang";
|
||||
import {installModLoader} from "./discord/extensions/mods";
|
||||
} from "./common/config.js";
|
||||
import {injectElectronFlags} from "./common/flags.js";
|
||||
import {setLang} from "./common/lang.js";
|
||||
import {installModLoader} from "./discord/extensions/mods.js";
|
||||
export let iconPath: string;
|
||||
export let settings: any;
|
||||
export let customTitlebar: boolean;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import {BrowserWindow, app, shell} from "electron";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import {getDisplayVersion} from "../common/version";
|
||||
import {getDisplayVersion} from "../common/version.js";
|
||||
let settingsWindow: BrowserWindow;
|
||||
let instance = 0;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {contextBridge, ipcRenderer} from "electron";
|
||||
//import {addStyle} from "../utils";
|
||||
//import {addStyle} from "../utils.js";
|
||||
console.log("ArmCord Settings");
|
||||
console.log(process.platform);
|
||||
contextBridge.exposeInMainWorld("settings", {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import {BrowserWindow, app, ipcMain} from "electron";
|
||||
import path from "path";
|
||||
import * as fs from "fs";
|
||||
import {iconPath} from "../main";
|
||||
import {setConfigBulk, getConfigLocation, Settings} from "../common/config";
|
||||
import {iconPath} from "../main.js";
|
||||
import {setConfigBulk, getConfigLocation, Settings} from "../common/config.js";
|
||||
|
||||
let setupWindow: BrowserWindow;
|
||||
export function createSetupWindow(): void {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {BrowserWindow} from "electron";
|
||||
import {iconPath} from "../main";
|
||||
import {iconPath} from "../main.js";
|
||||
import path from "path";
|
||||
|
||||
export let splashWindow: BrowserWindow;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import {BrowserWindow, app, dialog, ipcMain, shell} from "electron";
|
||||
import path from "path";
|
||||
import fs from "fs";
|
||||
import {sleep} from "../common/sleep";
|
||||
import {createInviteWindow, mainWindow} from "../discord/window";
|
||||
import {sleep} from "../common/sleep.js";
|
||||
import {createInviteWindow, mainWindow} from "../discord/window.js";
|
||||
let themeWindow: BrowserWindow;
|
||||
let instance = 0;
|
||||
interface ThemeManifest {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {ipcRenderer, contextBridge} from "electron";
|
||||
import {sleep} from "../common/sleep";
|
||||
import {sleep} from "../common/sleep.js";
|
||||
contextBridge.exposeInMainWorld("themes", {
|
||||
install: (url: string) => ipcRenderer.send("installBDTheme", url),
|
||||
uninstall: (id: string) => ipcRenderer.send("uninstallTheme", id)
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as fs from "fs";
|
||||
import {Menu, MessageBoxOptions, Tray, app, dialog, nativeImage} from "electron";
|
||||
import {createInviteWindow, mainWindow} from "./discord/window";
|
||||
import {createInviteWindow, mainWindow} from "./discord/window.js";
|
||||
import * as path from "path";
|
||||
import {createSettingsWindow} from "./settings/main";
|
||||
import {getConfig, getConfigLocation, setConfig} from "./common/config";
|
||||
import {getDisplayVersion} from "./common/version";
|
||||
import {createSettingsWindow} from "./settings/main.js";
|
||||
import {getConfig, getConfigLocation, setConfig} from "./common/config.js";
|
||||
import {getDisplayVersion} from "./common/version.js";
|
||||
export let tray: any = null;
|
||||
let trayIcon = "ac_plug_colored";
|
||||
app.whenReady().then(async () => {
|
||||
|
|
Loading…
Reference in a new issue