lombok-typescript 0.1.0 → 0.2.0

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 CHANGED
@@ -1,51 +1,27 @@
1
1
  # lombok-typescript
2
2
 
3
- [![CI](https://github.com/A-Dev-Kit/lombok-typescript/actions/workflows/ci.yml/badge.svg)](https://github.com/A-Dev-Kit/lombok-typescript/actions/workflows/ci.yml)
4
- [![Docs](https://github.com/A-Dev-Kit/lombok-typescript/actions/workflows/docs.yml/badge.svg)](https://a-dev-kit.github.io/lombok-typescript/)
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)
6
- [![npm version](https://img.shields.io/npm/v/lombok-typescript.svg?label=npm)](https://www.npmjs.com/package/lombok-typescript)
7
- [![coverage](https://img.shields.io/codecov/c/github/A-Dev-Kit/lombok-typescript/main?label=coverage)](https://codecov.io/gh/A-Dev-Kit/lombok-typescript)
8
- [![Node](https://img.shields.io/badge/node-%E2%89%A522-brightgreen)](https://nodejs.org/)
9
- [![TypeScript](https://img.shields.io/badge/TypeScript-%E2%89%A55.0-blue?logo=typescript)](https://www.typescriptlang.org/)
3
+ Lombok-like decorators and code generation for TypeScript, with Gang-of-Four design patterns.
10
4
 
11
- A TypeScript port of Java's [Project Lombok](https://projectlombok.org/) with Gang-of-Four design patterns as decorators. Legacy `experimentalDecorators` and Stage 3 ECMAScript decorators are supported side-by-side.
12
-
13
- ## Status
14
-
15
- **Version `0.1.0` — code-complete, not on npm yet.** Batch publish is deferred until the full release queue is ready. See [CHANGELOG.md](./CHANGELOG.md).
16
-
17
- Phase 1 decorators are implemented: `@NonNull`, `@ToString`, `@Builder`, `@Data`, `@Singleton`, `@Prototype`, `@Factory`, `@Memoize`.
18
-
19
- Documentation site: [a-dev-kit.github.io/lombok-typescript](https://a-dev-kit.github.io/lombok-typescript/) (after GitHub Pages deploy).
5
+ **Version:** `0.2.0`
20
6
 
21
7
  ## Install
22
8
 
23
9
  ```bash
24
- # Not on npm yet — clone and link locally:
25
- git clone https://github.com/A-Dev-Kit/lombok-typescript.git
26
- cd lombok-typescript && pnpm install && pnpm build && pnpm link --global
27
-
28
- # When published (preview tag):
29
10
  npm install lombok-typescript@preview
11
+ # pin this tree: npm install lombok-typescript@0.2.0
30
12
  ```
31
13
 
32
- ## Pick a decorator standard
33
-
34
- ### Legacy (`lombok-typescript/legacy`)
35
-
36
- For NestJS, TypeORM, and most existing decorator-based projects.
14
+ ## Decorators
37
15
 
38
- ```jsonc
39
- { "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true } }
40
- ```
41
-
42
- ### Stage 3 (`lombok-typescript/stage3`)
16
+ Includes all decorators from `0.1.0` and earlier.
43
17
 
44
- For TS 5.0+ projects without `experimentalDecorators`.
18
+ **New in 0.2.0:**
45
19
 
46
- ```jsonc
47
- { "compilerOptions": { "experimentalDecorators": false } }
48
- ```
20
+ - @Value
21
+ - @With
22
+ - @Equals
23
+ - @Getter
24
+ - @Setter
49
25
 
50
26
  ## Quick start
51
27
 
@@ -55,44 +31,29 @@ npx lombok-ts generate
55
31
  ```
56
32
 
57
33
  ```ts
58
- import { Data, Builder, NonNull, Memoize, Singleton } from 'lombok-typescript/legacy';
34
+ import { Data, Builder, NonNull } from 'lombok-typescript/legacy';
59
35
 
60
36
  @Data
61
37
  @Builder
62
38
  class User {
63
39
  @NonNull name!: string;
64
- age!: number;
65
- }
66
-
67
- @Singleton
68
- class Cache {
69
- @Memoize()
70
- get(key: string) {
71
- return key;
72
- }
73
40
  }
74
41
  ```
75
42
 
76
- After codegen, import and call `applyAllGenerated` from the `.lombok/` companion file. See [docs-site/guide/getting-started.md](./docs-site/guide/getting-started.md).
43
+ After codegen, call `applyAllGenerated` from the `.lombok/` companion file.
77
44
 
78
45
  ## CLI
79
46
 
80
- | Command | Description |
81
- | -------------------- | --------------------------------------------- |
82
- | `lombok-ts generate` | Emit `.lombok.ts` + `.lombok.d.ts` companions |
83
- | `lombok-ts init` | Create `lombok.config.ts` |
84
- | `lombok-ts clean` | Remove `.lombok/`, `dist/`, `coverage/` |
85
- | `lombok-ts watch` | Phase 2 stub |
86
-
87
- ## Examples
88
-
89
- - [examples/plain-ts](./examples/plain-ts/) — legacy backend + codegen
90
- - [examples/nestjs](./examples/nestjs/) — `@Injectable()` with `@Singleton`, `@Factory`, `@Memoize`
47
+ | Command | Description |
48
+ | -------------------- | --------------------------------------- |
49
+ | `lombok-ts generate` | Emit `.lombok.ts` companion files |
50
+ | `lombok-ts init` | Create `lombok.config.ts` |
51
+ | `lombok-ts clean` | Remove `.lombok/`, `dist/`, `coverage/` |
91
52
 
92
- ## Contributing
53
+ ## Documentation
93
54
 
94
- See [CONTRIBUTING.md](./CONTRIBUTING.md). Tests require **95%+** coverage on changed code.
55
+ https://a-dev-kit.github.io/lombok-typescript/
95
56
 
96
57
  ## License
97
58
 
98
- [MIT](./LICENSE)
59
+ MIT