swc-project / pkgs

node.js packages for SWC
62 stars 20 forks source link

feat(cli): Add callbacks to cli #56

Closed lake2 closed 2 months ago

lake2 commented 2 months ago

Closes https://github.com/swc-project/pkgs/issues/55

I rename packages/cli/src/swc/index.ts to packages/cli/src/swc/bin.ts, and export swcDir function via new packages/cli/src/swc/index.ts

add doc here: https://github.com/swc-project/website/pull/261

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: 605a2b26983d71b25532e428a8373b4569d76b1a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

CLAassistant commented 2 months ago

CLA assistant check
All committers have signed the CLA.

lake2 commented 2 months ago

Can you add some tests for this?

I tried, I can add tests for watch=false and sync=true options. It's hard to mock worker and file change watcher.

kdy1 commented 2 months ago

I think tests to ensure that onSuccess and onFail are called are enough

lake2 commented 2 months ago

I think tests to ensure that onSuccess and onFail are called are enough

Sure. I will accomplish it later.

lake2 commented 2 months ago

I think tests to ensure that onSuccess and onFail are called are enough

Test cases update. Can you release a beta version for testing?