-
Notifications
You must be signed in to change notification settings - Fork 42
build: bundling configs for .node + proper import of setapp package #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
eaf00bf
4858c06
0e7260d
cf405f7
7fb790b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ export default { | |
| loader: "ts-loader", | ||
| }, | ||
| }, | ||
| { | ||
| test: /\.node$/, | ||
| loader: "node-loader", | ||
| }, | ||
| ], | ||
| }, | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -32,6 +32,14 @@ import logger from "../utils/logger"; | |||||||||||||||||||||||||||||||||
| import { setupIPCForwardingToWebApp } from "./actions/setupIPCForwarding"; | ||||||||||||||||||||||||||||||||||
| import { saveCookies } from "./actions/cookiesHelpers"; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if (process.env.IS_SETAPP_BUILD === "true") { | ||||||||||||||||||||||||||||||||||
| log.log("[SETAPP] build identified") | ||||||||||||||||||||||||||||||||||
| const setappFramework = require("@setapp/framework-wrapper"); | ||||||||||||||||||||||||||||||||||
| setappFramework.SetappManager.shared.reportUsageEvent(setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION); | ||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Major: Reconsider USER_INTERACTION event timing. Reporting a
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| log.log("[SETAPP] integration complete") | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+42
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Add error handling for optional dependency. The dynamic Apply this diff to add proper error handling: if (process.env.IS_SETAPP_BUILD === "true") {
log.log("[SETAPP] build identified")
- const setappFramework = require("@setapp/framework-wrapper");
- setappFramework.SetappManager.shared.reportUsageEvent(setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION);
- log.log("[SETAPP] integration complete")
+ try {
+ const setappFramework = require("@setapp/framework-wrapper");
+ setappFramework.SetappManager.shared.reportUsageEvent(setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION);
+ log.log("[SETAPP] integration complete")
+ } catch (error) {
+ log.error("[SETAPP] Failed to initialize Setapp framework:", error);
+ }
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents🧩 Analysis chainVerify webpack bundling of optional dependency. The dynamic Run the following script to check if the Setapp framework is properly bundled in production builds: 🏁 Script executed: #!/bin/bash
# Description: Verify that @setapp/framework-wrapper is available in production builds
# Check if the package is present in release/app/node_modules
if [ -d "release/app/node_modules/@setapp/framework-wrapper" ]; then
echo "✓ @setapp/framework-wrapper found in release/app/node_modules"
ls -la release/app/node_modules/@setapp/framework-wrapper/
else
echo "✗ @setapp/framework-wrapper NOT found in release/app/node_modules"
fi
# Check webpack externals configuration
echo "Checking webpack externals configuration..."
rg -n "externals" .erb/configs/webpack.config.base.ts -A 5
# Check if @setapp/framework-wrapper is in the externals list
echo "Verifying if @setapp/framework-wrapper is externalized..."
rg -n "@setapp/framework-wrapper" release/app/package.jsonLength of output: 429 🏁 Script executed: #!/bin/bash
# Check if @setapp/framework-wrapper is in root node_modules
echo "=== Checking root node_modules ==="
if [ -d "node_modules/@setapp/framework-wrapper" ]; then
echo "✓ @setapp/framework-wrapper found in root node_modules"
else
echo "✗ @setapp/framework-wrapper NOT found in root node_modules"
fi
# Check main package.json
echo ""
echo "=== Checking root package.json for @setapp/framework-wrapper ==="
rg -n "@setapp/framework-wrapper" package.json
# Check release/app package.json structure
echo ""
echo "=== Checking release/app/package.json dependencies section ==="
rg -n "dependencies" release/app/package.json -A 20 | head -30
# Check webpack config for how externals are handled in the actual build
echo ""
echo "=== Checking if there are webpack plugins or special handling for externals ==="
rg -n "externals|optional|@setapp" .erb/configs/ -B 2 -A 2Length of output: 1673 🏁 Script executed: #!/bin/bash
# Check the actual code context around the require statement
echo "=== Checking code context for error handling ==="
rg -n "require.*@setapp" src/main/main.ts -B 10 -A 5
# Check if there's a try-catch or conditional check
echo ""
echo "=== Checking for error handling patterns ==="
rg -n "try|catch|optional|IS_SETAPP_BUILD" src/main/main.ts -B 2 -A 2
# Check webpack config to see if optionalDependencies should be included
echo ""
echo "=== Full webpack externals configuration ==="
rg -n "externals" .erb/configs/webpack.config.base.ts -B 5 -A 10Length of output: 2721 🏁 Script executed: #!/bin/bash
# Check the actual code context around the require statement
echo "=== Checking code context for error handling ==="
rg -n "require.*@setapp" src/main/main.ts -B 10 -A 5
# Check if there's a try-catch or conditional check
echo ""
echo "=== Checking for error handling patterns ==="
rg -n "try|catch|optional|IS_SETAPP_BUILD" src/main/main.ts -B 2 -A 2
# Check webpack config to see if optionalDependencies should be included
echo ""
echo "=== Full webpack externals configuration ==="
rg -n "externals" .erb/configs/webpack.config.base.ts -B 5 -A 10Length of output: 2721 Wrap require() in try-catch or update webpack config to handle optional dependencies. The code lacks error handling for a dynamic require of an optional dependency. The package Fix one of:
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // Init remote so that it could be consumed in renderer | ||||||||||||||||||||||||||||||||||
| const remote = require("@electron/remote/main"); | ||||||||||||||||||||||||||||||||||
| remote.initialize(); | ||||||||||||||||||||||||||||||||||
|
|
@@ -473,15 +481,7 @@ app.on("window-all-closed", () => { | |||||||||||||||||||||||||||||||||
| app | ||||||||||||||||||||||||||||||||||
| .whenReady() | ||||||||||||||||||||||||||||||||||
| .then(() => { | ||||||||||||||||||||||||||||||||||
| if (process.env.IS_SETAPP_BUILD === "true") { | ||||||||||||||||||||||||||||||||||
| log.log("[SETAPP] build identified") | ||||||||||||||||||||||||||||||||||
| const setappFramework = require("@setapp/framework-wrapper"); | ||||||||||||||||||||||||||||||||||
| setappFramework.SetappManager.shared.reportUsageEvent(setappFramework.SETAPP_USAGE_EVENT.USER_INTERACTION); | ||||||||||||||||||||||||||||||||||
| log.log("[SETAPP] integration complete") | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| app.on("activate", () => { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // On macOS it's common to re-create a window in the app when the | ||||||||||||||||||||||||||||||||||
| // dock icon is clicked and there are no other windows open. | ||||||||||||||||||||||||||||||||||
| if (BrowserWindow.getAllWindows().length === 0) { | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: requestly/requestly-desktop-app
Length of output: 843
🏁 Script executed:
Repository: requestly/requestly-desktop-app
Length of output: 346
🌐 Web query:
@setapp/framework-wrapper npm package version 4.3.4💡 Result:
I couldn't find a published @setapp/framework-wrapper version 4.3.4 on npm. The npm package page shows latest version 4.3.1 (published recently). [1]
If you need features/fixes from 4.3.4, confirm the version on the package's repo or request the maintainer to publish it. The Setapp docs reference Setapp Framework v4.3.0+ as a minimum for mobile distribution. [2]
Sources:
🌐 Web query:
@setapp/framework-wrapper security vulnerabilities advisories💡 Result:
I couldn't find any public security advisories for the package @setapp/framework-wrapper as of Dec 15, 2025. Sources checked include the package page on npm and Setapp's official docs (no advisories or security notices listed). [1][2]
If you want, I can:
Sources:
[1] @setapp/framework-wrapper — npm package page.
[2] Setapp Framework docs (installation / integration).
Version 4.3.4 does not exist on npm registry.
The specified version
@setapp/[email protected]cannot be found on npm. The latest available version is 4.3.1. This will cause package resolution to fail during installation. Either use an existing version (e.g.,^4.3.1) or verify that 4.3.4 has been published to the npm registry before merging.🤖 Prompt for AI Agents