Skip to content

Fix packaged SQL.js WASM path for CLI auth#41

Open
xianzuyang9-blip wants to merge 1 commit into
backblaze-labs:mainfrom
xianzuyang9-blip:codex/fix-sql-wasm-packaged-path
Open

Fix packaged SQL.js WASM path for CLI auth#41
xianzuyang9-blip wants to merge 1 commit into
backblaze-labs:mainfrom
xianzuyang9-blip:codex/fix-sql-wasm-packaged-path

Conversation

@xianzuyang9-blip
Copy link
Copy Markdown

Fixes #9.

AuthService copied sql-wasm.wasm into dist/sql-wasm.wasm during webpack packaging, but the CLI credential path still tried to read ../node_modules/sql.js/dist/sql-wasm.wasm relative to the bundled extension. That path is not present in VSIX installs built with --no-dependencies.

This PR:

  • resolves sql-wasm.wasm from the packaged dist directory first
  • keeps the
    ode_modules/sql.js/dist/sql-wasm.wasm fallback for development checkouts
  • throws a clear initialization error if neither runtime asset exists
  • adds tests for packaged, development, and missing-asset layouts

Verification:

npm run type-check npm run compile-tests npm run lint npm run package node -e "const fs=require('fs'); if(!fs.existsSync('dist/sql-wasm.wasm')) throw new Error('missing dist/sql-wasm.wasm'); console.log('packaged wasm present')"

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.

Fix packaged CLI auto-auth: SQL.js WASM path mismatch

1 participant