Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle the extension #3555

Merged
merged 5 commits into from
Sep 14, 2021
Merged

Bundle the extension #3555

merged 5 commits into from
Sep 14, 2021

Conversation

andyleejordan
Copy link
Member

@andyleejordan andyleejordan commented Sep 8, 2021

This uses esbuild as outlined in the VS Code docs to bundle the PowerShell extension.

Resolves #2450.

@ghost ghost added Area-Build & Release Issue-Enhancement A feature request (enhancement). labels Sep 8, 2021
@andyleejordan
Copy link
Member Author

Wow, so this is really annoying. The tooling is absolutely not ready for tests yet.

@andyleejordan andyleejordan changed the title WIP: Bundle the extension Bundle the extension Sep 10, 2021
@andyleejordan andyleejordan marked this pull request as ready for review September 10, 2021 23:42
@andyleejordan
Copy link
Member Author

@rjmholt and @SeeminglyScience please test this (and especially the launch configurations). Everything seems to be working right but it wasn't trivial.

While we need to bundle the extension code with `eslint` we still have
to use `tsc` for the tests, which is annoying.

This also fixes are (already broken) VS Code launch tasks!
Since bundling produces a single (bundled) file at `out/main.js` all the
relative paths that expected `out/src/...` needed to drop one set of
`../` to be correct. We cannot emit the bundled extension to
`out/src/main.js` because, as mentioned previously, we still must
transpile everything for the unit tests, so `out/src/` is already full.
@andyleejordan
Copy link
Member Author

Also filed #3561 as a next step.

Comment on lines +3 to +4
// NOTE: The TypeScript compiler is only used for building the tests (and
// the sources which the tests need). The extension is built with `esbuild`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this file configure the typescript compiler rather than esbuild?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, T(ype)S(cript)config.json. While esbuild supports transpiling typescript to javascript, it does not do any sort of type checking etc., and it also will only produce a bundled file. So we still need tsc around to type-check the sources and transpile the test code.

@andyleejordan andyleejordan merged commit 10371a3 into master Sep 14, 2021
@andyleejordan andyleejordan deleted the andschwa/bundle branch September 14, 2021 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build & Release Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundle the PowerShell extension
3 participants