@prestizni-software/server-dem 0.2.21 → 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.
@@ -1,5 +1,5 @@
1
- import { AutoUpdated } from "./AutoUpdatedClientObjectClass.ts";
2
- import { Constructor, IsData, LoggersType, SocketType } from "./CommonTypes.ts";
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
- protected classers: Record<string, AutoUpdateManager<any>>;
10
+ public readonly classers: Record<string, AutoUpdateManager<any>>;
11
11
  protected loggers: LoggersType = {
12
12
  info: () => {},
13
13
  debug: () => {},
@@ -1,55 +1,73 @@
1
1
  import { Server, Socket } from "socket.io";
2
- import { AutoUpdateManager } from "./AutoUpdateManagerClass.ts";
3
- import { createAutoUpdatedClass } from "./AutoUpdatedServerObjectClass.ts";
2
+ import { AutoUpdateManager } from "./AutoUpdateManagerClass.js";
3
+ import {
4
+ createAutoUpdatedClass,
5
+ } from "./AutoUpdatedServerObjectClass.js";
4
6
  import {
5
7
  Constructor,
6
8
  IsData,
7
9
  LoggersType,
8
10
  Paths,
11
+ PathValueOf,
9
12
  ServerResponse,
10
13
  ServerUpdateRequest,
11
- } from "./CommonTypes.ts";
12
- import { BeAnObject, ReturnModelType } from "@typegoose/typegoose/lib/types.ts";
14
+ } from "./CommonTypes.js";
15
+ import { BeAnObject, ReturnModelType } from "@typegoose/typegoose/lib/types.js";
13
16
  import { getModelForClass } from "@typegoose/typegoose";
14
17
  export type WrappedInstances<T extends Record<string, Constructor<any>>> = {
15
18
  [K in keyof T]: AutoUpdateServerManager<T[K]>;
16
19
  };
17
20
  type AccessDefinitions<C extends Constructor<any>> = {
18
- [K in Paths<C>]: {
21
+ [K in Paths<C>]?: {
19
22
  access?: string[];
20
23
  update?: boolean;
21
24
  };
22
25
  };
23
26
 
24
- export type AutoStatusDefinitions<C extends Constructor<any>> = {
27
+ export type AutoStatusDefinitions<
28
+ C extends Constructor<any>,
29
+ E extends Record<string, string | number>,
30
+ S extends StatusDefinition<C>
31
+ > = {
25
32
  statusProperty: Paths<C>;
26
- statusEnum: Record<string, string | number>;
27
- definitions: Record<string, {}>;
33
+ statusEnum: E;
34
+ definitions: { [K in keyof E]: S };
35
+ };
36
+
37
+ type StatusDefinition<C extends Constructor<any>> = {
38
+ [K in Paths<C>]?: PathValueOf<C, K>;
28
39
  };
29
40
 
30
41
  export function createAutoStatusDefinitions<
31
42
  C extends Constructor<any>,
32
- E extends { [k: string]: string | number }
33
- >(def: {
34
- class: C;
35
- statusProperty: Paths<C>;
36
- statusEnum: E;
37
- definitions: { [K in keyof E]: {} };
38
- }): AutoStatusDefinitions<C> & {
39
- statusEnum: E;
40
- definitions: { [K in keyof E]: {} };
41
- } {
42
- return def;
43
+ E extends { [k: string]: string | number },
44
+ S extends StatusDefinition<C>
45
+ >(
46
+ _class: C,
47
+ _template: S,
48
+ statusProperty: Paths<C>,
49
+ statusEnum: E,
50
+ definitions: { [K in keyof E]: S }
51
+ ): AutoStatusDefinitions<C, E, S> {
52
+ return {
53
+ statusProperty,
54
+ statusEnum,
55
+ definitions,
56
+ };
43
57
  }
44
58
 
45
- export type AUSOptions<T extends Record<string, Constructor<any>>> = {
59
+ export type AUSDefinitions<T extends Record<string, Constructor<any>>> = {
46
60
  [K in keyof T]: ServerManagerDefinition<T[K]>;
47
61
  };
48
62
 
49
- export type AUSOption<C extends Constructor<any>> = {
50
- accessDefinitions?: Partial<AccessDefinitions<C>>;
51
- autoStatusDefinitions?: Partial<AutoStatusDefinitions<C>>;
52
- };
63
+ export type AUSOption<C extends Constructor<any>> = {
64
+ accessDefinitions?: Partial<AccessDefinitions<C>>;
65
+ autoStatusDefinitions?: AutoStatusDefinitions<
66
+ C,
67
+ { [k: string]: string | number },
68
+ StatusDefinition<C>
69
+ >;
70
+ };
53
71
 
54
72
  type ServerManagerDefinition<C extends Constructor<any>> = {
55
73
  class: C;
@@ -59,7 +77,7 @@ type ServerManagerDefinition<C extends Constructor<any>> = {
59
77
  export async function AUSManagerFactory<
60
78
  T extends Record<string, Constructor<any>>
61
79
  >(
62
- defs: AUSOptions<T>,
80
+ defs: AUSDefinitions<T>,
63
81
  loggers: LoggersType,
64
82
  socket: Server,
65
83
  emitter: EventTarget
@@ -83,7 +101,6 @@ export async function AUSManagerFactory<
83
101
  await c.loadDB();
84
102
  }
85
103
 
86
-
87
104
  return classers as WrappedInstances<T>;
88
105
  }
89
106
 
@@ -92,7 +109,7 @@ export class AutoUpdateServerManager<
92
109
  > extends AutoUpdateManager<T> {
93
110
  public readonly model: ReturnModelType<T, BeAnObject>;
94
111
  private readonly clientSockets: Set<Socket> = new Set<Socket>();
95
-
112
+ public readonly options?: AUSOption<T>;
96
113
  constructor(
97
114
  classParam: T,
98
115
  loggers: LoggersType,
@@ -104,6 +121,7 @@ export class AutoUpdateServerManager<
104
121
  ) {
105
122
  super(classParam, socket, loggers, classers, emitter);
106
123
  this.model = model;
124
+ this.options = options;
107
125
  }
108
126
 
109
127
  public async loadDB() {
@@ -210,7 +228,7 @@ export class AutoUpdateServerManager<
210
228
  this.socket,
211
229
  document,
212
230
  this.loggers,
213
- this.classers,
231
+ this,
214
232
  this.emitter
215
233
  );
216
234
  }
@@ -224,12 +242,12 @@ export class AutoUpdateServerManager<
224
242
  this.socket,
225
243
  entry,
226
244
  this.loggers,
227
- this.classers,
245
+ this,
228
246
  this.emitter
229
247
  );
248
+ object.checkAutoStatusChange();
230
249
  this.classes[object._id] = object;
231
250
  this.classesAsArray.push(object);
232
- this.socket.emit("new" + this.classParam.name, await object._id);
233
251
  return object;
234
252
  }
235
253
  }
@@ -12,9 +12,10 @@ import {
12
12
  ServerResponse,
13
13
  ServerUpdateRequest,
14
14
  SocketType,
15
- } from "./CommonTypes.ts";
16
- import { AutoUpdateManager } from "./AutoUpdateManagerClass.ts";
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: { [key: string]: AutoUpdateManager<any> },
27
+ autoClassers: AutoUpdateClientManager<any>,
27
28
  emitter: EventTarget
28
29
  ): Promise<AutoUpdated<C>> {
29
30
  if (typeof data !== "string")
@@ -60,7 +61,7 @@ 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 autoClassers: Record<string, AutoUpdateManager<any>>;
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();
@@ -91,14 +92,14 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
91
92
  properties: (keyof T)[],
92
93
  className: string,
93
94
  classProperty: Constructor<T>,
94
- autoClassers: Record<string, AutoUpdateManager<any>>,
95
+ autoClasser: AutoUpdateManager<any>,
95
96
  emitter: EventTarget
96
97
  ) {
97
98
  this.emitter = emitter;
98
99
  this.classProp = classProperty;
99
100
  this.isLoadingReferences = true;
100
101
  this.isLoading = true;
101
- this.autoClassers = autoClassers;
102
+ this.autoClasser = autoClasser;
102
103
  this.className = className;
103
104
  this.properties = properties;
104
105
  this.loggers.debug = loggers.debug;
@@ -125,7 +126,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
125
126
  res.data as any,
126
127
  properties,
127
128
  classProperty as any,
128
- autoClassers
129
+ autoClasser
129
130
  );
130
131
  this.data = res.data as IsData<T>;
131
132
  this.isLoading = false;
@@ -139,12 +140,12 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
139
140
  data as any,
140
141
  properties,
141
142
  classProperty as any,
142
- autoClassers
143
+ autoClasser
143
144
  );
144
145
  this.data = data as any;
145
146
 
146
147
  if (this.data._id === "") this.handleNewObject(data as any);
147
- else this.isLoading = false;
148
+ else {this.isLoading = false};
148
149
  }
149
150
  if (!this.isServer) this.openSockets();
150
151
  this.generateSettersAndGetters();
@@ -167,7 +168,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
167
168
  res.data as any,
168
169
  this.properties,
169
170
  this.classProp as any,
170
- this.autoClassers
171
+ this.autoClasser
171
172
  );
172
173
  this.data = res.data as IsData<T>;
173
174
  this.isLoading = false;
@@ -272,7 +273,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
272
273
  }
273
274
 
274
275
  protected findReference(id: string): AutoUpdated<any> | undefined {
275
- for (const classer of Object.values(this.autoClassers)) {
276
+ for (const classer of Object.values(this.autoClasser.classers)) {
276
277
  const result = classer.getObject(id);
277
278
  if (result) return result;
278
279
  }
@@ -321,6 +322,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
321
322
  const pathArr = lastPath.split(".");
322
323
  if (pathArr.length === 1) {
323
324
  (this.data as any)[key as any] = value;
325
+ await this.checkAutoStatusChange();
324
326
  return true;
325
327
  }
326
328
  const pathMinusLast = pathArr.splice(0, 1);
@@ -329,6 +331,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
329
331
  ref = ref[p];
330
332
  }
331
333
  ref[pathArr.at(-1)!] = value;
334
+ await this.checkAutoStatusChange();
332
335
  return true;
333
336
  } catch (error) {
334
337
  this.loggers.error(error);
@@ -336,6 +339,15 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
336
339
  }
337
340
  }
338
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
+
339
351
  protected async setValueInternal(key: string, value: any): Promise<boolean> {
340
352
  const update: ServerUpdateRequest<T> = this.makeUpdate(key, value);
341
353
  const promise = new Promise<boolean>((resolve) => {
@@ -360,11 +372,15 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
360
372
  return { _id: id, key, value } as any;
361
373
  }
362
374
 
375
+ protected async checkAutoStatusChange() {
376
+ return;
377
+ }
378
+
363
379
  // return a properly typed AutoUpdatedClientClass (or null)
364
380
  // inside AutoUpdatedClientClass
365
381
  protected resolveReference(id: string): AutoUpdatedClientObject<any> | null {
366
- if (!this.autoClassers) throw new Error("No autoClassers");
367
- for (const autoClasser of Object.values(this.autoClassers)) {
382
+ if (!this.autoClasser) throw new Error("No autoClasser");
383
+ for (const autoClasser of Object.values(this.autoClasser.classers)) {
368
384
  const data = autoClasser.getObject(id);
369
385
  if (data) return data;
370
386
  }
@@ -395,10 +411,10 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
395
411
  }
396
412
 
397
413
  private async handleLoadOnForced(obj: any, key: string) {
398
- if (!this.autoClassers) throw new Error("No autoClassers");
414
+ if (!this.autoClasser) throw new Error("No autoClassers");
399
415
  const refId = obj[key];
400
416
  if (refId) {
401
- for (const classer of Object.values(this.autoClassers)) {
417
+ for (const classer of Object.values(this.autoClasser.classers)) {
402
418
  const result = classer.getObject(refId);
403
419
  if (result) {
404
420
  obj[key] = result;
@@ -482,7 +498,7 @@ function checkForMissingRefs<C extends Constructor<any>>(
482
498
  data: IsData<InstanceType<C>>,
483
499
  props: any,
484
500
  classParam: C,
485
- autoClassers: { [key: string]: AutoUpdateManager<any> }
501
+ autoClassers: AutoUpdateManager<any>
486
502
  ) {
487
503
  if (typeof data !== "string") {
488
504
  const entryKeys = Object.keys(data);
@@ -491,7 +507,7 @@ function checkForMissingRefs<C extends Constructor<any>>(
491
507
  !entryKeys.includes(prop.toString()) &&
492
508
  getMetadataRecursive("isRef", classParam.prototype, prop.toString())
493
509
  ) {
494
- findMissingObjectReference(data, prop, autoClassers);
510
+ findMissingObjectReference(data, prop, autoClassers.classers);
495
511
  }
496
512
  }
497
513
  }
@@ -1,6 +1,6 @@
1
- import { IObjectWithTypegooseFunction } from "@typegoose/typegoose/lib/types.ts";
1
+ import { IObjectWithTypegooseFunction } from "@typegoose/typegoose/lib/types.js";
2
2
  import { Types, Document } from "mongoose";
3
- import { AutoUpdatedClientObject } from "./AutoUpdatedClientObjectClass.ts";
3
+ import { AutoUpdatedClientObject } from "./AutoUpdatedClientObjectClass.js";
4
4
  import {
5
5
  AutoProps,
6
6
  Constructor,
@@ -10,9 +10,8 @@ import {
10
10
  ServerUpdateRequest,
11
11
  SocketType,
12
12
  UnboxConstructor,
13
- } from "./CommonTypes.ts";
14
- import { AutoUpdateManager } from "./AutoUpdateManagerClass.ts";
15
- import { AutoUpdateServerManager } from "./AutoUpdateServerManagerClass.ts";
13
+ } from "./CommonTypes.js";
14
+ import { AutoUpdateServerManager } from "./AutoUpdateServerManagerClass.js";
16
15
  import "reflect-metadata";
17
16
 
18
17
  export type AutoUpdated<T extends Constructor<any>> = AutoUpdatedServerObject<T> & UnboxConstructor<T>;
@@ -22,7 +21,7 @@ export async function createAutoUpdatedClass<C extends Constructor<any>>(
22
21
  socket: SocketType,
23
22
  data: DocWithProps<InstanceType<C>>,
24
23
  loggers: LoggersType,
25
- autoClassers: Record<string, AutoUpdateManager<any>>,
24
+ autoClasser: AutoUpdateServerManager<any>,
26
25
  emitter: EventTarget
27
26
  ): Promise<AutoProps<C> & AutoUpdated<InstanceType<C>> & DeRef<InstanceType<C>>> {
28
27
  const instance = new (class extends AutoUpdatedServerObject<
@@ -37,10 +36,11 @@ export async function createAutoUpdatedClass<C extends Constructor<any>>(
37
36
  ) as (keyof InstanceType<C>)[],
38
37
  classParam.name,
39
38
  classParam,
40
- autoClassers,
39
+ autoClasser,
41
40
  emitter
42
41
  );
43
42
  await instance.isLoadedAsync();
43
+ await instance.checkAutoStatusChange();
44
44
  return instance as AutoProps<C> & AutoUpdated<InstanceType<C>> & DeRef<InstanceType<C>>;
45
45
  }
46
46
 
@@ -50,6 +50,7 @@ export abstract class AutoUpdatedServerObject<
50
50
  > extends AutoUpdatedClientObject<T> {
51
51
  protected readonly isServer: boolean = true;
52
52
  private readonly entry: DocWithProps<T>;
53
+ protected override autoClasser: AutoUpdateServerManager<any>;
53
54
 
54
55
  constructor(
55
56
  socket: SocketType,
@@ -63,7 +64,7 @@ export abstract class AutoUpdatedServerObject<
63
64
  properties: (keyof T)[],
64
65
  className: string,
65
66
  classProp: Constructor<T>,
66
- autoClassers: Record<string, AutoUpdateManager<any>>,
67
+ autoClasser: AutoUpdateServerManager<any>,
67
68
  emitter: EventTarget
68
69
  ) {
69
70
  super(
@@ -73,11 +74,11 @@ export abstract class AutoUpdatedServerObject<
73
74
  properties,
74
75
  className,
75
76
  classProp,
76
- autoClassers,
77
+ autoClasser,
77
78
  emitter
78
79
  );
80
+ this.autoClasser = autoClasser;
79
81
  this.entry = data;
80
- this.socket.emit("new", { id: this.data._id, type: className });
81
82
  }
82
83
 
83
84
  protected handleNewObject(_data: IsData<T>) {
@@ -86,7 +87,7 @@ export abstract class AutoUpdatedServerObject<
86
87
  protected async setValueInternal(key: string, value: any): Promise<boolean> {
87
88
  try {
88
89
  await (
89
- this.autoClassers[this.className] as AutoUpdateServerManager<any>
90
+ this.autoClasser.classers[this.className] as AutoUpdateServerManager<any>
90
91
  ).model.updateOne({ _id: this.data._id }, { $set: { [key]: value } });
91
92
 
92
93
  const update: ServerUpdateRequest<T> = this.makeUpdate(key, value);
@@ -104,6 +105,36 @@ export abstract class AutoUpdatedServerObject<
104
105
  await this.entry.deleteOne({ _id: this.data._id });
105
106
  this.wipeSelf();
106
107
  }
108
+
109
+ public override async checkAutoStatusChange() {
110
+ if (!this.autoClasser.options?.autoStatusDefinitions) return;
111
+ const statusPath = this.autoClasser.options.autoStatusDefinitions.statusProperty;
112
+ let finalStatus:
113
+ | keyof typeof this.autoClasser.options.autoStatusDefinitions.statusEnum
114
+ | null = "null";
115
+ for (const [currentStatus, statusDef] of Object.entries(
116
+ this.autoClasser.options.autoStatusDefinitions.definitions
117
+ )) {
118
+ finalStatus = currentStatus;
119
+ for (const [key, value] of Object.entries(statusDef)) {
120
+ if (this.getValue(key as any) !== value) {
121
+ finalStatus = null;
122
+ break;
123
+ }
124
+ }
125
+
126
+ if (!finalStatus) continue;
127
+ if(this.autoClasser.options.autoStatusDefinitions.statusEnum[finalStatus] === this.getValue(statusPath as any)) break;
128
+ await this.setValue(
129
+ statusPath as any,
130
+ this.autoClasser.options.autoStatusDefinitions.statusEnum[finalStatus] as any
131
+ );
132
+ break;
133
+ }
134
+ if (!finalStatus)
135
+ throw new Error(`No final status found`);
136
+ }
137
+
107
138
  }
108
139
 
109
140
  export type DocWithProps<T> = Document &
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
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/server-dem/compare/v0.2.21...v0.2.22) (2025-11-10)
6
+
5
7
  ### [0.2.21](https://github.com/Prestizni-Software/server-dem/compare/v0.2.20...v0.2.21) (2025-11-10)
6
8
 
7
9
  ### [0.2.20](https://github.com/Prestizni-Software/server-dem/compare/v0.2.19...v0.2.20) (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.ts";
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prestizni-software/server-dem",
3
- "version": "0.2.21",
3
+ "version": "0.2.22",
4
4
  "description": "An solution for when making http requests is not a good solution",
5
5
  "keywords": [
6
6
  "websockets"
package/server.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as AutoUpdateServerManagerClass from "./AutoUpdateServerManagerClass.ts";
2
- import * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.ts";
3
- import * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.ts";
4
- import * as AutoUpdatedServerObjectClass from "./AutoUpdatedServerObjectClass.ts";
5
- import * as CommonTypes from "./CommonTypes.ts";
1
+ import * as AutoUpdateServerManagerClass from "./AutoUpdateServerManagerClass.js";
2
+ import * as AutoUpdateManagerClass from "./AutoUpdateManagerClass.js";
3
+ import * as AutoUpdatedClientObjectClass from "./AutoUpdatedClientObjectClass.js";
4
+ import * as AutoUpdatedServerObjectClass from "./AutoUpdatedServerObjectClass.js";
5
+ import * as CommonTypes from "./CommonTypes.js";
6
6
 
7
7
  module.exports = {
8
8
  AutoUpdateServerManagerClass,
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, /* Enable constraints that allow a TypeScript project to be used with project references. */
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, /* Enable experimental support for legacy experimental decorators. */
19
- "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
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": "node18", /* Specify what module code is generated. */
30
- "rootDir": "./", /* Specify the root folder within your source files. */
31
- "moduleResolution": "node16", /* Specify how TypeScript looks up a file from a given module specifier. */
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
- "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
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, /* Enable importing .json files. */
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
- "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
58
- "sourceMap": true, /* Create source map files for emitted JavaScript files. */
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", /* Specify an output folder for all emitted files. */
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. */