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 +21 -60
- package/dist/cli/index.cjs +389 -98
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +389 -98
- package/dist/cli/index.js.map +1 -1
- package/dist/codegen/index.cjs +371 -92
- package/dist/codegen/index.cjs.map +1 -1
- package/dist/codegen/index.d.cts +6 -3
- package/dist/codegen/index.d.ts +6 -3
- package/dist/codegen/index.js +371 -92
- package/dist/codegen/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/legacy/index.cjs +195 -0
- package/dist/legacy/index.cjs.map +1 -1
- package/dist/legacy/index.d.cts +24 -3
- package/dist/legacy/index.d.ts +24 -3
- package/dist/legacy/index.js +185 -1
- package/dist/legacy/index.js.map +1 -1
- package/dist/{memoize-DvelzGDl.d.ts → log-Dbe0sSP1.d.ts} +23 -1
- package/dist/{memoize-Bj9pm_cK.d.cts → log-Dpr79VRt.d.cts} +23 -1
- package/dist/stage3/index.cjs +200 -0
- package/dist/stage3/index.cjs.map +1 -1
- package/dist/stage3/index.d.cts +24 -3
- package/dist/stage3/index.d.ts +24 -3
- package/dist/stage3/index.js +190 -1
- package/dist/stage3/index.js.map +1 -1
- package/package.json +4 -17
package/README.md
CHANGED
|
@@ -1,51 +1,27 @@
|
|
|
1
1
|
# lombok-typescript
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://a-dev-kit.github.io/lombok-typescript/)
|
|
5
|
-
[](./LICENSE)
|
|
6
|
-
[](https://www.npmjs.com/package/lombok-typescript)
|
|
7
|
-
[](https://codecov.io/gh/A-Dev-Kit/lombok-typescript)
|
|
8
|
-
[](https://nodejs.org/)
|
|
9
|
-
[](https://www.typescriptlang.org/)
|
|
3
|
+
Lombok-like decorators and code generation for TypeScript, with Gang-of-Four design patterns.
|
|
10
4
|
|
|
11
|
-
|
|
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
|
-
##
|
|
33
|
-
|
|
34
|
-
### Legacy (`lombok-typescript/legacy`)
|
|
35
|
-
|
|
36
|
-
For NestJS, TypeORM, and most existing decorator-based projects.
|
|
14
|
+
## Decorators
|
|
37
15
|
|
|
38
|
-
|
|
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
|
-
|
|
18
|
+
**New in 0.2.0:**
|
|
45
19
|
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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,
|
|
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`
|
|
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
|
-
##
|
|
53
|
+
## Documentation
|
|
93
54
|
|
|
94
|
-
|
|
55
|
+
https://a-dev-kit.github.io/lombok-typescript/
|
|
95
56
|
|
|
96
57
|
## License
|
|
97
58
|
|
|
98
|
-
|
|
59
|
+
MIT
|