Skip to content

Conversation

@sawka
Copy link
Member

@sawka sawka commented Nov 14, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 14, 2025

Walkthrough

Consolidates tsunami app metadata into a single tsunami:appmeta payload and updates type/schema usage accordingly; introduces a feature:waveappbuilder settings flag and surfaces it to the frontend to control Apps UI rendering; changes Electron packaging to add extraResources for dist/tsunamiscaffold, excludes it from main file copies, and removes it from asarUnpack; adds an Electron resources path variable passed to waveserver and cached by wavebase; renames scaffold Node modules to nm during scaffold/setup and threads a Go tool path (GoPath) through the Tsunami build flow via a new BuildEnv struct.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • electron-builder.config.cjs — verify extraResources mapping, exclusion filter, and asar unpack implications for runtime resource access.
  • tsunami/build/build.go — review BuildEnv additions (GoPath), changed signatures (createGoMod, runGoBuild), and all references switched from node_modules to nm.
  • Type and schema changes — frontend/types/gotypes.d.ts, pkg/waveobj/objrtinfo.go, schema/settings.json: ensure consumers and (de)serialization paths handle tsunami:appmeta and the new feature:waveappbuilder flag.
  • Runtime env flow — emain-platform.ts, emain-util.ts, emain-wavesrv.ts, pkg/wavebase/wavebase.go: confirm WAVETERM_RESOURCES_PATH is set, cached, and consumed correctly in dev and production.
  • Controller and manifest changes — pkg/blockcontroller/tsunamicontroller.go: validate manifest-based metadata handling replaces prior HTTP fetch flow and that event publishing uses the new fields.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided, so the check cannot verify if the description relates to the changeset. Add a description explaining the purpose and scope of these changes, such as why the scaffold path changes are needed and how they impact the build process.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix tsunami scaffold in build' directly relates to the main change—moving node_modules to nm in scaffold tasks and updating build-related Taskfile.yml logic, which is the primary focus across multiple changes.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/builder-improvements-1

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 669d8b8 and b41b7da.

