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
.vite/
# electron
out/

View File

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

View File

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

View File

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