Skip to content

Commit 5fa5263

Browse files
committed
fix: unpacking amical/smart-whisper dep
1 parent 8781981 commit 5fa5263

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/desktop/forge.config.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const config: ForgeConfig = {
149149

150150
// Copy the package
151151
console.log(`Copying ${dep}...`);
152-
cpSync(rootDepPath, localDepPath, { recursive: true });
152+
cpSync(rootDepPath, localDepPath, { recursive: true, dereference: true, force: true });
153153
console.log(`✓ Successfully copied ${dep}`);
154154
} catch (error) {
155155
console.error(`Failed to copy ${dep}:`, error);
@@ -169,7 +169,7 @@ const config: ForgeConfig = {
169169

170170
// Read where the symlink points to
171171
const symlinkTarget = readlinkSync(localDepPath);
172-
const absoluteTarget = join(localNodeModules, dep, "..", symlinkTarget);
172+
const absoluteTarget = join(localDepPath, "..", symlinkTarget);
173173
const sourcePath = normalize(absoluteTarget);
174174

175175
console.log(` Symlink points to: ${sourcePath}`);
@@ -314,6 +314,7 @@ const config: ForgeConfig = {
314314
icon: "./assets/logo", // Path to your icon file
315315
appBundleId: "com.amical.desktop", // Proper bundle ID
316316
extraResource: [
317+
`${process.platform === "win32" ? "../../packages/native-helpers/windows-helper/bin" : "../../packages/native-helpers/swift-helper/bin"}`,
317318
"./src/db/migrations",
318319
// Only include the platform-specific node binary
319320
`./node-binaries/${process.platform}-${process.arch}/node${
@@ -398,11 +399,13 @@ const config: ForgeConfig = {
398399
}
399400

400401
// Handle scoped packages: if dep is @scope/package, also keep @scope/ directory
402+
// But not for our workspace packages
401403
if (dep.includes("/") && dep.startsWith("@")) {
402404
const scopeDir = dep.split("/")[0]; // @libsql/client -> @libsql
403405
// for workspace packages only keep the actual package
404406
if (scopeDir === "@amical") {
405-
if (filePath.startsWith(`/node_modules/${dep}/`)) {
407+
if (filePath.startsWith(`/node_modules/${dep}`) ||
408+
filePath === `/node_modules/${scopeDir}`) {
406409
KEEP_FILE.keep = true;
407410
KEEP_FILE.log = true;
408411
}

0 commit comments

Comments
 (0)