refactor(simulator): sort exports, switch to node: import syntax for internal
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 14 Feb 2023 00:10:53 +0000 (01:10 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 14 Feb 2023 00:10:53 +0000 (01:10 +0100)
     librairies

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
20 files changed:
rollup.config.mjs
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts
src/charging-station/ChargingStationWorker.ts
src/charging-station/WorkerBroadcastChannel.ts
src/charging-station/ocpp/OCPPIncomingRequestService.ts
src/charging-station/ocpp/index.ts
src/charging-station/ui-server/AbstractUIServer.ts
src/charging-station/ui-server/UIHttpServer.ts
src/charging-station/ui-server/UIServerUtils.ts
src/charging-station/ui-server/UIWebSocketServer.ts
src/performance/PerformanceStatistics.ts
src/utils/index.ts
src/worker/WorkerDynamicPool.ts
src/worker/WorkerFactory.ts
src/worker/WorkerSet.ts
src/worker/WorkerStaticPool.ts
src/worker/WorkerTypes.ts
src/worker/index.ts

index b97343c8c428f4263dbd94b976463b1f9a05f332..87825d8795e3b989c983e425449760f823e18616 100644 (file)
@@ -36,29 +36,29 @@ export default {
     '@mikro-orm/reflection',
     'ajv',
     'ajv-formats',
-    'async_hooks',
     'basic-ftp',
     'chalk',
-    'http',
     'http-status-codes',
     'just-clone',
     'just-merge',
     'mnemonist/lru-map-with-delete',
     'moment',
     'mongodb',
+    'node:async_hooks',
     'node:crypto',
     'node:fs',
+    'node:http',
     'node:path',
+    'node:perf_hooks',
     'node:url',
     'node:util',
-    'perf_hooks',
+    'node:worker_threads',
     'poolifier',
     'proper-lockfile',
     'tar',
     'winston',
     'winston-daily-rotate-file',
     'winston/lib/winston/transports',
-    'worker_threads',
     'ws',
   ],
   plugins: [
index 16fa839d9e99d290214268b3a6c1bc105ed537b2..26b3a2a22357c6d6ae5afce2db6ae3ae347a9608 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { AsyncResource } from 'async_hooks';
+import { AsyncResource } from 'node:async_hooks';
 
 import { type ChargingStation, ChargingStationUtils } from './internal';
 import { BaseError } from '../exception';
index 9ed17131dbf8c94b80fa49c1f1f8c1ca51344bd0..5f20e74b6ca320224e374bc4cbfe63e55dd70dec 100644 (file)
@@ -2,7 +2,7 @@
 
 import path from 'node:path';
 import { fileURLToPath } from 'node:url';
-import { type Worker, isMainThread } from 'worker_threads';
+import { type Worker, isMainThread } from 'node:worker_threads';
 
 import chalk from 'chalk';
 
index dd266cac8c446128e9e8db00b840c06cca56dd29..ef2c3a14b3efaf1ada9495dca50719051b35cfc6 100644 (file)
@@ -4,7 +4,7 @@ import crypto from 'node:crypto';
 import fs from 'node:fs';
 import path from 'node:path';
 import { URL } from 'node:url';
-import { parentPort } from 'worker_threads';
+import { parentPort } from 'node:worker_threads';
 
 import merge from 'just-merge';
 import WebSocket, { type RawData } from 'ws';
index 11d7cb0efa238530a321958f9cf7c0deefa3367a..b4325dbe4c1db192035652089621ffba1eef42c3 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { parentPort, workerData } from 'worker_threads';
+import { parentPort, workerData } from 'node:worker_threads';
 
 import { ThreadWorker } from 'poolifier';
 
index a5a3c40f76b64034624fdc160d127d8dde06f8de..f3c168bdc8f1057611d1b8768d6d1dde0364c627 100644 (file)
@@ -1,4 +1,4 @@
-import { BroadcastChannel } from 'worker_threads';
+import { BroadcastChannel } from 'node:worker_threads';
 
 import type {
   BroadcastChannelRequest,
index ccb7e98aa56d5b1bee69835d039a4c30a1d60eed..bca4809e8d38a2af5fc00ae66d619f73d182d742 100644 (file)
@@ -1,4 +1,4 @@
-import { AsyncResource } from 'async_hooks';
+import { AsyncResource } from 'node:async_hooks';
 
 import Ajv, { type JSONSchemaType } from 'ajv';
 import ajvFormats from 'ajv-formats';
index a7681be65e6a1ad757a2e72cf5e4b50990ed7d70..059c3f70fad646356fa88d142e6e804f0337fec8 100644 (file)
@@ -1,13 +1,13 @@
 export {
-  OCPP20ResponseService,
-  OCPP20RequestService,
   OCPP20IncomingRequestService,
+  OCPP20RequestService,
+  OCPP20ResponseService,
+  OCPP16IncomingRequestService,
+  OCPP16RequestService,
+  OCPP16ResponseService,
   // FIXME: shall not be exported
   OCPP16ServiceUtils,
   OCPPIncomingRequestService,
-  OCPP16ResponseService,
   OCPPRequestService,
   OCPPServiceUtils,
-  OCPP16IncomingRequestService,
-  OCPP16RequestService,
 } from './internal';
index 840d558ce52e958a448488f6018d9896ba16da1c..ca53d558894c5db16449d8534ebc0770307dbea7 100644 (file)
@@ -1,4 +1,4 @@
-import { type IncomingMessage, Server, type ServerResponse } from 'http';
+import { type IncomingMessage, Server, type ServerResponse } from 'node:http';
 
 import type { WebSocket } from 'ws';
 
index 4a7e30b8ae3dc177e2b54cf16c52a4065ee9e3b3..b52df5721bafad4a4b9810ad68791d7b9ca8b68c 100644 (file)
@@ -1,4 +1,4 @@
-import type { IncomingMessage, RequestListener, ServerResponse } from 'http';
+import type { IncomingMessage, RequestListener, ServerResponse } from 'node:http';
 
 import { StatusCodes } from 'http-status-codes';
 
index b590594989e6d410e5e7d5c0621204ec774a54b7..056d31fa8e0f0b37a9ec6101a0418b6d1c3d5fc4 100644 (file)
@@ -1,4 +1,4 @@
-import type { IncomingMessage } from 'http';
+import type { IncomingMessage } from 'node:http';
 
 import { Protocol, ProtocolVersion } from '../../types';
 import { Utils, logger } from '../../utils';
index 5017b746fd5b12c09a5297a73c8dd860d7ef1e7c..291e92631bc2864dda4a77c18fd702cf2763263c 100644 (file)
@@ -1,5 +1,5 @@
-import type { IncomingMessage } from 'http';
-import type { Duplex } from 'stream';
+import type { IncomingMessage } from 'node:http';
+import type { Duplex } from 'node:stream';
 
 import { StatusCodes } from 'http-status-codes';
 import WebSocket, { type RawData, WebSocketServer } from 'ws';
index 3ec065877281374cbab7dbe9e72aa744f0769587..909f6345ec0eb7e544c57ca6d96494f7e22103ea 100644 (file)
@@ -1,8 +1,8 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
+import { type PerformanceEntry, PerformanceObserver, performance } from 'node:perf_hooks';
 import type { URL } from 'node:url';
-import { PerformanceEntry, PerformanceObserver, performance } from 'perf_hooks';
-import { parentPort } from 'worker_threads';
+import { parentPort } from 'node:worker_threads';
 
 import { MessageChannelUtils } from '../charging-station';
 import {
index d7ae66b83b7ffc8874bfa5f12ffd3426d10c301f..ff5de5a1d9e72bae5c1d48fcb9be721fc18c006d 100644 (file)
@@ -1,10 +1,10 @@
 export {
-  Constants,
-  FileUtils,
+  ACElectricUtils,
   CircularArray,
   Configuration,
-  ACElectricUtils,
+  Constants,
   DCElectricUtils,
-  logger,
+  FileUtils,
   Utils,
+  logger,
 } from './internal';
index 889ae457de9d93626d80651d33ad64800529888c..8a7e6e558f170c42e00ab22c257507370b50e96e 100644 (file)
@@ -1,4 +1,4 @@
-import type { Worker } from 'worker_threads';
+import type { Worker } from 'node:worker_threads';
 
 import { DynamicThreadPool, type ErrorHandler, type ExitHandler } from 'poolifier';
 
index fb9a26f1ec2d675c9887ebb96a283a6c252be1f1..e590ad14749974bacd9b0c6aa4022164d3323b48 100644 (file)
@@ -1,4 +1,4 @@
-import { type Worker, isMainThread } from 'worker_threads';
+import { type Worker, isMainThread } from 'node:worker_threads';
 
 import type { PoolOptions } from 'poolifier';
 
index a79db16e0313deef9270cdb7a61b6e16398376c0..a8a06a39a764fdc105f886e34ad8aab1d2075119 100644 (file)
@@ -1,6 +1,6 @@
 // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
 
-import { Worker } from 'worker_threads';
+import { Worker } from 'node:worker_threads';
 
 import { WorkerAbstract } from './WorkerAbstract';
 import {
index 58e4c65a072091ced7c0fff24bd68d09bddf7bdc..8a717ad8b81f7010d27bd4a6f83ae0b781e8f836 100644 (file)
@@ -1,4 +1,4 @@
-import type { Worker } from 'worker_threads';
+import type { Worker } from 'node:worker_threads';
 
 import { type ErrorHandler, type ExitHandler, FixedThreadPool } from 'poolifier';
 
index 9204eadce8456c5c17c311c8c8ce6574e6f05a29..f79be0b28d866861d826b9cdafe3596561ecd9fe 100644 (file)
@@ -1,4 +1,4 @@
-import type { Worker } from 'worker_threads';
+import type { Worker } from 'node:worker_threads';
 
 import type { PoolOptions } from 'poolifier';
 
index 036ddaf168f69253e2618153617ad6f75bb38b49..2ad6671b610d45c9ce5c503d43647fbfdfa4ff6d 100644 (file)
@@ -2,9 +2,9 @@ export type { WorkerAbstract } from './WorkerAbstract';
 export { WorkerConstants } from './WorkerConstants';
 export { WorkerFactory } from './WorkerFactory';
 export {
-  WorkerProcessType,
+  type MessageHandler,
   type WorkerData,
   type WorkerMessage,
   WorkerMessageEvents,
-  type MessageHandler,
+  WorkerProcessType,
 } from './WorkerTypes';