-
Notifications
You must be signed in to change notification settings - Fork 72
CLOUDP-352308 Fix tsc script and share build commands #3323
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
Conversation
🦋 Changeset detectedLatest commit: 82c6e29 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
a6276bc to
f399e7b
Compare
|
Size Change: +301 B (+0.02%) Total Size: 1.79 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors build-related CLI command registration logic to eliminate code duplication between the lg and lg-build scripts. The changes centralize command definitions in a new cli-commands.ts file to ensure consistency between the two scripts and prevent them from drifting out of sync.
- Extracts command registration functions into shared utilities
- Fixes argument processing mismatch between
lg-build tscandlg build-ts - Removes unused
--directoption from bundle command
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/cli/src/index.ts | Replaces inline command definitions with calls to shared registration functions |
| tools/build/src/cli.ts | Replaces inline command definitions with calls to shared registration functions |
| tools/build/src/cli-commands.ts | New file containing shared command registration logic for bundle, TypeScript, and docs commands |
| tools/build/src/index.ts | Exports the new command registration functions |
| tools/build/src/rollup/build-package.ts | Removes unused direct option from BuildPackageOptions interface |
| tools/build/src/typescript/build-ts.ts | Extracts downlevel option and refactors verbose logging to use proper if-block |
| packages/icon/scripts/build/build.ts | Removes direct: true argument from buildPackage call |
71f2868 to
82c6e29
Compare
|
Coverage after merging cloudp-352308-fix-tsc-script into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I like this idea. Something that's been on my mind for a while. I'll take a closer look |
| import { buildTSDoc } from './tsdoc/build-tsdoc'; | ||
| import { buildTypescript } from './typescript/build-ts'; | ||
|
|
||
| export function registerBundleCommand(command: Command) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍 Been wanting to do something like this for a while. It always bothered me that the cli definitions weren't collocated in the same package as the actual logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Adam for the quick feedback, glad that the change resonated with you too! 😁💐
🎫 Ticket
CLOUDP-352308
📝 Description
lgscript to share command registration logic withlg-buildscript.--directoption from thelg-build bundle/lg build-packagescript.🔍 Why
While working on #3319 I realized that the following commands between
lgandlg-build:lg-build bundle/lg build-packagelg-build tsc/lg build-tslg-build docs/lg build-tsdocAlthough shared an identical implementation, there was a mismatch in the command args definition between
lg-build tscandlg build-tsscripts which led tolg-build tscnot processing args (e.g.--verbose) correctly. Sharing the command registration logic between the two scripts would prevent this sort of error in the future.🧪 Documentation and Testing