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

👻 Update the shared workspace to build to esm and commonjs #193

Merged
merged 6 commits into from
Jan 28, 2025

Conversation

ibolton336
Copy link
Member

@ibolton336 ibolton336 commented Jan 13, 2025

Resolves #192

Vite Library Mode Integration:

Enables efficient bundling of the shared package using Vite, producing both CommonJS (CJS) and ES Module (ESM) outputs. This setup ensures compatibility with modern and legacy environments for seamless use in both the VSCode extension and webview packages.

Summary of changes:

  • drop typescript composite project structures
  • build shared with vite in library mode
  • fixup the dev scripts so the shared build has a chance to run before the other packages go looking for its files
  • all workspaces now launch in dev or build watch mode - changes in any of them will result in recompiles

@ibolton336 ibolton336 requested a review from a team as a code owner January 13, 2025 17:42
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Why not use vite library mode? https://vite.dev/guide/build#library-mode

From what I can tell, esbuild comes in from @vitejs/plugin-react, but I could be wrong. Would be good to have the builders/packagers used all explicity listed as devDependencies in the approriate package.json files.

Probably can also remove:

"references": [
{ "path": "./shared" },
{ "path": "./vscode" },
{ "path": "./webview-ui" }
]

and:

"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"

@ibolton336 ibolton336 changed the title 👻 Add esbuild script for esm / commonjs shared builds 👻 Add vite build step for shared package Jan 13, 2025
@ibolton336 ibolton336 changed the title 👻 Add vite build step for shared package 👻 Update the shared workspace to build to esm and commonjs Jan 13, 2025
sjd78 added 3 commits January 20, 2025 23:09
More work to:
  - remove the remaining typescript composite configs
  - enhance the vite config for shared package
  - fixup the dev scripts so all workspaces can have
    their builders running in watch mode

Signed-off-by: Scott J Dickerson <[email protected]>
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

I pushed a few changes basically to drop the rest of the composite project configs and to fix up the dev scripts a bit. Super easy to do on a excellent base.

Copy link
Member Author

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member Author

@ibolton336 ibolton336 left a comment

Choose a reason for hiding this comment

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

LGTM

@sjd78 sjd78 merged commit 5d48c1f into konveyor:main Jan 28, 2025
10 checks passed
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.

Update the shared workspace to build to esm and commonjs
3 participants