📒 Files selected for processing (2)
  • frontend/app/workspace/widgets.tsx (4 hunks)
  • tsunami/build/build.go (13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/app/workspace/widgets.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
tsunami/build/build.go (1)
tsunami/build/buildutil.go (1)
  • DirFS (14-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build Docsite
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build for TestDriver.ai
  • GitHub Check: merge-gatekeeper
🔇 Additional comments (5)
tsunami/build/build.go (5)

110-115: LGTM! BuildEnv struct extended with GoPath

The addition of the GoPath field to BuildEnv is a good refactor that centralizes the Go tool path alongside GoVersion, making the build environment more cohesive and reducing parameter passing throughout the build flow.


333-333: LGTM! BuildEnv refactor applied consistently

The BuildEnv refactor is implemented consistently throughout the codebase:

  • verifyEnvironment correctly populates GoPath from the version check result
  • Both createGoMod and runGoBuild signatures updated to accept *BuildEnv
  • All Go tool invocations (go mod tidy, go build) now use buildEnv.GoPath
  • All call sites updated appropriately

This ensures the same Go executable is used throughout the build process.

Also applies to: 338-338, 377-377, 417-417, 659-659, 669-669, 750-750, 782-782


504-511: LGTM! Scaffold node_modules renamed to nm with robust symlink fallback

The changes correctly implement:

  1. Renaming scaffold node_modules to nm (lines 504-511)
  2. Symlink creation with fallback to copy when symlink fails (lines 1087-1109)

The new logic properly addresses the previous review concern about Windows/restricted environments: if os.Symlink fails, the code silently falls back to copyDirFromFS instead of returning a hard error. The symlinked flag pattern ensures the fallback is triggered when needed, and verbose logging reveals which path was taken.

Based on learnings (past review comments).

Also applies to: 1082-1112


627-627: LGTM! Helpful debugging improvements

The additions improve troubleshooting:

  • Line 627: Debug logging reveals the scaffold path being used during build
  • Line 433: Output flush before error return ensures captured output is visible when go mod tidy fails

Also applies to: 433-433


845-850: Node.js symlink preservation flags are properly supported and correctly implemented

The --preserve-symlinks flag was introduced in Node.js v6.3.0, and --preserve-symlinks-main was added in Node.js v10.2.0. The project's CI/CD pipelines specify NODE_VERSION: 22, which fully supports both flags. The implementation at lines 845–850 is correct: these flags prevent Node.js from resolving symlinks when node_modules is symlinked to nm, and they pose no issues when node_modules is a real directory—they are simply hints to the module loader that have no adverse effects.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sawka sawka changed the title Sawka/builder improvements 1 fix tsunami scaffold in build Nov 14, 2025
@sawka sawka marked this pull request as ready for review November 14, 2025 23:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
frontend/app/workspace/widgets.tsx (2)

376-393: Missing feature flag check in non-supercompact Apps button rendering.

Line 376 only checks isDev() to determine if the Apps button should be rendered in non-supercompact mode, but it should also check featureWaveAppBuilder for consistency with the supercompact layout (lines 348-360).

Apply this diff to add the missing feature flag check:

-                        {isDev() ? (
+                        {isDev() || featureWaveAppBuilder ? (
                             <div
                                 ref={appsButtonRef}
                                 className="flex flex-col justify-center items-center w-full py-1.5 pr-0.5 text-secondary text-lg overflow-hidden rounded-sm hover:bg-hoverbg hover:text-white cursor-pointer"

411-417: Floating window render guard should include feature flag.

The AppsFloatingWindow is only rendered when isDev() is true (line 411), but it should also be accessible when featureWaveAppBuilder is enabled for consistency with the button visibility logic.

Apply this diff to include the feature flag:

-            {isDev() && appsButtonRef.current && (
+            {(isDev() || featureWaveAppBuilder) && appsButtonRef.current && (
                 <AppsFloatingWindow
tsunami/build/build.go (1)

576-584: Potential nil dereference in TsunamiBuild / TsunamiRun on early errors

Both TsunamiBuild and TsunamiRun do:

buildEnv, err := TsunamiBuildInternal(opts)
defer buildEnv.cleanupTempDir(opts.KeepTemp, opts.Verbose)
if err != nil {
    return err
}

But TsunamiBuildInternal returns nil, err for several early failures (e.g., bad app path, bad scaffold path, environment verification failure). In those cases, the defer buildEnv.cleanupTempDir(...) will be scheduled with a nil receiver and will panic when invoked.

Consider guarding the defer with a nil check (and similarly gating setupSignalCleanup):

 func TsunamiBuild(opts BuildOpts) error {
-	buildEnv, err := TsunamiBuildInternal(opts)
-	defer buildEnv.cleanupTempDir(opts.KeepTemp, opts.Verbose)
-	if err != nil {
-		return err
-	}
-	setupSignalCleanup(buildEnv, opts.KeepTemp, opts.Verbose)
-	return nil
+	buildEnv, err := TsunamiBuildInternal(opts)
+	if buildEnv != nil {
+		defer buildEnv.cleanupTempDir(opts.KeepTemp, opts.Verbose)
+	}
+	if err != nil {
+		return err
+	}
+	if buildEnv != nil {
+		setupSignalCleanup(buildEnv, opts.KeepTemp, opts.Verbose)
+	}
+	return nil
 }
 
 func TsunamiRun(opts BuildOpts) error {
 	oc := opts.OutputCapture
-	buildEnv, err := TsunamiBuildInternal(opts)
-	defer buildEnv.cleanupTempDir(opts.KeepTemp, opts.Verbose)
+	buildEnv, err := TsunamiBuildInternal(opts)
+	if buildEnv != nil {
+		defer buildEnv.cleanupTempDir(opts.KeepTemp, opts.Verbose)
+	}
 	if err != nil {
 		return err
 	}
-	setupSignalCleanup(buildEnv, opts.KeepTemp, opts.Verbose)
+	if buildEnv != nil {
+		setupSignalCleanup(buildEnv, opts.KeepTemp, opts.Verbose)
+	}

This preserves existing behavior when buildEnv is valid while avoiding panics on early failures.

Also applies to: 971-975

🧹 Nitpick comments (2)
pkg/aiusechat/tools_tsunami.go (1)

22-31: Consider logging unmarshal errors.

The helper function silently returns an empty string when ReUnmarshal fails. While this provides a safe fallback, logging the error could help diagnose issues with malformed metadata during development or troubleshooting.

Consider this enhancement:

 func getTsunamiShortDesc(rtInfo *waveobj.ObjRTInfo) string {
 	if rtInfo == nil || rtInfo.TsunamiAppMeta == nil {
 		return ""
 	}
 	var appMeta wshrpc.AppMeta
-	if err := utilfn.ReUnmarshal(&appMeta, rtInfo.TsunamiAppMeta); err == nil && appMeta.ShortDesc != "" {
+	if err := utilfn.ReUnmarshal(&appMeta, rtInfo.TsunamiAppMeta); err != nil {
+		log.Printf("warning: failed to unmarshal tsunami appmeta: %v", err)
+		return ""
+	}
+	if appMeta.ShortDesc != "" {
 		return appMeta.ShortDesc
 	}
 	return ""
 }
pkg/blockcontroller/tsunamicontroller.go (1)

51-55: Consider logging the error when manifest reading fails.

The function silently returns when ReadAppManifest fails. While this may be intentional (since metadata is optional), logging the error would help with debugging when apps don't display expected metadata.

Apply this diff to add error logging:

 func (c *TsunamiController) setManifestMetadata(appId string) {
 	manifest, err := waveappstore.ReadAppManifest(appId)
 	if err != nil {
+		log.Printf("TsunamiController: failed to read manifest for app %s: %v", appId, err)
 		return
 	}
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1a190da and 669d8b8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • Taskfile.yml (2 hunks)
  • docs/docs/releasenotes.mdx (1 hunks)
  • electron-builder.config.cjs (2 hunks)
  • emain/emain-menu.ts (3 hunks)
  • emain/emain-platform.ts (2 hunks)
  • emain/emain-util.ts (1 hunks)
  • emain/emain-wavesrv.ts (3 hunks)
  • frontend/app/view/tsunami/tsunami.tsx (1 hunks)
  • frontend/app/workspace/widgets.tsx (2 hunks)
  • frontend/types/gotypes.d.ts (2 hunks)
  • pkg/aiusechat/tools_tsunami.go (5 hunks)
  • pkg/blockcontroller/tsunamicontroller.go (4 hunks)
  • pkg/waveapputil/waveapputil.go (2 hunks)
  • pkg/wavebase/wavebase.go (4 hunks)
  • pkg/waveobj/objrtinfo.go (1 hunks)
  • pkg/wconfig/metaconsts.go (1 hunks)
  • pkg/wconfig/settingsconfig.go (1 hunks)
  • schema/settings.json (1 hunks)
  • tsunami/build/build.go (13 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-15T03:21:02.229Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2433
File: pkg/aiusechat/tools_readfile.go:197-197
Timestamp: 2025-10-15T03:21:02.229Z
Learning: In Wave Terminal's AI tool definitions (pkg/aiusechat/tools_*.go), the Description field should not mention approval requirements even when ToolApproval returns ApprovalNeedsApproval. This prevents the LLM from asking users for approval before calling the tool, avoiding redundant double-approval prompts since the runtime will enforce approval anyway.

Applied to files:

  • pkg/aiusechat/tools_tsunami.go
🧬 Code graph analysis (11)
emain/emain-util.ts (1)
pkg/wavebase/wavebase.go (1)
  • WaveAppResourcesPathVarName (32-32)
emain/emain-wavesrv.ts (3)
emain/emain-util.ts (1)
  • WaveAppResourcesPathVarName (8-8)
pkg/wavebase/wavebase.go (1)
  • WaveAppResourcesPathVarName (32-32)
emain/emain-platform.ts (1)
  • getElectronAppResourcesPath (273-273)
emain/emain-platform.ts (1)
frontend/app/store/global.ts (1)
  • isDev (842-842)
frontend/types/gotypes.d.ts (5)
pkg/wshrpc/wshrpctypes.go (1)
  • AppMeta (1057-1062)
tsunami/engine/clientimpl.go (1)
  • AppMeta (43-48)
tsunami/app/defaultclient.go (1)
  • AppMeta (22-22)
tsunami/demo/cpuchart/app.go (1)
  • AppMeta (12-15)
tsunami/demo/pomodoro/app.go (1)
  • AppMeta (11-14)
pkg/waveapputil/waveapputil.go (1)
pkg/wavebase/wavebase.go (1)
  • GetWaveAppResourcesPath (121-123)
pkg/aiusechat/tools_tsunami.go (3)
pkg/waveobj/objrtinfo.go (1)
  • ObjRTInfo (6-27)
pkg/wshrpc/wshrpctypes.go (1)
  • AppMeta (1057-1062)
pkg/util/utilfn/marshal.go (1)
  • ReUnmarshal (36-42)
pkg/blockcontroller/tsunamicontroller.go (6)
pkg/waveappstore/waveappstore.go (1)
  • ReadAppManifest (722-744)
pkg/waveobj/waveobj.go (1)
  • MakeORef (71-76)
pkg/wshrpc/wshrpctypes.go (1)
  • AppMeta (1057-1062)
pkg/wstore/wstore_rtinfo.go (1)
  • SetRTInfo (84-125)
pkg/wps/wps.go (1)
  • Broker (46-50)
pkg/wps/wpstypes.go (2)
  • WaveEvent (26-32)
  • Event_TsunamiUpdateMeta (23-23)
emain/emain-menu.ts (3)
pkg/wconfig/settingsconfig.go (1)
  • FullConfigType (259-269)
frontend/app/store/wshclientapi.ts (1)
  • RpcApi (677-677)
emain/emain-wsh.ts (1)
  • ElectronWshClient (116-116)
pkg/wavebase/wavebase.go (1)
emain/emain-util.ts (1)
  • WaveAppResourcesPathVarName (8-8)
tsunami/build/build.go (1)
tsunami/build/buildutil.go (1)
  • DirFS (14-17)
frontend/app/workspace/widgets.tsx (2)
emain/emain-platform.ts (1)
  • isDev (280-280)
frontend/app/store/global.ts (1)
  • isDev (842-842)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: merge-gatekeeper
  • GitHub Check: Build Docsite
  • GitHub Check: Build for TestDriver.ai
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (36)
docs/docs/releasenotes.mdx (1)

15-15: Documentation update looks good.

The new Thinking Mode Toggle feature bullet is clearly written, properly positioned in the Wave AI Updates section, and consistent with the surrounding release notes format and style.

pkg/waveobj/objrtinfo.go (1)

7-8: LGTM! Clean consolidation of tsunami metadata.

The refactoring from individual fields (TsunamiTitle, TsunamiShortDesc, TsunamiIcon, TsunamiIconColor) to a single TsunamiAppMeta field simplifies the structure and aligns with the AppMeta type used throughout the codebase.

pkg/wconfig/metaconsts.go (1)

15-16: LGTM! Feature flag constant properly defined.

The new configuration key follows the established naming convention and aligns with the corresponding schema and settings changes.

frontend/app/view/tsunami/tsunami.tsx (1)

65-67: LGTM! Properly adapted to consolidated metadata structure.

The change from building an AppMeta object from individual fields to directly using rtInfo["tsunami:appmeta"] aligns with the backend refactoring and simplifies the code.

pkg/aiusechat/tools_tsunami.go (1)

41-43: LGTM! Consistent usage of the helper function.

All call sites have been properly updated to use getTsunamiShortDesc(rtInfo) instead of direct field access, maintaining backward compatibility with the consolidated metadata structure.

Also applies to: 127-129, 152-154, 190-192

pkg/wconfig/settingsconfig.go (1)

61-62: LGTM! Feature flag field properly integrated.

The new FeatureWaveAppBuilder field follows the established conventions with appropriate JSON tags and positioning within the struct.

schema/settings.json (1)

23-25: LGTM! Schema properly updated for the feature flag.

The schema addition correctly defines the feature:waveappbuilder property as a boolean, maintaining consistency with the Go struct definition.

frontend/app/workspace/widgets.tsx (2)

232-232: LGTM! Feature flag properly initialized.

The feature flag is correctly read from settings with an appropriate default value of false.


346-360: LGTM! Supercompact layout correctly checks the feature flag.

The rendering logic properly considers the featureWaveAppBuilder flag alongside isDev() and showHelp for controlling visibility in supercompact mode.

frontend/types/gotypes.d.ts (2)

917-918: LGTM! Type definitions properly updated for consolidated metadata.

The ObjRTInfo type correctly reflects the backend change, replacing individual tsunami fields with a single tsunami:appmeta property of type AppMeta.


1030-1030: LGTM! Feature flag added to settings type.

The SettingsType correctly includes the new feature:waveappbuilder boolean property, matching the backend schema.

pkg/blockcontroller/tsunamicontroller.go (3)

150-152: LGTM!

The placement and conditional call to setManifestMetadata is appropriate. Setting metadata early in the Start flow ensures it's available before the app runs.


189-189: Good addition for debugging build failures.

Logging the BuildOpts structure will help diagnose build issues more effectively.


51-76: The removed fetchAndSetSchemas method has no remaining references in the codebase.

Verification confirms complete removal with no external dependencies. The codebase is safe to use with the new manifest-based approach.

emain/emain-util.ts (1)

8-8: LGTM! Constant definition is consistent with Go backend.

The new constant matches WaveAppResourcesPathVarName in pkg/wavebase/wavebase.go and follows the existing naming convention.

emain/emain-platform.ts (3)

152-153: LGTM! Helpful clarification comment.

The comment clarifies the dev mode path behavior for import.meta.dirname.


160-166: LGTM! Resources path correctly distinguishes dev from production.

The function properly handles the difference between development and production environments:

  • Dev: Returns the app base path (same as getElectronAppBasePath())
  • Production: Returns process.resourcesPath, which points to the Electron resources directory (parent of app.asar)

This aligns with electron-builder's extraResources configuration for items like tsunami scaffold that need to be outside the asar bundle.


273-273: LGTM! Function properly exported.

emain/emain-wavesrv.ts (2)

11-11: LGTM! Imports are correctly organized.

The imports properly distinguish between:

  • getElectronAppResourcesPath from emain-platform (function implementation)
  • WaveAppResourcesPathVarName from emain-util (constant definition)

Also applies to: 21-26


68-68: LGTM! Environment variable correctly passed to wavesrv.

The resources path is properly set in the environment before spawning the wavesrv process, allowing the Go backend to access and cache this value.

pkg/waveapputil/waveapputil.go (1)

21-28: LGTM! Tsunami scaffold path correctly uses resources path.

The change from app path to resources path aligns with the broader refactoring to use extraResources in electron-builder. This ensures the tsunami scaffold is accessible as regular filesystem files outside the asar bundle.

pkg/wavebase/wavebase.go (4)

32-32: LGTM! Constant matches TypeScript definition.

The constant name and value match the TypeScript version in emain/emain-util.ts, ensuring cross-language consistency.


54-54: LGTM! Cache variable follows existing pattern.


103-104: LGTM! Environment variable properly cached and cleaned up.

The caching and unsetting follow the established pattern for other environment variables like WaveAppPathVarName, ensuring consistent environment cleanup after startup.


121-123: LGTM! Getter implementation is clean and consistent.

The getter follows the same simple pattern as GetWaveAppPath() and other path getters in this file.

emain/emain-menu.ts (2)

319-326: LGTM! Clean refactor to fetch full config.

The change from fetching specific config values to fetching the full config is well-implemented:

  • Maintains existing fullscreenOnLaunch extraction logic
  • Error handling preserves current behavior
  • Optional chaining protects against null values
  • Enables feature flag checking without additional RPC calls

113-135: No issues found - code is correct as written.

The feature flag implementation is type-safe. TypeScript automatically includes .d.ts files (like gotypes.d.ts) with declare global as ambient declarations, making FullConfigType available globally without explicit import. The "feature:waveappbuilder" setting is explicitly typed as boolean in SettingsType (line 1030 of frontend/types/gotypes.d.ts), so using it directly in a boolean context is safe. The implementation matches the codebase's existing pattern for accessing and using settings values.

Taskfile.yml (2)

528-548: Unix scaffold: node_modules → nm move looks correct

The added mv scaffold/node_modules scaffold/nm fits the preceding cd scaffold && npm install and the task dir: tsunami/frontend: the path is correct, scaffold is freshly recreated, and this will deterministically rename the installed node_modules to nm with no stale state. Matches the repo-wide nm convention for the tsunami scaffold.


549-568: Windows scaffold: Move-Item mirrors Unix behavior

The PowerShell Move-Item -Path scaffold/node_modules -Destination scaffold/nm correctly mirrors the Unix mv semantics relative to dir: tsunami/frontend and the earlier Set-Location scaffold; npm install call. This keeps the scaffold layout consistent across platforms and in line with the nm convention.

electron-builder.config.cjs (1)

21-39: Packaging tsunamiscaffold via extraResources is consistent; verify runtime lookup path

Excluding tsunamiscaffold from the main dist files and then adding dist/tsunamiscaffold → tsunamiscaffold in extraResources is a clean way to keep the scaffold outside the asar and under the app’s resources root, while avoiding duplicate copies. This aligns with the new scaffold layout (using nm) and the dedicated packaging of tsunami assets.

The only thing to double-check is that whatever code resolves the tsunami scaffold path now uses the Electron resources directory (e.g., process.resourcesPath/tsunamiscaffold or the new env wiring) rather than assuming it lives under app.asar(.unpacked)/dist/tsunamiscaffold.

tsunami/build/build.go (6)

110-115: Centralizing Go binary path in BuildEnv looks good

Storing the resolved Go executable path on BuildEnv and returning it from verifyEnvironment ensures go mod tidy and go build consistently use the same tool, including when a custom GoPath is provided. No issues spotted here.

Also applies to: 331-335


338-446: createGoMod correctly uses BuildEnv for Go version and go mod tidy

Passing buildEnv *BuildEnv into createGoMod and using buildEnv.GoVersion for AddGoStmt plus buildEnv.GoPath for go mod tidy keeps module metadata and tooling in sync with the Go version that passed validation. The extra oc.Flush() on tidy failure is also helpful for surfacing errors. The function now has a clear precondition that buildEnv is non‑nil and comes from verifyEnvironment; given current call sites, this looks safe.


479-513: Scaffold verification for nm directory matches new layout

Updating verifyScaffoldFs to require an nm directory (and still enforcing that it’s an actual directory) aligns with the new scaffold structure where nm represents node_modules. This keeps early validation in sync with the copy logic later in the build.


576-691: Build flow updates to pass BuildEnv into go module/build steps are coherent

Plumbing buildEnv into TsunamiBuildInternal, including the new debug log for the scaffold path and updated calls to createGoMod(..., buildEnv, ...) and runGoBuild(tempDir, buildEnv, opts), keeps all Go tool invocations tied to the environment verified up front. The added debug output around scaffold and temp dir paths should also make diagnosing build issues easier.


750-810: Using buildEnv.GoPath for go build keeps tooling consistent

runGoBuild now invokes exec.Command(buildEnv.GoPath, ...) instead of assuming go on PATH, which matches the result of CheckGoVersion and respects a custom Go path. The rest of the function (output path resolution, presence check for .go files, and logging) remains unchanged and correct.


841-883: Tailwind command changes align with new Node setup but should be verified across environments

Switching to opts.getNodePath() and adding --preserve-symlinks-main / --preserve-symlinks before the Tailwind CLI entrypoint is consistent with the new nmnode_modules behavior and should help avoid module‑resolution issues when using symlinks. The command structure (node [flags] script -i ... -o ...) and ELECTRON_RUN_AS_NODE=1 env look reasonable, but I’d recommend confirming this still works on all supported Node/Electron combinations and platforms (especially older Node versions) in your CI or local testing.

@sawka sawka merged commit 3b97084 into main Nov 15, 2025
10 checks passed
@sawka sawka deleted the sawka/builder-improvements-1 branch November 15, 2025 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants