Skip to content
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
2 changes: 1 addition & 1 deletion .changeset/initial-release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
"@nestm/nestjs-standard-schema": minor
"@nestm/standard-schema": minor
---

Initial release: runtime DTO classes backed by NestJS 12 native Standard Schema request validation and response serialization.
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"@nestm/nestjs-standard-schema": "0.1.0-alpha.0"
"@nestm/standard-schema": "0.1.0-alpha.0"
},
"changesets": []
}
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
with:
publish: pnpm run release
version: pnpm changeset version
title: 'chore: release @nestm/nestjs-standard-schema'
commit: 'chore: release @nestm/nestjs-standard-schema'
title: 'chore: release @nestm/standard-schema'
commit: 'chore: release @nestm/standard-schema'
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -56,7 +56,7 @@ jobs:
if: always()
run: |
VERSION=$(node -p "require('./package.json').version")
TAG="@nestm/nestjs-standard-schema@$VERSION"
if npm view "@nestm/nestjs-standard-schema@$VERSION" version > /dev/null 2>&1; then
TAG="@nestm/standard-schema@$VERSION"
if npm view "@nestm/standard-schema@$VERSION" version > /dev/null 2>&1; then
git tag "$TAG" 2> /dev/null && git push origin "$TAG" || true
fi
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @nestm/nestjs-standard-schema
# @nestm/standard-schema

All notable changes to this project will be documented in this file.

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

Thank you for helping improve `@nestm/nestjs-standard-schema`.
Thank you for helping improve `@nestm/standard-schema`.

The project follows NestJS 12's prerelease Standard Schema API. Changes should keep the core integration schema-vendor-neutral and should delegate parsing to Nest's native Standard Schema components.

Expand Down Expand Up @@ -56,9 +56,9 @@ npm publish --access public --tag alpha
Complete npm's browser or two-factor authentication flow locally; never add an npm token to this repository. Then bind the package to the release workflow:

```sh
npm trust github @nestm/nestjs-standard-schema \
npm trust github @nestm/standard-schema \
--file release.yml \
--repository nestm-dev/nestjs-standard-schema \
--repository nestm-dev/standard-schema \
--environment release \
--allow-publish
```
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# @nestm/nestjs-standard-schema
# @nestm/standard-schema

DTO ergonomics for NestJS 12's native [Standard Schema](https://standardschema.dev/) validation and serialization.

> [!CAUTION]
> NestJS 12 is currently prerelease software. This package is experimental and may change as Nest's native Standard Schema API stabilizes.

`@nestm/nestjs-standard-schema` connects runtime DTO classes to the Standard Schema support built into NestJS 12. It is schema-vendor-neutral: Zod is used in the examples, but the library API accepts Standard Schema-compatible schemas.
`@nestm/standard-schema` connects runtime DTO classes to the Standard Schema support built into NestJS 12. It is schema-vendor-neutral: Zod is used in the examples, but the library API accepts Standard Schema-compatible schemas.

## Why this exists

Expand Down Expand Up @@ -42,7 +42,7 @@ This is intentional. Runtime return metadata records `Promise<Product>` as `Prom
Install the package alongside NestJS 12 and a Standard Schema implementation:

```sh
pnpm add @nestm/nestjs-standard-schema
pnpm add @nestm/standard-schema
pnpm add @nestjs/common@12.0.0-alpha.5 @nestjs/core@12.0.0-alpha.5
pnpm add reflect-metadata rxjs
```
Expand All @@ -65,7 +65,7 @@ The same upstream mismatch can make npm stop with `ERESOLVE`. For this alpha com

```ts
// products.dto.ts
import { createStandardSchemaDto } from '@nestm/nestjs-standard-schema';
import { createStandardSchemaDto } from '@nestm/standard-schema';
import { z } from 'zod';

export const CreateProductSchema = z.object({
Expand Down Expand Up @@ -99,7 +99,7 @@ The generated DTO class is a runtime metadata carrier. The controller receives t
```ts
// app.module.ts
import { Module } from '@nestjs/common';
import { StandardSchemaModule } from '@nestm/nestjs-standard-schema';
import { StandardSchemaModule } from '@nestm/standard-schema';
import { ProductsController } from './products.controller.js';

@Module({
Expand All @@ -116,7 +116,7 @@ export class AppModule {}
```ts
// products.controller.ts
import { Body, Controller, Get, Post } from '@nestjs/common';
import { StandardSchemaResponse } from '@nestm/nestjs-standard-schema';
import { StandardSchemaResponse } from '@nestm/standard-schema';
import { CreateProductDto, ProductResponseDto } from './products.dto.js';

@Controller('products')
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Please do not disclose a suspected vulnerability in a public issue, discussion,

Use the repository's private **Report a vulnerability** flow when it is available:

<https://github.com/nestm-dev/nestjs-standard-schema/security/advisories/new>
<https://github.com/nestm-dev/standard-schema/security/advisories/new>

If private vulnerability reporting is not available, contact a repository maintainer through a private channel listed on their GitHub profile before sending sensitive details.

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@nestm/nestjs-standard-schema",
"name": "@nestm/standard-schema",
"version": "0.1.0-alpha.0",
"description": "DTO ergonomics for NestJS 12's native Standard Schema validation and serialization.",
"license": "MIT",
Expand Down Expand Up @@ -32,11 +32,11 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/nestm-dev/nestjs-standard-schema.git"
"url": "git+https://github.com/nestm-dev/standard-schema.git"
},
"homepage": "https://github.com/nestm-dev/nestjs-standard-schema#readme",
"homepage": "https://github.com/nestm-dev/standard-schema#readme",
"bugs": {
"url": "https://github.com/nestm-dev/nestjs-standard-schema/issues"
"url": "https://github.com/nestm-dev/standard-schema/issues"
},
"keywords": [
"nestjs",
Expand Down
4 changes: 1 addition & 3 deletions src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { StandardSchemaV1 } from '@standard-schema/spec';

export const STANDARD_SCHEMA_DTO = Symbol.for(
'@nestm/nestjs-standard-schema/dto',
);
export const STANDARD_SCHEMA_DTO = Symbol.for('@nestm/standard-schema/dto');

/**
* Runtime class created by `createStandardSchemaDto`.
Expand Down
Loading