@webiny/stdlib 0.0.1
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/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +60 -0
- package/dist/browser/features/LocalStorageCache/LocalStorageCache.d.ts +26 -0
- package/dist/browser/features/LocalStorageCache/LocalStorageCache.d.ts.map +1 -0
- package/dist/browser/features/LocalStorageCache/LocalStorageCache.js +159 -0
- package/dist/browser/features/LocalStorageCache/LocalStorageCache.js.map +1 -0
- package/dist/browser/features/LocalStorageCache/errors.d.ts +26 -0
- package/dist/browser/features/LocalStorageCache/errors.d.ts.map +1 -0
- package/dist/browser/features/LocalStorageCache/errors.js +23 -0
- package/dist/browser/features/LocalStorageCache/errors.js.map +1 -0
- package/dist/browser/features/LocalStorageCache/feature.d.ts +6 -0
- package/dist/browser/features/LocalStorageCache/feature.d.ts.map +1 -0
- package/dist/browser/features/LocalStorageCache/feature.js +10 -0
- package/dist/browser/features/LocalStorageCache/feature.js.map +1 -0
- package/dist/browser/features/LocalStorageCache/index.d.ts +4 -0
- package/dist/browser/features/LocalStorageCache/index.d.ts.map +1 -0
- package/dist/browser/features/LocalStorageCache/index.js +4 -0
- package/dist/browser/features/LocalStorageCache/index.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +2 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/common/core/BaseError.d.ts +13 -0
- package/dist/common/core/BaseError.d.ts.map +1 -0
- package/dist/common/core/BaseError.js +8 -0
- package/dist/common/core/BaseError.js.map +1 -0
- package/dist/common/core/Result.d.ts +103 -0
- package/dist/common/core/Result.d.ts.map +1 -0
- package/dist/common/core/Result.js +127 -0
- package/dist/common/core/Result.js.map +1 -0
- package/dist/common/core/ResultAsync.d.ts +17 -0
- package/dist/common/core/ResultAsync.d.ts.map +1 -0
- package/dist/common/core/ResultAsync.js +62 -0
- package/dist/common/core/ResultAsync.js.map +1 -0
- package/dist/common/core/createAbstraction.d.ts +4 -0
- package/dist/common/core/createAbstraction.d.ts.map +1 -0
- package/dist/common/core/createAbstraction.js +5 -0
- package/dist/common/core/createAbstraction.js.map +1 -0
- package/dist/common/core/createFeature.d.ts +10 -0
- package/dist/common/core/createFeature.d.ts.map +1 -0
- package/dist/common/core/createFeature.js +9 -0
- package/dist/common/core/createFeature.js.map +1 -0
- package/dist/common/core/index.d.ts +7 -0
- package/dist/common/core/index.d.ts.map +1 -0
- package/dist/common/core/index.js +6 -0
- package/dist/common/core/index.js.map +1 -0
- package/dist/common/features/Cache/AsyncMemoryCache.d.ts +23 -0
- package/dist/common/features/Cache/AsyncMemoryCache.d.ts.map +1 -0
- package/dist/common/features/Cache/AsyncMemoryCache.js +90 -0
- package/dist/common/features/Cache/AsyncMemoryCache.js.map +1 -0
- package/dist/common/features/Cache/AsyncMemoryCacheFeature.d.ts +6 -0
- package/dist/common/features/Cache/AsyncMemoryCacheFeature.d.ts.map +1 -0
- package/dist/common/features/Cache/AsyncMemoryCacheFeature.js +10 -0
- package/dist/common/features/Cache/AsyncMemoryCacheFeature.js.map +1 -0
- package/dist/common/features/Cache/MemoryCache.d.ts +23 -0
- package/dist/common/features/Cache/MemoryCache.d.ts.map +1 -0
- package/dist/common/features/Cache/MemoryCache.js +75 -0
- package/dist/common/features/Cache/MemoryCache.js.map +1 -0
- package/dist/common/features/Cache/MemoryCacheFeature.d.ts +6 -0
- package/dist/common/features/Cache/MemoryCacheFeature.d.ts.map +1 -0
- package/dist/common/features/Cache/MemoryCacheFeature.js +10 -0
- package/dist/common/features/Cache/MemoryCacheFeature.js.map +1 -0
- package/dist/common/features/Cache/abstractions/AsyncCache.d.ts +39 -0
- package/dist/common/features/Cache/abstractions/AsyncCache.d.ts.map +1 -0
- package/dist/common/features/Cache/abstractions/AsyncCache.js +3 -0
- package/dist/common/features/Cache/abstractions/AsyncCache.js.map +1 -0
- package/dist/common/features/Cache/abstractions/Cache.d.ts +39 -0
- package/dist/common/features/Cache/abstractions/Cache.d.ts.map +1 -0
- package/dist/common/features/Cache/abstractions/Cache.js +3 -0
- package/dist/common/features/Cache/abstractions/Cache.js.map +1 -0
- package/dist/common/features/Cache/abstractions/CacheError.d.ts +5 -0
- package/dist/common/features/Cache/abstractions/CacheError.d.ts.map +1 -0
- package/dist/common/features/Cache/abstractions/CacheError.js +5 -0
- package/dist/common/features/Cache/abstractions/CacheError.js.map +1 -0
- package/dist/common/features/Cache/abstractions/index.d.ts +4 -0
- package/dist/common/features/Cache/abstractions/index.d.ts.map +1 -0
- package/dist/common/features/Cache/abstractions/index.js +4 -0
- package/dist/common/features/Cache/abstractions/index.js.map +1 -0
- package/dist/common/features/Cache/index.d.ts +8 -0
- package/dist/common/features/Cache/index.d.ts.map +1 -0
- package/dist/common/features/Cache/index.js +6 -0
- package/dist/common/features/Cache/index.js.map +1 -0
- package/dist/common/features/Logger/ConsoleLogger.d.ts +28 -0
- package/dist/common/features/Logger/ConsoleLogger.d.ts.map +1 -0
- package/dist/common/features/Logger/ConsoleLogger.js +84 -0
- package/dist/common/features/Logger/ConsoleLogger.js.map +1 -0
- package/dist/common/features/Logger/abstractions/ConsoleLoggerConfig.d.ts +27 -0
- package/dist/common/features/Logger/abstractions/ConsoleLoggerConfig.d.ts.map +1 -0
- package/dist/common/features/Logger/abstractions/ConsoleLoggerConfig.js +3 -0
- package/dist/common/features/Logger/abstractions/ConsoleLoggerConfig.js.map +1 -0
- package/dist/common/features/Logger/abstractions/Logger.d.ts +20 -0
- package/dist/common/features/Logger/abstractions/Logger.d.ts.map +1 -0
- package/dist/common/features/Logger/abstractions/Logger.js +3 -0
- package/dist/common/features/Logger/abstractions/Logger.js.map +1 -0
- package/dist/common/features/Logger/abstractions/index.d.ts +3 -0
- package/dist/common/features/Logger/abstractions/index.d.ts.map +1 -0
- package/dist/common/features/Logger/abstractions/index.js +3 -0
- package/dist/common/features/Logger/abstractions/index.js.map +1 -0
- package/dist/common/features/Logger/feature.d.ts +9 -0
- package/dist/common/features/Logger/feature.d.ts.map +1 -0
- package/dist/common/features/Logger/feature.js +13 -0
- package/dist/common/features/Logger/feature.js.map +1 -0
- package/dist/common/features/Logger/index.d.ts +5 -0
- package/dist/common/features/Logger/index.d.ts.map +1 -0
- package/dist/common/features/Logger/index.js +5 -0
- package/dist/common/features/Logger/index.js.map +1 -0
- package/dist/common/index.d.ts +11 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +9 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/utils/boolean.d.ts +7 -0
- package/dist/common/utils/boolean.d.ts.map +1 -0
- package/dist/common/utils/boolean.js +22 -0
- package/dist/common/utils/boolean.js.map +1 -0
- package/dist/common/utils/dotProp.d.ts +23 -0
- package/dist/common/utils/dotProp.d.ts.map +1 -0
- package/dist/common/utils/dotProp.js +45 -0
- package/dist/common/utils/dotProp.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/node/features/DirectoryTool/DirectoryTool.d.ts +24 -0
- package/dist/node/features/DirectoryTool/DirectoryTool.d.ts.map +1 -0
- package/dist/node/features/DirectoryTool/DirectoryTool.js +83 -0
- package/dist/node/features/DirectoryTool/DirectoryTool.js.map +1 -0
- package/dist/node/features/DirectoryTool/abstractions/DirectoryTool.d.ts +32 -0
- package/dist/node/features/DirectoryTool/abstractions/DirectoryTool.d.ts.map +1 -0
- package/dist/node/features/DirectoryTool/abstractions/DirectoryTool.js +3 -0
- package/dist/node/features/DirectoryTool/abstractions/DirectoryTool.js.map +1 -0
- package/dist/node/features/DirectoryTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/DirectoryTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/DirectoryTool/abstractions/index.js +2 -0
- package/dist/node/features/DirectoryTool/abstractions/index.js.map +1 -0
- package/dist/node/features/DirectoryTool/feature.d.ts +5 -0
- package/dist/node/features/DirectoryTool/feature.d.ts.map +1 -0
- package/dist/node/features/DirectoryTool/feature.js +9 -0
- package/dist/node/features/DirectoryTool/feature.js.map +1 -0
- package/dist/node/features/DirectoryTool/index.d.ts +4 -0
- package/dist/node/features/DirectoryTool/index.d.ts.map +1 -0
- package/dist/node/features/DirectoryTool/index.js +4 -0
- package/dist/node/features/DirectoryTool/index.js.map +1 -0
- package/dist/node/features/FileTool/FileTool.d.ts +26 -0
- package/dist/node/features/FileTool/FileTool.d.ts.map +1 -0
- package/dist/node/features/FileTool/FileTool.js +71 -0
- package/dist/node/features/FileTool/FileTool.js.map +1 -0
- package/dist/node/features/FileTool/abstractions/FileTool.d.ts +15 -0
- package/dist/node/features/FileTool/abstractions/FileTool.d.ts.map +1 -0
- package/dist/node/features/FileTool/abstractions/FileTool.js +3 -0
- package/dist/node/features/FileTool/abstractions/FileTool.js.map +1 -0
- package/dist/node/features/FileTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/FileTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/FileTool/abstractions/index.js +2 -0
- package/dist/node/features/FileTool/abstractions/index.js.map +1 -0
- package/dist/node/features/FileTool/feature.d.ts +5 -0
- package/dist/node/features/FileTool/feature.d.ts.map +1 -0
- package/dist/node/features/FileTool/feature.js +9 -0
- package/dist/node/features/FileTool/feature.js.map +1 -0
- package/dist/node/features/FileTool/index.d.ts +4 -0
- package/dist/node/features/FileTool/index.d.ts.map +1 -0
- package/dist/node/features/FileTool/index.js +4 -0
- package/dist/node/features/FileTool/index.js.map +1 -0
- package/dist/node/features/JsonFileTool/JsonFileTool.d.ts +19 -0
- package/dist/node/features/JsonFileTool/JsonFileTool.d.ts.map +1 -0
- package/dist/node/features/JsonFileTool/JsonFileTool.js +43 -0
- package/dist/node/features/JsonFileTool/JsonFileTool.js.map +1 -0
- package/dist/node/features/JsonFileTool/abstractions/JsonFileTool.d.ts +17 -0
- package/dist/node/features/JsonFileTool/abstractions/JsonFileTool.d.ts.map +1 -0
- package/dist/node/features/JsonFileTool/abstractions/JsonFileTool.js +3 -0
- package/dist/node/features/JsonFileTool/abstractions/JsonFileTool.js.map +1 -0
- package/dist/node/features/JsonFileTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/JsonFileTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/JsonFileTool/abstractions/index.js +2 -0
- package/dist/node/features/JsonFileTool/abstractions/index.js.map +1 -0
- package/dist/node/features/JsonFileTool/feature.d.ts +5 -0
- package/dist/node/features/JsonFileTool/feature.d.ts.map +1 -0
- package/dist/node/features/JsonFileTool/feature.js +9 -0
- package/dist/node/features/JsonFileTool/feature.js.map +1 -0
- package/dist/node/features/JsonFileTool/index.d.ts +4 -0
- package/dist/node/features/JsonFileTool/index.d.ts.map +1 -0
- package/dist/node/features/JsonFileTool/index.js +4 -0
- package/dist/node/features/JsonFileTool/index.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/LineAccumulator.d.ts +13 -0
- package/dist/node/features/NdJsonReaderTool/LineAccumulator.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/LineAccumulator.js +68 -0
- package/dist/node/features/NdJsonReaderTool/LineAccumulator.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/NdJsonReaderTool.d.ts +22 -0
- package/dist/node/features/NdJsonReaderTool/NdJsonReaderTool.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/NdJsonReaderTool.js +73 -0
- package/dist/node/features/NdJsonReaderTool/NdJsonReaderTool.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/NdJsonReaderTool.d.ts +41 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/NdJsonReaderTool.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/NdJsonReaderTool.js +3 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/NdJsonReaderTool.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/index.js +2 -0
- package/dist/node/features/NdJsonReaderTool/abstractions/index.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/feature.d.ts +5 -0
- package/dist/node/features/NdJsonReaderTool/feature.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/feature.js +9 -0
- package/dist/node/features/NdJsonReaderTool/feature.js.map +1 -0
- package/dist/node/features/NdJsonReaderTool/index.d.ts +4 -0
- package/dist/node/features/NdJsonReaderTool/index.d.ts.map +1 -0
- package/dist/node/features/NdJsonReaderTool/index.js +4 -0
- package/dist/node/features/NdJsonReaderTool/index.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFile.d.ts +67 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFile.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFile.js +91 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFile.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFileTool.d.ts +23 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFileTool.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFileTool.js +75 -0
- package/dist/node/features/PackageJsonFileTool/PackageJsonFileTool.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.d.ts +40 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.js +3 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/index.js +2 -0
- package/dist/node/features/PackageJsonFileTool/abstractions/index.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/feature.d.ts +5 -0
- package/dist/node/features/PackageJsonFileTool/feature.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/feature.js +9 -0
- package/dist/node/features/PackageJsonFileTool/feature.js.map +1 -0
- package/dist/node/features/PackageJsonFileTool/index.d.ts +5 -0
- package/dist/node/features/PackageJsonFileTool/index.d.ts.map +1 -0
- package/dist/node/features/PackageJsonFileTool/index.js +5 -0
- package/dist/node/features/PackageJsonFileTool/index.js.map +1 -0
- package/dist/node/features/PathTool/PathTool.d.ts +14 -0
- package/dist/node/features/PathTool/PathTool.d.ts.map +1 -0
- package/dist/node/features/PathTool/PathTool.js +38 -0
- package/dist/node/features/PathTool/PathTool.js.map +1 -0
- package/dist/node/features/PathTool/abstractions/PathTool.d.ts +23 -0
- package/dist/node/features/PathTool/abstractions/PathTool.d.ts.map +1 -0
- package/dist/node/features/PathTool/abstractions/PathTool.js +3 -0
- package/dist/node/features/PathTool/abstractions/PathTool.js.map +1 -0
- package/dist/node/features/PathTool/abstractions/index.d.ts +2 -0
- package/dist/node/features/PathTool/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/PathTool/abstractions/index.js +2 -0
- package/dist/node/features/PathTool/abstractions/index.js.map +1 -0
- package/dist/node/features/PathTool/errors.d.ts +12 -0
- package/dist/node/features/PathTool/errors.d.ts.map +1 -0
- package/dist/node/features/PathTool/errors.js +9 -0
- package/dist/node/features/PathTool/errors.js.map +1 -0
- package/dist/node/features/PathTool/feature.d.ts +5 -0
- package/dist/node/features/PathTool/feature.d.ts.map +1 -0
- package/dist/node/features/PathTool/feature.js +9 -0
- package/dist/node/features/PathTool/feature.js.map +1 -0
- package/dist/node/features/PathTool/index.d.ts +5 -0
- package/dist/node/features/PathTool/index.d.ts.map +1 -0
- package/dist/node/features/PathTool/index.js +5 -0
- package/dist/node/features/PathTool/index.js.map +1 -0
- package/dist/node/features/PinoLogger/PinoLogger.d.ts +27 -0
- package/dist/node/features/PinoLogger/PinoLogger.d.ts.map +1 -0
- package/dist/node/features/PinoLogger/PinoLogger.js +152 -0
- package/dist/node/features/PinoLogger/PinoLogger.js.map +1 -0
- package/dist/node/features/PinoLogger/abstractions/PinoLoggerConfig.d.ts +24 -0
- package/dist/node/features/PinoLogger/abstractions/PinoLoggerConfig.d.ts.map +1 -0
- package/dist/node/features/PinoLogger/abstractions/PinoLoggerConfig.js +3 -0
- package/dist/node/features/PinoLogger/abstractions/PinoLoggerConfig.js.map +1 -0
- package/dist/node/features/PinoLogger/abstractions/index.d.ts +2 -0
- package/dist/node/features/PinoLogger/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/PinoLogger/abstractions/index.js +2 -0
- package/dist/node/features/PinoLogger/abstractions/index.js.map +1 -0
- package/dist/node/features/PinoLogger/feature.d.ts +9 -0
- package/dist/node/features/PinoLogger/feature.d.ts.map +1 -0
- package/dist/node/features/PinoLogger/feature.js +13 -0
- package/dist/node/features/PinoLogger/feature.js.map +1 -0
- package/dist/node/features/PinoLogger/index.d.ts +4 -0
- package/dist/node/features/PinoLogger/index.d.ts.map +1 -0
- package/dist/node/features/PinoLogger/index.js +4 -0
- package/dist/node/features/PinoLogger/index.js.map +1 -0
- package/dist/node/features/ReadStreamFactory/ReadStreamFactory.d.ts +11 -0
- package/dist/node/features/ReadStreamFactory/ReadStreamFactory.d.ts.map +1 -0
- package/dist/node/features/ReadStreamFactory/ReadStreamFactory.js +27 -0
- package/dist/node/features/ReadStreamFactory/ReadStreamFactory.js.map +1 -0
- package/dist/node/features/ReadStreamFactory/abstractions/ReadStreamFactory.d.ts +21 -0
- package/dist/node/features/ReadStreamFactory/abstractions/ReadStreamFactory.d.ts.map +1 -0
- package/dist/node/features/ReadStreamFactory/abstractions/ReadStreamFactory.js +3 -0
- package/dist/node/features/ReadStreamFactory/abstractions/ReadStreamFactory.js.map +1 -0
- package/dist/node/features/ReadStreamFactory/abstractions/index.d.ts +2 -0
- package/dist/node/features/ReadStreamFactory/abstractions/index.d.ts.map +1 -0
- package/dist/node/features/ReadStreamFactory/abstractions/index.js +2 -0
- package/dist/node/features/ReadStreamFactory/abstractions/index.js.map +1 -0
- package/dist/node/features/ReadStreamFactory/feature.d.ts +5 -0
- package/dist/node/features/ReadStreamFactory/feature.d.ts.map +1 -0
- package/dist/node/features/ReadStreamFactory/feature.js +9 -0
- package/dist/node/features/ReadStreamFactory/feature.js.map +1 -0
- package/dist/node/features/ReadStreamFactory/index.d.ts +4 -0
- package/dist/node/features/ReadStreamFactory/index.d.ts.map +1 -0
- package/dist/node/features/ReadStreamFactory/index.js +4 -0
- package/dist/node/features/ReadStreamFactory/index.js.map +1 -0
- package/dist/node/index.d.ts +9 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +9 -0
- package/dist/node/index.js.map +1 -0
- package/dist/package.json +58 -0
- package/package.json +61 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { PackageJson } from "type-fest";
|
|
2
|
+
import type { PackageJsonFile } from "../PackageJsonFile.js";
|
|
3
|
+
export interface IPackageJsonFileTool {
|
|
4
|
+
/**
|
|
5
|
+
* Read and validate a package.json file at the given path.
|
|
6
|
+
* Returns null if the file does not exist.
|
|
7
|
+
* Throws on JSON parse failure or schema validation error.
|
|
8
|
+
*/
|
|
9
|
+
read(path: string): PackageJsonFile.Interface | null;
|
|
10
|
+
/**
|
|
11
|
+
* Read and validate a package.json file at the given path.
|
|
12
|
+
* Throws if the file does not exist, JSON parse fails, or validation fails.
|
|
13
|
+
*/
|
|
14
|
+
readOrThrow(path: string): PackageJsonFile.Interface;
|
|
15
|
+
/**
|
|
16
|
+
* Serialize `data` as formatted JSON and write it to `path`.
|
|
17
|
+
* Creates parent directories as needed. Logs a warning and returns without throwing on failure.
|
|
18
|
+
*/
|
|
19
|
+
write(path: string, data: PackageJson): void;
|
|
20
|
+
/**
|
|
21
|
+
* Serialize `file.raw` as formatted JSON and write it to `file.path`.
|
|
22
|
+
* Creates parent directories as needed. Logs a warning and returns without throwing on failure.
|
|
23
|
+
*/
|
|
24
|
+
write(file: PackageJsonFile.Interface): void;
|
|
25
|
+
/**
|
|
26
|
+
* Serialize `data` as formatted JSON and write it to `path`.
|
|
27
|
+
* Creates parent directories as needed. Throws if the write fails.
|
|
28
|
+
*/
|
|
29
|
+
writeOrThrow(path: string, data: PackageJson): void;
|
|
30
|
+
/**
|
|
31
|
+
* Serialize `file.raw` as formatted JSON and write it to `file.path`.
|
|
32
|
+
* Creates parent directories as needed. Throws if the write fails.
|
|
33
|
+
*/
|
|
34
|
+
writeOrThrow(file: PackageJsonFile.Interface): void;
|
|
35
|
+
}
|
|
36
|
+
export declare const PackageJsonFileTool: import("@webiny/di").Abstraction<IPackageJsonFileTool>;
|
|
37
|
+
export declare namespace PackageJsonFileTool {
|
|
38
|
+
type Interface = IPackageJsonFileTool;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=PackageJsonFileTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PackageJsonFileTool.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,oBAAoB;IACjC;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC,SAAS,GAAG,IAAI,CAAC;IAErD;;;OAGG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAAC,SAAS,CAAC;IAErD;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7C;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,GAAG,IAAI,CAAC;IAE7C;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;IACpD;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,GAAG,IAAI,CAAC;CACvD;AAED,eAAO,MAAM,mBAAmB,wDAE/B,CAAC;AAEF,yBAAiB,mBAAmB,CAAC;IACjC,KAAY,SAAS,GAAG,oBAAoB,CAAC;CAChD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PackageJsonFileTool.js","sourceRoot":"","sources":["../../../../../src/node/features/PackageJsonFileTool/abstractions/PackageJsonFileTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAyCtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAChD,0BAA0B,CAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PackageJsonFileTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/node/features/PackageJsonFileTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PackageJsonFileTool/feature.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B;;;CAKrC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createFeature } from "../../../common/index.js";
|
|
2
|
+
import { PackageJsonFileTool } from "./PackageJsonFileTool.js";
|
|
3
|
+
export const PackageJsonFileToolFeature = createFeature({
|
|
4
|
+
name: "Node/PackageJsonFileToolFeature",
|
|
5
|
+
register(container) {
|
|
6
|
+
container.register(PackageJsonFileTool).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/node/features/PackageJsonFileTool/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAE/D,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC;IACpD,IAAI,EAAE,iCAAiC;IACvC,QAAQ,CAAC,SAAS;QACd,SAAS,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAC/D,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PackageJsonFileTool } from "./abstractions/index.js";
|
|
2
|
+
export { PackageJsonFileToolFeature } from "./feature.js";
|
|
3
|
+
export { createPackageJsonFileTool, type CreatePackageJsonFileToolParams } from "./PackageJsonFileTool.js";
|
|
4
|
+
export { PackageJsonFile } from "./PackageJsonFile.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PackageJsonFileTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,yBAAyB,EACzB,KAAK,+BAA+B,EACvC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { PackageJsonFileTool } from "./abstractions/index.js";
|
|
2
|
+
export { PackageJsonFileToolFeature } from "./feature.js";
|
|
3
|
+
export { createPackageJsonFileTool } from "./PackageJsonFileTool.js";
|
|
4
|
+
export { PackageJsonFile } from "./PackageJsonFile.js";
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/features/PackageJsonFileTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EACH,yBAAyB,EAE5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PathTool as PathToolAbstraction } from "./abstractions/PathTool.js";
|
|
2
|
+
declare class PathToolImpl implements PathToolAbstraction.Interface {
|
|
3
|
+
join(...paths: string[]): string;
|
|
4
|
+
resolve(...paths: string[]): string;
|
|
5
|
+
dirname(path: string): string;
|
|
6
|
+
basename(path: string, ext?: string): string;
|
|
7
|
+
resolvePackageFile(specifier: string): string;
|
|
8
|
+
}
|
|
9
|
+
export declare const PathTool: typeof PathToolImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/PathTool.js").IPathTool>;
|
|
11
|
+
};
|
|
12
|
+
export declare function createPathTool(): PathToolAbstraction.Interface;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=PathTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTool.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PathTool/PathTool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAG7E,cAAM,YAAa,YAAW,mBAAmB,CAAC,SAAS;IAChD,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEtC;IAEM,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAEzC;IAEM,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnC;IAEM,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;IAEM,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUnD;CACJ;AAED,eAAO,MAAM,QAAQ;;CAGnB,CAAC;AAEH,wBAAgB,cAAc,IAAI,mBAAmB,CAAC,SAAS,CAE9D"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { join, resolve, dirname, basename } from "node:path";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { PathTool as PathToolAbstraction } from "./abstractions/PathTool.js";
|
|
4
|
+
import { PackageNotFoundError } from "./errors.js";
|
|
5
|
+
class PathToolImpl {
|
|
6
|
+
join(...paths) {
|
|
7
|
+
return join(...paths);
|
|
8
|
+
}
|
|
9
|
+
resolve(...paths) {
|
|
10
|
+
return resolve(...paths);
|
|
11
|
+
}
|
|
12
|
+
dirname(path) {
|
|
13
|
+
return dirname(path);
|
|
14
|
+
}
|
|
15
|
+
basename(path, ext) {
|
|
16
|
+
return basename(path, ext);
|
|
17
|
+
}
|
|
18
|
+
resolvePackageFile(specifier) {
|
|
19
|
+
const require = createRequire(join(process.cwd(), "index.js"));
|
|
20
|
+
try {
|
|
21
|
+
return require.resolve(specifier);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
throw new PackageNotFoundError({
|
|
25
|
+
message: `Cannot resolve package file: ${specifier}`,
|
|
26
|
+
data: { specifier }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export const PathTool = PathToolAbstraction.createImplementation({
|
|
32
|
+
implementation: PathToolImpl,
|
|
33
|
+
dependencies: []
|
|
34
|
+
});
|
|
35
|
+
export function createPathTool() {
|
|
36
|
+
return new PathToolImpl();
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=PathTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTool.js","sourceRoot":"","sources":["../../../../src/node/features/PathTool/PathTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,MAAM,YAAY;IACP,IAAI,CAAC,GAAG,KAAe;QAC1B,OAAO,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC1B,CAAC;IAEM,OAAO,CAAC,GAAG,KAAe;QAC7B,OAAO,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7B,CAAC;IAEM,OAAO,CAAC,IAAY;QACvB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC;IAEM,QAAQ,CAAC,IAAY,EAAE,GAAY;QACtC,OAAO,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAEM,kBAAkB,CAAC,SAAiB;QACvC,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;QAC/D,IAAI,CAAC;YACD,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACL,MAAM,IAAI,oBAAoB,CAAC;gBAC3B,OAAO,EAAE,gCAAgC,SAAS,EAAE;gBACpD,IAAI,EAAE,EAAE,SAAS,EAAE;aACtB,CAAC,CAAC;QACP,CAAC;IACL,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,oBAAoB,CAAC;IAC7D,cAAc,EAAE,YAAY;IAC5B,YAAY,EAAE,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,UAAU,cAAc;IAC1B,OAAO,IAAI,YAAY,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface IPathTool {
|
|
2
|
+
/** Joins path segments using the OS-native separator. */
|
|
3
|
+
join(...paths: string[]): string;
|
|
4
|
+
/** Resolves a sequence of paths into an absolute path. Relative segments resolve against `process.cwd()`. */
|
|
5
|
+
resolve(...paths: string[]): string;
|
|
6
|
+
/** Returns the directory portion of a path. */
|
|
7
|
+
dirname(path: string): string;
|
|
8
|
+
/** Returns the last segment of a path. Strips `ext` when provided. */
|
|
9
|
+
basename(path: string, ext?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Resolves a package-relative file specifier to an absolute filesystem path.
|
|
12
|
+
* Resolution starts from `process.cwd()`, matching Node's standard module
|
|
13
|
+
* lookup (hoisted node_modules at the project root).
|
|
14
|
+
*
|
|
15
|
+
* @throws PackageNotFoundError when the specifier cannot be resolved.
|
|
16
|
+
*/
|
|
17
|
+
resolvePackageFile(specifier: string): string;
|
|
18
|
+
}
|
|
19
|
+
export declare const PathTool: import("@webiny/di").Abstraction<IPathTool>;
|
|
20
|
+
export declare namespace PathTool {
|
|
21
|
+
type Interface = IPathTool;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=PathTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTool.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PathTool/abstractions/PathTool.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACtB,yDAAyD;IACzD,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACjC,6GAA6G;IAC7G,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACpC,+CAA+C;IAC/C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7C;;;;;;OAMG;IACH,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;CACjD;AAED,eAAO,MAAM,QAAQ,6CAAgD,CAAC;AAEtE,yBAAiB,QAAQ,CAAC;IACtB,KAAY,SAAS,GAAG,SAAS,CAAC;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PathTool.js","sourceRoot":"","sources":["../../../../../src/node/features/PathTool/abstractions/PathTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAqBtD,MAAM,CAAC,MAAM,QAAQ,GAAG,iBAAiB,CAAY,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PathTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/node/features/PathTool/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseError } from "../../../common/index.js";
|
|
2
|
+
import type { ErrorInput } from "../../../common/index.js";
|
|
3
|
+
interface PackageNotFoundData {
|
|
4
|
+
specifier: string;
|
|
5
|
+
}
|
|
6
|
+
/** Thrown when a package-relative specifier cannot be resolved to a filesystem path. */
|
|
7
|
+
export declare class PackageNotFoundError extends BaseError<PackageNotFoundData> {
|
|
8
|
+
readonly code: "PACKAGE_NOT_FOUND";
|
|
9
|
+
constructor(input: ErrorInput<PackageNotFoundData>);
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PathTool/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,UAAU,mBAAmB;IACzB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wFAAwF;AACxF,qBAAa,oBAAqB,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACpE,SAAgB,IAAI,EAAG,mBAAmB,CAAU;IACpD,YAAmB,KAAK,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAExD;CACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseError } from "../../../common/index.js";
|
|
2
|
+
/** Thrown when a package-relative specifier cannot be resolved to a filesystem path. */
|
|
3
|
+
export class PackageNotFoundError extends BaseError {
|
|
4
|
+
code = "PACKAGE_NOT_FOUND";
|
|
5
|
+
constructor(input) {
|
|
6
|
+
super(input);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/node/features/PathTool/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAO9C,wFAAwF;AACxF,MAAM,OAAO,oBAAqB,SAAQ,SAA8B;IACpD,IAAI,GAAG,mBAA4B,CAAC;IACpD,YAAmB,KAAsC;QACrD,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PathTool/feature.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe;;;CAK1B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createFeature } from "../../../common/index.js";
|
|
2
|
+
import { PathTool } from "./PathTool.js";
|
|
3
|
+
export const PathToolFeature = createFeature({
|
|
4
|
+
name: "Node/PathToolFeature",
|
|
5
|
+
register(container) {
|
|
6
|
+
container.register(PathTool).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/node/features/PathTool/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE,sBAAsB;IAC5B,QAAQ,CAAC,SAAS;QACd,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpD,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PathTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/features/PathTool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Logger } from "../../../common/index.js";
|
|
2
|
+
import { PinoLoggerConfig } from "./abstractions/PinoLoggerConfig.js";
|
|
3
|
+
/** Pino-based logger. Registered under the Logger abstraction by PinoLoggerFeature. */
|
|
4
|
+
declare class PinoLoggerImpl implements Logger.Interface {
|
|
5
|
+
private readonly pinoLogger;
|
|
6
|
+
constructor(configProvider?: PinoLoggerConfig.Interface);
|
|
7
|
+
debug(message: string, data?: Record<string, unknown>): void;
|
|
8
|
+
info(message: string, data?: Record<string, unknown>): void;
|
|
9
|
+
warn(message: string, data?: Record<string, unknown>): void;
|
|
10
|
+
error(message: string, data?: Record<string, unknown>): void;
|
|
11
|
+
fatal(message: string, data?: Record<string, unknown>): void;
|
|
12
|
+
child(prefix: string): Logger.Interface;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Pino-based Logger implementation for Node.js.
|
|
16
|
+
* Register via PinoLoggerFeature. Optionally pair with PinoLoggerConfig
|
|
17
|
+
* to configure log level and transport.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PinoLogger: typeof PinoLoggerImpl & {
|
|
20
|
+
__abstraction: import("@webiny/di").Abstraction<import("../../../common/index.js").ILogger>;
|
|
21
|
+
};
|
|
22
|
+
export interface CreatePinoLoggerParams {
|
|
23
|
+
config?: PinoLoggerConfig.Config;
|
|
24
|
+
}
|
|
25
|
+
export declare function createPinoLogger(params?: CreatePinoLoggerParams): Logger.Interface;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=PinoLogger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinoLogger.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/PinoLogger.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAgGtE,uFAAuF;AACvF,cAAM,cAAe,YAAW,MAAM,CAAC,SAAS;IAC5C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IAEzC,YAAmB,cAAc,CAAC,EAAE,gBAAgB,CAAC,SAAS,EAQ7D;IAEM,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMlE;IAEM,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMjE;IAEM,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMjE;IAEM,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMlE;IAEM,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAMlE;IAEM,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,SAAS,CAE7C;CACJ;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU;;CAGrB,CAAC;AAEH,MAAM,WAAW,sBAAsB;IACnC,MAAM,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC;CACpC;AAED,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAAC,SAAS,CAIlF"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import pino from "pino";
|
|
2
|
+
import pretty from "pino-pretty";
|
|
3
|
+
import { Writable } from "node:stream";
|
|
4
|
+
import { Logger } from "../../../common/index.js";
|
|
5
|
+
import { PinoLoggerConfig } from "./abstractions/PinoLoggerConfig.js";
|
|
6
|
+
const LEVEL_TO_TYPE = {
|
|
7
|
+
20: "debug",
|
|
8
|
+
30: "info",
|
|
9
|
+
40: "warn",
|
|
10
|
+
50: "error",
|
|
11
|
+
60: "fatal"
|
|
12
|
+
};
|
|
13
|
+
const createJsonDestination = () => {
|
|
14
|
+
return new Writable({
|
|
15
|
+
write(chunk, _enc, cb) {
|
|
16
|
+
try {
|
|
17
|
+
const entry = JSON.parse(chunk.toString());
|
|
18
|
+
const type = LEVEL_TO_TYPE[entry.level] ?? "info";
|
|
19
|
+
process.stdout.write(JSON.stringify({ type, message: entry.msg }) + "\n");
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// ignore malformed lines
|
|
23
|
+
}
|
|
24
|
+
cb();
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
const createPrettyDestination = () => {
|
|
29
|
+
return pretty({
|
|
30
|
+
colorize: true,
|
|
31
|
+
customColors: "fatal:red,error:red,warn:yellow,info:blue,debug:gray",
|
|
32
|
+
ignore: "pid,hostname,time",
|
|
33
|
+
messageFormat: "{msg}"
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Internal child logger that wraps an existing pino instance and prepends a prefix.
|
|
38
|
+
* Not registered in DI — created by PinoLoggerImpl.child().
|
|
39
|
+
*/
|
|
40
|
+
class ChildPinoLogger {
|
|
41
|
+
pinoLogger;
|
|
42
|
+
prefix;
|
|
43
|
+
constructor(pinoLogger, prefix) {
|
|
44
|
+
this.pinoLogger = pinoLogger;
|
|
45
|
+
this.prefix = prefix;
|
|
46
|
+
}
|
|
47
|
+
format(message) {
|
|
48
|
+
return `${this.prefix} ${message}`;
|
|
49
|
+
}
|
|
50
|
+
debug(message, data) {
|
|
51
|
+
if (data) {
|
|
52
|
+
this.pinoLogger.debug(data, this.format(message));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
this.pinoLogger.debug(this.format(message));
|
|
56
|
+
}
|
|
57
|
+
info(message, data) {
|
|
58
|
+
if (data) {
|
|
59
|
+
this.pinoLogger.info(data, this.format(message));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this.pinoLogger.info(this.format(message));
|
|
63
|
+
}
|
|
64
|
+
warn(message, data) {
|
|
65
|
+
if (data) {
|
|
66
|
+
this.pinoLogger.warn(data, this.format(message));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this.pinoLogger.warn(this.format(message));
|
|
70
|
+
}
|
|
71
|
+
error(message, data) {
|
|
72
|
+
if (data) {
|
|
73
|
+
this.pinoLogger.error(data, this.format(message));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.pinoLogger.error(this.format(message));
|
|
77
|
+
}
|
|
78
|
+
fatal(message, data) {
|
|
79
|
+
if (data) {
|
|
80
|
+
this.pinoLogger.fatal(data, this.format(message));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.pinoLogger.fatal(this.format(message));
|
|
84
|
+
}
|
|
85
|
+
child(prefix) {
|
|
86
|
+
const combined = `${this.prefix}:${prefix}`;
|
|
87
|
+
return new ChildPinoLogger(this.pinoLogger, combined);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/** Pino-based logger. Registered under the Logger abstraction by PinoLoggerFeature. */
|
|
91
|
+
class PinoLoggerImpl {
|
|
92
|
+
pinoLogger;
|
|
93
|
+
constructor(configProvider) {
|
|
94
|
+
const cfg = configProvider?.getConfig();
|
|
95
|
+
const logLevel = cfg?.logLevel ?? "info";
|
|
96
|
+
const transport = cfg?.transport ?? "pretty";
|
|
97
|
+
const stream = transport === "json" ? createJsonDestination() : createPrettyDestination();
|
|
98
|
+
this.pinoLogger = pino({ level: logLevel }, stream);
|
|
99
|
+
}
|
|
100
|
+
debug(message, data) {
|
|
101
|
+
if (data) {
|
|
102
|
+
this.pinoLogger.debug(data, message);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.pinoLogger.debug(message);
|
|
106
|
+
}
|
|
107
|
+
info(message, data) {
|
|
108
|
+
if (data) {
|
|
109
|
+
this.pinoLogger.info(data, message);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.pinoLogger.info(message);
|
|
113
|
+
}
|
|
114
|
+
warn(message, data) {
|
|
115
|
+
if (data) {
|
|
116
|
+
this.pinoLogger.warn(data, message);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
this.pinoLogger.warn(message);
|
|
120
|
+
}
|
|
121
|
+
error(message, data) {
|
|
122
|
+
if (data) {
|
|
123
|
+
this.pinoLogger.error(data, message);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
this.pinoLogger.error(message);
|
|
127
|
+
}
|
|
128
|
+
fatal(message, data) {
|
|
129
|
+
if (data) {
|
|
130
|
+
this.pinoLogger.fatal(data, message);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
this.pinoLogger.fatal(message);
|
|
134
|
+
}
|
|
135
|
+
child(prefix) {
|
|
136
|
+
return new ChildPinoLogger(this.pinoLogger, prefix);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Pino-based Logger implementation for Node.js.
|
|
141
|
+
* Register via PinoLoggerFeature. Optionally pair with PinoLoggerConfig
|
|
142
|
+
* to configure log level and transport.
|
|
143
|
+
*/
|
|
144
|
+
export const PinoLogger = Logger.createImplementation({
|
|
145
|
+
implementation: PinoLoggerImpl,
|
|
146
|
+
dependencies: [[PinoLoggerConfig, { optional: true }]]
|
|
147
|
+
});
|
|
148
|
+
export function createPinoLogger(params) {
|
|
149
|
+
const configProvider = params?.config !== undefined ? { getConfig: () => params.config } : undefined;
|
|
150
|
+
return new PinoLoggerImpl(configProvider);
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=PinoLogger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinoLogger.js","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/PinoLogger.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration shape for PinoLogger.
|
|
3
|
+
* All fields are optional — PinoLogger defaults to info level + pretty transport.
|
|
4
|
+
*/
|
|
5
|
+
export interface PinoLoggerConfigData {
|
|
6
|
+
/** Minimum log level. Default: "info". */
|
|
7
|
+
logLevel?: "debug" | "info" | "warn" | "error" | "fatal";
|
|
8
|
+
/**
|
|
9
|
+
* Output transport.
|
|
10
|
+
* - "pretty": human-readable coloured output (default, good for development)
|
|
11
|
+
* - "json": compact JSON line per message (good for structured log pipelines)
|
|
12
|
+
*/
|
|
13
|
+
transport?: "pretty" | "json";
|
|
14
|
+
}
|
|
15
|
+
interface IPinoLoggerConfig {
|
|
16
|
+
getConfig(): PinoLoggerConfigData;
|
|
17
|
+
}
|
|
18
|
+
export declare const PinoLoggerConfig: import("@webiny/di").Abstraction<IPinoLoggerConfig>;
|
|
19
|
+
export declare namespace PinoLoggerConfig {
|
|
20
|
+
type Interface = IPinoLoggerConfig;
|
|
21
|
+
type Config = PinoLoggerConfigData;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=PinoLoggerConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinoLoggerConfig.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PinoLogger/abstractions/PinoLoggerConfig.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;IACzD;;;;OAIG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;CACjC;AAED,UAAU,iBAAiB;IACvB,SAAS,IAAI,oBAAoB,CAAC;CACrC;AAED,eAAO,MAAM,gBAAgB,qDAAgE,CAAC;AAE9F,yBAAiB,gBAAgB,CAAC;IAC9B,KAAY,SAAS,GAAG,iBAAiB,CAAC;IAC1C,KAAY,MAAM,GAAG,oBAAoB,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PinoLoggerConfig.js","sourceRoot":"","sources":["../../../../../src/node/features/PinoLogger/abstractions/PinoLoggerConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAqBtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAoB,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/node/features/PinoLogger/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/node/features/PinoLogger/abstractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers PinoLogger as the Logger implementation.
|
|
3
|
+
* Optionally pair with PinoLoggerConfig to override defaults (info + pretty).
|
|
4
|
+
*/
|
|
5
|
+
export declare const PinoLoggerFeature: {
|
|
6
|
+
name: string;
|
|
7
|
+
register(container: import("@webiny/di").Container): void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/feature.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;CAK5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createFeature } from "../../../common/index.js";
|
|
2
|
+
import { PinoLogger } from "./PinoLogger.js";
|
|
3
|
+
/**
|
|
4
|
+
* Registers PinoLogger as the Logger implementation.
|
|
5
|
+
* Optionally pair with PinoLoggerConfig to override defaults (info + pretty).
|
|
6
|
+
*/
|
|
7
|
+
export const PinoLoggerFeature = createFeature({
|
|
8
|
+
name: "Node/PinoLoggerFeature",
|
|
9
|
+
register(container) {
|
|
10
|
+
container.register(PinoLogger).inSingletonScope();
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/feature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE,wBAAwB;IAC9B,QAAQ,CAAC,SAAS;QACd,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtD,CAAC;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/node/features/PinoLogger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAA+B,MAAM,iBAAiB,CAAC"}
|