diff --git a/electron.vite.config.ts b/electron.vite.config.ts
index 1767cb47e..42fd9d29f 100644
--- a/electron.vite.config.ts
+++ b/electron.vite.config.ts
@@ -60,7 +60,7 @@ export default defineConfig({
}),
],
build: {
- sourcemap: true,
+ sourcemap: !!process.env.CI,
},
define: {
APP_VERSION: JSON.stringify(pkg.version),
diff --git a/forge.config.ts b/forge.config.ts
index 25f3eefa7..fb63be3aa 100644
--- a/forge.config.ts
+++ b/forge.config.ts
@@ -24,6 +24,7 @@ const ymlMapsMap = {
win32: "latest.yml",
}
+const keepModules = new Set(["font-list", "vscode-languagedetection"])
// remove folders & files not to be included in the app
async function cleanSources(
buildPath,
@@ -41,7 +42,7 @@ async function cleanSources(
])
// Keep only node_modules to be included in the app
- const modules = new Set(["font-list", "@vscode/vscode-languagedetection"])
+
await Promise.all([
...(await readdir(buildPath).then((items) =>
items
@@ -50,13 +51,18 @@ async function cleanSources(
)),
...(await readdir(path.join(buildPath, "node_modules")).then((items) =>
items
- .filter((item) => !modules.has(item))
+ .filter((item) => !keepModules.has(item))
.map((item) => rimraf(path.join(buildPath, "node_modules", item))),
)),
])
callback()
}
+
+const ignorePattern = new RegExp(
+ `^/node_modules/(?!${[...keepModules].join("|")})`,
+)
+
const config: ForgeConfig = {
packagerConfig: {
appBundleId: "is.follow",
@@ -70,7 +76,7 @@ const config: ForgeConfig = {
],
afterCopy: [cleanSources],
asar: true,
- ignore: [/^\/node_modules\/(?!font-list|@vscode\/vscode-languagedetection)/],
+ ignore: [ignorePattern],
prune: true,
...(process.env.APPLE_ID &&
process.env.APPLE_PASSWORD &&
@@ -171,7 +177,11 @@ const config: ForgeConfig = {
makeResults = makeResults.map((result) => {
result.artifacts = result.artifacts.map((artifact) => {
if (artifactRegex.test(artifact)) {
- const newArtifact = `${path.dirname(artifact)}/${result.packageJSON.name}-${result.packageJSON.version}-${platformNamesMap[result.platform]}-${result.arch}${path.extname(artifact)}`
+ const newArtifact = `${path.dirname(artifact)}/${
+ result.packageJSON.name
+ }-${result.packageJSON.version}-${
+ platformNamesMap[result.platform]
+ }-${result.arch}${path.extname(artifact)}`
fs.renameSync(artifact, newArtifact)
try {
@@ -200,17 +210,18 @@ const config: ForgeConfig = {
yml.releaseDate = new Date().toISOString()
const ymlStr =
`version: ${yml.version}\n` +
- `files:\n${
- yml.files
- .map((file) => (
+ `files:\n${yml.files
+ .map(
+ (file) =>
` - url: ${file.url}\n` +
` sha512: ${file.sha512}\n` +
- ` size: ${file.size}\n`
- ))
- .join("")
- }releaseDate: ${yml.releaseDate}\n`
+ ` size: ${file.size}\n`,
+ )
+ .join("")}releaseDate: ${yml.releaseDate}\n`
- const ymlPath = `${path.dirname(makeResults[0].artifacts[0])}/${ymlMapsMap[makeResults[0].platform]}`
+ const ymlPath = `${path.dirname(makeResults[0].artifacts[0])}/${
+ ymlMapsMap[makeResults[0].platform]
+ }`
fs.writeFileSync(ymlPath, ymlStr)
makeResults.push({
diff --git a/package.json b/package.json
index 5dda850bb..5a798c1ce 100644
--- a/package.json
+++ b/package.json
@@ -69,7 +69,6 @@
"@tanstack/react-query-devtools": "5.51.15",
"@tanstack/react-query-persist-client": "5.51.15",
"@use-gesture/react": "10.3.1",
- "@vscode/vscode-languagedetection": "1.0.22",
"@yornaath/batshit": "0.10.1",
"builder-util-runtime": "9.2.5-alpha.3",
"class-variance-authority": "0.7.0",
@@ -129,6 +128,7 @@
"use-context-selector": "2.0.0",
"usehooks-ts": "3.1.0",
"vfile": "6.0.2",
+ "vscode-languagedetection": "npm:@vscode/vscode-languagedetection@^1.0.22",
"zod": "3.23.8",
"zustand": "4.5.4"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f435adb0d..351e20674 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -139,9 +139,6 @@ importers:
'@use-gesture/react':
specifier: 10.3.1
version: 10.3.1(react@18.3.1)
- '@vscode/vscode-languagedetection':
- specifier: 1.0.22
- version: 1.0.22
'@yornaath/batshit':
specifier: 0.10.1
version: 0.10.1
@@ -319,6 +316,9 @@ importers:
vfile:
specifier: 6.0.2
version: 6.0.2
+ vscode-languagedetection:
+ specifier: npm:@vscode/vscode-languagedetection@^1.0.22
+ version: '@vscode/vscode-languagedetection@1.0.22'
zod:
specifier: 3.23.8
version: 3.23.8
diff --git a/src/main/tipc/reader.ts b/src/main/tipc/reader.ts
index fad711ef9..e848b1103 100644
--- a/src/main/tipc/reader.ts
+++ b/src/main/tipc/reader.ts
@@ -20,9 +20,9 @@ export const readerRoute = {
detectCodeStringLanguage: t.procedure
.input<{ codeString: string }>()
.action(async ({ input }) => {
- const { ModelOperations } = require("@vscode/vscode-languagedetection")
- const modulOperations = new ModelOperations()
- const result = await modulOperations.runModel(input.codeString)
+ const { ModelOperations } = require("vscode-languagedetection")
+ const modelOperations = new ModelOperations()
+ const result = await modelOperations.runModel(input.codeString)
return result
}),
}
diff --git a/src/renderer/src/components/common/ErrorElement.tsx b/src/renderer/src/components/common/ErrorElement.tsx
index 9612f42aa..81411b7e9 100644
--- a/src/renderer/src/components/common/ErrorElement.tsx
+++ b/src/renderer/src/components/common/ErrorElement.tsx
@@ -1,4 +1,3 @@
-import pkg from "@pkg"
import { attachOpenInEditor } from "@renderer/lib/dev"
import { getNewIssueUrl } from "@renderer/lib/issues"
import { clearLocalPersistStoreData } from "@renderer/store/utils/clear"
@@ -6,8 +5,8 @@ import { useEffect, useRef } from "react"
import { isRouteErrorResponse, useRouteError } from "react-router-dom"
import { toast } from "sonner"
-import { Logo } from "../icons/logo"
import { StyledButton } from "../ui/button"
+import { PoweredByFooter } from "./PoweredByFooter"
export function ErrorElement() {
const error = useRouteError()
@@ -85,20 +84,8 @@ export function ErrorElement() {