Skip to content

Commit

Permalink
chore: revert turbo repo migration
Browse files Browse the repository at this point in the history
  • Loading branch information
vfurmane committed May 27, 2024
1 parent 8089ebb commit a3d9e02
Show file tree
Hide file tree
Showing 76 changed files with 4,102 additions and 5,270 deletions.
27 changes: 21 additions & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
// This configuration only applies to the package manager root.
/** @type {import("eslint").Linter.Config} */
module.exports = {
ignorePatterns: ["apps/**", "packages/**"],
extends: ["@repo/eslint-config/library.js"],
parser: "@typescript-eslint/parser",
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.cjs'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
7 changes: 3 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ env:
REGISTRY: ghcr.io
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASS: ${{ secrets.GITHUB_TOKEN }}
API_IMAGE_NAME: ${{ github.repository }}-api
IMAGE_NAME: ${{ github.repository }}

jobs:
api:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -39,7 +39,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.API_IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
Expand All @@ -48,7 +48,6 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
file: ./apps/api/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# compiled output
dist/
node_modules/
build/
/dist
/node_modules
/build

# Logs
logs
Expand Down Expand Up @@ -36,15 +36,12 @@ lerna-debug.log*
!.vscode/extensions.json

# dotenv environment variable files
apps/api/.env
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# Turbo
.turbo

# temp directory
.temp
.tmp
Expand All @@ -59,4 +56,4 @@ pids
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# IDE and editors
.idea/
.idea/
File renamed without changes.
22 changes: 8 additions & 14 deletions apps/api/Dockerfile → Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,24 @@ ENV PATH="$PNPM_HOME:$PATH"
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN corepack enable

RUN pnpm add turbo --global

FROM base as dev

ENV NODE_ENV dev

COPY --chown=node:node . .
RUN turbo prune 42cal-api --docker

FROM dev as install

COPY --chown=node:node --from=dev /app/out/json/ .
COPY --chown=node:node --from=dev /app/out/json/pnpm-lock.yaml ./pnpm-lock.yaml

RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile

FROM install as build
USER node

FROM base as build

ENV NODE_ENV production

COPY --chown=node:node --from=install /app/node_modules ./node_modules
COPY --chown=node:node --from=dev /app/out/full/ .
COPY --chown=node:node --from=dev /app/node_modules ./node_modules
COPY --chown=node:node . .

RUN turbo run build --filter=42cal-api...
RUN pnpm run build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

USER node
Expand All @@ -41,8 +35,8 @@ FROM base as prod
ENV NODE_ENV production# Set Docker as non-root user


COPY --chown=node:node --from=build /app/apps/api/package.json package.json
COPY --chown=node:node --from=build /app/apps/api/dist dist
COPY --chown=node:node --from=build /app/package.json package.json
COPY --chown=node:node --from=build /app/dist dist
COPY --chown=node:node --from=build /app/node_modules node_modules

USER node
Expand Down
17 changes: 0 additions & 17 deletions apps/api/.eslintrc.cjs

This file was deleted.

85 changes: 0 additions & 85 deletions apps/api/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions apps/api/tsconfig.build.json

This file was deleted.

7 changes: 0 additions & 7 deletions apps/api/tsconfig.json

This file was deleted.

90 changes: 79 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,87 @@
{
"name": "42cal",
"version": "1.0.4",
"description": "",
"type": "module",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint"
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"dev": "pnpm run start:dev",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix"
},
"dependencies": {
"@nestjs/cache-manager": "^2.2.2",
"@nestjs/common": "^10.0.0",
"@nestjs/config": "^3.2.2",
"@nestjs/core": "^10.0.0",
"@nestjs/mapped-types": "*",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/schedule": "^4.0.2",
"@nestjs/swagger": "^7.3.1",
"cache-manager": "^5.5.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"ical-generator": "^7.1.0",
"p-queue": "^8.0.1",
"parse-link-header": "^2.0.0",
"passport": "^0.7.0",
"passport-http": "^0.3.0",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"simple-oauth2": "^5.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"prettier": "^3.2.5",
"turbo": "latest"
"@nestjs/cli": "^10.0.0",
"@nestjs/schematics": "^10.0.0",
"@nestjs/testing": "^10.0.0",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.12",
"@types/node": "^20.3.1",
"@types/parse-link-header": "^2.0.3",
"@types/passport-http": "^0.3.11",
"@types/simple-oauth2": "^5.0.7",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.5.0",
"prettier": "^3.0.0",
"source-map-support": "^0.5.21",
"supertest": "^6.3.3",
"ts-jest": "^29.1.0",
"ts-loader": "^9.4.3",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.1.3"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
}
"packageManager": "[email protected]+sha1.09ada6cd05003e0ced25fb716f9fda4063ec2e3b"
}
3 changes: 0 additions & 3 deletions packages/eslint-config/README.md

This file was deleted.

Loading

0 comments on commit a3d9e02

Please sign in to comment.