Skip to content

Commit

Permalink
move to monorepo structure (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenLorantfy authored Oct 14, 2024
1 parent ae2eb3f commit 4e3564b
Show file tree
Hide file tree
Showing 77 changed files with 8,428 additions and 5,189 deletions.
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn build
version: 9
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: pnpm test
- run: pnpm build

- name: Extract version
id: version
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: yarn install --frozen-lockfile
- run: yarn test
- run: yarn build
version: 9
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- run: pnpm install
- run: cd packages/nestjs-zod && pnpm test
- run: cd packages/nestjs-zod &&pnpm build
22 changes: 1 addition & 21 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
.DS_Store
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
node_modules
.env
.env.test
.cache
.next
.nuxt
.vscode/*
.idea
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
dist
package-lock.json
/*.d.ts
!z.d.ts
.DS_Store
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
## Installation

```
yarn add nestjs-zod zod
npm install nestjs-zod zod
```

Peer dependencies:
Expand Down
94 changes: 7 additions & 87 deletions package.json
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,89 +1,9 @@
{
"name": "nestjs-zod",
"description": "All NestJS + Zod utilities you need",
"version": "0.0.0-set-by-ci",
"main": "./dist/index.js",
"exports": {
".": "./dist/index.js",
"./z": {
"import": "./dist/z.mjs",
"default": "./dist/z.js"
},
"./frontend": {
"import": "./dist/frontend.mjs",
"default": "./dist/frontend.js"
},
"./dto": {
"import": "./dist/dto.mjs",
"default": "./dist/dto.js"
"name": "nestjs-zod-monorepo",
"description": "All NestJS + Zod utilities you need",
"version": "0.0.1",
"private": true,
"dependencies": {
"syncpack": "^13.0.0"
}
},
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"z.d.ts",
"frontend.d.ts",
"dto.d.ts"
],
"sideEffects": false,
"license": "MIT",
"repository": "[email protected]:risenforces/nestjs-zod.git",
"author": "Evgeny Zakharov <[email protected]>",
"publishConfig": {
"access": "public"
},
"scripts": {
"dev": "vite",
"build": "rollup -c",
"test": "jest",
"lint": "eslint --ext .ts,.tsx src",
"lint:fix": "eslint --ext .ts,.tsx src --fix"
},
"devDependencies": {
"@golevelup/ts-jest": "^0.3.3",
"@nestjs/common": "8.0.0",
"@nestjs/core": "8.0.0",
"@nestjs/swagger": "^5.2.1",
"@types/jest": "^26.0.14",
"@types/merge-deep": "^3.0.0",
"esbuild": "^0.14.24",
"eslint": "^8.18.0",
"eslint-kit": "^5.7.0",
"jest": "^28.1.0",
"reflect-metadata": "^0.1.13",
"rollup": "^2.69.0",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-dts": "^4.1.0",
"rollup-plugin-esbuild": "^4.8.2",
"rollup-plugin-terser": "^7.0.2",
"rxjs": "^7.5.5",
"ts-jest": "^28.0.2",
"typescript": "4.6.3",
"zod": "3.21.4"
},
"peerDependencies": {
"@nestjs/common": ">= 8.0.0",
"@nestjs/core": ">= 8.0.0",
"@nestjs/swagger": ">= 5.0.0",
"zod": ">= 3.14.3"
},
"peerDependenciesMeta": {
"@nestjs/common": {
"optional": true
},
"@nestjs/core": {
"optional": true
},
"@nestjs/swagger": {
"optional": true
},
"zod": {
"optional": false
}
},
"dependencies": {
"merge-deep": "^3.0.3"
}
}
}
25 changes: 25 additions & 0 deletions packages/example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
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.js'],
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',
},
};
56 changes: 56 additions & 0 deletions packages/example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
4 changes: 4 additions & 0 deletions packages/example/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
85 changes: 85 additions & 0 deletions packages/example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<p align="center">
<a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
</p>

[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest

<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>
<p align="center">
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
<a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
<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>
<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>
<a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
<a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
<a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
<a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
<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>
<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>
</p>
<!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
[![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->

## Description

[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.

## Project setup

```bash
$ pnpm install
```

## Compile and run the project

```bash
# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod
```

## Run tests

```bash
# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov
```

## Resources

Check out a few resources that may come in handy when working with NestJS:

- Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
- For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
- To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
- Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
- Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
- To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
- Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).

## Support

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).

## Stay in touch

- Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
- Website - [https://nestjs.com](https://nestjs.com/)
- Twitter - [@nestframework](https://twitter.com/nestframework)

## License

Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
8 changes: 8 additions & 0 deletions packages/example/nest-cli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/nest-cli",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
}
}
Loading

0 comments on commit 4e3564b

Please sign in to comment.