Skip to content

Commit 4e3564b

Browse files
authored
move to monorepo structure (#100)
1 parent ae2eb3f commit 4e3564b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+8428
-5189
lines changed

.github/workflows/release.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ jobs:
88
publish-npm:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v1
12-
- uses: actions/setup-node@v1
11+
- uses: actions/checkout@v4
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v4
1314
with:
14-
node-version: 16
15-
registry-url: https://registry.npmjs.org/
16-
- run: yarn install --frozen-lockfile
17-
- run: yarn test
18-
- run: yarn build
15+
version: 9
16+
- name: Use Node.js 20
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
cache: 'pnpm'
21+
- run: pnpm install
22+
- run: pnpm test
23+
- run: pnpm build
1924

2025
- name: Extract version
2126
id: version

.github/workflows/test-and-build.yml

+12-7
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ jobs:
1010
test-and-build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v1
14-
- uses: actions/setup-node@v1
13+
- uses: actions/checkout@v4
14+
- name: Install pnpm
15+
uses: pnpm/action-setup@v4
1516
with:
16-
node-version: 16
17-
registry-url: https://registry.npmjs.org/
18-
- run: yarn install --frozen-lockfile
19-
- run: yarn test
20-
- run: yarn build
17+
version: 9
18+
- name: Use Node.js 20
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
cache: 'pnpm'
23+
- run: pnpm install
24+
- run: cd packages/nestjs-zod && pnpm test
25+
- run: cd packages/nestjs-zod &&pnpm build

.gitignore

+1-21
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,2 @@
1-
.DS_Store
2-
*.log
3-
npm-debug.log*
4-
yarn-debug.log*
5-
yarn-error.log*
6-
lerna-debug.log*
71
node_modules
8-
.env
9-
.env.test
10-
.cache
11-
.next
12-
.nuxt
13-
.vscode/*
14-
.idea
15-
!.vscode/settings.json
16-
!.vscode/tasks.json
17-
!.vscode/launch.json
18-
!.vscode/extensions.json
19-
dist
20-
package-lock.json
21-
/*.d.ts
22-
!z.d.ts
2+
.DS_Store

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
## Installation
5151

5252
```
53-
yarn add nestjs-zod zod
53+
npm install nestjs-zod zod
5454
```
5555

5656
Peer dependencies:

package.json

100755100644
+7-87
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,9 @@
11
{
2-
"name": "nestjs-zod",
3-
"description": "All NestJS + Zod utilities you need",
4-
"version": "0.0.0-set-by-ci",
5-
"main": "./dist/index.js",
6-
"exports": {
7-
".": "./dist/index.js",
8-
"./z": {
9-
"import": "./dist/z.mjs",
10-
"default": "./dist/z.js"
11-
},
12-
"./frontend": {
13-
"import": "./dist/frontend.mjs",
14-
"default": "./dist/frontend.js"
15-
},
16-
"./dto": {
17-
"import": "./dist/dto.mjs",
18-
"default": "./dist/dto.js"
2+
"name": "nestjs-zod-monorepo",
3+
"description": "All NestJS + Zod utilities you need",
4+
"version": "0.0.1",
5+
"private": true,
6+
"dependencies": {
7+
"syncpack": "^13.0.0"
198
}
20-
},
21-
"module": "./dist/index.js",
22-
"types": "./dist/index.d.ts",
23-
"files": [
24-
"dist",
25-
"z.d.ts",
26-
"frontend.d.ts",
27-
"dto.d.ts"
28-
],
29-
"sideEffects": false,
30-
"license": "MIT",
31-
"repository": "[email protected]:risenforces/nestjs-zod.git",
32-
"author": "Evgeny Zakharov <[email protected]>",
33-
"publishConfig": {
34-
"access": "public"
35-
},
36-
"scripts": {
37-
"dev": "vite",
38-
"build": "rollup -c",
39-
"test": "jest",
40-
"lint": "eslint --ext .ts,.tsx src",
41-
"lint:fix": "eslint --ext .ts,.tsx src --fix"
42-
},
43-
"devDependencies": {
44-
"@golevelup/ts-jest": "^0.3.3",
45-
"@nestjs/common": "8.0.0",
46-
"@nestjs/core": "8.0.0",
47-
"@nestjs/swagger": "^5.2.1",
48-
"@types/jest": "^26.0.14",
49-
"@types/merge-deep": "^3.0.0",
50-
"esbuild": "^0.14.24",
51-
"eslint": "^8.18.0",
52-
"eslint-kit": "^5.7.0",
53-
"jest": "^28.1.0",
54-
"reflect-metadata": "^0.1.13",
55-
"rollup": "^2.69.0",
56-
"rollup-plugin-bundle-size": "^1.0.3",
57-
"rollup-plugin-copy": "^3.4.0",
58-
"rollup-plugin-dts": "^4.1.0",
59-
"rollup-plugin-esbuild": "^4.8.2",
60-
"rollup-plugin-terser": "^7.0.2",
61-
"rxjs": "^7.5.5",
62-
"ts-jest": "^28.0.2",
63-
"typescript": "4.6.3",
64-
"zod": "3.21.4"
65-
},
66-
"peerDependencies": {
67-
"@nestjs/common": ">= 8.0.0",
68-
"@nestjs/core": ">= 8.0.0",
69-
"@nestjs/swagger": ">= 5.0.0",
70-
"zod": ">= 3.14.3"
71-
},
72-
"peerDependenciesMeta": {
73-
"@nestjs/common": {
74-
"optional": true
75-
},
76-
"@nestjs/core": {
77-
"optional": true
78-
},
79-
"@nestjs/swagger": {
80-
"optional": true
81-
},
82-
"zod": {
83-
"optional": false
84-
}
85-
},
86-
"dependencies": {
87-
"merge-deep": "^3.0.3"
88-
}
89-
}
9+
}

packages/example/.eslintrc.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
project: 'tsconfig.json',
5+
tsconfigRootDir: __dirname,
6+
sourceType: 'module',
7+
},
8+
plugins: ['@typescript-eslint/eslint-plugin'],
9+
extends: [
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:prettier/recommended',
12+
],
13+
root: true,
14+
env: {
15+
node: true,
16+
jest: true,
17+
},
18+
ignorePatterns: ['.eslintrc.js'],
19+
rules: {
20+
'@typescript-eslint/interface-name-prefix': 'off',
21+
'@typescript-eslint/explicit-function-return-type': 'off',
22+
'@typescript-eslint/explicit-module-boundary-types': 'off',
23+
'@typescript-eslint/no-explicit-any': 'off',
24+
},
25+
};

packages/example/.gitignore

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# compiled output
2+
/dist
3+
/node_modules
4+
/build
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
pnpm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
lerna-debug.log*
14+
15+
# OS
16+
.DS_Store
17+
18+
# Tests
19+
/coverage
20+
/.nyc_output
21+
22+
# IDEs and editors
23+
/.idea
24+
.project
25+
.classpath
26+
.c9/
27+
*.launch
28+
.settings/
29+
*.sublime-workspace
30+
31+
# IDE - VSCode
32+
.vscode/*
33+
!.vscode/settings.json
34+
!.vscode/tasks.json
35+
!.vscode/launch.json
36+
!.vscode/extensions.json
37+
38+
# dotenv environment variable files
39+
.env
40+
.env.development.local
41+
.env.test.local
42+
.env.production.local
43+
.env.local
44+
45+
# temp directory
46+
.temp
47+
.tmp
48+
49+
# Runtime data
50+
pids
51+
*.pid
52+
*.seed
53+
*.pid.lock
54+
55+
# Diagnostic reports (https://nodejs.org/api/report.html)
56+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

packages/example/.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

packages/example/README.md

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<p align="center">
2+
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3+
</p>
4+
5+
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6+
[circleci-url]: https://circleci.com/gh/nestjs/nest
7+
8+
<p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9+
<p align="center">
10+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12+
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13+
<a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14+
<a href="https://coveralls.io/github/nestjs/nest?branch=master" target="_blank"><img src="https://coveralls.io/repos/github/nestjs/nest/badge.svg?branch=master#9" alt="Coverage" /></a>
15+
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
16+
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
17+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
18+
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
19+
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
20+
<a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
21+
</p>
22+
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
23+
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
24+
25+
## Description
26+
27+
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
28+
29+
## Project setup
30+
31+
```bash
32+
$ pnpm install
33+
```
34+
35+
## Compile and run the project
36+
37+
```bash
38+
# development
39+
$ pnpm run start
40+
41+
# watch mode
42+
$ pnpm run start:dev
43+
44+
# production mode
45+
$ pnpm run start:prod
46+
```
47+
48+
## Run tests
49+
50+
```bash
51+
# unit tests
52+
$ pnpm run test
53+
54+
# e2e tests
55+
$ pnpm run test:e2e
56+
57+
# test coverage
58+
$ pnpm run test:cov
59+
```
60+
61+
## Resources
62+
63+
Check out a few resources that may come in handy when working with NestJS:
64+
65+
- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
66+
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
67+
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
68+
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
69+
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
70+
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
71+
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
72+
73+
## Support
74+
75+
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
76+
77+
## Stay in touch
78+
79+
- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
80+
- Website - [https://nestjs.com](https://nestjs.com/)
81+
- Twitter - [@nestframework](https://twitter.com/nestframework)
82+
83+
## License
84+
85+
Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).

packages/example/nest-cli.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json.schemastore.org/nest-cli",
3+
"collection": "@nestjs/schematics",
4+
"sourceRoot": "src",
5+
"compilerOptions": {
6+
"deleteOutDir": true
7+
}
8+
}

0 commit comments

Comments
 (0)