@prestizni-software/client-dem 0.2.20 → 0.2.22
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/AutoUpdateClientManagerClass.ts +5 -5
- package/AutoUpdateManagerClass.ts +3 -3
- package/AutoUpdatedClientObjectClass.ts +75 -52
- package/CHANGELOG.md +4 -0
- package/CommonTypes.ts +1 -1
- package/client.ts +4 -4
- package/package.json +1 -1
- package/tsconfig.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Socket } from "socket.io-client";
|
|
2
|
-
import { AutoUpdateManager } from "./AutoUpdateManagerClass.
|
|
3
|
-
import { createAutoUpdatedClass } from "./AutoUpdatedClientObjectClass.
|
|
4
|
-
import { Constructor, IsData, LoggersType } from "./CommonTypes.
|
|
2
|
+
import { AutoUpdateManager } from "./AutoUpdateManagerClass.js";
|
|
3
|
+
import { createAutoUpdatedClass } from "./AutoUpdatedClientObjectClass.js";
|
|
4
|
+
import { Constructor, IsData, LoggersType } from "./CommonTypes.js";
|
|
5
5
|
export type WrappedInstances<T extends Record<string, Constructor<any>>> = {
|
|
6
6
|
[K in keyof T]: AutoUpdateClientManager<T[K]>;
|
|
7
7
|
};
|
|
@@ -61,7 +61,7 @@ export class AutoUpdateClientManager<
|
|
|
61
61
|
this.socket,
|
|
62
62
|
_id,
|
|
63
63
|
this.loggers,
|
|
64
|
-
this
|
|
64
|
+
this,
|
|
65
65
|
this.emitter
|
|
66
66
|
);
|
|
67
67
|
}
|
|
@@ -73,7 +73,7 @@ export class AutoUpdateClientManager<
|
|
|
73
73
|
this.socket,
|
|
74
74
|
data,
|
|
75
75
|
this.loggers,
|
|
76
|
-
this
|
|
76
|
+
this,
|
|
77
77
|
this.emitter
|
|
78
78
|
);
|
|
79
79
|
this.classes[object._id as any] = object;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AutoUpdated } from "./AutoUpdatedClientObjectClass.
|
|
2
|
-
import { Constructor, IsData, LoggersType, SocketType } from "./CommonTypes.
|
|
1
|
+
import { AutoUpdated } from "./AutoUpdatedClientObjectClass.js";
|
|
2
|
+
import { Constructor, IsData, LoggersType, SocketType } from "./CommonTypes.js";
|
|
3
3
|
import "reflect-metadata";
|
|
4
4
|
|
|
5
5
|
export abstract class AutoUpdateManager<T extends Constructor<any>> {
|
|
@@ -7,7 +7,7 @@ export abstract class AutoUpdateManager<T extends Constructor<any>> {
|
|
|
7
7
|
public socket: SocketType;
|
|
8
8
|
protected classParam: T;
|
|
9
9
|
protected properties: (keyof T)[];
|
|
10
|
-
|
|
10
|
+
public readonly classers: Record<string, AutoUpdateManager<any>>;
|
|
11
11
|
protected loggers: LoggersType = {
|
|
12
12
|
info: () => {},
|
|
13
13
|
debug: () => {},
|
|
@@ -12,9 +12,10 @@ import {
|
|
|
12
12
|
ServerResponse,
|
|
13
13
|
ServerUpdateRequest,
|
|
14
14
|
SocketType,
|
|
15
|
-
} from "./CommonTypes.
|
|
16
|
-
import { AutoUpdateManager } from "./AutoUpdateManagerClass.
|
|
15
|
+
} from "./CommonTypes.js";
|
|
16
|
+
import { AutoUpdateManager } from "./AutoUpdateManagerClass.js";
|
|
17
17
|
import { ObjectId } from "bson";
|
|
18
|
+
import { AutoUpdateClientManager } from "./AutoUpdateClientManagerClass.js";
|
|
18
19
|
|
|
19
20
|
export type AutoUpdated<T extends Constructor<any>> =
|
|
20
21
|
AutoUpdatedClientObject<T> & DeRef<InstanceOf<T>>;
|
|
@@ -23,7 +24,7 @@ export async function createAutoUpdatedClass<C extends Constructor<any>>(
|
|
|
23
24
|
socket: SocketType,
|
|
24
25
|
data: RefToId<IsData<InstanceType<C>>> | string,
|
|
25
26
|
loggers: LoggersType,
|
|
26
|
-
autoClassers:
|
|
27
|
+
autoClassers: AutoUpdateClientManager<any>,
|
|
27
28
|
emitter: EventTarget
|
|
28
29
|
): Promise<AutoUpdated<C>> {
|
|
29
30
|
if (typeof data !== "string")
|
|
@@ -60,11 +61,10 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
60
61
|
protected readonly emitter;
|
|
61
62
|
protected readonly properties: (keyof T)[];
|
|
62
63
|
protected readonly className: string;
|
|
63
|
-
protected
|
|
64
|
+
protected autoClasser: AutoUpdateManager<any>;
|
|
64
65
|
protected isLoadingReferences = false;
|
|
65
66
|
public readonly classProp: Constructor<T>;
|
|
66
67
|
private readonly EmitterID = new ObjectId().toHexString();
|
|
67
|
-
protected unpopulatedData: RefToId<IsData<T>>;
|
|
68
68
|
private readonly loadShit = async () => {
|
|
69
69
|
if (this.isLoaded()) {
|
|
70
70
|
try {
|
|
@@ -92,14 +92,14 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
92
92
|
properties: (keyof T)[],
|
|
93
93
|
className: string,
|
|
94
94
|
classProperty: Constructor<T>,
|
|
95
|
-
|
|
95
|
+
autoClasser: AutoUpdateManager<any>,
|
|
96
96
|
emitter: EventTarget
|
|
97
97
|
) {
|
|
98
98
|
this.emitter = emitter;
|
|
99
99
|
this.classProp = classProperty;
|
|
100
100
|
this.isLoadingReferences = true;
|
|
101
101
|
this.isLoading = true;
|
|
102
|
-
this.
|
|
102
|
+
this.autoClasser = autoClasser;
|
|
103
103
|
this.className = className;
|
|
104
104
|
this.properties = properties;
|
|
105
105
|
this.loggers.debug = loggers.debug;
|
|
@@ -122,12 +122,11 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
122
122
|
this.emitter.dispatchEvent(new Event("loaded" + this.EmitterID));
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
-
this.unpopulatedData = res.data as any;
|
|
126
125
|
checkForMissingRefs<T>(
|
|
127
126
|
res.data as any,
|
|
128
127
|
properties,
|
|
129
128
|
classProperty as any,
|
|
130
|
-
|
|
129
|
+
autoClasser
|
|
131
130
|
);
|
|
132
131
|
this.data = res.data as IsData<T>;
|
|
133
132
|
this.isLoading = false;
|
|
@@ -135,20 +134,18 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
135
134
|
}
|
|
136
135
|
);
|
|
137
136
|
this.data = { _id: data } as IsData<T>;
|
|
138
|
-
this.unpopulatedData = { _id: data } as any;
|
|
139
137
|
} else {
|
|
140
138
|
this.isLoading = true;
|
|
141
|
-
this.unpopulatedData = data;
|
|
142
139
|
checkForMissingRefs<T>(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
data as any,
|
|
141
|
+
properties,
|
|
142
|
+
classProperty as any,
|
|
143
|
+
autoClasser
|
|
144
|
+
);
|
|
148
145
|
this.data = data as any;
|
|
149
146
|
|
|
150
147
|
if (this.data._id === "") this.handleNewObject(data as any);
|
|
151
|
-
else this.isLoading = false;
|
|
148
|
+
else {this.isLoading = false};
|
|
152
149
|
}
|
|
153
150
|
if (!this.isServer) this.openSockets();
|
|
154
151
|
this.generateSettersAndGetters();
|
|
@@ -167,13 +164,12 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
167
164
|
this.emitter.dispatchEvent(new Event("loaded" + this.EmitterID));
|
|
168
165
|
return;
|
|
169
166
|
}
|
|
170
|
-
this.unpopulatedData = res.data as any;
|
|
171
167
|
checkForMissingRefs<T>(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
res.data as any,
|
|
169
|
+
this.properties,
|
|
170
|
+
this.classProp as any,
|
|
171
|
+
this.autoClasser
|
|
172
|
+
);
|
|
177
173
|
this.data = res.data as IsData<T>;
|
|
178
174
|
this.isLoading = false;
|
|
179
175
|
this.emitter.dispatchEvent(new Event("loaded" + this.EmitterID));
|
|
@@ -183,13 +179,12 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
183
179
|
public get extractedData(): {
|
|
184
180
|
[K in keyof InstanceType<T>]: InstanceOf<InstanceType<T>>[K];
|
|
185
181
|
} {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
) as any as {
|
|
182
|
+
const extracted = Object.fromEntries(
|
|
183
|
+
Object.entries(
|
|
184
|
+
processIsRefProperties(this.data, this.classProp.prototype).newData
|
|
185
|
+
).filter(([k, v]) => typeof v !== "function")
|
|
186
|
+
);
|
|
187
|
+
return structuredClone(extracted) as any as {
|
|
193
188
|
[K in keyof InstanceType<T>]: InstanceOf<InstanceType<T>>[K];
|
|
194
189
|
};
|
|
195
190
|
}
|
|
@@ -248,7 +243,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
248
243
|
}
|
|
249
244
|
|
|
250
245
|
private generateSettersAndGetters() {
|
|
251
|
-
this.properties
|
|
246
|
+
for (const key of this.properties) {
|
|
252
247
|
if (typeof key !== "string") return;
|
|
253
248
|
|
|
254
249
|
const k = key as keyof IsData<T>;
|
|
@@ -259,8 +254,13 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
259
254
|
);
|
|
260
255
|
|
|
261
256
|
Object.defineProperty(this, key, {
|
|
262
|
-
get: () =>
|
|
263
|
-
|
|
257
|
+
get: () => {
|
|
258
|
+
if (isRef)
|
|
259
|
+
return typeof this.data[k] === "string"
|
|
260
|
+
? this.findReference(this.data[k] as string)
|
|
261
|
+
: this.data[k];
|
|
262
|
+
else return this.data[k];
|
|
263
|
+
},
|
|
264
264
|
set: () => {
|
|
265
265
|
throw new Error(
|
|
266
266
|
`Cannot set ${key} this way, use "setValue" function.`
|
|
@@ -269,11 +269,11 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
269
269
|
enumerable: true,
|
|
270
270
|
configurable: true,
|
|
271
271
|
});
|
|
272
|
-
}
|
|
272
|
+
}
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
protected findReference(id: string): AutoUpdated<any> | undefined {
|
|
276
|
-
for (const classer of Object.values(this.
|
|
276
|
+
for (const classer of Object.values(this.autoClasser.classers)) {
|
|
277
277
|
const result = classer.getObject(id);
|
|
278
278
|
if (result) return result;
|
|
279
279
|
}
|
|
@@ -322,6 +322,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
322
322
|
const pathArr = lastPath.split(".");
|
|
323
323
|
if (pathArr.length === 1) {
|
|
324
324
|
(this.data as any)[key as any] = value;
|
|
325
|
+
await this.checkAutoStatusChange();
|
|
325
326
|
return true;
|
|
326
327
|
}
|
|
327
328
|
const pathMinusLast = pathArr.splice(0, 1);
|
|
@@ -330,6 +331,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
330
331
|
ref = ref[p];
|
|
331
332
|
}
|
|
332
333
|
ref[pathArr.at(-1)!] = value;
|
|
334
|
+
await this.checkAutoStatusChange();
|
|
333
335
|
return true;
|
|
334
336
|
} catch (error) {
|
|
335
337
|
this.loggers.error(error);
|
|
@@ -337,6 +339,15 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
public getValue(key: Paths<T>) {
|
|
343
|
+
let value: any;
|
|
344
|
+
for (const part of key.split(".")) {
|
|
345
|
+
if (value) value = value[part];
|
|
346
|
+
else value = (this.data as any)[part];
|
|
347
|
+
}
|
|
348
|
+
return value;
|
|
349
|
+
}
|
|
350
|
+
|
|
340
351
|
protected async setValueInternal(key: string, value: any): Promise<boolean> {
|
|
341
352
|
const update: ServerUpdateRequest<T> = this.makeUpdate(key, value);
|
|
342
353
|
const promise = new Promise<boolean>((resolve) => {
|
|
@@ -361,11 +372,15 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
361
372
|
return { _id: id, key, value } as any;
|
|
362
373
|
}
|
|
363
374
|
|
|
375
|
+
protected async checkAutoStatusChange() {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
|
|
364
379
|
// return a properly typed AutoUpdatedClientClass (or null)
|
|
365
380
|
// inside AutoUpdatedClientClass
|
|
366
381
|
protected resolveReference(id: string): AutoUpdatedClientObject<any> | null {
|
|
367
|
-
if (!this.
|
|
368
|
-
for (const autoClasser of Object.values(this.
|
|
382
|
+
if (!this.autoClasser) throw new Error("No autoClasser");
|
|
383
|
+
for (const autoClasser of Object.values(this.autoClasser.classers)) {
|
|
369
384
|
const data = autoClasser.getObject(id);
|
|
370
385
|
if (data) return data;
|
|
371
386
|
}
|
|
@@ -396,10 +411,10 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
396
411
|
}
|
|
397
412
|
|
|
398
413
|
private async handleLoadOnForced(obj: any, key: string) {
|
|
399
|
-
if (!this.
|
|
414
|
+
if (!this.autoClasser) throw new Error("No autoClassers");
|
|
400
415
|
const refId = obj[key];
|
|
401
416
|
if (refId) {
|
|
402
|
-
for (const classer of Object.values(this.
|
|
417
|
+
for (const classer of Object.values(this.autoClasser.classers)) {
|
|
403
418
|
const result = classer.getObject(refId);
|
|
404
419
|
if (result) {
|
|
405
420
|
obj[key] = result;
|
|
@@ -429,8 +444,9 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
429
444
|
export function processIsRefProperties(
|
|
430
445
|
instance: any,
|
|
431
446
|
target: any,
|
|
432
|
-
prefix =
|
|
447
|
+
prefix: string | null = null,
|
|
433
448
|
allProps: string[] = [],
|
|
449
|
+
newData = {} as any,
|
|
434
450
|
loggers?: LoggersType
|
|
435
451
|
) {
|
|
436
452
|
const props: string[] = Reflect.getMetadata("props", target) || [];
|
|
@@ -438,25 +454,31 @@ export function processIsRefProperties(
|
|
|
438
454
|
for (const prop of props) {
|
|
439
455
|
const path = prefix ? `${prefix}.${prop}` : prop;
|
|
440
456
|
allProps.push(path);
|
|
457
|
+
newData[prop] = instance[prop];
|
|
441
458
|
if (Reflect.getMetadata("isRef", target, prop)) {
|
|
442
459
|
(loggers ?? console).debug("Changing isRef:", path);
|
|
443
|
-
|
|
444
|
-
instance[prop] =
|
|
460
|
+
newData[prop] =
|
|
445
461
|
typeof instance[prop] === "string"
|
|
446
462
|
? instance[prop]
|
|
447
|
-
: instance[prop]
|
|
463
|
+
: instance[prop]?._id;
|
|
448
464
|
}
|
|
449
465
|
|
|
450
|
-
// recurse into nested objects
|
|
451
466
|
const type = Reflect.getMetadata("design:type", target, prop);
|
|
452
467
|
if (type?.prototype) {
|
|
453
468
|
const nestedProps = Reflect.getMetadata("props", type.prototype);
|
|
454
469
|
if (nestedProps && instance[prop]) {
|
|
455
|
-
|
|
470
|
+
newData[prop] = processIsRefProperties(
|
|
471
|
+
instance[prop],
|
|
472
|
+
type.prototype,
|
|
473
|
+
path,
|
|
474
|
+
allProps,
|
|
475
|
+
undefined,
|
|
476
|
+
loggers
|
|
477
|
+
).newData;
|
|
456
478
|
}
|
|
457
479
|
}
|
|
458
480
|
}
|
|
459
|
-
return allProps;
|
|
481
|
+
return { allProps, newData };
|
|
460
482
|
}
|
|
461
483
|
|
|
462
484
|
export function getMetadataRecursive(
|
|
@@ -476,7 +498,7 @@ function checkForMissingRefs<C extends Constructor<any>>(
|
|
|
476
498
|
data: IsData<InstanceType<C>>,
|
|
477
499
|
props: any,
|
|
478
500
|
classParam: C,
|
|
479
|
-
autoClassers:
|
|
501
|
+
autoClassers: AutoUpdateManager<any>
|
|
480
502
|
) {
|
|
481
503
|
if (typeof data !== "string") {
|
|
482
504
|
const entryKeys = Object.keys(data);
|
|
@@ -485,7 +507,7 @@ function checkForMissingRefs<C extends Constructor<any>>(
|
|
|
485
507
|
!entryKeys.includes(prop.toString()) &&
|
|
486
508
|
getMetadataRecursive("isRef", classParam.prototype, prop.toString())
|
|
487
509
|
) {
|
|
488
|
-
findMissingObjectReference(data, prop, autoClassers);
|
|
510
|
+
findMissingObjectReference(data, prop, autoClassers.classers);
|
|
489
511
|
}
|
|
490
512
|
}
|
|
491
513
|
}
|
|
@@ -495,15 +517,16 @@ function findMissingObjectReference(
|
|
|
495
517
|
prop: any,
|
|
496
518
|
autoClassers: { [key: string]: AutoUpdateManager<any> }
|
|
497
519
|
) {
|
|
498
|
-
for(const ac of Object.values(autoClassers)){
|
|
499
|
-
for(const obj of ac.objectsAsArray){
|
|
520
|
+
for (const ac of Object.values(autoClassers)) {
|
|
521
|
+
for (const obj of ac.objectsAsArray) {
|
|
500
522
|
const found = Object.values(obj.extractedData).find((value) =>
|
|
501
523
|
Array.isArray(value) ? value.includes(data._id) : value === data._id
|
|
502
|
-
)
|
|
503
|
-
if(found){
|
|
524
|
+
);
|
|
525
|
+
if (found) {
|
|
504
526
|
data[prop] = obj._id;
|
|
505
527
|
return;
|
|
506
528
|
}
|
|
507
529
|
}
|
|
508
530
|
}
|
|
531
|
+
console.log("a");
|
|
509
532
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.22](https://github.com/Prestizni-Software/client-dem/compare/v0.2.21...v0.2.22) (2025-11-10)
|
|
6
|
+
|
|
7
|
+
### [0.2.21](https://github.com/Prestizni-Software/client-dem/compare/v0.2.20...v0.2.21) (2025-11-10)
|
|
8
|
+
|
|
5
9
|
### [0.2.20](https://github.com/Prestizni-Software/client-dem/compare/v0.2.19...v0.2.20) (2025-11-10)
|
|
6
10
|
|
|
7
11
|
### [0.2.19](https://github.com/Prestizni-Software/client-dem/compare/v0.2.18...v0.2.19) (2025-11-10)
|
package/CommonTypes.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DefaultEventsMap, Server } from "socket.io";
|
|
2
2
|
import { Socket as SocketClient } from "socket.io-client";
|
|
3
3
|
import { ObjectId } from "bson";
|
|
4
|
-
import { AutoUpdated } from "./AutoUpdatedClientObjectClass.
|
|
4
|
+
import { AutoUpdated } from "./AutoUpdatedClientObjectClass.js";
|
|
5
5
|
import "reflect-metadata";
|
|
6
6
|
|
|
7
7
|
export type Ref<T> = string | (T extends Constructor<any> ? AutoUpdated<T> : (T & { _id: string }));
|
package/client.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as AutoUpdateClientManagerClass from "./AutoUpdateClientManagerClass.
|
|
2
|
-
import * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.
|
|
3
|
-
import * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.
|
|
4
|
-
import * as CommonTypes from "./CommonTypes.
|
|
1
|
+
import * as AutoUpdateClientManagerClass from "./AutoUpdateClientManagerClass.js";
|
|
2
|
+
import * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.js";
|
|
3
|
+
import * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.js";
|
|
4
|
+
import * as CommonTypes from "./CommonTypes.js";
|
|
5
5
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
AutoUpdateClientManagerClass,
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/* Projects */
|
|
6
6
|
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
"composite": true,
|
|
7
|
+
"composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
8
|
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
9
|
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
10
|
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
16
|
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
17
|
// "libReplacement": true, /* Enable lib replacement. */
|
|
18
|
-
"experimentalDecorators": true,
|
|
19
|
-
"emitDecoratorMetadata": true,
|
|
18
|
+
"experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
|
|
19
|
+
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
20
20
|
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
21
21
|
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
22
22
|
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
27
27
|
|
|
28
28
|
/* Modules */
|
|
29
|
-
"module": "
|
|
30
|
-
"rootDir": "./",
|
|
31
|
-
"moduleResolution": "
|
|
29
|
+
"module": "es2022", /* Specify what module code is generated. */
|
|
30
|
+
"rootDir": "./", /* Specify the root folder within your source files. */
|
|
31
|
+
"moduleResolution": "bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
32
32
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
33
33
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
34
34
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
37
37
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
38
38
|
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
39
|
-
|
|
39
|
+
"allowImportingTsExtensions": false, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
|
|
40
40
|
// "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
|
|
41
41
|
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
|
|
42
42
|
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
|
|
43
43
|
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
|
|
44
44
|
// "noUncheckedSideEffectImports": true, /* Check side effect imports. */
|
|
45
|
-
"resolveJsonModule": true,
|
|
45
|
+
"resolveJsonModule": true, /* Enable importing .json files. */
|
|
46
46
|
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
|
|
47
47
|
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
48
48
|
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
/* Emit */
|
|
55
55
|
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
56
56
|
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
57
|
-
|
|
58
|
-
"sourceMap": true,
|
|
57
|
+
"emitDeclarationOnly": false, /* Only output d.ts files and not JavaScript files. */
|
|
58
|
+
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
59
59
|
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
60
60
|
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
61
61
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
62
|
-
"outDir": "./dist",
|
|
62
|
+
"outDir": "./dist", /* Specify an output folder for all emitted files. */
|
|
63
63
|
// "removeComments": true, /* Disable emitting comments. */
|
|
64
64
|
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
65
65
|
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|