expressots-cli
expressots-cli copied to clipboard
Feat/experimetal transpile with swc
Pull Request Guidelines
Our guidelines for submitting a pull request.
Before submitting a Pull Request, please make sure you have verified the following:
- [ ] The commit message follows our guidelines:
- A good commit message should be two things: meaningful and concise. It should not contain every single detail, describing each changed line—we can see all the changes in Git—but, at the same time, it should say enough to avoid ambiguity.
- We use Microverse's commit message convention
- The convention stablish that a commit message has to be in the present tense, imperative and lowercase.
- Example:
fix typo in README.md
- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
PR Type
What kind of change does this PR introduce?
- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Other... Please describe:
What is the current behavior?
Please describe the current behavior that you are modifying, or link to a relevant issue.
Issue Number: N/A
What is the new behavior?
Describe the new behavior or link to a relevant issue.
Does this PR introduce a breaking change?
- [ ] Yes
- [x] No
If this PR contains a breaking change, please describe the impact and migration path for existing applications below.
Other information
Added experimental flag for templates (see: https://github.com/expressots/expressots-cli/pull/17)
An interactive stdout example:
Added cli commands:
This pull request moves the dependencies that used to be in the templates to the CLI, making it essential for the build. This change simplifies the installation and maintenance of the templates, as they no longer need to have the same dependencies as the CLI. It also allows the CLI to have more control over the build process and use different tools for different tasks.
The pull request adds new dependencies to the expressots-cli package.json file:
- @swc/cli
- @swc/core
- @swc/register
- concurrently
- nodemon
- rimraf
- ts-node-dev
- tsconfig-paths
It also adds a new dev dependency:
- @types/nodemon
The new dependencies can be removed from the templates.
The pull request also adds new commands to the expressots-cli bin file:
-
expressots dev: usests-node-devto start the server and watch for changes in the./srcdirectory and reload, showing type errors. -
expressots dev --experimental: usesnodemonin conjunction withtscandeslintrespectively to start the server and watch for changes in the./srcdirectory and reload and in parallel validate the typing and code style, showing errors. -
expressots build: usestscthat look fortsconfig.build.jsonto transpile a hole project in dist -
expressots build --experimental: usesconcurrentlyto start types, lint and build (with swc) in parallel, and if one of these tasks fail, the process exit code is an error
Any other information that is important to this PR.
As soon as @juliano-soares approve it, @rsaz may test it on Windows and merge.
We are currently using tsx and tsc combined. With SWC we had few issues with compatibility, and didn't worth to fix as tsx + tsc deliver a good performance for the current system.