meteorjs-decorators 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# meteorjs-decorators
|
|
2
2
|
|
|
3
3
|
NestJS-style decorators for Meteor methods, publications, dependency injection, and DTO validation.
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ NestJS-style decorators for Meteor methods, publications, dependency injection,
|
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
```bash
|
|
12
|
-
npm install
|
|
12
|
+
npm install meteorjs-decorators
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Setup
|
|
@@ -30,8 +30,8 @@ import 'reflect-metadata';
|
|
|
30
30
|
|
|
31
31
|
## Quick start
|
|
32
32
|
```ts
|
|
33
|
-
import { Controller, Method, Auth, Validate, Dto, Injectable, BaseController } from '
|
|
34
|
-
import { RequestDto, ResponseDto } from '
|
|
33
|
+
import { Controller, Method, Auth, Validate, Dto, Injectable, BaseController } from 'meteorjs-decorators';
|
|
34
|
+
import { RequestDto, ResponseDto } from 'meteorjs-decorators';
|
|
35
35
|
import { IsEmail, IsString } from 'class-validator';
|
|
36
36
|
|
|
37
37
|
class CreateUserDto extends RequestDto {
|
|
@@ -81,7 +81,7 @@ export class UsersController extends BaseController {
|
|
|
81
81
|
|
|
82
82
|
## Publications (with optional DTO mapping)
|
|
83
83
|
```ts
|
|
84
|
-
import { Publication, ReactiveDto, BasePublication, Injectable } from '
|
|
84
|
+
import { Publication, ReactiveDto, BasePublication, Injectable } from 'meteorjs-decorators';
|
|
85
85
|
|
|
86
86
|
@Injectable()
|
|
87
87
|
class UsersService {
|
|
@@ -107,7 +107,7 @@ export class UsersPublication extends BasePublication {
|
|
|
107
107
|
|
|
108
108
|
## Modules and DI
|
|
109
109
|
```ts
|
|
110
|
-
import { Module, forwardRef } from '
|
|
110
|
+
import { Module, forwardRef } from 'meteorjs-decorators';
|
|
111
111
|
|
|
112
112
|
@Module({
|
|
113
113
|
imports: [forwardRef(() => AuthModule)],
|
|
@@ -119,7 +119,7 @@ export class UsersModule {}
|
|
|
119
119
|
|
|
120
120
|
Use `@Inject(token)` when you need a custom token or to resolve circular deps:
|
|
121
121
|
```ts
|
|
122
|
-
import { Inject, Injectable, forwardRef } from '
|
|
122
|
+
import { Inject, Injectable, forwardRef } from 'meteorjs-decorators';
|
|
123
123
|
|
|
124
124
|
@Injectable()
|
|
125
125
|
class BillingService {
|
|
@@ -129,7 +129,7 @@ class BillingService {
|
|
|
129
129
|
|
|
130
130
|
## Entities and indexes
|
|
131
131
|
```ts
|
|
132
|
-
import { Entity, Index, BaseEntity } from '
|
|
132
|
+
import { Entity, Index, BaseEntity } from 'meteorjs-decorators';
|
|
133
133
|
|
|
134
134
|
@Entity('widgets')
|
|
135
135
|
export class WidgetEntity extends BaseEntity {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "meteorjs-decorators",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Meteor decorators to make your Meteor app with NestJS-style pattern.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,4 +23,4 @@
|
|
|
23
23
|
"mongodb": "^6.13.1",
|
|
24
24
|
"typescript": "^5.4.5"
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|