-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ready to deploy nestjs to vercel
- Loading branch information
0 parents
commit 44b3d4d
Showing
14 changed files
with
3,919 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["prettier"], | ||
"extends": ["eslint:recommended", "plugin:prettier/recommended"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"no-unused-vars":"warn" | ||
}, | ||
"ignorePatterns": ["tests","out", "dist", "**/*.d.ts","tsconfig.json"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
dist | ||
.log | ||
.debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"endOfLine": "lf" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Vercel-nest | ||
|
||
Vercel builder for Nestjs | ||
|
||
Help you to deploy [Nestjs](https://docs.nestjs.com/) application on [Vercel](https://vercel.com) in SSR mode | ||
|
||
# Usage | ||
|
||
## 2. Configure `vercel-nest` as builder in `vercel.json` | ||
|
||
### Add a `vercel.json` file to your project root path | ||
|
||
```json | ||
{ | ||
"version": 2, | ||
"builds": [ | ||
{ | ||
"src": "package.json", | ||
"use": "vercel-nest" | ||
} | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { join } from 'node:path'; | ||
import { readFileSync } from 'node:fs'; | ||
import { build } from 'esbuild'; | ||
|
||
const pkgPath = join(process.cwd(), 'package.json'); | ||
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')); | ||
const externals = Object.keys(pkg.dependencies || {}); | ||
|
||
await build({ | ||
entryPoints: ['src/index.ts'], | ||
format: 'cjs', | ||
outdir: 'dist', | ||
platform: 'node', | ||
bundle: true, | ||
external: ['@vercel/build-utils', ...externals], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
"name": "vercel-nest", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"exports": { | ||
".": "./dist/index.js" | ||
}, | ||
"repository": { | ||
"url": "https://github.com/dongwa/vercel-nest" | ||
}, | ||
"scripts": { | ||
"build": "node build.mjs", | ||
"prepublishOnly": "npm run release", | ||
"release": "npm run build", | ||
"lint": "eslint --ext .js,.ts,.json ./", | ||
"fix": "eslint --ext .js,.ts,.json ./ --fix", | ||
"format": "prettier --config ./.prettierrc --write \"./**/*.{ts,js,json}\" ", | ||
"test": "jest", | ||
"ver": "standard-version", | ||
"vermi": "standard-version -r minor", | ||
"verma": "standard-version -r major", | ||
"verp": "standard-version -p beat" | ||
}, | ||
"author": "dongwa", | ||
"license": "MIT", | ||
"jest": { | ||
"transform": { | ||
"^.+\\.(t|j)sx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/test/.*|(\\.|/)(test|spec))\\.(ts)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"js", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@types/fs-extra": "^9.0.13", | ||
"@types/jest": "^27.5.0", | ||
"@types/node": "^17.0.31", | ||
"@typescript-eslint/eslint-plugin": "^5.22.0", | ||
"@typescript-eslint/parser": "^5.22.0", | ||
"@vercel/build-utils": "7.5.1", | ||
"build": "^0.1.4", | ||
"esbuild": "^0.20.0", | ||
"eslint": "^8.14.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"jest": "^28.0.3", | ||
"prettier": "^2.6.2", | ||
"ts-jest": "^28.0.0", | ||
"typescript": "^4.6.4" | ||
}, | ||
"dependencies": { | ||
"@types/glob": "^7.2.0", | ||
"@vercel/node-bridge": "^2.2.1", | ||
"@vercel/routing-utils": "^1.13.2", | ||
"consola": "^2.15.3", | ||
"execa": "5.1.1", | ||
"fs-extra": "^10.1.0", | ||
"jiti": "^1.19.1", | ||
"path-to-regexp": "^6.2.1" | ||
}, | ||
"standard-version": { | ||
"skip": { | ||
"commit": true, | ||
"tag": true | ||
} | ||
} | ||
} |
Oops, something went wrong.