fix(main): cherry-pick #12936 — export Filesystem/Share from build:web native stubs (unbreaks prod Pages deploys) - #12985
Conversation
build:web failed with 'Filesystem is not exported by native-stub:@capacitor/filesystem'
because src/ios-attachment-smoke.ts statically imports { Filesystem } from
@capacitor/filesystem and { Share } from @capacitor/share, but the native-module
stub plugin emitted only a default noop object for those packages.
Add explicit named Filesystem/Share exports to the stubs. Every method throws
(mobile-only) rather than silently no-opping, so a web/desktop code path can
never fabricate a successful file write or share.
Also export isSensitiveKeyName/redactLogArgs from core index.browser.ts
(superseded by develop's export * from ./security/redact — resolved at merge).
(cherry picked from commit a06ad22)
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Local validation for the
Attempted but blocked locally:
Given this is a one-file cherry-pick of the develop fix and the generated stub output verifies the missing Rollup named exports directly, the risk is limited to the intended deployment unblock. |
lalalune
left a comment
There was a problem hiding this comment.
Validated as a main hotfix cherry-pick of the already-merged #12936 native-stub fix.
Local checks:
git diff --check origin/main...HEAD && git diff --checkbunx @biomejs/biome check packages/app/vite/native-module-stub-plugin.ts- direct smoke confirmed
@capacitor/filesystemexportsFilesystem/default and@capacitor/shareexportsShare/default from the stub source bunx vitest run packages/app/test/native-module-stub-plugin.test.tspassed
App visual audit is N/A for this PR: Vite build-time native module stubs only; no app UI/rendering path changed.
|
Validated the main-branch cherry-pick locally against fresh What I checked:
I did not run |
…ges build (#13013) The #12848 promote brought packages/cloud/shared/src/lib/utils/logger.ts, which imports isSensitiveKeyName/redactLogArgs from @elizaos/core, but the matching core browser-barrel export (export * from "./security/redact" in packages/core/src/index.browser.ts) landed on develop in #12919 minutes AFTER the promote cut. Result: build:web fails on main with '"isSensitiveKeyName" is not exported by core dist/browser', so both prod Pages projects (eliza-cloud / eliza-app) cannot deploy from main — same skew class as #12985. One-file, additive-only cherry-pick of the index.browser.ts hunk from develop commit f317d1c (#12919). Verified locally at main tip: bun run build:core green, packages/app build:web green, verify-chunk-safety OK (392 chunks scanned).
What
Cherry-pick of a06ad22 (#12936, already merged to develop) onto
main.Why main needs it now
packages/app/src/ios-attachment-smoke.tsontomain. That file top-level imports{ Filesystem }from@capacitor/filesystemand{ Share }from@capacitor/share.build:webroutes all@capacitor/*(except core) throughvite/native-module-stub-plugin.ts, whose generic stub did not emit those named exports, so rollup fails:"Filesystem" is not exported by "^@native-stub:@capacitor/filesystem", imported by "src/ios-attachment-smoke.ts".maindoes not have it — so every prod Pages deploy from currentmain(db2b2a0) will fail the same way (prod run 28695321227's App build is exposed to it).Scope
-x).The next develop→main promote would carry this anyway; this PR just closes the window where prod front-end deploys from
mainare build-broken.[cloud-security]