@twin.org/nameof 0.0.3-next.3 → 0.0.3-next.30

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,8 +1,6 @@
1
1
  # TWIN Nameof
2
2
 
3
- The methods in this package are used to convert TypeScript class/type/property names to embedded strings, so that they are available to your JavaScript code at runtime.
4
-
5
- This package is used in conjunction with the `@twin.org/nameof-transformer` package, without using the transformer for compilation you will end up with an error string embedded in your code instead of the runtime name you are expecting.
3
+ This package is part of the framework workspace and provides the definitions for the methods which are processed by the nameof-transformer to support consistent development workflows across the ecosystem.
6
4
 
7
5
  ## Installation
8
6
 
package/docs/changelog.md CHANGED
@@ -1,4 +1,404 @@
1
- # @twin.org/nameof - Changelog
1
+ # Changelog
2
+
3
+ ## [0.0.3-next.30](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.29...nameof-v0.0.3-next.30) (2026-04-14)
4
+
5
+
6
+ ### Miscellaneous Chores
7
+
8
+ * **nameof:** Synchronize repo versions
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * devDependencies
15
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.29 to 0.0.3-next.30
16
+
17
+ ## [0.0.3-next.29](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.28...nameof-v0.0.3-next.29) (2026-04-14)
18
+
19
+
20
+ ### Miscellaneous Chores
21
+
22
+ * **nameof:** Synchronize repo versions
23
+
24
+
25
+ ### Dependencies
26
+
27
+ * The following workspace dependencies were updated
28
+ * devDependencies
29
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.28 to 0.0.3-next.29
30
+
31
+ ## [0.0.3-next.28](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.27...nameof-v0.0.3-next.28) (2026-03-27)
32
+
33
+
34
+ ### Miscellaneous Chores
35
+
36
+ * **nameof:** Synchronize repo versions
37
+
38
+
39
+ ### Dependencies
40
+
41
+ * The following workspace dependencies were updated
42
+ * devDependencies
43
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.27 to 0.0.3-next.28
44
+
45
+ ## [0.0.3-next.27](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.26...nameof-v0.0.3-next.27) (2026-03-27)
46
+
47
+
48
+ ### Miscellaneous Chores
49
+
50
+ * **nameof:** Synchronize repo versions
51
+
52
+
53
+ ### Dependencies
54
+
55
+ * The following workspace dependencies were updated
56
+ * devDependencies
57
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.26 to 0.0.3-next.27
58
+
59
+ ## [0.0.3-next.26](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.25...nameof-v0.0.3-next.26) (2026-03-24)
60
+
61
+
62
+ ### Miscellaneous Chores
63
+
64
+ * **nameof:** Synchronize repo versions
65
+
66
+
67
+ ### Dependencies
68
+
69
+ * The following workspace dependencies were updated
70
+ * devDependencies
71
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.25 to 0.0.3-next.26
72
+
73
+ ## [0.0.3-next.25](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.24...nameof-v0.0.3-next.25) (2026-03-23)
74
+
75
+
76
+ ### Miscellaneous Chores
77
+
78
+ * **nameof:** Synchronize repo versions
79
+
80
+
81
+ ### Dependencies
82
+
83
+ * The following workspace dependencies were updated
84
+ * devDependencies
85
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.24 to 0.0.3-next.25
86
+
87
+ ## [0.0.3-next.24](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.23...nameof-v0.0.3-next.24) (2026-03-19)
88
+
89
+
90
+ ### Bug Fixes
91
+
92
+ * ensure __decorate is defined for decorators ([103a563](https://github.com/twinfoundation/framework/commit/103a563ce01ebdef6240d2e590e7b026e8692684))
93
+
94
+
95
+ ### Dependencies
96
+
97
+ * The following workspace dependencies were updated
98
+ * devDependencies
99
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.23 to 0.0.3-next.24
100
+
101
+ ## [0.0.3-next.23](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.22...nameof-v0.0.3-next.23) (2026-03-17)
102
+
103
+
104
+ ### Miscellaneous Chores
105
+
106
+ * **nameof:** Synchronize repo versions
107
+
108
+
109
+ ### Dependencies
110
+
111
+ * The following workspace dependencies were updated
112
+ * devDependencies
113
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.22 to 0.0.3-next.23
114
+
115
+ ## [0.0.3-next.22](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.21...nameof-v0.0.3-next.22) (2026-02-26)
116
+
117
+
118
+ ### Miscellaneous Chores
119
+
120
+ * **nameof:** Synchronize repo versions
121
+
122
+
123
+ ### Dependencies
124
+
125
+ * The following workspace dependencies were updated
126
+ * devDependencies
127
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.21 to 0.0.3-next.22
128
+
129
+ ## [0.0.3-next.21](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.20...nameof-v0.0.3-next.21) (2026-02-26)
130
+
131
+
132
+ ### Features
133
+
134
+ * add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
135
+ * additional nameof operators ([a5aab60](https://github.com/twinfoundation/framework/commit/a5aab60bf66a86f1b7ff8af7c4f044cb03706d50))
136
+ * eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
137
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
138
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
139
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
140
+ * use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
141
+
142
+
143
+ ### Bug Fixes
144
+
145
+ * repo urls in package.json for moved packages ([31ae463](https://github.com/twinfoundation/framework/commit/31ae463095dfa8c0e48bb5bb12316f1e8abb9a4c))
146
+
147
+
148
+ ### Dependencies
149
+
150
+ * The following workspace dependencies were updated
151
+ * devDependencies
152
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.20 to 0.0.3-next.21
153
+
154
+ ## [0.0.3-next.20](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.19...nameof-v0.0.3-next.20) (2026-02-26)
155
+
156
+
157
+ ### Miscellaneous Chores
158
+
159
+ * **nameof:** Synchronize repo versions
160
+
161
+
162
+ ### Dependencies
163
+
164
+ * The following workspace dependencies were updated
165
+ * devDependencies
166
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.19 to 0.0.3-next.20
167
+
168
+ ## [0.0.3-next.19](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.18...nameof-v0.0.3-next.19) (2026-02-26)
169
+
170
+
171
+ ### Miscellaneous Chores
172
+
173
+ * **nameof:** Synchronize repo versions
174
+
175
+
176
+ ### Dependencies
177
+
178
+ * The following workspace dependencies were updated
179
+ * devDependencies
180
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.18 to 0.0.3-next.19
181
+
182
+ ## [0.0.3-next.18](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.17...nameof-v0.0.3-next.18) (2026-02-23)
183
+
184
+
185
+ ### Miscellaneous Chores
186
+
187
+ * **nameof:** Synchronize repo versions
188
+
189
+
190
+ ### Dependencies
191
+
192
+ * The following workspace dependencies were updated
193
+ * devDependencies
194
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.17 to 0.0.3-next.18
195
+
196
+ ## [0.0.3-next.17](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.16...nameof-v0.0.3-next.17) (2026-02-09)
197
+
198
+
199
+ ### Miscellaneous Chores
200
+
201
+ * **nameof:** Synchronize repo versions
202
+
203
+
204
+ ### Dependencies
205
+
206
+ * The following workspace dependencies were updated
207
+ * devDependencies
208
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.16 to 0.0.3-next.17
209
+
210
+ ## [0.0.3-next.16](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.15...nameof-v0.0.3-next.16) (2026-02-06)
211
+
212
+
213
+ ### Miscellaneous Chores
214
+
215
+ * **nameof:** Synchronize repo versions
216
+
217
+
218
+ ### Dependencies
219
+
220
+ * The following workspace dependencies were updated
221
+ * devDependencies
222
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.15 to 0.0.3-next.16
223
+
224
+ ## [0.0.3-next.15](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.14...nameof-v0.0.3-next.15) (2026-01-29)
225
+
226
+
227
+ ### Miscellaneous Chores
228
+
229
+ * **nameof:** Synchronize repo versions
230
+
231
+
232
+ ### Dependencies
233
+
234
+ * The following workspace dependencies were updated
235
+ * devDependencies
236
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.14 to 0.0.3-next.15
237
+
238
+ ## [0.0.3-next.14](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.13...nameof-v0.0.3-next.14) (2026-01-22)
239
+
240
+
241
+ ### Miscellaneous Chores
242
+
243
+ * **nameof:** Synchronize repo versions
244
+
245
+
246
+ ### Dependencies
247
+
248
+ * The following workspace dependencies were updated
249
+ * devDependencies
250
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.13 to 0.0.3-next.14
251
+
252
+ ## [0.0.3-next.13](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.12...nameof-v0.0.3-next.13) (2026-01-08)
253
+
254
+
255
+ ### Miscellaneous Chores
256
+
257
+ * **nameof:** Synchronize repo versions
258
+
259
+
260
+ ### Dependencies
261
+
262
+ * The following workspace dependencies were updated
263
+ * devDependencies
264
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.12 to 0.0.3-next.13
265
+
266
+ ## [0.0.3-next.12](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.11...nameof-v0.0.3-next.12) (2026-01-08)
267
+
268
+
269
+ ### Miscellaneous Chores
270
+
271
+ * **nameof:** Synchronize repo versions
272
+
273
+
274
+ ### Dependencies
275
+
276
+ * The following workspace dependencies were updated
277
+ * devDependencies
278
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.11 to 0.0.3-next.12
279
+
280
+ ## [0.0.3-next.11](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.10...nameof-v0.0.3-next.11) (2026-01-07)
281
+
282
+
283
+ ### Miscellaneous Chores
284
+
285
+ * **nameof:** Synchronize repo versions
286
+
287
+
288
+ ### Dependencies
289
+
290
+ * The following workspace dependencies were updated
291
+ * devDependencies
292
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.10 to 0.0.3-next.11
293
+
294
+ ## [0.0.3-next.10](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.9...nameof-v0.0.3-next.10) (2026-01-07)
295
+
296
+
297
+ ### Miscellaneous Chores
298
+
299
+ * **nameof:** Synchronize repo versions
300
+
301
+
302
+ ### Dependencies
303
+
304
+ * The following workspace dependencies were updated
305
+ * devDependencies
306
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.9 to 0.0.3-next.10
307
+
308
+ ## [0.0.3-next.9](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.8...nameof-v0.0.3-next.9) (2026-01-05)
309
+
310
+
311
+ ### Miscellaneous Chores
312
+
313
+ * **nameof:** Synchronize repo versions
314
+
315
+
316
+ ### Dependencies
317
+
318
+ * The following workspace dependencies were updated
319
+ * devDependencies
320
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.8 to 0.0.3-next.9
321
+
322
+ ## [0.0.3-next.8](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.7...nameof-v0.0.3-next.8) (2025-11-26)
323
+
324
+
325
+ ### Miscellaneous Chores
326
+
327
+ * **nameof:** Synchronize repo versions
328
+
329
+
330
+ ### Dependencies
331
+
332
+ * The following workspace dependencies were updated
333
+ * devDependencies
334
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.7 to 0.0.3-next.8
335
+
336
+ ## [0.0.3-next.7](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.6...nameof-v0.0.3-next.7) (2025-11-25)
337
+
338
+
339
+ ### Features
340
+
341
+ * add context id features ([#206](https://github.com/twinfoundation/framework/issues/206)) ([ef0d4ee](https://github.com/twinfoundation/framework/commit/ef0d4ee11a4f5fc6cc6f52a4958ce905c04ee13b))
342
+ * additional nameof operators ([a5aab60](https://github.com/twinfoundation/framework/commit/a5aab60bf66a86f1b7ff8af7c4f044cb03706d50))
343
+ * eslint migration to flat config ([74427d7](https://github.com/twinfoundation/framework/commit/74427d78d342167f7850e49ab87269326355befe))
344
+ * locales validation ([#197](https://github.com/twinfoundation/framework/issues/197)) ([55fdadb](https://github.com/twinfoundation/framework/commit/55fdadb13595ce0047f787bd1d4135d429a99f12))
345
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
346
+ * update dependencies ([f3bd015](https://github.com/twinfoundation/framework/commit/f3bd015efd169196b7e0335f5cab876ba6ca1d75))
347
+ * use cause instead of inner for errors ([1f4acc4](https://github.com/twinfoundation/framework/commit/1f4acc4d7a6b71a134d9547da9bf40de1e1e49da))
348
+
349
+
350
+ ### Bug Fixes
351
+
352
+ * repo urls in package.json for moved packages ([31ae463](https://github.com/twinfoundation/framework/commit/31ae463095dfa8c0e48bb5bb12316f1e8abb9a4c))
353
+
354
+
355
+ ### Dependencies
356
+
357
+ * The following workspace dependencies were updated
358
+ * devDependencies
359
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.6 to 0.0.3-next.7
360
+
361
+ ## [0.0.3-next.6](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.5...nameof-v0.0.3-next.6) (2025-11-25)
362
+
363
+
364
+ ### Miscellaneous Chores
365
+
366
+ * **nameof:** Synchronize repo versions
367
+
368
+
369
+ ### Dependencies
370
+
371
+ * The following workspace dependencies were updated
372
+ * devDependencies
373
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.5 to 0.0.3-next.6
374
+
375
+ ## [0.0.3-next.5](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.4...nameof-v0.0.3-next.5) (2025-11-20)
376
+
377
+
378
+ ### Miscellaneous Chores
379
+
380
+ * **nameof:** Synchronize repo versions
381
+
382
+
383
+ ### Dependencies
384
+
385
+ * The following workspace dependencies were updated
386
+ * devDependencies
387
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.4 to 0.0.3-next.5
388
+
389
+ ## [0.0.3-next.4](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.3...nameof-v0.0.3-next.4) (2025-11-13)
390
+
391
+
392
+ ### Miscellaneous Chores
393
+
394
+ * **nameof:** Synchronize repo versions
395
+
396
+
397
+ ### Dependencies
398
+
399
+ * The following workspace dependencies were updated
400
+ * devDependencies
401
+ * @twin.org/nameof-transformer bumped from 0.0.3-next.3 to 0.0.3-next.4
2
402
 
3
403
  ## [0.0.3-next.3](https://github.com/twinfoundation/framework/compare/nameof-v0.0.3-next.2...nameof-v0.0.3-next.3) (2025-11-12)
4
404
 
package/docs/examples.md CHANGED
@@ -1,74 +1,60 @@
1
- # @twin.org/nameof - Examples
1
+ # Nameof Examples
2
2
 
3
- ## `nameof<T>`
3
+ Use these snippets for strongly typed name extraction patterns that remain safe during refactors.
4
4
 
5
- One of the internal transformers in the TypeScript compiler will reduce an interface to no code, which means that at runtime the type information is missing. So operations where you might like to find the name of a class/type etc are not available.
6
-
7
- We have many places in our code where we want to use the name of the class, we could do the following.
5
+ ## `nameof`
8
6
 
9
7
  ```typescript
10
- export class MyClass {
11
- public static className(): string {
12
- return 'MyClass';
13
- }
14
- }
15
- console.log(MyClass.className()); // Outputs "MyClass"
16
- ```
8
+ import { nameof } from '@twin.org/nameof';
17
9
 
18
- But if you changed the name of the class you would have to make sure you also replaced all string instances where it was mentioned as well, this is prone to lots of errors.
10
+ class AccountState {
11
+ public id!: string;
12
+ }
19
13
 
20
- We can use the `nameof` transformer as follows.
14
+ nameof<AccountState>(); // 'AccountState'
15
+ ```
21
16
 
22
17
  ```typescript
23
18
  import { nameof } from '@twin.org/nameof';
24
19
 
25
- export class MyClass {
26
- public static className(): string {
27
- return nameof<MyClass>();
28
- }
20
+ interface Profile {
21
+ displayName: string;
22
+ stats?: {
23
+ loginCount: number;
24
+ };
29
25
  }
30
- console.log(MyClass.className()); // Outputs "MyClass"
31
- ```
32
-
33
- Now if we rename `MyClass` without updating the references in the `nameof` call we will get a compiler error, code auto refactoring would actually perform the rename for us.
34
26
 
35
- Since `nameof` is performed as a compile time transform, the actual code produced looks like this.
27
+ const profile: Profile = {
28
+ displayName: 'Ari',
29
+ stats: {
30
+ loginCount: 12
31
+ }
32
+ };
36
33
 
37
- ```javascript
38
- export class MyClass {
39
- static public className(): string {
40
- return "MyClass";
41
- }
42
- }
43
- console.log(MyClass.className()); // Outputs "MyClass"
34
+ nameof(profile.displayName); // 'displayName'
35
+ nameof(profile.stats?.loginCount); // 'stats.loginCount'
44
36
  ```
45
37
 
46
- This means there is no additional overheads in function calls at runtime.
47
-
48
- ## `nameof(propName)`
49
-
50
- The `nameof(propName)` transform behaves in much the same way as `nameof<T>`, but instead works on properties passed to it.
38
+ ## `nameofKebabCase`
51
39
 
52
40
  ```typescript
53
- import { nameof } from '@twin.org/nameof';
41
+ import { nameofKebabCase } from '@twin.org/nameof';
54
42
 
55
- export class MyClass {
56
- public static propName(aProp: string): string {
57
- return nameof(aProp);
58
- }
43
+ class ReportSummary {
44
+ public totalCount!: number;
59
45
  }
60
- console.log(MyClass.propName()); // Outputs "aProp"
46
+
47
+ nameofKebabCase<ReportSummary>(); // 'report-summary'
61
48
  ```
62
49
 
63
- You can also used it with chained properties, nullish operators can also be used, but are removed.
50
+ ## `nameofCamelCase`
64
51
 
65
52
  ```typescript
66
- import { nameof } from '@twin.org/nameof';
53
+ import { nameofCamelCase } from '@twin.org/nameof';
67
54
 
68
- export class MyClass {
69
- public static propName(aProp: { inner?: boolean }): string {
70
- return nameof(aProp?.inner);
71
- }
55
+ class UserProfileRecord {
56
+ public profileImageUrl!: string;
72
57
  }
73
- console.log(MyClass.propName()); // Outputs "aProp.inner"
58
+
59
+ nameofCamelCase<UserProfileRecord>(); // 'userProfileRecord'
74
60
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@twin.org/nameof",
3
- "version": "0.0.3-next.3",
4
- "description": "Provides the definitions for the methods which are processed by the nameof-transformer",
3
+ "version": "0.0.3-next.30",
4
+ "description": "The definitions for the methods which are processed by the nameof-transformer",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/twinfoundation/framework.git",