Bundle @dbux/cli with dbux-code extension
- Dominant language
- JavaScript
- Stars
- 171
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
We currently install `@dbux/cli` in `ProjectsManager.installModules`, which is called from `installDbuxDependencies` right during `dbux-code` intialization.
Problem: This takes a long time for a first-time user.
Sln: We can save the user the time by bundling it with the extension (about 5 MB after compression).
NOTE: When bundling the extension, it bundles the entire `dbux-code` folder minus everything from `.vscodeignore`
* [ ] in `dbux-code/package.json` -> `package-no-build` add an extra step to bundle `@dbux/cli`:
* For that, copy all of `@dbux/cli` (without its own `node_modules`) to a new folder (maybe call it `dbux_bundled`), outside the `dbux` folder (because else, yarn workspaces will hoist dependencies)
* Theoretically, the `glob` library supports negative lookahead, something like this: `somewhere!(/node_modules)/*` (but needs testing!)
* In that folder run `yarn install`
* TODO:
* Problem: make sure that `@dbux/cli` is also added to it's own `node_modules` folder
* Problem: must not contain symlinks
* Move that `dbux_bundled` folder back to `dbux-code`
* (then proceed with packaging)
* [ ] remove dependency from `ProjectsManager`
* [ ] Instead, when starting, and `dbux_bundled` exists and `node_modules` does not exist, rename the `dbux_bundled` folder to `node_modules` (the latter is ignored by `.vscodeignore`)
* [ ] Don't forget to test this new approach
* NOTE: use `production` build to avoid it using local dependencies and skipping install process
* Stop dev-mode `npm watch`
* Run production build (with or without watch) instead
* `yarn run code:install`
Contributor guide
Assessment
This issue has not been assessed yet.