Skip to content
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

feat: tsc switches to swc #190

Merged
merged 2 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# All node_modules directories
node_modules
**/node_modules
dist
**/dist
**/.next

# All secrets
Expand Down Expand Up @@ -53,4 +53,5 @@ tmp
.vscode

# other
**/.assets
.DS_Store
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,11 @@ db-push: ## connects to your database and adds Prisma models to your Prisma sch
else echo "Unknown command."; fi

sqlite-mode: ## sqlite-mode
@make gen-sqlite-prisma-schema
@cd ./packages/db-main-prisma; \
yarn prisma-generate --schema ./prisma/sqlite/schema.prisma; \
yarn prisma-migrate deploy --schema ./prisma/sqlite/schema.prisma

postgres-mode: ## postgres-mode
@make gen-postgres-prisma-schema
@cd ./packages/db-main-prisma; \
yarn prisma-generate --schema ./prisma/postgres/schema.prisma; \
yarn prisma-migrate deploy --schema ./prisma/postgres/schema.prisma
Expand Down
13 changes: 13 additions & 0 deletions apps/nestjs-backend/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./"
},
"minify": false
}
3 changes: 2 additions & 1 deletion apps/nestjs-backend/nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"entryFile": "index",
"flat": true,
"compilerOptions": {
"tsConfigPath": "./tsconfig.json"
"builder": "swc",
"typeCheck": true
}
}
10 changes: 6 additions & 4 deletions apps/nestjs-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
]
},
"scripts": {
"build": "nest build",
"build": "nest build -b swc --type-check",
"clean": "rimraf ./out ./coverage ./main ./dist ./tsconfig.tsbuildinfo ./node_modules/.cache",
"dev": "nest start --watch",
"start": "NODE_ENV=production node ./dist",
"start:debug": "nest start --debug --watch",
"dev": "nest start -b swc --type-check -w",
"start": "nest start -b swc",
"start:debug": "nest start -b swc --debug --watch",
"check-dist": "es-check -v",
"check-size": "size-limit --highlight-less",
"test": "run-s test-unit test:e2e",
Expand All @@ -53,6 +53,8 @@
"@faker-js/faker": "8.1.0",
"@nestjs/cli": "10.1.18",
"@nestjs/testing": "10.2.7",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.92",
"@teable-group/eslint-config-bases": "workspace:^",
"@types/bcrypt": "5.0.0",
"@types/cookie": "0.5.2",
Expand Down
2 changes: 2 additions & 0 deletions dockers/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ services:
context: ../
dockerfile: ./dockers/teable/Dockerfile
target: builder
args:
INTEGRATION_TEST: 1
hostname: integration-test
networks:
- teable-net
Expand Down
19 changes: 11 additions & 8 deletions dockers/teable/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ RUN yarn install --immutable --inline-builds

FROM deps AS builder

ARG INTEGRATION_TEST

ENV NEXT_BUILD_ENV_TYPECHECK=false
ENV NEXT_BUILD_ENV_LINT=false
ENV NEXT_BUILD_ENV_OUTPUT=standalone
Expand All @@ -56,14 +58,15 @@ COPY --from=deps --link /workspace-install ./

# Optional: if the app depends on global /static shared assets like images, locales...
RUN yarn workspace @teable-group/db-main-prisma prisma-generate --schema ./prisma/postgres/schema.prisma
RUN yarn workspace @teable-group/app share-static-hardlink; \
yarn g:build

# Does not play well with buildkit on CI
# https://github.com/moby/buildkit/issues/1673
RUN SKIP_POSTINSTALL=1 \
yarn workspaces focus --production @teable-group/core @teable-group/openapi @teable-group/db-main-prisma \
@teable-group/backend @teable-group/app

# integration_test
RUN if [ -n "$INTEGRATION_TEST" ]; \
then yarn workspaces foreach -A -tv --exclude '@teable-group/(app|backend)' run build; \
else yarn workspace @teable-group/app share-static-hardlink && \
yarn g:build && \
SKIP_POSTINSTALL=1 yarn workspaces focus --production @teable-group/core @teable-group/openapi @teable-group/db-main-prisma \
@teable-group/backend @teable-group/app; \
fi

##################################################################
# Stage 3: Extract a minimal image from the build #
Expand Down
Loading