Skip to content

Commit

Permalink
Add swc
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkNjunge committed Aug 1, 2023
1 parent 62f8781 commit 23ca216
Show file tree
Hide file tree
Showing 4 changed files with 1,748 additions and 5 deletions.
18 changes: 18 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./",
"paths": {
"@/*": [ "src/*" ]
}
},
"module": {
"type": "commonjs",
"noInterop": true
}
}
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ A boilerplate for [NestJS](https://nestjs.com/), using Fastify.
- [Docker support](#docker)
- [Testing](#testing)
- [Continuous Integration](#ci)
- [SWC (Speedy Web Compiler)](#swc)

## Installation

Expand Down Expand Up @@ -74,11 +75,11 @@ Conversion of column names from camel case to snake case is automatically done i
It however does not work in all cases. See excerpt below from Objection docs
([Snake case to camel case conversion](https://vincit.github.io/objection.js/recipes/snake-case-to-camel-case-conversion.html)):

> When the conversion is done on objection level only database columns of the returned
rows (model instances) are convered to camel case. You still need to use snake case in
relationMappings and queries. Note that insert, patch, update and their variants still
take objects in camel case. The reasoning is that objects passed to those methods
usually come from the client that also uses camel case.
> When the conversion is done on objection level only database columns of the returned
> rows (model instances) are convered to camel case. You still need to use snake case in
> relationMappings and queries. Note that insert, patch, update and their variants still
> take objects in camel case. The reasoning is that objects passed to those methods
> usually come from the client that also uses camel case.

### Migrations
Expand Down Expand Up @@ -362,3 +363,17 @@ npm run test:e2e:local

[Github Actions config](./.github/workflows/main-workflow.yml)
![](https://github.com/MarkNjunge/nest-boilerplate/workflows/Main%20Workflow/badge.svg)

# swc

SWC is available in the project, but it generates incorrect imports on Windows when using paths,
similar to https://github.com/swc-project/swc/issues/7592.

It can however be run manually:
```
# Compile
npx swc ./src -d dist -w
# Type check
tsc --noEmit
```
Loading

0 comments on commit 23ca216

Please sign in to comment.