Bundle extension using esbuild#335
Conversation
|
Hey there! I just built a new version of the vscode extension based on 63cca47. You can downloaded the .vsix here and then follow these installation instructions. |
a9847ff to
7bc581e
Compare
|
Hey there! I just built a new version of the vscode extension based on 3e0cc58. You can downloaded the .vsix here and then follow these installation instructions. |
|
Hey there! I just built a new version of the vscode extension based on acedc1b. You can downloaded the .vsix here and then follow these installation instructions. |
|
Hey there! I just built a new version of the vscode extension based on f12d5cf. You can downloaded the .vsix here and then follow these installation instructions. |
|
Hey there! I just built a new version of the vscode extension based on 31752ae. You can downloaded the .vsix here and then follow these installation instructions. |
e19b04d to
1aa9129
Compare
c9b1018 to
c9d9846
Compare
- Remove unused `cwd` variable in LanguageServerManager.spec.ts - Remove unused `glob` import in autoIndent.spec.ts (already staged in merge commit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ded version
When dist/brighterscript.js exists (packaged or post-build), use it as the embedded
packageDir instead of the node_modules path. This means the packaged extension doesn't
need to ship node_modules/brighterscript.
- esbuild injects BSC_EMBEDDED_VERSION at build time so the version string is always
available even when require.resolve('brighterscript') isn't callable
- Constructor wraps require.resolve in try/catch for safety in the bundled context
- init() overrides embeddedBscInfo.packageDir to the bundled path when present
- User-selected versions still go through localPackageManager as before
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace `import * as X from 'X'` with `import X = require('X')` for
dayjs, md5, minimatch, get-port, and jszip. All five use `export =` in
their type declarations, making this the correct TypeScript idiom. It
compiles to a plain require() call, which esbuild handles as a direct
module reference rather than a namespace object, eliminating all 7
call-import-namespace warnings without needing esModuleInterop.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three issues prevented the bundled LSP from starting:
1. dayjs.extend(relativeTime) crashed because `import * as relativeTime`
produces a namespace object that dayjs tries to call as a function.
Changed to `import relativeTime = require(...)`.
2. roku-test-automation uses __dirname-relative paths to locate its
JSON schema files; bundling broke __dirname resolution. Marked it
external so Node's module resolution handles it at runtime.
3. brighterscript spawns a worker thread from `${__dirname}/run.js`.
Added a `run` entry point so the worker script ends up at
`dist/run.js` next to the bundled brighterscript.js.
4. `ensureBscVersionInstalled` treated the bundled .js path as a
directory and looked for package.json inside it. Short-circuit the
lookup when versionInfo matches the embedded packageDir.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Bundle roku-test-automation into dist/ via a plugin that rewrites its three __dirname-based paths to dist/rta/..., and copy the schema files and on-device component bundle there post-build. This lets .vscodeignore exclude all of node_modules/, dropping the vsix from 18.6 MB to 3.99 MB. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Hey there! I just built a new version of the vscode extension based on cecb51d. You can downloaded the .vsix here and then follow these installation instructions. |
This uses esbuild to bundle the application.
Here are some rough metrics of how this improves the process:
This replaces #200 because webpack is too slow. :P
Outstanding issues: