build(simulator): switch to TS 5.x.x
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 00:01:29 +0000 (01:01 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 18 Mar 2023 00:01:29 +0000 (01:01 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
package-lock.json
package.json
src/charging-station/ChargingStation.ts
src/performance/storage/MikroOrmStorage.ts
src/types/index.ts
src/types/internal.ts
tsconfig.json

index 2484fc5a5620b10e28861a609bfa16a781858d9a..032dba7745c5a2fa3113e262c413dc898ad01af3 100644 (file)
@@ -75,7 +75,7 @@
         "rollup-plugin-delete": "^2.0.0",
         "semver": "^7.3.8",
         "ts-node": "^10.9.1",
-        "typescript": "^4.9.5"
+        "typescript": "^5.0.2"
       },
       "engines": {
         "node": ">=16.0.0",
         "node": ">=8"
       }
     },
+    "node_modules/@commitlint/load/node_modules/typescript": {
+      "version": "4.9.5",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
+      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "dev": true,
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
+      },
+      "engines": {
+        "node": ">=4.2.0"
+      }
+    },
     "node_modules/@commitlint/message": {
       "version": "17.4.2",
       "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-17.4.2.tgz",
       }
     },
     "node_modules/typescript": {
-      "version": "4.9.5",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
-      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
+      "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
       "dev": true,
       "bin": {
         "tsc": "bin/tsc",
         "tsserver": "bin/tsserver"
       },
       "engines": {
-        "node": ">=4.2.0"
+        "node": ">=12.20"
       }
     },
     "node_modules/uglify-js": {
           "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz",
           "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==",
           "dev": true
+        },
+        "typescript": {
+          "version": "4.9.5",
+          "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
+          "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+          "dev": true
         }
       }
     },
       }
     },
     "typescript": {
-      "version": "4.9.5",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
-      "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
+      "version": "5.0.2",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz",
+      "integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==",
       "dev": true
     },
     "uglify-js": {
index 3d7a11d9b1cc8f6bba1782ace96b25b09ac17914..2092bf303120a3f69cde7fd616425f3f13b5350d 100644 (file)
     "rollup-plugin-delete": "^2.0.0",
     "semver": "^7.3.8",
     "ts-node": "^10.9.1",
-    "typescript": "^4.9.5"
+    "typescript": "^5.0.2"
   }
 }
index c4388061c093189632263a54f2c384adbb8fcd0f..9125c377c2ae76e5750b66f9cf62b5dcdaabe600 100644 (file)
@@ -47,7 +47,7 @@ import {
   type ChargingStationOcppConfiguration,
   type ChargingStationTemplate,
   ConnectorPhaseRotation,
-  ConnectorStatus,
+  type ConnectorStatus,
   ConnectorStatusEnum,
   CurrentType,
   type ErrorCallback,
index 47823c8052d94800f779f85bfe2e182c12f62396..72fc82e87e21d1fb990553fd2b12b7328ed436a0 100644 (file)
@@ -1,6 +1,12 @@
 // Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { Configuration, Connection, IDatabaseDriver, MikroORM, Options } from '@mikro-orm/core';
+import {
+  Configuration,
+  Connection,
+  type IDatabaseDriver,
+  MikroORM,
+  type Options,
+} from '@mikro-orm/core';
 import { TsMorphMetadataProvider } from '@mikro-orm/reflection';
 
 import {
index 406cbd001bd21cd444b2211755f3c907856aa8fe..a7c7d24efbd8638e004052866c86154885e742ae 100644 (file)
@@ -45,7 +45,7 @@ export {
   type ConfigurationKeyType,
   ConfigurationStatus,
   ConnectorPhaseRotation,
-  ConnectorStatus,
+  type ConnectorStatus,
   ConnectorStatusEnum,
   CurrentType,
   DBName,
index c7a141a4972f36c6cbc552cdc89a90b428d125da..3d9fa5cbbfe3be4b1df314560def4e9018a578d2 100644 (file)
@@ -15,11 +15,11 @@ export * from './ocpp/ChargePointErrorCode';
 export * from './ocpp/ChargingProfile';
 export * from './ocpp/Configuration';
 export * from './ocpp/ConnectorStatusEnum';
-export * from './ocpp/ErrorType';
+export { ErrorType } from './ocpp/ErrorType';
 export * from './ocpp/MessageType';
 export * from './ocpp/MeterValues';
-export * from './ocpp/OCPPProtocol';
-export * from './ocpp/OCPPVersion';
+export { OCPPProtocol } from './ocpp/OCPPProtocol';
+export { OCPPVersion } from './ocpp/OCPPVersion';
 export * from './ocpp/Requests';
 export * from './ocpp/Responses';
 export * from './ocpp/Transaction';
@@ -27,18 +27,18 @@ export * from './orm/entities/PerformanceData';
 export * from './orm/entities/PerformanceRecord';
 export * from './AutomaticTransactionGenerator';
 export * from './ChargingStationConfiguration';
-export * from './ChargingStationInfo';
+export type { ChargingStationInfo, ChargingStationInfoConfiguration } from './ChargingStationInfo';
 export * from './ChargingStationOcppConfiguration';
 export * from './ChargingStationTemplate';
 export * from './ChargingStationWorker';
 export * from './ConfigurationData';
-export * from './ConnectorStatus';
-export * from './EmptyObject';
-export * from './Error';
-export * from './FileType';
-export * from './JsonType';
+export type { ConnectorStatus } from './ConnectorStatus';
+export type { EmptyObject } from './EmptyObject';
+export type { HandleErrorParams } from './Error';
+export { FileType } from './FileType';
+export type { JsonType, JsonObject } from './JsonType';
 export * from './MeasurandPerPhaseSampledValueTemplates';
-export * from './MeasurandValues';
+export type { MeasurandValues } from './MeasurandValues';
 export * from './Statistics';
 export * from './Storage';
 export * from './UIProtocol';
index 0944a20d2e668c7a64c63341c04717c1144ec93f..82b4e8ef180d3af091e22545622b3e113146adfb 100644 (file)
@@ -23,6 +23,7 @@
     "importHelpers": true,                    /* Import emit helpers from 'tslib'. */
     // "downlevelIteration": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
     // "isolatedModules": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
+    "verbatimModuleSyntax": true,
 
     /* Strict Type-Checking Options */
     // "strict": true,                        /* Enable all strict type-checking options. */
@@ -33,7 +34,6 @@
     // "strictPropertyInitialization": true,  /* Enable strict checking of property initialization in classes. */
     // "noImplicitThis": true,                /* Raise error on 'this' expressions with an implied 'any' type. */
     // "alwaysStrict": true,                  /* Parse in strict mode and emit "use strict" for each source file. */
-    "importsNotUsedAsValues": "error",        /* Enforce using `import type` instead of `import` for types */
 
     /* Additional Checks */
     // "noUnusedLocals": true,                /* Report errors on unused locals. */