@siyavuyachagi/typesharp 0.1.4 ā 0.1.5-beta.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 +138 -118
- package/dist/cli/index.js +2 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +114 -38
- package/dist/core/index.js.map +1 -1
- package/dist/generator/index.d.ts +5 -0
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +21 -18
- package/dist/generator/index.js.map +1 -1
- package/dist/helpers/change-tracker.d.ts +14 -0
- package/dist/helpers/change-tracker.d.ts.map +1 -0
- package/dist/helpers/change-tracker.js +95 -0
- package/dist/helpers/change-tracker.js.map +1 -0
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +2 -108
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/parse-classes-from-file.d.ts +6 -0
- package/dist/parser/parse-classes-from-file.d.ts.map +1 -0
- package/dist/parser/parse-classes-from-file.js +279 -0
- package/dist/parser/parse-classes-from-file.js.map +1 -0
- package/dist/parser/parse-properties.d.ts +22 -0
- package/dist/parser/parse-properties.d.ts.map +1 -1
- package/dist/parser/parse-properties.js +177 -34
- package/dist/parser/parse-properties.js.map +1 -1
- package/dist/parser/resolve-project-files-from-source.d.ts.map +1 -1
- package/dist/parser/resolve-project-files-from-source.js.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,19 +8,20 @@
|
|
|
8
8
|
[](https://github.com/siyavuyachagi/typesharp/stargazers)
|
|
9
9
|
[](https://github.com/sponsors/siyavuyachagi)
|
|
10
10
|
|
|
11
|
-
Generate TypeScript types from C# models with ease! TypeSharp scans your ASP.NET Core projects and automatically generates TypeScript interfaces from your C# classes decorated with the `[TypeSharp]` attribute.
|
|
11
|
+
Generate TypeScript types from C# models with ease! TypeSharp scans your ASP.NET Core projects and automatically generates TypeScript interfaces from your C# classes and records decorated with the `[TypeSharp]` attribute.
|
|
12
12
|
|
|
13
13
|
Project structure: [docs/project-structure](docs/project-structure.md)
|
|
14
14
|
|
|
15
15
|
## Features
|
|
16
16
|
|
|
17
17
|
- **Automatic Type Generation** ā Convert C# models to TypeScript interfaces
|
|
18
|
+
- **Record Support** ā Positional records, `record class`, `record struct`, and body-only records
|
|
18
19
|
- **Custom Attribute Targeting** ā Use `[TypeSharp]` or any custom attribute
|
|
19
20
|
- **Nullable Support** ā `string?` ā `string | null`
|
|
20
21
|
- **Collection Handling** ā Supports `List<T>`, `IEnumerable<T>`, arrays **and generic collections**
|
|
21
22
|
- **Dictionary Mapping** ā `Dictionary<K, V>` ā `Record<K, V>`
|
|
22
23
|
- **Generic Types** ā Preserves generic type definitions like `Response<T>` ā `Response<T>`
|
|
23
|
-
- **Inheritance** ā Preserves class inheritance using `extends`
|
|
24
|
+
- **Inheritance** ā Preserves class and record inheritance using `extends`
|
|
24
25
|
- **Computed Properties** ā Expression-bodied and block getter properties are included
|
|
25
26
|
- **Naming Conventions** ā Convert property names (camel, pascal, snake, kebab)
|
|
26
27
|
- **Flexible Output** ā Single file or multiple files
|
|
@@ -39,6 +40,7 @@ This is not an OpenApi-based tool !
|
|
|
39
40
|
| Attribute targeting | ā | ! | ā | ! |
|
|
40
41
|
| Non-API models | ā | ā | ā | ā |
|
|
41
42
|
| Generics preserved | ā | ! | ! | ! |
|
|
43
|
+
| Record support | ā | ā | ā | ā |
|
|
42
44
|
| File grouping | ā | ā | ā | ā |
|
|
43
45
|
| Naming control | ā | ! | ! | ā |
|
|
44
46
|
| API client generation | ā | ā | ā | ā |
|
|
@@ -63,7 +65,7 @@ dotnet add package TypeSharp.Attributes
|
|
|
63
65
|
|
|
64
66
|
### 2. Decorate your C# models or DTOs
|
|
65
67
|
|
|
66
|
-
Use `[TypeSharp]`
|
|
68
|
+
Use `[TypeSharp]` on classes, records, or enums:
|
|
67
69
|
|
|
68
70
|
```csharp
|
|
69
71
|
[TypeSharp]
|
|
@@ -77,6 +79,9 @@ public class User
|
|
|
77
79
|
public DateTime CreatedAt { get; set; }
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
[TypeSharp]
|
|
83
|
+
public record ProductSummary(int Id, string Name, decimal Price);
|
|
84
|
+
|
|
80
85
|
[TypeSharp]
|
|
81
86
|
public enum UserRole
|
|
82
87
|
{
|
|
@@ -142,58 +147,6 @@ npx typesharp generate
|
|
|
142
147
|
npx typesharp generate --config ./custom-config.ts
|
|
143
148
|
```
|
|
144
149
|
|
|
145
|
-
Output (`app/types/user.ts`):
|
|
146
|
-
|
|
147
|
-
```typescript
|
|
148
|
-
/**
|
|
149
|
-
* Auto-generated by TypeSharp
|
|
150
|
-
* Generated at: 2024-12-12T10:30:00.000Z
|
|
151
|
-
* Do not edit this file manually
|
|
152
|
-
*/
|
|
153
|
-
|
|
154
|
-
export interface User {
|
|
155
|
-
id: number;
|
|
156
|
-
name: string | null;
|
|
157
|
-
email: string;
|
|
158
|
-
roles: UserRole[];
|
|
159
|
-
permissions: string[];
|
|
160
|
-
createdAt: string;
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Output (`app/types/user-role.ts`):
|
|
165
|
-
|
|
166
|
-
```ts
|
|
167
|
-
/**
|
|
168
|
-
* Auto-generated by TypeSharp
|
|
169
|
-
* Generated at: 2024-12-12T10:30:00.000Z
|
|
170
|
-
* Do not edit this file manually
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
export enum UserRole {
|
|
174
|
-
Admin = "Admin",
|
|
175
|
-
User = "User",
|
|
176
|
-
Guest = "Guest",
|
|
177
|
-
}
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
Output (`app/types/api-response.ts`):
|
|
181
|
-
|
|
182
|
-
```ts
|
|
183
|
-
/**
|
|
184
|
-
* Auto-generated by TypeSharp
|
|
185
|
-
* Generated at: 2024-12-12T10:30:00.000Z
|
|
186
|
-
* Do not edit this file manually
|
|
187
|
-
*/
|
|
188
|
-
|
|
189
|
-
export interface ApiResponse<T> {
|
|
190
|
-
success: boolean;
|
|
191
|
-
message: string | null;
|
|
192
|
-
data: T;
|
|
193
|
-
errors: string[];
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
150
|
For more advanced usage [docs/usage](docs/usage.md)
|
|
198
151
|
|
|
199
152
|
## Configuration
|
|
@@ -236,23 +189,6 @@ TypeSharp preserves your C# file organization. Here's how it works:
|
|
|
236
189
|
| **Multiple classes per file**<br>`UserDtos.cs` ā 3 classes | `user-dtos.ts` (3 interfaces) | All classes in `types.ts` |
|
|
237
190
|
| **Mixed structure**<br>Various C# files | Each C# file ā 1 TS file<br>(preserves grouping) | All classes in `types.ts` |
|
|
238
191
|
|
|
239
|
-
**Example:**
|
|
240
|
-
|
|
241
|
-
```
|
|
242
|
-
C# Structure: TypeScript Output (singleOutputFile: false):
|
|
243
|
-
Backend/ src/types/
|
|
244
|
-
āāā DTOs/ āāā DTOs/
|
|
245
|
-
ā āāā UserDtos.cs ā āāā user-dtos.ts ā All 3 classes together
|
|
246
|
-
ā ā āāā UserCreateDto ā āāā product-dtos.ts ā All 2 classes together
|
|
247
|
-
ā ā āāā UserUpdateDto
|
|
248
|
-
ā ā āāā UserResponseDto
|
|
249
|
-
ā āāā ProductDtos.cs
|
|
250
|
-
ā āāā ProductDto
|
|
251
|
-
ā āāā ProductCreateDto
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
**This means if you organize related DTOs in one C# file, they'll stay together in the generated TypeScript file!** šÆ
|
|
255
|
-
|
|
256
192
|
### 4. Configuration File Formats
|
|
257
193
|
|
|
258
194
|
TypeSharp supports multiple configuration formats:
|
|
@@ -304,7 +240,125 @@ Add TypeSharp to your build scripts:
|
|
|
304
240
|
|
|
305
241
|
## Advanced Examples
|
|
306
242
|
|
|
307
|
-
### 1.
|
|
243
|
+
### 1. Records
|
|
244
|
+
|
|
245
|
+
TypeSharp supports all C# record forms. Records are emitted as TypeScript interfaces identical to classes.
|
|
246
|
+
|
|
247
|
+
**Positional record:**
|
|
248
|
+
|
|
249
|
+
```csharp
|
|
250
|
+
[TypeSharp]
|
|
251
|
+
public record ProductSummary(int Id, string Name, decimal Price, bool IsActive);
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
export interface ProductSummary {
|
|
256
|
+
id: number;
|
|
257
|
+
name: string;
|
|
258
|
+
price: number;
|
|
259
|
+
isActive: boolean;
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
**Positional record with nullable and collection parameters:**
|
|
264
|
+
|
|
265
|
+
```csharp
|
|
266
|
+
[TypeSharp]
|
|
267
|
+
public record UserRecord(int Id, string? DisplayName, List<string> Tags);
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
export interface UserRecord {
|
|
272
|
+
id: number;
|
|
273
|
+
displayName: string | null;
|
|
274
|
+
tags: string[];
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Generic positional record:**
|
|
279
|
+
|
|
280
|
+
```csharp
|
|
281
|
+
[TypeSharp]
|
|
282
|
+
public record PagedResult<T>(IEnumerable<T> Items, int TotalCount, int PageSize);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
```typescript
|
|
286
|
+
export interface PagedResult<T> {
|
|
287
|
+
items: T[];
|
|
288
|
+
totalCount: number;
|
|
289
|
+
pageSize: number;
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**`record class` and `record struct`:**
|
|
294
|
+
|
|
295
|
+
```csharp
|
|
296
|
+
[TypeSharp]
|
|
297
|
+
public record class AddressRecord(string Street, string City, string PostalCode);
|
|
298
|
+
|
|
299
|
+
[TypeSharp]
|
|
300
|
+
public record struct CoordRecord(double Lat, double Lng);
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Body-only record (no primary constructor):**
|
|
304
|
+
|
|
305
|
+
```csharp
|
|
306
|
+
[TypeSharp]
|
|
307
|
+
public record PersonRecord
|
|
308
|
+
{
|
|
309
|
+
public string FirstName { get; set; }
|
|
310
|
+
public string LastName { get; set; }
|
|
311
|
+
public int Age { get; set; }
|
|
312
|
+
}
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Record inheritance:**
|
|
316
|
+
|
|
317
|
+
```csharp
|
|
318
|
+
[TypeSharp]
|
|
319
|
+
public record BaseEvent(Guid Id, DateTime OccurredAt);
|
|
320
|
+
|
|
321
|
+
[TypeSharp]
|
|
322
|
+
public record UserCreatedEvent(Guid Id, DateTime OccurredAt, string Email) : BaseEvent(Id, OccurredAt);
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
export interface BaseEvent {
|
|
327
|
+
id: string;
|
|
328
|
+
occurredAt: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
export interface UserCreatedEvent extends BaseEvent {
|
|
332
|
+
id: string;
|
|
333
|
+
occurredAt: string;
|
|
334
|
+
email: string;
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Per-parameter attribute overrides** (use the `property:` target ā required by C# for primary constructor parameters):
|
|
339
|
+
|
|
340
|
+
```csharp
|
|
341
|
+
[TypeSharp]
|
|
342
|
+
public record SecureRecord(
|
|
343
|
+
string Name,
|
|
344
|
+
[property: TypeIgnore] string Secret,
|
|
345
|
+
[property: TypeAs("Date")] DateTime CreatedAt,
|
|
346
|
+
[property: Obsolete("Use Name")] string LegacyName
|
|
347
|
+
);
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
```typescript
|
|
351
|
+
export interface SecureRecord {
|
|
352
|
+
name: string;
|
|
353
|
+
/** @deprecated Use Name */
|
|
354
|
+
legacyName: string;
|
|
355
|
+
createdAt: Date;
|
|
356
|
+
}
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
> `[TypeIgnore]`, `[TypeName("x")]`, `[TypeAs("y")]`, and `[Obsolete]` on primary constructor parameters require the `property:` attribute target because C# must know the attribute applies to the generated property, not the constructor parameter itself.
|
|
360
|
+
|
|
361
|
+
### 2. With Inheritance
|
|
308
362
|
|
|
309
363
|
**C#:**
|
|
310
364
|
|
|
@@ -338,9 +392,9 @@ export interface Product extends BaseEntity {
|
|
|
338
392
|
}
|
|
339
393
|
```
|
|
340
394
|
|
|
341
|
-
###
|
|
395
|
+
### 3. Computed Properties
|
|
342
396
|
|
|
343
|
-
TypeSharp includes expression-bodied and block getter properties
|
|
397
|
+
TypeSharp includes expression-bodied and block getter properties:
|
|
344
398
|
|
|
345
399
|
**C#:**
|
|
346
400
|
|
|
@@ -357,9 +411,6 @@ public class PollOptionUserLinkDto
|
|
|
357
411
|
|
|
358
412
|
// Block getter
|
|
359
413
|
public string UserFirstName { get { return User.FirstName; } }
|
|
360
|
-
|
|
361
|
-
// Init-only (Planned)
|
|
362
|
-
// public string Slug { get; init; }
|
|
363
414
|
}
|
|
364
415
|
```
|
|
365
416
|
|
|
@@ -372,11 +423,10 @@ export interface PollOptionUserLinkDto {
|
|
|
372
423
|
user: UserDto;
|
|
373
424
|
avatar: string | null;
|
|
374
425
|
userFirstName: string;
|
|
375
|
-
slug: string;
|
|
376
426
|
}
|
|
377
427
|
```
|
|
378
428
|
|
|
379
|
-
###
|
|
429
|
+
### 4. Dictionary Types
|
|
380
430
|
|
|
381
431
|
**C#:**
|
|
382
432
|
|
|
@@ -398,7 +448,7 @@ export interface PermissionMap {
|
|
|
398
448
|
}
|
|
399
449
|
```
|
|
400
450
|
|
|
401
|
-
###
|
|
451
|
+
### 5. Obsolete / Deprecated Properties
|
|
402
452
|
|
|
403
453
|
**C#:**
|
|
404
454
|
|
|
@@ -430,11 +480,7 @@ export interface Employee {
|
|
|
430
480
|
}
|
|
431
481
|
```
|
|
432
482
|
|
|
433
|
-
###
|
|
434
|
-
|
|
435
|
-
Use `[TypeSharp("name")]` to override the generated TypeScript type name. The override takes precedence over `namingConvention`.
|
|
436
|
-
|
|
437
|
-
**C#:**
|
|
483
|
+
### 6. Custom Type Name Override
|
|
438
484
|
|
|
439
485
|
```csharp
|
|
440
486
|
[TypeSharp("auth_response")]
|
|
@@ -443,34 +489,16 @@ public class AuthResponse
|
|
|
443
489
|
public string AccessToken { get; set; }
|
|
444
490
|
public string RefreshToken { get; set; }
|
|
445
491
|
}
|
|
446
|
-
|
|
447
|
-
[TypeSharp("user_role")]
|
|
448
|
-
public enum UserRole
|
|
449
|
-
{
|
|
450
|
-
Admin,
|
|
451
|
-
User,
|
|
452
|
-
Guest
|
|
453
|
-
}
|
|
454
492
|
```
|
|
455
493
|
|
|
456
|
-
**Generated TypeScript:**
|
|
457
|
-
|
|
458
494
|
```typescript
|
|
459
495
|
export interface auth_response {
|
|
460
496
|
accessToken: string;
|
|
461
497
|
refreshToken: string;
|
|
462
498
|
}
|
|
463
|
-
|
|
464
|
-
export enum user_role {
|
|
465
|
-
Admin = "Admin",
|
|
466
|
-
User = "User",
|
|
467
|
-
Guest = "Guest",
|
|
468
|
-
}
|
|
469
499
|
```
|
|
470
500
|
|
|
471
|
-
###
|
|
472
|
-
|
|
473
|
-
Scan multiple C# projects at once:
|
|
501
|
+
### 7. Multi-Project
|
|
474
502
|
|
|
475
503
|
```json
|
|
476
504
|
{
|
|
@@ -483,9 +511,7 @@ Scan multiple C# projects at once:
|
|
|
483
511
|
}
|
|
484
512
|
```
|
|
485
513
|
|
|
486
|
-
###
|
|
487
|
-
|
|
488
|
-
**Config:**
|
|
514
|
+
### 8. Single Output File
|
|
489
515
|
|
|
490
516
|
```typescript
|
|
491
517
|
const config: TypeSharpConfig = {
|
|
@@ -495,19 +521,15 @@ const config: TypeSharpConfig = {
|
|
|
495
521
|
};
|
|
496
522
|
```
|
|
497
523
|
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
### 8. Custom Naming Conventions
|
|
501
|
-
|
|
502
|
-
**Config:**
|
|
524
|
+
### 9. Custom Naming Conventions
|
|
503
525
|
|
|
504
526
|
```typescript
|
|
505
527
|
const config: TypeSharpConfig = {
|
|
506
528
|
source: "./Backend/Backend.csproj",
|
|
507
529
|
outputPath: "./src/types",
|
|
508
530
|
namingConvention: {
|
|
509
|
-
dir: "kebab",
|
|
510
|
-
file: "camel",
|
|
531
|
+
dir: "kebab",
|
|
532
|
+
file: "camel",
|
|
511
533
|
},
|
|
512
534
|
};
|
|
513
535
|
```
|
|
@@ -541,8 +563,6 @@ const config: TypeSharpConfig = {
|
|
|
541
563
|
|
|
542
564
|
## Programmatic Usage
|
|
543
565
|
|
|
544
|
-
You can also use TypeSharp programmatically:
|
|
545
|
-
|
|
546
566
|
```typescript
|
|
547
567
|
import { generate } from "typesharp";
|
|
548
568
|
|
|
@@ -571,4 +591,4 @@ MIT Ā© Siyavuya Chagi
|
|
|
571
591
|
|
|
572
592
|
---
|
|
573
593
|
|
|
574
|
-
Built with ā¤ļø in South Africa šæš¦
|
|
594
|
+
Built with ā¤ļø in South Africa šæš¦
|
package/dist/cli/index.js
CHANGED
|
@@ -20,9 +20,10 @@ program
|
|
|
20
20
|
.command('generate', { isDefault: true })
|
|
21
21
|
.description('Generate TypeScript types from C# files')
|
|
22
22
|
.option('-c, --config <path>', 'Path to configuration file')
|
|
23
|
+
.option('--no-incremental', 'Disable incremental generation (full clean)')
|
|
23
24
|
.action(async (options) => {
|
|
24
25
|
try {
|
|
25
|
-
await (0, core_1.generate)(options.config);
|
|
26
|
+
await (0, core_1.generate)(options.config, options.incremental !== false);
|
|
26
27
|
process.exit(0);
|
|
27
28
|
}
|
|
28
29
|
catch (error) {
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,kCAAmC;AACnC,kDAA0B;AAC1B,qDAAgE;AAChE,uEAAk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,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TypeSharpConfig } from '../types/typesharp-config';
|
|
|
3
3
|
* Merge user config with defaults
|
|
4
4
|
*/
|
|
5
5
|
export declare const mergeWithDefaults: (config: Partial<TypeSharpConfig>) => TypeSharpConfig;
|
|
6
|
-
export declare function generate(configPath?: string): Promise<void>;
|
|
6
|
+
export declare function generate(configPath?: string, incremental?: boolean): Promise<void>;
|
|
7
7
|
/**
|
|
8
8
|
* Deletes all contents of a directory but keeps the directory itself.
|
|
9
9
|
* @param dir Path to the directory to clean
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA8C5D;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,OAAO,CAAC,eAAe,CAAC,KAAG,eAsBpE,CAAC;AAOF,wBAAsB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,WAAW,GAAE,OAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC9F;AAkHD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,QAiB/C;AAkCD;;GAEG;AACH,wBAAsB,UAAU,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAqB9E"}
|
package/dist/core/index.js
CHANGED
|
@@ -88,7 +88,7 @@ const mergeWithDefaults = (config) => {
|
|
|
88
88
|
// Deprecation warning
|
|
89
89
|
if (config.projectFiles && !config.source) {
|
|
90
90
|
console.warn(chalk_1.default.yellow.bold('ā Deprecation:'), chalk_1.default.white('`projectFiles` is deprecated. Please rename it to `source` in your config.'));
|
|
91
|
-
config.source = config.projectFiles;
|
|
91
|
+
config.source = config.source || config.projectFiles;
|
|
92
92
|
}
|
|
93
93
|
if (!config.source && !config.projectFiles) {
|
|
94
94
|
throw new Error('`source` is required in configuration');
|
|
@@ -102,61 +102,116 @@ const mergeWithDefaults = (config) => {
|
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
exports.mergeWithDefaults = mergeWithDefaults;
|
|
105
|
-
async function generate(configPath) {
|
|
105
|
+
async function generate(configPath, incremental = true) {
|
|
106
106
|
try {
|
|
107
107
|
console.log(chalk_1.default.cyan.bold('\nš TypeSharp - Starting generation...'));
|
|
108
|
-
// Load configuration
|
|
109
108
|
const config = await loadConfig(configPath);
|
|
110
109
|
console.log(chalk_1.default.green.bold('\nā Configuration loaded'));
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
? config.projectFiles
|
|
114
|
-
: [config.projectFiles];
|
|
115
|
-
if (projectFiles.length === 1) {
|
|
116
|
-
console.log(chalk_1.default.cyan(`-> Target:`), chalk_1.default.white(projectFiles[0]));
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
console.log(chalk_1.default.cyan(`-> Targets (${projectFiles.length} projects):`));
|
|
120
|
-
projectFiles.forEach((file, index) => {
|
|
121
|
-
console.log(chalk_1.default.cyan(` ${index + 1}.`), chalk_1.default.white(file));
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
console.log(chalk_1.default.cyan(`-> Output:`), chalk_1.default.white(config.outputPath));
|
|
125
|
-
console.log(chalk_1.default.cyan(`-> Annotation:`), chalk_1.default.white(`[${config.targetAnnotation}]`));
|
|
126
|
-
console.log(chalk_1.default.cyan(`-> Single file:`), chalk_1.default.white(config.singleOutputFile));
|
|
127
|
-
if (config.fileSuffix) {
|
|
128
|
-
console.log(chalk_1.default.cyan(`-> File suffix:`), chalk_1.default.white(config.fileSuffix));
|
|
129
|
-
}
|
|
130
|
-
// Validate configuration
|
|
131
|
-
console.log(chalk_1.default.cyan('\nā§ Configuration validation...'));
|
|
132
|
-
validateConfig(config);
|
|
133
|
-
console.log(chalk_1.default.green.bold('ā Configuration validated'));
|
|
134
|
-
// Clean output directory
|
|
135
|
-
cleanOutputDirectory(config.outputPath);
|
|
136
|
-
// Parse C# files from all projects
|
|
110
|
+
// [... existing code ...]
|
|
111
|
+
// Parse C# files
|
|
137
112
|
console.log(chalk_1.default.cyan('\nā§ Parsing C# files...'));
|
|
138
113
|
const parseResults = await (0, parser_1.parseCSharpFiles)(config);
|
|
139
114
|
if (parseResults.length === 0) {
|
|
140
115
|
console.warn(chalk_1.default.yellow.bold('ā Warning:'), chalk_1.default.white(`No C# files found with [${config.targetAnnotation}] attribute\n`));
|
|
141
116
|
return;
|
|
142
117
|
}
|
|
143
|
-
//
|
|
118
|
+
// NEW: Incremental cleanup
|
|
119
|
+
if (incremental) {
|
|
120
|
+
await cleanOnlyChangedOutputFiles(config, parseResults);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
cleanOutputDirectory(config.outputPath); // Full clean (old behavior)
|
|
124
|
+
}
|
|
144
125
|
const allClasses = parseResults.flatMap(result => result.classes);
|
|
145
126
|
console.log(chalk_1.default.green.bold(`ā Found ${allClasses.length} class(es) with [${config.targetAnnotation}] attribute`));
|
|
146
|
-
// Generate TypeScript files
|
|
147
127
|
console.log(chalk_1.default.blue.cyan('\nā§ Generating TypeScript files...'));
|
|
148
128
|
(0, generator_1.generateTypeScriptFiles)(config, parseResults);
|
|
149
129
|
console.log(chalk_1.default.green.bold('ā
Generation completed successfully!\n'));
|
|
150
130
|
}
|
|
151
131
|
catch (error) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
132
|
+
// [... error handling ...]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// export async function generate(configPath?: string): Promise<void> {
|
|
136
|
+
// try {
|
|
137
|
+
// console.log(chalk.cyan.bold('\nš TypeSharp - Starting generation...'));
|
|
138
|
+
// // Load configuration
|
|
139
|
+
// const config = await loadConfig(configPath);
|
|
140
|
+
// console.log(chalk.green.bold('\nā Configuration loaded'));
|
|
141
|
+
// // Display project files
|
|
142
|
+
// const projectFiles = Array.isArray(config.projectFiles)
|
|
143
|
+
// ? config.projectFiles
|
|
144
|
+
// : [config.projectFiles];
|
|
145
|
+
// if (projectFiles.length === 1) {
|
|
146
|
+
// console.log(chalk.cyan(`-> Target:`), chalk.white(projectFiles[0]));
|
|
147
|
+
// } else {
|
|
148
|
+
// console.log(chalk.cyan(`-> Targets (${projectFiles.length} projects):`));
|
|
149
|
+
// projectFiles.forEach((file, index) => {
|
|
150
|
+
// console.log(chalk.cyan(` ${index + 1}.`), chalk.white(file));
|
|
151
|
+
// });
|
|
152
|
+
// }
|
|
153
|
+
// console.log(chalk.cyan(`-> Output:`), chalk.white(config.outputPath));
|
|
154
|
+
// console.log(chalk.cyan(`-> Annotation:`), chalk.white(`[${config.targetAnnotation}]`));
|
|
155
|
+
// console.log(chalk.cyan(`-> Single file:`), chalk.white(config.singleOutputFile));
|
|
156
|
+
// if (config.fileSuffix) {
|
|
157
|
+
// console.log(chalk.cyan(`-> File suffix:`), chalk.white(config.fileSuffix));
|
|
158
|
+
// }
|
|
159
|
+
// // Validate configuration
|
|
160
|
+
// console.log(chalk.cyan('\nā§ Configuration validation...'));
|
|
161
|
+
// validateConfig(config);
|
|
162
|
+
// console.log(chalk.green.bold('ā Configuration validated'));
|
|
163
|
+
// // Clean output directory
|
|
164
|
+
// cleanOutputDirectory(config.outputPath);
|
|
165
|
+
// // Parse C# files from all projects
|
|
166
|
+
// console.log(chalk.cyan('\nā§ Parsing C# files...'));
|
|
167
|
+
// const parseResults = await parseCSharpFiles(config);
|
|
168
|
+
// if (parseResults.length === 0) {
|
|
169
|
+
// console.warn(chalk.yellow.bold('ā Warning:'), chalk.white(`No C# files found with [${config.targetAnnotation}] attribute\n`));
|
|
170
|
+
// return;
|
|
171
|
+
// }
|
|
172
|
+
// // Collect all classes
|
|
173
|
+
// const allClasses = parseResults.flatMap(result => result.classes);
|
|
174
|
+
// console.log(chalk.green.bold(`ā Found ${allClasses.length} class(es) with [${config.targetAnnotation}] attribute`));
|
|
175
|
+
// // Generate TypeScript files
|
|
176
|
+
// console.log(chalk.blue.cyan('\nā§ Generating TypeScript files...'));
|
|
177
|
+
// generateTypeScriptFiles(config, parseResults);
|
|
178
|
+
// console.log(chalk.green.bold('ā
Generation completed successfully!\n'));
|
|
179
|
+
// } catch (error) {
|
|
180
|
+
// if (error instanceof Error) {
|
|
181
|
+
// console.error(chalk.red.bold(`\nā Error:`), chalk.white(error.message));
|
|
182
|
+
// } else {
|
|
183
|
+
// console.error(chalk.red.bold(`\nā An unknown error occurred`));
|
|
184
|
+
// }
|
|
185
|
+
// throw error;
|
|
186
|
+
// }
|
|
187
|
+
// }
|
|
188
|
+
/**
|
|
189
|
+
* Clean only output files corresponding to changed C# files
|
|
190
|
+
*/
|
|
191
|
+
async function cleanOnlyChangedOutputFiles(config, parseResults) {
|
|
192
|
+
const { loadPreviousHashes, savePreviousHashes, getChangedFiles, computeFileHash } = await Promise.resolve().then(() => __importStar(require('../helpers/change-tracker')));
|
|
193
|
+
const csharpFiles = parseResults.map(r => r.filePath);
|
|
194
|
+
const previousHashes = loadPreviousHashes();
|
|
195
|
+
const { changed, deleted } = getChangedFiles(csharpFiles, previousHashes);
|
|
196
|
+
console.log('\nš Change Detection:');
|
|
197
|
+
if (changed.length > 0) {
|
|
198
|
+
console.log(chalk_1.default.yellow(` Changed files: ${changed.length}`));
|
|
199
|
+
changed.forEach(f => console.log(chalk_1.default.yellow(` ā³ ${f}`)));
|
|
200
|
+
}
|
|
201
|
+
if (deleted.length > 0) {
|
|
202
|
+
console.log(chalk_1.default.red(` Deleted files: ${deleted.length}`));
|
|
203
|
+
deleted.forEach(f => console.log(chalk_1.default.red(` ā³ ${f}`)));
|
|
204
|
+
}
|
|
205
|
+
// Remove TS files for deleted C# files
|
|
206
|
+
for (const deletedFile of deleted) {
|
|
207
|
+
removeCorrespondingTsFile(config, deletedFile);
|
|
208
|
+
}
|
|
209
|
+
// Save current hashes for next run
|
|
210
|
+
const currentHashes = new Map();
|
|
211
|
+
for (const file of csharpFiles) {
|
|
212
|
+
currentHashes.set(file, computeFileHash(file));
|
|
159
213
|
}
|
|
214
|
+
savePreviousHashes(currentHashes);
|
|
160
215
|
}
|
|
161
216
|
/**
|
|
162
217
|
* Deletes all contents of a directory but keeps the directory itself.
|
|
@@ -179,6 +234,27 @@ function cleanOutputDirectory(dir) {
|
|
|
179
234
|
}
|
|
180
235
|
}
|
|
181
236
|
}
|
|
237
|
+
/**
|
|
238
|
+
* Remove TypeScript output file(s) for a deleted C# source file
|
|
239
|
+
*/
|
|
240
|
+
function removeCorrespondingTsFile(config, csharpFilePath) {
|
|
241
|
+
const outputPath = config.outputPath;
|
|
242
|
+
const relativePath = path.relative(config.source, csharpFilePath);
|
|
243
|
+
const fileName = path.basename(relativePath, '.cs');
|
|
244
|
+
const fileConvention = typeof config.namingConvention === 'string'
|
|
245
|
+
? config.namingConvention
|
|
246
|
+
: config.namingConvention?.file ?? 'camel';
|
|
247
|
+
let baseName = fileName;
|
|
248
|
+
if (config.fileSuffix) {
|
|
249
|
+
baseName = `${baseName}${config.fileSuffix}`;
|
|
250
|
+
}
|
|
251
|
+
const tsFileName = (0, generator_1.convertFileName)(baseName, fileConvention) + '.ts';
|
|
252
|
+
const tsFilePath = path.join(outputPath, path.dirname(relativePath), tsFileName);
|
|
253
|
+
if (fs.existsSync(tsFilePath)) {
|
|
254
|
+
fs.unlinkSync(tsFilePath);
|
|
255
|
+
console.log(chalk_1.default.red(` Removed: ${tsFilePath}`));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
182
258
|
/**
|
|
183
259
|
* Load configuration from file or use provided config
|
|
184
260
|
*/
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,4BAmCC;AAsHD,oDAiBC;AAqCD,gCAqBC;AAvTD,uCAAyB;AACzB,2CAA6B;AAC7B,sCAA6C;AAC7C,4CAAwE;AACxE,kDAA0B;AAE1B,6BAAoC;AAEpC,mGAA4F;AAG5F;;GAEG;AACH,MAAM,cAAc,GAA6B;IAC/C,gBAAgB,EAAE,WAAW;IAC7B,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,OAAO;CAC1B,CAAC;AAEF;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAAC,QAAgB;IAChD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEnC,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,OAAO,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,GAAG,KAAK,KAAK,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,IAAA,mBAAa,EAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,MAAM,MAAM,GAAG,yBAAa,OAAO,uCAAC,CAAC;QACrC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC;QAChD,OAAO,IAAA,yBAAiB,EAAC,cAAc,CAAC,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