feat(VEG-3430): Add the Connector bundle logic into the cli#309
Conversation
c3117f1 to
9efefae
Compare
1c91f03 to
549aea0
Compare
549aea0 to
16d1587
Compare
There was a problem hiding this comment.
Pull request overview
This pull request introduces a new zcli connectors bundle command that provides a streamlined way to bundle Zendesk connectors for deployment. The implementation uses Vite as the bundling engine and includes automated asset copying, translation handling, and manifest generation capabilities.
Changes:
- Added new
connectors bundlecommand with support for watch mode and custom output directories - Implemented Vite-based bundling infrastructure with Babel transpilation targeting IE11 compatibility
- Created manifest generator to automatically generate connector manifest files from bundled output
- Refactored test files in zcli-core for better test isolation and cleanup
- Added new dependencies: Vite, Rollup plugins, ora spinner, and sinon-chai for testing
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zcli-connectors/src/commands/connectors/bundle.ts | New bundle command implementation with flag parsing and error handling |
| packages/zcli-connectors/src/lib/vite/vite-config.ts | Vite configuration builder with asset/translation copying and manifest generation plugins |
| packages/zcli-connectors/src/lib/vite/vite-runner.ts | Vite runner wrapper that executes builds and handles errors |
| packages/zcli-connectors/src/lib/manifest-generator/generator.ts | Manifest generator that creates manifest.json from bundled connector |
| packages/zcli-connectors/tests/functional/bundle.test.ts | Comprehensive tests for bundle command functionality |
| packages/zcli-connectors/src/lib/vite/vite-config.test.ts | Tests for Vite configuration builder and plugins |
| packages/zcli-connectors/src/lib/vite/vite-runner.test.ts | Tests for Vite runner error handling and build process |
| packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts | Tests for manifest generation and validation |
| packages/zcli-core/src/lib/config.test.ts | Refactored tests with proper stub lifecycle management |
| packages/zcli-connectors/tsconfig.json | Removed esModuleInterop setting |
| packages/zcli-connectors/package.json | Added bundling-related dependencies and dev dependencies |
| .github/CODEOWNERS | Added Vegemite team as owners of connectors package |
| yarn.lock | Lock file updates for new dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/zcli-connectors/src/lib/manifest-generator/generator.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
49996b9 to
8e68c74
Compare
| if (flags.verbose) { | ||
| this.log(chalk.cyan('Verbose mode enabled')) | ||
| this.log(chalk.cyan(`Input path: ${inputPath}`)) | ||
| this.log(chalk.cyan(`Output path: ${outputPath}`)) | ||
| this.log(chalk.cyan(`Watch mode: ${flags.watch ? 'enabled' : 'disabled'}`)) | ||
| } |
There was a problem hiding this comment.
Should this be before the output directory creation?
There was a problem hiding this comment.
We are printing the resolved absolute paths for output and the input based on the flags or default values. The logic code path above these print statements. Can we leave it here?
There was a problem hiding this comment.
Sure, not a blocker on my end. Just wanted to call out the output order would be:
Created output directory: ${outputPath}
Verbose mode enabled
Input path: ${inputPath}
Output path: ${outputPath}
Watch mode: enabled
Which seems a bit odd. As a user I would expect:
Verbose mode enabled
Input path: ${inputPath}
Output path: ${outputPath}
Watch mode: enabled
Created output directory: ${outputPath}
...
There was a problem hiding this comment.
Renamed the labels like this for now:
Resolved Input path: ${inputPath}
Resolved Output path: ${outputPath}
packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts
Outdated
Show resolved
Hide resolved
packages/zcli-connectors/src/lib/manifest-generator/generator.test.ts
Outdated
Show resolved
Hide resolved
packages/zcli-connectors/src/lib/manifest-generator/generator.ts
Outdated
Show resolved
Hide resolved
8e68c74 to
7348df1
Compare
7348df1 to
5c56bb4
Compare
f004b76
into
skambaiyyagari/introduce-connector-commands
Description
This PR introduces a new zcli connectors bundle command that provides a streamlined way to bundle Zendesk connectors for deployment. The command uses Vite as the bundling engine and includes asset copying, translation handling, and manifest generation.
2822f16Add the manifest generator logic to generate the connector manifest16d1587Introduce the connector bundle logic to create the minified JS outputdea5d1cAdd codeowners5c56bb4Refactor and structure the codeDetail
JIRA: https://zendesk.atlassian.net/browse/VEG-3430
Checklist