Add .gitignore for electron:package artifacts and lint

This commit is contained in:
Pierre Jacquier
2024-08-03 07:39:06 -04:00
committed by 49lf
parent dc4741ae43
commit 9f07e2f500
4 changed files with 23 additions and 12 deletions

3
.gitignore vendored
View File

@ -63,3 +63,6 @@ Mac_App_Distribution.provisionprofile
venv venv
.vite/ .vite/
# electron
out/

View File

@ -212,8 +212,12 @@ const collectAllFilesRecursiveFrom = async (path: string) => {
// Sort all entries so files come first and directories last // Sort all entries so files come first and directories last
// so a top-most KCL file is returned first. // so a top-most KCL file is returned first.
entries.sort((a: string, b: string) => { entries.sort((a: string, b: string) => {
if (a.endsWith(".kcl") && !b.endsWith(".kcl")) { return -1 } if (a.endsWith('.kcl') && !b.endsWith('.kcl')) {
if (!a.endsWith(".kcl") && b.endsWith(".kcl")) { return 1 } return -1
}
if (!a.endsWith('.kcl') && b.endsWith('.kcl')) {
return 1
}
return 0 return 0
}) })
@ -249,7 +253,10 @@ const collectAllFilesRecursiveFrom = async (path: string) => {
return entry return entry
} }
export const getDefaultKclFileForDir = async (projectDir: string, file: FileEntry) => { export const getDefaultKclFileForDir = async (
projectDir: string,
file: FileEntry
) => {
// Make sure the dir is a directory. // Make sure the dir is a directory.
const isFileEntryDir = await window.electron.statIsDirectory(projectDir) const isFileEntryDir = await window.electron.statIsDirectory(projectDir)
if (!isFileEntryDir) { if (!isFileEntryDir) {

View File

@ -96,7 +96,7 @@ export const fileLoader: LoaderFunction = async (
`${paths.FILE}/${encodeURIComponent( `${paths.FILE}/${encodeURIComponent(
isDesktop() isDesktop()
? project.default_file ? project.default_file
: (params.id + '/' + PROJECT_ENTRYPOINT) : params.id + '/' + PROJECT_ENTRYPOINT
)}` )}`
) )
} }

View File

@ -31,7 +31,7 @@ const createWindow = () => {
height: 300, height: 300,
transparent: false, transparent: false,
frame: false, frame: false,
alwaysOnTop: true alwaysOnTop: true,
}) })
// and load the index.html of the app. // and load the index.html of the app.
@ -39,7 +39,9 @@ const createWindow = () => {
splashWindow.loadFile(`splash.html`) splashWindow.loadFile(`splash.html`)
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL) mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL)
} else { } else {
splashWindow.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/splash.html`)) splashWindow.loadFile(
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/splash.html`)
)
mainWindow.loadFile( mainWindow.loadFile(
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`) path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`)
) )
@ -135,4 +137,3 @@ ipcMain.handle('login', async (event, host) => {
return tokenSet.access_token return tokenSet.access_token
}) })