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" |         "node": ">=18.0.0" | ||||||
|     }, |     }, | ||||||
|     "scripts": { |     "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", |         "watch": "tsc -w", | ||||||
|         "start": "npm run build && electron ./ts-out/main.js", |         "start": "npm run build && electron ./ts-out/main.js", | ||||||
|         "startThemeManager": "npm run build && electron ./ts-out/main.js themes", |         "startThemeManager": "npm run build && electron ./ts-out/main.js themes", | ||||||
|  | @ -16,7 +16,6 @@ | ||||||
|         "package": "npm run build && electron-builder", |         "package": "npm run build && electron-builder", | ||||||
|         "packageQuick": "npm run build && electron-builder --dir", |         "packageQuick": "npm run build && electron-builder --dir", | ||||||
|         "format": "prettier --write src *.json", |         "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", |         "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", |         "CIbuild": "npm run build && electron-builder --linux zip && electron-builder --windows zip && electron-builder --macos zip", | ||||||
|         "prepare": "git config --local core.hooksPath .hooks/" |         "prepare": "git config --local core.hooksPath .hooks/" | ||||||
|  | @ -44,7 +43,6 @@ | ||||||
|         "eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel", |         "eslint-config-dmitmel": "github:dmitmel/eslint-config-dmitmel", | ||||||
|         "eslint-plugin-node": "^11.1.0", |         "eslint-plugin-node": "^11.1.0", | ||||||
|         "eslint-plugin-prettier": "^4.2.1", |         "eslint-plugin-prettier": "^4.2.1", | ||||||
|         "fix-esm-import-path": "github:smartfrigde/fix-esm-import-path", |  | ||||||
|         "prettier": "^2.7.1", |         "prettier": "^2.7.1", | ||||||
|         "typescript": "^4.9.3" |         "typescript": "^4.9.3" | ||||||
|     }, |     }, | ||||||
|  |  | ||||||
							
								
								
									
										14
									
								
								pnpm-lock.yaml
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										14
									
								
								pnpm-lock.yaml
									
										
									
										generated
									
									
									
								
							|  | @ -60,9 +60,6 @@ importers: | ||||||
