lombok-typescript 0.1.0 → 0.3.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 +33 -64
- 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,39 @@
|
|
|
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/)
|
|
10
|
-
|
|
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).
|
|
3
|
+
TypeScript decorators inspired by Project Lombok and common design patterns.
|
|
20
4
|
|
|
21
5
|
## Install
|
|
22
6
|
|
|
23
|
-
|
|
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
|
|
7
|
+
To install the current stable release:
|
|
27
8
|
|
|
28
|
-
|
|
29
|
-
npm install lombok-typescript
|
|
9
|
+
```bash
|
|
10
|
+
npm install lombok-typescript
|
|
30
11
|
```
|
|
31
12
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
### Legacy (`lombok-typescript/legacy`)
|
|
13
|
+
To try the next preview release (one version ahead during backfill):
|
|
35
14
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
```jsonc
|
|
39
|
-
{ "compilerOptions": { "experimentalDecorators": true, "emitDecoratorMetadata": true } }
|
|
15
|
+
```bash
|
|
16
|
+
npm install lombok-typescript@preview
|
|
40
17
|
```
|
|
41
18
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
## Decorators in this release
|
|
20
|
+
|
|
21
|
+
- @NonNull
|
|
22
|
+
- @ToString
|
|
23
|
+
- @Builder
|
|
24
|
+
- @Data
|
|
25
|
+
- @Singleton
|
|
26
|
+
- @Prototype
|
|
27
|
+
- @Factory
|
|
28
|
+
- @Memoize
|
|
29
|
+
- @Value
|
|
30
|
+
- @With
|
|
31
|
+
- @Equals
|
|
32
|
+
- @Getter
|
|
33
|
+
- @Setter
|
|
34
|
+
- @Log
|
|
35
|
+
- @Accessors
|
|
36
|
+
- @UtilityClass
|
|
49
37
|
|
|
50
38
|
## Quick start
|
|
51
39
|
|
|
@@ -55,44 +43,25 @@ npx lombok-ts generate
|
|
|
55
43
|
```
|
|
56
44
|
|
|
57
45
|
```ts
|
|
58
|
-
import { Data, Builder, NonNull
|
|
46
|
+
import { Data, Builder, NonNull } from 'lombok-typescript/legacy';
|
|
59
47
|
|
|
60
48
|
@Data
|
|
61
49
|
@Builder
|
|
62
50
|
class User {
|
|
63
51
|
@NonNull name!: string;
|
|
64
|
-
age!: number;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
@Singleton
|
|
68
|
-
class Cache {
|
|
69
|
-
@Memoize()
|
|
70
|
-
get(key: string) {
|
|
71
|
-
return key;
|
|
72
|
-
}
|
|
73
52
|
}
|
|
74
53
|
```
|
|
75
54
|
|
|
76
|
-
|
|
55
|
+
Full setup, codegen, and framework guides: [https://a-dev-kit.github.io/lombok-typescript/](https://a-dev-kit.github.io/lombok-typescript/)
|
|
77
56
|
|
|
78
57
|
## CLI
|
|
79
58
|
|
|
80
|
-
| Command | Description
|
|
81
|
-
| -------------------- |
|
|
82
|
-
| `lombok-ts generate` |
|
|
83
|
-
| `lombok-ts init` |
|
|
84
|
-
| `lombok-ts clean` | Remove
|
|
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`
|
|
91
|
-
|
|
92
|
-
## Contributing
|
|
93
|
-
|
|
94
|
-
See [CONTRIBUTING.md](./CONTRIBUTING.md). Tests require **95%+** coverage on changed code.
|
|
59
|
+
| Command | Description |
|
|
60
|
+
| -------------------- | --------------------------------------------------------- |
|
|
61
|
+
| `lombok-ts generate` | Generate companion TypeScript files for decorated classes |
|
|
62
|
+
| `lombok-ts init` | Add lombok configuration to your project |
|
|
63
|
+
| `lombok-ts clean` | Remove generated lombok output from your project |
|
|
95
64
|
|
|
96
65
|
## License
|
|
97
66
|
|
|
98
|
-
|
|
67
|
+
MIT
|