pnpm-catalog-updates 0.5.6 → 0.6.5
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/bin/pcu.js +1 -1
- package/dist/index.js +9559 -32
- package/dist/index.js.map +1 -1
- package/package.json +61 -103
- package/src/cli/commands/checkCommand.ts +227 -0
- package/src/cli/commands/initCommand.ts +394 -0
- package/src/cli/commands/securityCommand.ts +569 -0
- package/src/cli/commands/updateCommand.ts +245 -0
- package/src/cli/formatters/outputFormatter.ts +830 -0
- package/src/cli/formatters/progressBar.ts +700 -0
- package/src/cli/index.ts +565 -0
- package/src/cli/interactive/interactivePrompts.ts +517 -0
- package/src/cli/options/globalOptions.ts +380 -0
- package/src/cli/options/index.ts +5 -0
- package/src/cli/themes/colorTheme.ts +379 -0
- package/src/cli/validators/commandValidator.ts +395 -0
- package/src/cli/validators/index.ts +5 -0
- package/src/index.ts +4 -0
- package/LICENSE +0 -21
- package/README.ja.md +0 -582
- package/README.md +0 -690
- package/README.zh-CN.md +0 -630
- package/dist/application/services/CatalogUpdateService.d.ts +0 -209
- package/dist/application/services/CatalogUpdateService.d.ts.map +0 -1
- package/dist/application/services/CatalogUpdateService.js +0 -836
- package/dist/application/services/CatalogUpdateService.js.map +0 -1
- package/dist/application/services/WorkspaceService.d.ts +0 -139
- package/dist/application/services/WorkspaceService.d.ts.map +0 -1
- package/dist/application/services/WorkspaceService.js +0 -340
- package/dist/application/services/WorkspaceService.js.map +0 -1
- package/dist/cli/commands/CheckCommand.d.ts +0 -40
- package/dist/cli/commands/CheckCommand.d.ts.map +0 -1
- package/dist/cli/commands/CheckCommand.js +0 -177
- package/dist/cli/commands/CheckCommand.js.map +0 -1
- package/dist/cli/commands/InitCommand.d.ts +0 -53
- package/dist/cli/commands/InitCommand.d.ts.map +0 -1
- package/dist/cli/commands/InitCommand.js +0 -338
- package/dist/cli/commands/InitCommand.js.map +0 -1
- package/dist/cli/commands/SecurityCommand.d.ts +0 -113
- package/dist/cli/commands/SecurityCommand.d.ts.map +0 -1
- package/dist/cli/commands/SecurityCommand.js +0 -410
- package/dist/cli/commands/SecurityCommand.js.map +0 -1
- package/dist/cli/commands/UpdateCommand.d.ts +0 -44
- package/dist/cli/commands/UpdateCommand.d.ts.map +0 -1
- package/dist/cli/commands/UpdateCommand.js +0 -189
- package/dist/cli/commands/UpdateCommand.js.map +0 -1
- package/dist/cli/formatters/OutputFormatter.d.ts +0 -116
- package/dist/cli/formatters/OutputFormatter.d.ts.map +0 -1
- package/dist/cli/formatters/OutputFormatter.js +0 -664
- package/dist/cli/formatters/OutputFormatter.js.map +0 -1
- package/dist/cli/formatters/ProgressBar.d.ts +0 -195
- package/dist/cli/formatters/ProgressBar.d.ts.map +0 -1
- package/dist/cli/formatters/ProgressBar.js +0 -622
- package/dist/cli/formatters/ProgressBar.js.map +0 -1
- package/dist/cli/index.d.ts +0 -12
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -492
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/interactive/InteractivePrompts.d.ts +0 -85
- package/dist/cli/interactive/InteractivePrompts.d.ts.map +0 -1
- package/dist/cli/interactive/InteractivePrompts.js +0 -434
- package/dist/cli/interactive/InteractivePrompts.js.map +0 -1
- package/dist/cli/options/GlobalOptions.d.ts +0 -117
- package/dist/cli/options/GlobalOptions.d.ts.map +0 -1
- package/dist/cli/options/GlobalOptions.js +0 -278
- package/dist/cli/options/GlobalOptions.js.map +0 -1
- package/dist/cli/options/index.d.ts +0 -5
- package/dist/cli/options/index.d.ts.map +0 -1
- package/dist/cli/options/index.js +0 -5
- package/dist/cli/options/index.js.map +0 -1
- package/dist/cli/themes/ColorTheme.d.ts +0 -211
- package/dist/cli/themes/ColorTheme.d.ts.map +0 -1
- package/dist/cli/themes/ColorTheme.js +0 -267
- package/dist/cli/themes/ColorTheme.js.map +0 -1
- package/dist/cli/validators/CommandValidator.d.ts +0 -60
- package/dist/cli/validators/CommandValidator.d.ts.map +0 -1
- package/dist/cli/validators/CommandValidator.js +0 -319
- package/dist/cli/validators/CommandValidator.js.map +0 -1
- package/dist/cli/validators/index.d.ts +0 -5
- package/dist/cli/validators/index.d.ts.map +0 -1
- package/dist/cli/validators/index.js +0 -5
- package/dist/cli/validators/index.js.map +0 -1
- package/dist/common/config/Config.d.ts +0 -142
- package/dist/common/config/Config.d.ts.map +0 -1
- package/dist/common/config/Config.js +0 -382
- package/dist/common/config/Config.js.map +0 -1
- package/dist/common/config/ConfigLoader.d.ts +0 -49
- package/dist/common/config/ConfigLoader.d.ts.map +0 -1
- package/dist/common/config/ConfigLoader.js +0 -180
- package/dist/common/config/ConfigLoader.js.map +0 -1
- package/dist/common/config/PackageFilterConfig.d.ts +0 -56
- package/dist/common/config/PackageFilterConfig.d.ts.map +0 -1
- package/dist/common/config/PackageFilterConfig.js +0 -94
- package/dist/common/config/PackageFilterConfig.js.map +0 -1
- package/dist/common/config/index.d.ts +0 -8
- package/dist/common/config/index.d.ts.map +0 -1
- package/dist/common/config/index.js +0 -8
- package/dist/common/config/index.js.map +0 -1
- package/dist/common/error-handling/ErrorTracker.d.ts +0 -48
- package/dist/common/error-handling/ErrorTracker.d.ts.map +0 -1
- package/dist/common/error-handling/ErrorTracker.js +0 -93
- package/dist/common/error-handling/ErrorTracker.js.map +0 -1
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts +0 -74
- package/dist/common/error-handling/UserFriendlyErrorHandler.d.ts.map +0 -1
- package/dist/common/error-handling/UserFriendlyErrorHandler.js +0 -703
- package/dist/common/error-handling/UserFriendlyErrorHandler.js.map +0 -1
- package/dist/common/error-handling/index.d.ts +0 -11
- package/dist/common/error-handling/index.d.ts.map +0 -1
- package/dist/common/error-handling/index.js +0 -9
- package/dist/common/error-handling/index.js.map +0 -1
- package/dist/common/logger/Logger.d.ts +0 -110
- package/dist/common/logger/Logger.d.ts.map +0 -1
- package/dist/common/logger/Logger.js +0 -289
- package/dist/common/logger/Logger.js.map +0 -1
- package/dist/common/logger/index.d.ts +0 -6
- package/dist/common/logger/index.d.ts.map +0 -1
- package/dist/common/logger/index.js +0 -6
- package/dist/common/logger/index.js.map +0 -1
- package/dist/common/types/cli.d.ts +0 -265
- package/dist/common/types/cli.d.ts.map +0 -1
- package/dist/common/types/cli.js +0 -5
- package/dist/common/types/cli.js.map +0 -1
- package/dist/common/types/core.d.ts +0 -270
- package/dist/common/types/core.d.ts.map +0 -1
- package/dist/common/types/core.js +0 -32
- package/dist/common/types/core.js.map +0 -1
- package/dist/common/types/index.d.ts +0 -8
- package/dist/common/types/index.d.ts.map +0 -1
- package/dist/common/types/index.js +0 -8
- package/dist/common/types/index.js.map +0 -1
- package/dist/common/utils/VersionChecker.d.ts +0 -54
- package/dist/common/utils/VersionChecker.d.ts.map +0 -1
- package/dist/common/utils/VersionChecker.js +0 -180
- package/dist/common/utils/VersionChecker.js.map +0 -1
- package/dist/common/utils/async.d.ts +0 -74
- package/dist/common/utils/async.d.ts.map +0 -1
- package/dist/common/utils/async.js +0 -228
- package/dist/common/utils/async.js.map +0 -1
- package/dist/common/utils/format.d.ts +0 -32
- package/dist/common/utils/format.d.ts.map +0 -1
- package/dist/common/utils/format.js +0 -121
- package/dist/common/utils/format.js.map +0 -1
- package/dist/common/utils/git.d.ts +0 -44
- package/dist/common/utils/git.d.ts.map +0 -1
- package/dist/common/utils/git.js +0 -147
- package/dist/common/utils/git.js.map +0 -1
- package/dist/common/utils/index.d.ts +0 -12
- package/dist/common/utils/index.d.ts.map +0 -1
- package/dist/common/utils/index.js +0 -12
- package/dist/common/utils/index.js.map +0 -1
- package/dist/common/utils/string.d.ts +0 -56
- package/dist/common/utils/string.d.ts.map +0 -1
- package/dist/common/utils/string.js +0 -134
- package/dist/common/utils/string.js.map +0 -1
- package/dist/common/utils/validation.d.ts +0 -88
- package/dist/common/utils/validation.d.ts.map +0 -1
- package/dist/common/utils/validation.js +0 -308
- package/dist/common/utils/validation.js.map +0 -1
- package/dist/domain/entities/Catalog.d.ts +0 -117
- package/dist/domain/entities/Catalog.d.ts.map +0 -1
- package/dist/domain/entities/Catalog.js +0 -240
- package/dist/domain/entities/Catalog.js.map +0 -1
- package/dist/domain/entities/Package.d.ts +0 -143
- package/dist/domain/entities/Package.d.ts.map +0 -1
- package/dist/domain/entities/Package.js +0 -272
- package/dist/domain/entities/Package.js.map +0 -1
- package/dist/domain/entities/Workspace.d.ts +0 -95
- package/dist/domain/entities/Workspace.d.ts.map +0 -1
- package/dist/domain/entities/Workspace.js +0 -173
- package/dist/domain/entities/Workspace.js.map +0 -1
- package/dist/domain/repositories/WorkspaceRepository.d.ts +0 -41
- package/dist/domain/repositories/WorkspaceRepository.d.ts.map +0 -1
- package/dist/domain/repositories/WorkspaceRepository.js +0 -8
- package/dist/domain/repositories/WorkspaceRepository.js.map +0 -1
- package/dist/domain/value-objects/CatalogCollection.d.ts +0 -106
- package/dist/domain/value-objects/CatalogCollection.d.ts.map +0 -1
- package/dist/domain/value-objects/CatalogCollection.js +0 -230
- package/dist/domain/value-objects/CatalogCollection.js.map +0 -1
- package/dist/domain/value-objects/PackageCollection.d.ts +0 -122
- package/dist/domain/value-objects/PackageCollection.d.ts.map +0 -1
- package/dist/domain/value-objects/PackageCollection.js +0 -263
- package/dist/domain/value-objects/PackageCollection.js.map +0 -1
- package/dist/domain/value-objects/Version.d.ts +0 -141
- package/dist/domain/value-objects/Version.d.ts.map +0 -1
- package/dist/domain/value-objects/Version.js +0 -268
- package/dist/domain/value-objects/Version.js.map +0 -1
- package/dist/domain/value-objects/WorkspaceConfig.d.ts +0 -144
- package/dist/domain/value-objects/WorkspaceConfig.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspaceConfig.js +0 -357
- package/dist/domain/value-objects/WorkspaceConfig.js.map +0 -1
- package/dist/domain/value-objects/WorkspaceId.d.ts +0 -51
- package/dist/domain/value-objects/WorkspaceId.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspaceId.js +0 -104
- package/dist/domain/value-objects/WorkspaceId.js.map +0 -1
- package/dist/domain/value-objects/WorkspacePath.d.ts +0 -75
- package/dist/domain/value-objects/WorkspacePath.d.ts.map +0 -1
- package/dist/domain/value-objects/WorkspacePath.js +0 -128
- package/dist/domain/value-objects/WorkspacePath.js.map +0 -1
- package/dist/index.d.ts +0 -25
- package/dist/index.d.ts.map +0 -1
- package/dist/infrastructure/cache/Cache.d.ts +0 -161
- package/dist/infrastructure/cache/Cache.d.ts.map +0 -1
- package/dist/infrastructure/cache/Cache.js +0 -398
- package/dist/infrastructure/cache/Cache.js.map +0 -1
- package/dist/infrastructure/cache/index.d.ts +0 -6
- package/dist/infrastructure/cache/index.d.ts.map +0 -1
- package/dist/infrastructure/cache/index.js +0 -6
- package/dist/infrastructure/cache/index.js.map +0 -1
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts +0 -145
- package/dist/infrastructure/external-services/NpmRegistryService.d.ts.map +0 -1
- package/dist/infrastructure/external-services/NpmRegistryService.js +0 -466
- package/dist/infrastructure/external-services/NpmRegistryService.js.map +0 -1
- package/dist/infrastructure/file-system/FileSystemService.d.ts +0 -120
- package/dist/infrastructure/file-system/FileSystemService.d.ts.map +0 -1
- package/dist/infrastructure/file-system/FileSystemService.js +0 -663
- package/dist/infrastructure/file-system/FileSystemService.js.map +0 -1
- package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts +0 -57
- package/dist/infrastructure/repositories/FileWorkspaceRepository.d.ts.map +0 -1
- package/dist/infrastructure/repositories/FileWorkspaceRepository.js +0 -179
- package/dist/infrastructure/repositories/FileWorkspaceRepository.js.map +0 -1
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* PackageCollection Value Object
|
|
3
|
-
*
|
|
4
|
-
* Represents a collection of packages in a workspace.
|
|
5
|
-
* Provides operations for managing and querying multiple packages.
|
|
6
|
-
*/
|
|
7
|
-
import { Package, PackageName } from '../entities/Package.js';
|
|
8
|
-
export declare class PackageCollection {
|
|
9
|
-
private readonly packages;
|
|
10
|
-
private constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Create an empty package collection
|
|
13
|
-
*/
|
|
14
|
-
static empty(): PackageCollection;
|
|
15
|
-
/**
|
|
16
|
-
* Create a package collection from an array of packages
|
|
17
|
-
*/
|
|
18
|
-
static fromPackages(packages: Package[]): PackageCollection;
|
|
19
|
-
/**
|
|
20
|
-
* Create a package collection from a Map
|
|
21
|
-
*/
|
|
22
|
-
static fromMap(packageMap: Map<PackageName, Package>): PackageCollection;
|
|
23
|
-
/**
|
|
24
|
-
* Check if collection contains a package with the given name
|
|
25
|
-
*/
|
|
26
|
-
has(packageName: PackageName): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Get a package by name
|
|
29
|
-
*/
|
|
30
|
-
get(packageName: PackageName): Package | undefined;
|
|
31
|
-
/**
|
|
32
|
-
* Get all packages as an array
|
|
33
|
-
*/
|
|
34
|
-
getAll(): Package[];
|
|
35
|
-
/**
|
|
36
|
-
* Get all package names
|
|
37
|
-
*/
|
|
38
|
-
getPackageNames(): PackageName[];
|
|
39
|
-
/**
|
|
40
|
-
* Get the number of packages
|
|
41
|
-
*/
|
|
42
|
-
size(): number;
|
|
43
|
-
/**
|
|
44
|
-
* Check if collection is empty
|
|
45
|
-
*/
|
|
46
|
-
isEmpty(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Add a package to the collection
|
|
49
|
-
*/
|
|
50
|
-
add(pkg: Package): PackageCollection;
|
|
51
|
-
/**
|
|
52
|
-
* Remove a package from the collection
|
|
53
|
-
*/
|
|
54
|
-
remove(packageName: PackageName): PackageCollection;
|
|
55
|
-
/**
|
|
56
|
-
* Update a package in the collection
|
|
57
|
-
*/
|
|
58
|
-
update(pkg: Package): PackageCollection;
|
|
59
|
-
/**
|
|
60
|
-
* Filter packages by a predicate function
|
|
61
|
-
*/
|
|
62
|
-
filter(predicate: (pkg: Package) => boolean): PackageCollection;
|
|
63
|
-
/**
|
|
64
|
-
* Filter packages that use a specific catalog dependency
|
|
65
|
-
*/
|
|
66
|
-
filterByCatalogDependency(catalogName: string, packageName: string): PackageCollection;
|
|
67
|
-
/**
|
|
68
|
-
* Find packages that have catalog references
|
|
69
|
-
*/
|
|
70
|
-
findPackagesWithCatalogReferences(): Package[];
|
|
71
|
-
/**
|
|
72
|
-
* Find packages that reference a specific catalog
|
|
73
|
-
*/
|
|
74
|
-
findPackagesUsingCatalog(catalogName: string): Package[];
|
|
75
|
-
/**
|
|
76
|
-
* Get all unique catalog names referenced by packages
|
|
77
|
-
*/
|
|
78
|
-
getReferencedCatalogNames(): string[];
|
|
79
|
-
/**
|
|
80
|
-
* Get all unique dependency names across all packages
|
|
81
|
-
*/
|
|
82
|
-
getAllDependencyNames(): string[];
|
|
83
|
-
/**
|
|
84
|
-
* Find packages that have a specific dependency
|
|
85
|
-
*/
|
|
86
|
-
findPackagesWithDependency(dependencyName: string): Package[];
|
|
87
|
-
/**
|
|
88
|
-
* Validate all packages in the collection
|
|
89
|
-
*/
|
|
90
|
-
validate(): PackageCollectionValidationResult;
|
|
91
|
-
/**
|
|
92
|
-
* Group packages by workspace path
|
|
93
|
-
*/
|
|
94
|
-
groupByWorkspacePath(): Map<string, Package[]>;
|
|
95
|
-
/**
|
|
96
|
-
* Convert to a Map for serialization
|
|
97
|
-
*/
|
|
98
|
-
toMap(): Map<PackageName, Package>;
|
|
99
|
-
/**
|
|
100
|
-
* Iterate over packages
|
|
101
|
-
*/
|
|
102
|
-
[Symbol.iterator](): Iterator<[PackageName, Package]>;
|
|
103
|
-
/**
|
|
104
|
-
* Check equality with another package collection
|
|
105
|
-
*/
|
|
106
|
-
equals(other: PackageCollection): boolean;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Package Collection Validation Result
|
|
110
|
-
*/
|
|
111
|
-
export declare class PackageCollectionValidationResult {
|
|
112
|
-
private readonly isValid;
|
|
113
|
-
private readonly errors;
|
|
114
|
-
private readonly warnings;
|
|
115
|
-
constructor(isValid: boolean, errors: string[], warnings: string[]);
|
|
116
|
-
getIsValid(): boolean;
|
|
117
|
-
getErrors(): string[];
|
|
118
|
-
getWarnings(): string[];
|
|
119
|
-
hasErrors(): boolean;
|
|
120
|
-
hasWarnings(): boolean;
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=PackageCollection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PackageCollection.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/PackageCollection.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA4B;IAErD,OAAO;IAIP;;OAEG;WACW,KAAK,IAAI,iBAAiB;IAIxC;;OAEG;WACW,YAAY,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,iBAAiB;IAUlE;;OAEG;WACW,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,GAAG,iBAAiB;IAI/E;;OAEG;IACI,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO;IAI7C;;OAEG;IACI,GAAG,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,GAAG,SAAS;IAIzD;;OAEG;IACI,MAAM,IAAI,OAAO,EAAE;IAI1B;;OAEG;IACI,eAAe,IAAI,WAAW,EAAE;IAIvC;;OAEG;IACI,IAAI,IAAI,MAAM;IAIrB;;OAEG;IACI,OAAO,IAAI,OAAO;IAIzB;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB;IAM3C;;OAEG;IACI,MAAM,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB;IAM1D;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB;IAU9C;;OAEG;IACI,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,OAAO,K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Represents a collection of packages in a workspace.
|
|
5
|
-
* Provides operations for managing and querying multiple packages.
|
|
6
|
-
*/
|
|
7
|
-
export class PackageCollection {
|
|
8
|
-
packages;
|
|
9
|
-
constructor(packages) {
|
|
10
|
-
this.packages = new Map(packages);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Create an empty package collection
|
|
14
|
-
*/
|
|
15
|
-
static empty() {
|
|
16
|
-
return new PackageCollection(new Map());
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Create a package collection from an array of packages
|
|
20
|
-
*/
|
|
21
|
-
static fromPackages(packages) {
|
|
22
|
-
const packageMap = new Map();
|
|
23
|
-
for (const pkg of packages) {
|
|
24
|
-
packageMap.set(pkg.getName(), pkg);
|
|
25
|
-
}
|
|
26
|
-
return new PackageCollection(packageMap);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a package collection from a Map
|
|
30
|
-
*/
|
|
31
|
-
static fromMap(packageMap) {
|
|
32
|
-
return new PackageCollection(packageMap);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Check if collection contains a package with the given name
|
|
36
|
-
*/
|
|
37
|
-
has(packageName) {
|
|
38
|
-
return this.packages.has(packageName);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get a package by name
|
|
42
|
-
*/
|
|
43
|
-
get(packageName) {
|
|
44
|
-
return this.packages.get(packageName);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Get all packages as an array
|
|
48
|
-
*/
|
|
49
|
-
getAll() {
|
|
50
|
-
return Array.from(this.packages.values());
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Get all package names
|
|
54
|
-
*/
|
|
55
|
-
getPackageNames() {
|
|
56
|
-
return Array.from(this.packages.keys());
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Get the number of packages
|
|
60
|
-
*/
|
|
61
|
-
size() {
|
|
62
|
-
return this.packages.size;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Check if collection is empty
|
|
66
|
-
*/
|
|
67
|
-
isEmpty() {
|
|
68
|
-
return this.packages.size === 0;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Add a package to the collection
|
|
72
|
-
*/
|
|
73
|
-
add(pkg) {
|
|
74
|
-
const newPackages = new Map(this.packages);
|
|
75
|
-
newPackages.set(pkg.getName(), pkg);
|
|
76
|
-
return new PackageCollection(newPackages);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Remove a package from the collection
|
|
80
|
-
*/
|
|
81
|
-
remove(packageName) {
|
|
82
|
-
const newPackages = new Map(this.packages);
|
|
83
|
-
newPackages.delete(packageName);
|
|
84
|
-
return new PackageCollection(newPackages);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Update a package in the collection
|
|
88
|
-
*/
|
|
89
|
-
update(pkg) {
|
|
90
|
-
if (!this.has(pkg.getName())) {
|
|
91
|
-
throw new Error(`Package "${pkg.getName()}" not found in collection`);
|
|
92
|
-
}
|
|
93
|
-
const newPackages = new Map(this.packages);
|
|
94
|
-
newPackages.set(pkg.getName(), pkg);
|
|
95
|
-
return new PackageCollection(newPackages);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Filter packages by a predicate function
|
|
99
|
-
*/
|
|
100
|
-
filter(predicate) {
|
|
101
|
-
const filteredPackages = new Map();
|
|
102
|
-
for (const [name, pkg] of this.packages) {
|
|
103
|
-
if (predicate(pkg)) {
|
|
104
|
-
filteredPackages.set(name, pkg);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return new PackageCollection(filteredPackages);
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Filter packages that use a specific catalog dependency
|
|
111
|
-
*/
|
|
112
|
-
filterByCatalogDependency(catalogName, packageName) {
|
|
113
|
-
return this.filter((pkg) => pkg.usesCatalogDependency(catalogName, packageName));
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Find packages that have catalog references
|
|
117
|
-
*/
|
|
118
|
-
findPackagesWithCatalogReferences() {
|
|
119
|
-
return this.getAll().filter((pkg) => pkg.getCatalogReferences().length > 0);
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Find packages that reference a specific catalog
|
|
123
|
-
*/
|
|
124
|
-
findPackagesUsingCatalog(catalogName) {
|
|
125
|
-
return this.getAll().filter((pkg) => pkg.getCatalogReferences().some((ref) => ref.getCatalogName() === catalogName));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get all unique catalog names referenced by packages
|
|
129
|
-
*/
|
|
130
|
-
getReferencedCatalogNames() {
|
|
131
|
-
const catalogNames = new Set();
|
|
132
|
-
for (const pkg of this.packages.values()) {
|
|
133
|
-
for (const ref of pkg.getCatalogReferences()) {
|
|
134
|
-
catalogNames.add(ref.getCatalogName());
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return Array.from(catalogNames);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Get all unique dependency names across all packages
|
|
141
|
-
*/
|
|
142
|
-
getAllDependencyNames() {
|
|
143
|
-
const dependencyNames = new Set();
|
|
144
|
-
for (const pkg of this.packages.values()) {
|
|
145
|
-
const deps = pkg.getDependencies();
|
|
146
|
-
// Add dependencies from all types
|
|
147
|
-
for (const depType of [
|
|
148
|
-
'dependencies',
|
|
149
|
-
'devDependencies',
|
|
150
|
-
'peerDependencies',
|
|
151
|
-
'optionalDependencies',
|
|
152
|
-
]) {
|
|
153
|
-
for (const depName of deps.getDependenciesByType(depType).keys()) {
|
|
154
|
-
dependencyNames.add(depName);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return Array.from(dependencyNames);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Find packages that have a specific dependency
|
|
162
|
-
*/
|
|
163
|
-
findPackagesWithDependency(dependencyName) {
|
|
164
|
-
return this.getAll().filter((pkg) => {
|
|
165
|
-
const deps = pkg.getDependencies();
|
|
166
|
-
return ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'].some((depType) => deps.getDependenciesByType(depType).has(dependencyName));
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Validate all packages in the collection
|
|
171
|
-
*/
|
|
172
|
-
validate() {
|
|
173
|
-
const errors = [];
|
|
174
|
-
const warnings = [];
|
|
175
|
-
// Check for empty collection
|
|
176
|
-
if (this.isEmpty()) {
|
|
177
|
-
warnings.push('No packages found in workspace');
|
|
178
|
-
}
|
|
179
|
-
// Validate each package
|
|
180
|
-
for (const pkg of this.packages.values()) {
|
|
181
|
-
const result = pkg.validate();
|
|
182
|
-
errors.push(...result.getErrors().map((err) => `Package "${pkg.getName()}": ${err}`));
|
|
183
|
-
warnings.push(...result.getWarnings().map((warn) => `Package "${pkg.getName()}": ${warn}`));
|
|
184
|
-
}
|
|
185
|
-
// Check for duplicate package names (shouldn't happen with Map, but good to verify)
|
|
186
|
-
const packageNames = this.getPackageNames();
|
|
187
|
-
const uniqueNames = new Set(packageNames);
|
|
188
|
-
if (packageNames.length !== uniqueNames.size) {
|
|
189
|
-
errors.push('Duplicate package names found in collection');
|
|
190
|
-
}
|
|
191
|
-
return new PackageCollectionValidationResult(errors.length === 0, errors, warnings);
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Group packages by workspace path
|
|
195
|
-
*/
|
|
196
|
-
groupByWorkspacePath() {
|
|
197
|
-
const grouped = new Map();
|
|
198
|
-
for (const pkg of this.packages.values()) {
|
|
199
|
-
const pathKey = pkg.getPath().toString();
|
|
200
|
-
if (!grouped.has(pathKey)) {
|
|
201
|
-
grouped.set(pathKey, []);
|
|
202
|
-
}
|
|
203
|
-
grouped.get(pathKey).push(pkg);
|
|
204
|
-
}
|
|
205
|
-
return grouped;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Convert to a Map for serialization
|
|
209
|
-
*/
|
|
210
|
-
toMap() {
|
|
211
|
-
return new Map(this.packages);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Iterate over packages
|
|
215
|
-
*/
|
|
216
|
-
*[Symbol.iterator]() {
|
|
217
|
-
yield* this.packages;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Check equality with another package collection
|
|
221
|
-
*/
|
|
222
|
-
equals(other) {
|
|
223
|
-
if (this.size() !== other.size()) {
|
|
224
|
-
return false;
|
|
225
|
-
}
|
|
226
|
-
for (const [name, pkg] of this.packages) {
|
|
227
|
-
const otherPackage = other.get(name);
|
|
228
|
-
if (!otherPackage || !pkg.equals(otherPackage)) {
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* Package Collection Validation Result
|
|
237
|
-
*/
|
|
238
|
-
export class PackageCollectionValidationResult {
|
|
239
|
-
isValid;
|
|
240
|
-
errors;
|
|
241
|
-
warnings;
|
|
242
|
-
constructor(isValid, errors, warnings) {
|
|
243
|
-
this.isValid = isValid;
|
|
244
|
-
this.errors = errors;
|
|
245
|
-
this.warnings = warnings;
|
|
246
|
-
}
|
|
247
|
-
getIsValid() {
|
|
248
|
-
return this.isValid;
|
|
249
|
-
}
|
|
250
|
-
getErrors() {
|
|
251
|
-
return [...this.errors];
|
|
252
|
-
}
|
|
253
|
-
getWarnings() {
|
|
254
|
-
return [...this.warnings];
|
|
255
|
-
}
|
|
256
|
-
hasErrors() {
|
|
257
|
-
return this.errors.length > 0;
|
|
258
|
-
}
|
|
259
|
-
hasWarnings() {
|
|
260
|
-
return this.warnings.length > 0;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
//# sourceMappingURL=PackageCollection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PackageCollection.js","sourceRoot":"","sources":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AS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAChC,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Version Value Object
|
|
3
|
-
*
|
|
4
|
-
* Represents a semantic version with comparison and validation capabilities.
|
|
5
|
-
* Handles version ranges, pre-release versions, and semantic version operations.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Version {
|
|
8
|
-
private readonly value;
|
|
9
|
-
private readonly semverInstance;
|
|
10
|
-
private constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Create a Version from a version string
|
|
13
|
-
*/
|
|
14
|
-
static fromString(versionString: string): Version;
|
|
15
|
-
/**
|
|
16
|
-
* Create a Version from semver components
|
|
17
|
-
*/
|
|
18
|
-
static fromComponents(major: number, minor: number, patch: number, prerelease?: string): Version;
|
|
19
|
-
/**
|
|
20
|
-
* Parse a version that might include range operators
|
|
21
|
-
*/
|
|
22
|
-
static parseVersionRange(rangeString: string): VersionRange;
|
|
23
|
-
/**
|
|
24
|
-
* Get the version string
|
|
25
|
-
*/
|
|
26
|
-
toString(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Get major version number
|
|
29
|
-
*/
|
|
30
|
-
getMajor(): number;
|
|
31
|
-
/**
|
|
32
|
-
* Get minor version number
|
|
33
|
-
*/
|
|
34
|
-
getMinor(): number;
|
|
35
|
-
/**
|
|
36
|
-
* Get patch version number
|
|
37
|
-
*/
|
|
38
|
-
getPatch(): number;
|
|
39
|
-
/**
|
|
40
|
-
* Get prerelease identifier
|
|
41
|
-
*/
|
|
42
|
-
getPrerelease(): string[];
|
|
43
|
-
/**
|
|
44
|
-
* Check if this is a prerelease version
|
|
45
|
-
*/
|
|
46
|
-
isPrerelease(): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Compare with another version
|
|
49
|
-
*/
|
|
50
|
-
compareTo(other: Version): number;
|
|
51
|
-
/**
|
|
52
|
-
* Check if this version is newer than another
|
|
53
|
-
*/
|
|
54
|
-
isNewerThan(other: Version): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Check if this version is older than another
|
|
57
|
-
*/
|
|
58
|
-
isOlderThan(other: Version): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Check if this version equals another
|
|
61
|
-
*/
|
|
62
|
-
equals(other: Version): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Check if this version satisfies a range
|
|
65
|
-
*/
|
|
66
|
-
satisfies(range: VersionRange): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Get the difference type compared to another version
|
|
69
|
-
*/
|
|
70
|
-
getDifferenceType(other: Version): 'major' | 'minor' | 'patch' | 'prerelease' | 'same';
|
|
71
|
-
/**
|
|
72
|
-
* Increment version by type
|
|
73
|
-
*/
|
|
74
|
-
increment(type: 'major' | 'minor' | 'patch', prerelease?: string): Version;
|
|
75
|
-
/**
|
|
76
|
-
* Convert to JSON representation
|
|
77
|
-
*/
|
|
78
|
-
toJSON(): string;
|
|
79
|
-
/**
|
|
80
|
-
* Create from JSON representation
|
|
81
|
-
*/
|
|
82
|
-
static fromJSON(json: string): Version;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Version Range Value Object
|
|
86
|
-
*
|
|
87
|
-
* Represents a version range (e.g., "^1.2.3", "~2.0.0", ">=1.0.0 <2.0.0")
|
|
88
|
-
*/
|
|
89
|
-
export declare class VersionRange {
|
|
90
|
-
private readonly value;
|
|
91
|
-
private constructor();
|
|
92
|
-
/**
|
|
93
|
-
* Create a VersionRange from a range string
|
|
94
|
-
*/
|
|
95
|
-
static fromString(rangeString: string): VersionRange;
|
|
96
|
-
/**
|
|
97
|
-
* Get the range string
|
|
98
|
-
*/
|
|
99
|
-
toString(): string;
|
|
100
|
-
/**
|
|
101
|
-
* Check if a version satisfies this range
|
|
102
|
-
*/
|
|
103
|
-
includes(version: Version): boolean;
|
|
104
|
-
/**
|
|
105
|
-
* Check if this range is compatible with another range
|
|
106
|
-
*/
|
|
107
|
-
isCompatibleWith(other: VersionRange): boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Get the minimum version that satisfies this range
|
|
110
|
-
*/
|
|
111
|
-
getMinVersion(): Version | null;
|
|
112
|
-
/**
|
|
113
|
-
* Get the maximum version that satisfies this range
|
|
114
|
-
*/
|
|
115
|
-
getMaxVersion(): Version | null;
|
|
116
|
-
/**
|
|
117
|
-
* Check if this is a caret range (^x.y.z)
|
|
118
|
-
*/
|
|
119
|
-
isCaret(): boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Check if this is a tilde range (~x.y.z)
|
|
122
|
-
*/
|
|
123
|
-
isTilde(): boolean;
|
|
124
|
-
/**
|
|
125
|
-
* Check if this is an exact version
|
|
126
|
-
*/
|
|
127
|
-
isExact(): boolean;
|
|
128
|
-
/**
|
|
129
|
-
* Convert to JSON representation
|
|
130
|
-
*/
|
|
131
|
-
toJSON(): string;
|
|
132
|
-
/**
|
|
133
|
-
* Create from JSON representation
|
|
134
|
-
*/
|
|
135
|
-
static fromJSON(json: string): VersionRange;
|
|
136
|
-
/**
|
|
137
|
-
* Check equality with another VersionRange
|
|
138
|
-
*/
|
|
139
|
-
equals(other: VersionRange): boolean;
|
|
140
|
-
}
|
|
141
|
-
//# sourceMappingURL=Version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Version.d.ts","sourceRoot":"","sources":["../../../src/domain/value-objects/Version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAE/C,OAAO;IAKP;;OAEG;WACW,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAexD;;OAEG;WACW,cAAc,CAC1B,KAAK,EAAE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