|       eslint-plugin-prettier: |       eslint-plugin-prettier: | ||||||
|         specifier: ^4.2.1 |         specifier: ^4.2.1 | ||||||
|         version: 4.2.1(eslint@8.40.0)(prettier@2.7.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: |       prettier: | ||||||
|         specifier: ^2.7.1 |         specifier: ^2.7.1 | ||||||
|         version: 2.7.1 |         version: 2.7.1 | ||||||
|  | @ -766,11 +763,6 @@ packages: | ||||||
|     resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} |     resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} | ||||||
|     engines: {node: '>=10'} |     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: |   flat-cache@3.0.4: | ||||||
|     resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} |     resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} | ||||||
|     engines: {node: ^10.12.0 || >=12.0.0} |     engines: {node: ^10.12.0 || >=12.0.0} | ||||||
|  | @ -2513,12 +2505,6 @@ snapshots: | ||||||
|       locate-path: 6.0.0 |       locate-path: 6.0.0 | ||||||
|       path-exists: 4.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: |   flat-cache@3.0.4: | ||||||
|     dependencies: |     dependencies: | ||||||
|       flatted: 3.2.7 |       flatted: 3.2.7 | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import {app, dialog} from "electron"; | import {app, dialog} from "electron"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import {getWindowStateLocation} from "./windowState"; | import {getWindowStateLocation} from "./windowState.js"; | ||||||
| export let firstRun: boolean; | export let firstRun: boolean; | ||||||
| export function checkForDataFolder(): void { | export function checkForDataFolder(): void { | ||||||
|     const dataPath = path.join(path.dirname(app.getPath("exe")), "armcord-data"); |     const dataPath = path.join(path.dirname(app.getPath("exe")), "armcord-data"); | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| import {app} from "electron"; | import {app} from "electron"; | ||||||
| import {getConfig} from "./config"; | import {getConfig} from "./config.js"; | ||||||
| 
 | 
 | ||||||
| export let transparency: boolean; | export let transparency: boolean; | ||||||
| export async function injectElectronFlags(): Promise<void> { | export async function injectElectronFlags(): Promise<void> { | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| import electron from "electron"; | import electron from "electron"; | ||||||
| import {getConfig} from "../../common/config"; | import {getConfig} from "../../common/config.js"; | ||||||
| 
 | 
 | ||||||
| const unstrictCSP = (): void => { | const unstrictCSP = (): void => { | ||||||
|     console.log("Setting up CSP unstricter..."); |     console.log("Setting up CSP unstricter..."); | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import {app, dialog} from "electron"; | import {app, dialog} from "electron"; | ||||||
| import extract from "extract-zip"; | import extract from "extract-zip"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import {getConfig} from "../../common/config"; | import {getConfig} from "../../common/config.js"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import {promisify} from "node:util"; | import {promisify} from "node:util"; | ||||||
| import {pipeline} from "stream"; | import {pipeline} from "stream"; | ||||||
|  |  | ||||||
|  | @ -1,19 +1,19 @@ | ||||||
| //ipc stuff
 | //ipc stuff
 | ||||||
| import {app, clipboard, desktopCapturer, ipcMain, nativeImage, shell} from "electron"; | import {app, clipboard, desktopCapturer, ipcMain, nativeImage, shell} from "electron"; | ||||||
| import {mainWindow} from "./window"; | import {mainWindow} from "./window.js"; | ||||||
| 
 | 
 | ||||||
| import os from "os"; | import os from "os"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import {getConfig, setConfigBulk, getConfigLocation, Settings} from "../common/config"; | import {getConfig, setConfigBulk, getConfigLocation, Settings} from "../common/config.js"; | ||||||
| import {setLang, getLang, getLangName} from "../common/lang"; | import {setLang, getLang, getLangName} from "../common/lang.js"; | ||||||
| import {sleep} from "../common/sleep"; | import {sleep} from "../common/sleep.js"; | ||||||
| import {getVersion, getDisplayVersion} from "../common/version"; | import {getVersion, getDisplayVersion} from "../common/version.js"; | ||||||
| import {customTitlebar} from "../main"; | import {customTitlebar} from "../main.js"; | ||||||
| import {createSettingsWindow} from "../settings/main"; | import {createSettingsWindow} from "../settings/main.js"; | ||||||
| import {splashWindow} from "../splash/main"; | import {splashWindow} from "../splash/main.js"; | ||||||
| import {createTManagerWindow} from "../themeManager/main"; | import {createTManagerWindow} from "../themeManager/main.js"; | ||||||
| import {modInstallState} from "./extensions/mods"; | import {modInstallState} from "./extensions/mods.js"; | ||||||
| 
 | 
 | ||||||
| const userDataPath = app.getPath("userData"); | const userDataPath = app.getPath("userData"); | ||||||
| const storagePath = path.join(userDataPath, "/storage/"); | const storagePath = path.join(userDataPath, "/storage/"); | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| import {BrowserWindow, Menu, app, clipboard} from "electron"; | import {BrowserWindow, Menu, app, clipboard} from "electron"; | ||||||
| import {mainWindow} from "./window"; | import {mainWindow} from "./window.js"; | ||||||
| import {createSettingsWindow} from "../settings/main"; | import {createSettingsWindow} from "../settings/main.js"; | ||||||
| 
 | 
 | ||||||
| function paste(contents: any): void { | function paste(contents: any): void { | ||||||
|     const contentTypes = clipboard.availableFormats().toString(); |     const contentTypes = clipboard.availableFormats().toString(); | ||||||
|  |  | ||||||
|  | @ -4,16 +4,16 @@ | ||||||
| // I'm sorry for this mess but I'm not sure how to fix it.
 | // 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 {BrowserWindow, MessageBoxOptions, app, dialog, nativeImage, shell} from "electron"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import {registerIpc} from "./ipc"; | import {registerIpc} from "./ipc.js"; | ||||||
| import {setMenu} from "./menu"; | import {setMenu} from "./menu.js"; | ||||||
| import * as fs from "fs"; | import * as fs from "fs"; | ||||||
| import contextMenu from "electron-context-menu"; | import contextMenu from "electron-context-menu"; | ||||||
| import os from "os"; | import os from "os"; | ||||||
| import RPCServer from "arrpc"; | import RPCServer from "arrpc"; | ||||||
| import {tray} from "../tray"; | import {tray} from "../tray.js"; | ||||||
| import {iconPath} from "../main"; | import {iconPath} from "../main.js"; | ||||||
| import {getConfig, setConfig, firstRun} from "../common/config"; | import {getConfig, setConfig, firstRun} from "../common/config.js"; | ||||||
| import {getWindowState, setWindowState} from "../common/windowState"; | import {getWindowState, setWindowState} from "../common/windowState.js"; | ||||||
| export let mainWindow: BrowserWindow; | export let mainWindow: BrowserWindow; | ||||||
| export let inviteWindow: BrowserWindow; | export let inviteWindow: BrowserWindow; | ||||||
| let forceQuit = false; | 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
 | // Modules to control application life and create native browser window
 | ||||||
| import {BrowserWindow, app, crashReporter, session} from "electron"; | import {BrowserWindow, app, crashReporter, session} from "electron"; | ||||||
| import "v8-compile-cache"; | import "v8-compile-cache"; | ||||||
| import "./discord/extensions/csp"; | import "./discord/extensions/csp.js"; | ||||||
| import "./tray"; | import "./tray.js"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./discord/window"; | import {createCustomWindow, createNativeWindow, createTransparentWindow} from "./discord/window.js"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import {createTManagerWindow} from "./themeManager/main"; | import {createTManagerWindow} from "./themeManager/main.js"; | ||||||
| import {createSplashWindow} from "./splash/main"; | import {createSplashWindow} from "./splash/main.js"; | ||||||
| import {createSetupWindow} from "./setup/main"; | import {createSetupWindow} from "./setup/main.js"; | ||||||
| import { | import { | ||||||
|     setConfig, |     setConfig, | ||||||
|     getConfigSync, |     getConfigSync, | ||||||
|  | @ -19,10 +19,10 @@ import { | ||||||
|     firstRun, |     firstRun, | ||||||
|     Settings, |     Settings, | ||||||
|     getConfigLocation |     getConfigLocation | ||||||
| } from "./common/config"; | } from "./common/config.js"; | ||||||
| import {injectElectronFlags} from "./common/flags"; | import {injectElectronFlags} from "./common/flags.js"; | ||||||
| import {setLang} from "./common/lang"; | import {setLang} from "./common/lang.js"; | ||||||
| import {installModLoader} from "./discord/extensions/mods"; | import {installModLoader} from "./discord/extensions/mods.js"; | ||||||
| export let iconPath: string; | export let iconPath: string; | ||||||
| export let settings: any; | export let settings: any; | ||||||
| export let customTitlebar: boolean; | export let customTitlebar: boolean; | ||||||
|  |  | ||||||
|  | @ -1,7 +1,7 @@ | ||||||
| import {BrowserWindow, app, shell} from "electron"; | import {BrowserWindow, app, shell} from "electron"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import {getDisplayVersion} from "../common/version"; | import {getDisplayVersion} from "../common/version.js"; | ||||||
| let settingsWindow: BrowserWindow; | let settingsWindow: BrowserWindow; | ||||||
| let instance = 0; | let instance = 0; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| import {contextBridge, ipcRenderer} from "electron"; | import {contextBridge, ipcRenderer} from "electron"; | ||||||
| //import {addStyle} from "../utils";
 | //import {addStyle} from "../utils.js";
 | ||||||
| console.log("ArmCord Settings"); | console.log("ArmCord Settings"); | ||||||
| console.log(process.platform); | console.log(process.platform); | ||||||
| contextBridge.exposeInMainWorld("settings", { | contextBridge.exposeInMainWorld("settings", { | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| import {BrowserWindow, app, ipcMain} from "electron"; | import {BrowserWindow, app, ipcMain} from "electron"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import * as fs from "fs"; | import * as fs from "fs"; | ||||||
| import {iconPath} from "../main"; | import {iconPath} from "../main.js"; | ||||||
| import {setConfigBulk, getConfigLocation, Settings} from "../common/config"; | import {setConfigBulk, getConfigLocation, Settings} from "../common/config.js"; | ||||||
| 
 | 
 | ||||||
| let setupWindow: BrowserWindow; | let setupWindow: BrowserWindow; | ||||||
| export function createSetupWindow(): void { | export function createSetupWindow(): void { | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| import {BrowserWindow} from "electron"; | import {BrowserWindow} from "electron"; | ||||||
| import {iconPath} from "../main"; | import {iconPath} from "../main.js"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| 
 | 
 | ||||||
| export let splashWindow: BrowserWindow; | export let splashWindow: BrowserWindow; | ||||||
|  |  | ||||||
|  | @ -1,8 +1,8 @@ | ||||||
| import {BrowserWindow, app, dialog, ipcMain, shell} from "electron"; | import {BrowserWindow, app, dialog, ipcMain, shell} from "electron"; | ||||||
| import path from "path"; | import path from "path"; | ||||||
| import fs from "fs"; | import fs from "fs"; | ||||||
| import {sleep} from "../common/sleep"; | import {sleep} from "../common/sleep.js"; | ||||||
| import {createInviteWindow, mainWindow} from "../discord/window"; | import {createInviteWindow, mainWindow} from "../discord/window.js"; | ||||||
| let themeWindow: BrowserWindow; | let themeWindow: BrowserWindow; | ||||||
| let instance = 0; | let instance = 0; | ||||||
| interface ThemeManifest { | interface ThemeManifest { | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| import {ipcRenderer, contextBridge} from "electron"; | import {ipcRenderer, contextBridge} from "electron"; | ||||||
| import {sleep} from "../common/sleep"; | import {sleep} from "../common/sleep.js"; | ||||||
| contextBridge.exposeInMainWorld("themes", { | contextBridge.exposeInMainWorld("themes", { | ||||||
|     install: (url: string) => ipcRenderer.send("installBDTheme", url), |     install: (url: string) => ipcRenderer.send("installBDTheme", url), | ||||||
|     uninstall: (id: string) => ipcRenderer.send("uninstallTheme", id) |     uninstall: (id: string) => ipcRenderer.send("uninstallTheme", id) | ||||||
|  |  | ||||||
|  | @ -1,10 +1,10 @@ | ||||||
| import * as fs from "fs"; | import * as fs from "fs"; | ||||||
| import {Menu, MessageBoxOptions, Tray, app, dialog, nativeImage} from "electron"; | 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 * as path from "path"; | ||||||
| import {createSettingsWindow} from "./settings/main"; | import {createSettingsWindow} from "./settings/main.js"; | ||||||
| import {getConfig, getConfigLocation, setConfig} from "./common/config"; | import {getConfig, getConfigLocation, setConfig} from "./common/config.js"; | ||||||
| import {getDisplayVersion} from "./common/version"; | import {getDisplayVersion} from "./common/version.js"; | ||||||
| export let tray: any = null; | export let tray: any = null; | ||||||
| let trayIcon = "ac_plug_colored"; | let trayIcon = "ac_plug_colored"; | ||||||
| app.whenReady().then(async () => { | app.whenReady().then(async () => { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue