@eui/mcp 1.0.3
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/README.md +846 -0
- package/dist/config/index.d.ts +6 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +6 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +27 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +224 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/schema.d.ts +171 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +100 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/loader/cache-manager.d.ts +74 -0
- package/dist/loader/cache-manager.d.ts.map +1 -0
- package/dist/loader/cache-manager.js +107 -0
- package/dist/loader/cache-manager.js.map +1 -0
- package/dist/loader/documentation-loader.d.ts +57 -0
- package/dist/loader/documentation-loader.d.ts.map +1 -0
- package/dist/loader/documentation-loader.js +81 -0
- package/dist/loader/documentation-loader.js.map +1 -0
- package/dist/loader/documentation-source.d.ts +37 -0
- package/dist/loader/documentation-source.d.ts.map +1 -0
- package/dist/loader/documentation-source.js +2 -0
- package/dist/loader/documentation-source.js.map +1 -0
- package/dist/loader/errors.d.ts +34 -0
- package/dist/loader/errors.d.ts.map +1 -0
- package/dist/loader/errors.js +65 -0
- package/dist/loader/errors.js.map +1 -0
- package/dist/loader/http-client.d.ts +43 -0
- package/dist/loader/http-client.d.ts.map +1 -0
- package/dist/loader/http-client.js +144 -0
- package/dist/loader/http-client.js.map +1 -0
- package/dist/loader/index.d.ts +6 -0
- package/dist/loader/index.d.ts.map +1 -0
- package/dist/loader/index.js +5 -0
- package/dist/loader/index.js.map +1 -0
- package/dist/loader/local-documentation-source.d.ts +62 -0
- package/dist/loader/local-documentation-source.d.ts.map +1 -0
- package/dist/loader/local-documentation-source.js +190 -0
- package/dist/loader/local-documentation-source.js.map +1 -0
- package/dist/loader/path-type-detector.d.ts +34 -0
- package/dist/loader/path-type-detector.d.ts.map +1 -0
- package/dist/loader/path-type-detector.js +78 -0
- package/dist/loader/path-type-detector.js.map +1 -0
- package/dist/loader/remote-documentation-source.d.ts +112 -0
- package/dist/loader/remote-documentation-source.d.ts.map +1 -0
- package/dist/loader/remote-documentation-source.js +252 -0
- package/dist/loader/remote-documentation-source.js.map +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +211 -0
- package/dist/main.js.map +1 -0
- package/dist/mcp/index.d.ts +5 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +65 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +224 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/publish/index.d.ts +8 -0
- package/dist/publish/index.d.ts.map +1 -0
- package/dist/publish/index.js +8 -0
- package/dist/publish/index.js.map +1 -0
- package/dist/publish/publish-utils.d.ts +74 -0
- package/dist/publish/publish-utils.d.ts.map +1 -0
- package/dist/publish/publish-utils.js +170 -0
- package/dist/publish/publish-utils.js.map +1 -0
- package/dist/query/component-query.d.ts +33 -0
- package/dist/query/component-query.d.ts.map +1 -0
- package/dist/query/component-query.js +63 -0
- package/dist/query/component-query.js.map +1 -0
- package/dist/query/index-builder.d.ts +79 -0
- package/dist/query/index-builder.d.ts.map +1 -0
- package/dist/query/index-builder.js +217 -0
- package/dist/query/index-builder.js.map +1 -0
- package/dist/query/index.d.ts +5 -0
- package/dist/query/index.d.ts.map +1 -0
- package/dist/query/index.js +6 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/result-formatter.d.ts +108 -0
- package/dist/query/result-formatter.d.ts.map +1 -0
- package/dist/query/result-formatter.js +165 -0
- package/dist/query/result-formatter.js.map +1 -0
- package/dist/query/search-engine.d.ts +54 -0
- package/dist/query/search-engine.d.ts.map +1 -0
- package/dist/query/search-engine.js +178 -0
- package/dist/query/search-engine.js.map +1 -0
- package/dist/test-error.ts +1 -0
- package/dist/tools/get-component-docs.d.ts +43 -0
- package/dist/tools/get-component-docs.d.ts.map +1 -0
- package/dist/tools/get-component-docs.js +55 -0
- package/dist/tools/get-component-docs.js.map +1 -0
- package/dist/tools/get-component-examples.d.ts +45 -0
- package/dist/tools/get-component-examples.d.ts.map +1 -0
- package/dist/tools/get-component-examples.js +56 -0
- package/dist/tools/get-component-examples.js.map +1 -0
- package/dist/tools/get-component-inputs.d.ts +44 -0
- package/dist/tools/get-component-inputs.d.ts.map +1 -0
- package/dist/tools/get-component-inputs.js +55 -0
- package/dist/tools/get-component-inputs.js.map +1 -0
- package/dist/tools/get-component-outputs.d.ts +44 -0
- package/dist/tools/get-component-outputs.d.ts.map +1 -0
- package/dist/tools/get-component-outputs.js +55 -0
- package/dist/tools/get-component-outputs.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +8 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-components.d.ts +69 -0
- package/dist/tools/list-components.d.ts.map +1 -0
- package/dist/tools/list-components.js +84 -0
- package/dist/tools/list-components.js.map +1 -0
- package/dist/tools/search-components.d.ts +69 -0
- package/dist/tools/search-components.d.ts.map +1 -0
- package/dist/tools/search-components.js +98 -0
- package/dist/tools/search-components.js.map +1 -0
- package/dist/types/compodoc.d.ts +261 -0
- package/dist/types/compodoc.d.ts.map +1 -0
- package/dist/types/compodoc.js +5 -0
- package/dist/types/compodoc.js.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/circuit-breaker.d.ts +91 -0
- package/dist/utils/circuit-breaker.d.ts.map +1 -0
- package/dist/utils/circuit-breaker.js +186 -0
- package/dist/utils/circuit-breaker.js.map +1 -0
- package/dist/utils/credential-masking.d.ts +90 -0
- package/dist/utils/credential-masking.d.ts.map +1 -0
- package/dist/utils/credential-masking.js +202 -0
- package/dist/utils/credential-masking.js.map +1 -0
- package/dist/utils/error-handler.d.ts +68 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +184 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/errors.d.ts +156 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +242 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +16 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +76 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +150 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/retry.d.ts +19 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +81 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/version/changelog-file-utils.d.ts +69 -0
- package/dist/version/changelog-file-utils.d.ts.map +1 -0
- package/dist/version/changelog-file-utils.js +161 -0
- package/dist/version/changelog-file-utils.js.map +1 -0
- package/dist/version/changelog-utils.d.ts +98 -0
- package/dist/version/changelog-utils.d.ts.map +1 -0
- package/dist/version/changelog-utils.js +198 -0
- package/dist/version/changelog-utils.js.map +1 -0
- package/dist/version/dry-run-utils.d.ts +108 -0
- package/dist/version/dry-run-utils.d.ts.map +1 -0
- package/dist/version/dry-run-utils.js +126 -0
- package/dist/version/dry-run-utils.js.map +1 -0
- package/dist/version/git-tag-utils.d.ts +50 -0
- package/dist/version/git-tag-utils.d.ts.map +1 -0
- package/dist/version/git-tag-utils.js +66 -0
- package/dist/version/git-tag-utils.js.map +1 -0
- package/dist/version/index.d.ts +11 -0
- package/dist/version/index.d.ts.map +1 -0
- package/dist/version/index.js +11 -0
- package/dist/version/index.js.map +1 -0
- package/dist/version/release-utils.d.ts +94 -0
- package/dist/version/release-utils.d.ts.map +1 -0
- package/dist/version/release-utils.js +170 -0
- package/dist/version/release-utils.js.map +1 -0
- package/dist/version/rollback-utils.d.ts +47 -0
- package/dist/version/rollback-utils.d.ts.map +1 -0
- package/dist/version/rollback-utils.js +73 -0
- package/dist/version/rollback-utils.js.map +1 -0
- package/dist/version/version-manager.d.ts +98 -0
- package/dist/version/version-manager.d.ts.map +1 -0
- package/dist/version/version-manager.js +158 -0
- package/dist/version/version-manager.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rollback Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for rolling back to previous versions.
|
|
5
|
+
* Validates: Requirements 11.1, 11.2, 11.3, 11.5
|
|
6
|
+
*/
|
|
7
|
+
import { isValidVersion } from './version-manager.js';
|
|
8
|
+
/**
|
|
9
|
+
* Validates a rollback version string.
|
|
10
|
+
*
|
|
11
|
+
* Checks:
|
|
12
|
+
* - Version format is valid
|
|
13
|
+
* - Version is not the current version
|
|
14
|
+
*
|
|
15
|
+
* @param rollbackVersion - The version to rollback to
|
|
16
|
+
* @param currentVersion - The current version
|
|
17
|
+
* @returns Validation result with error message if invalid
|
|
18
|
+
*
|
|
19
|
+
* Validates: Requirements 11.1, 11.2
|
|
20
|
+
*/
|
|
21
|
+
export function validateRollbackVersion(rollbackVersion, currentVersion) {
|
|
22
|
+
// Check version format
|
|
23
|
+
if (!isValidVersion(rollbackVersion)) {
|
|
24
|
+
return {
|
|
25
|
+
valid: false,
|
|
26
|
+
error: `Invalid version format: ${rollbackVersion}. Expected format: MAJOR.MINOR.PATCH`,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// Check not rolling back to current version
|
|
30
|
+
const cleanRollback = rollbackVersion.startsWith('v') ? rollbackVersion.slice(1) : rollbackVersion;
|
|
31
|
+
const cleanCurrent = currentVersion.startsWith('v') ? currentVersion.slice(1) : currentVersion;
|
|
32
|
+
if (cleanRollback === cleanCurrent) {
|
|
33
|
+
return {
|
|
34
|
+
valid: false,
|
|
35
|
+
error: `Cannot rollback to current version: ${rollbackVersion}`,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return { valid: true };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Formats a rollback changelog entry.
|
|
42
|
+
*
|
|
43
|
+
* @param version - The version being rolled back to
|
|
44
|
+
* @param reason - Optional reason for the rollback
|
|
45
|
+
* @returns Formatted changelog entry
|
|
46
|
+
*
|
|
47
|
+
* Validates: Requirements 11.5
|
|
48
|
+
*/
|
|
49
|
+
export function formatRollbackChangelogEntry(version, reason) {
|
|
50
|
+
const date = new Date().toISOString().split('T')[0];
|
|
51
|
+
const cleanVersion = version.startsWith('v') ? version.slice(1) : version;
|
|
52
|
+
let entry = `## ${cleanVersion} (${date})\n\n`;
|
|
53
|
+
entry += `### Rollback\n\n`;
|
|
54
|
+
entry += `* Rolled back to version ${cleanVersion}\n`;
|
|
55
|
+
if (reason) {
|
|
56
|
+
entry += `* Reason: ${reason}\n`;
|
|
57
|
+
}
|
|
58
|
+
entry += '\n';
|
|
59
|
+
return entry;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Generates a Git tag name for a rollback.
|
|
63
|
+
*
|
|
64
|
+
* @param version - The version being rolled back to
|
|
65
|
+
* @returns Git tag name (e.g., "v1.2.3")
|
|
66
|
+
*
|
|
67
|
+
* Validates: Requirements 11.3
|
|
68
|
+
*/
|
|
69
|
+
export function generateRollbackTag(version) {
|
|
70
|
+
const cleanVersion = version.startsWith('v') ? version.slice(1) : version;
|
|
71
|
+
return `v${cleanVersion}`;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=rollback-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rollback-utils.js","sourceRoot":"","sources":["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O,CAAC;IAC/C,KAAK,IAAI,kBAAkB,CAAC;IAC5B,KAAK,IAAI,4BAA4B,YAAY,IAAI,CAAC;IAEtD,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,IAAI,aAAa,MAAM,IAAI,CAAC;IACnC,CAAC;IAED,KAAK,IAAI,IAAI,CAAC;IAEd,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAC1E,OAAO,IAAI,YAAY,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Management Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for parsing, validating, and bumping semantic versions.
|
|
5
|
+
* Follows semantic versioning specification (semver.org).
|
|
6
|
+
*/
|
|
7
|
+
export type ReleaseType = 'patch' | 'minor' | 'major';
|
|
8
|
+
export interface SemanticVersion {
|
|
9
|
+
major: number;
|
|
10
|
+
minor: number;
|
|
11
|
+
patch: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parses a semantic version string into its components.
|
|
15
|
+
*
|
|
16
|
+
* @param version - Version string in format "MAJOR.MINOR.PATCH" or "vMAJOR.MINOR.PATCH"
|
|
17
|
+
* @returns Parsed semantic version object
|
|
18
|
+
* @throws Error if version format is invalid
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseVersion(version: string): SemanticVersion;
|
|
21
|
+
/**
|
|
22
|
+
* Validates a semantic version string format.
|
|
23
|
+
*
|
|
24
|
+
* @param version - Version string to validate
|
|
25
|
+
* @returns true if valid, false otherwise
|
|
26
|
+
*/
|
|
27
|
+
export declare function isValidVersion(version: string): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Formats a semantic version object as a string.
|
|
30
|
+
*
|
|
31
|
+
* @param version - Semantic version object
|
|
32
|
+
* @returns Formatted version string "MAJOR.MINOR.PATCH"
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatVersion(version: SemanticVersion): string;
|
|
35
|
+
/**
|
|
36
|
+
* Increments a semantic version according to the specified release type.
|
|
37
|
+
*
|
|
38
|
+
* Rules:
|
|
39
|
+
* - patch: Increments PATCH version
|
|
40
|
+
* - minor: Increments MINOR version, resets PATCH to 0
|
|
41
|
+
* - major: Increments MAJOR version, resets MINOR and PATCH to 0
|
|
42
|
+
*
|
|
43
|
+
* @param version - Current semantic version
|
|
44
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
45
|
+
* @returns New semantic version after increment
|
|
46
|
+
*/
|
|
47
|
+
export declare function bumpVersion(version: SemanticVersion, releaseType: ReleaseType): SemanticVersion;
|
|
48
|
+
/**
|
|
49
|
+
* Increments a version string according to the specified release type.
|
|
50
|
+
*
|
|
51
|
+
* @param versionString - Current version string
|
|
52
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
53
|
+
* @returns New version string after increment
|
|
54
|
+
* @throws Error if version string is invalid
|
|
55
|
+
*/
|
|
56
|
+
export declare function bumpVersionString(versionString: string, releaseType: ReleaseType): string;
|
|
57
|
+
/**
|
|
58
|
+
* Environment types for npm publishing
|
|
59
|
+
*/
|
|
60
|
+
export type Environment = 'staging' | 'production';
|
|
61
|
+
/**
|
|
62
|
+
* npm distribution tags
|
|
63
|
+
*/
|
|
64
|
+
export type NpmTag = 'beta' | 'latest';
|
|
65
|
+
/**
|
|
66
|
+
* Selects the appropriate npm distribution tag based on the environment.
|
|
67
|
+
*
|
|
68
|
+
* Rules:
|
|
69
|
+
* - staging environment → "beta" tag
|
|
70
|
+
* - production environment → "latest" tag
|
|
71
|
+
*
|
|
72
|
+
* @param environment - The deployment environment (staging or production)
|
|
73
|
+
* @returns The npm distribution tag to use for publishing
|
|
74
|
+
*/
|
|
75
|
+
export declare function selectNpmTag(environment: Environment): NpmTag;
|
|
76
|
+
/**
|
|
77
|
+
* Result of a dry run version calculation
|
|
78
|
+
*/
|
|
79
|
+
export interface DryRunVersionResult {
|
|
80
|
+
currentVersion: string;
|
|
81
|
+
newVersion: string;
|
|
82
|
+
releaseType: ReleaseType;
|
|
83
|
+
isDryRun: true;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Calculates what the new version would be without modifying any files.
|
|
87
|
+
*
|
|
88
|
+
* This function is used in dry run mode to preview version changes.
|
|
89
|
+
*
|
|
90
|
+
* @param currentVersion - The current version string
|
|
91
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
92
|
+
* @returns Dry run result with current and calculated new version
|
|
93
|
+
* @throws Error if version string is invalid
|
|
94
|
+
*
|
|
95
|
+
* Validates: Requirements 15.2
|
|
96
|
+
*/
|
|
97
|
+
export declare function calculateDryRunVersion(currentVersion: string, releaseType: ReleaseType): DryRunVersionResult;
|
|
98
|
+
//# sourceMappingURL=version-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manager.d.ts","sourceRoot":"","sources":["../../src/version/version-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAiC7D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAOvD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAE9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,GAAG,eAAe,CA0B/F;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,GAAG,MAAM,CAIzF;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,YAAY,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEvC;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,CAS7D;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,QAAQ,EAAE,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,WAAW,GACvB,mBAAmB,CAarB"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Management Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides functions for parsing, validating, and bumping semantic versions.
|
|
5
|
+
* Follows semantic versioning specification (semver.org).
|
|
6
|
+
*/
|
|
7
|
+
import { isDryRunEnabled, logDryRunAction } from './dry-run-utils.js';
|
|
8
|
+
/**
|
|
9
|
+
* Parses a semantic version string into its components.
|
|
10
|
+
*
|
|
11
|
+
* @param version - Version string in format "MAJOR.MINOR.PATCH" or "vMAJOR.MINOR.PATCH"
|
|
12
|
+
* @returns Parsed semantic version object
|
|
13
|
+
* @throws Error if version format is invalid
|
|
14
|
+
*/
|
|
15
|
+
export function parseVersion(version) {
|
|
16
|
+
// Remove leading 'v' if present
|
|
17
|
+
const cleanVersion = version.startsWith('v') ? version.slice(1) : version;
|
|
18
|
+
// Split into components
|
|
19
|
+
const parts = cleanVersion.split('.');
|
|
20
|
+
if (parts.length !== 3) {
|
|
21
|
+
throw new Error(`Invalid version format: ${version}. Expected format: MAJOR.MINOR.PATCH`);
|
|
22
|
+
}
|
|
23
|
+
const [majorStr, minorStr, patchStr] = parts;
|
|
24
|
+
// Parse each component as integer
|
|
25
|
+
const major = parseInt(majorStr, 10);
|
|
26
|
+
const minor = parseInt(minorStr, 10);
|
|
27
|
+
const patch = parseInt(patchStr, 10);
|
|
28
|
+
// Validate that all parts are valid non-negative integers
|
|
29
|
+
if (isNaN(major) || isNaN(minor) || isNaN(patch)) {
|
|
30
|
+
throw new Error(`Invalid version format: ${version}. All components must be integers`);
|
|
31
|
+
}
|
|
32
|
+
if (major < 0 || minor < 0 || patch < 0) {
|
|
33
|
+
throw new Error(`Invalid version format: ${version}. All components must be non-negative`);
|
|
34
|
+
}
|
|
35
|
+
// Validate that the string representation matches (no leading zeros except for "0")
|
|
36
|
+
if (majorStr !== major.toString() || minorStr !== minor.toString() || patchStr !== patch.toString()) {
|
|
37
|
+
throw new Error(`Invalid version format: ${version}. Components must not have leading zeros`);
|
|
38
|
+
}
|
|
39
|
+
return { major, minor, patch };
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Validates a semantic version string format.
|
|
43
|
+
*
|
|
44
|
+
* @param version - Version string to validate
|
|
45
|
+
* @returns true if valid, false otherwise
|
|
46
|
+
*/
|
|
47
|
+
export function isValidVersion(version) {
|
|
48
|
+
try {
|
|
49
|
+
parseVersion(version);
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Formats a semantic version object as a string.
|
|
58
|
+
*
|
|
59
|
+
* @param version - Semantic version object
|
|
60
|
+
* @returns Formatted version string "MAJOR.MINOR.PATCH"
|
|
61
|
+
*/
|
|
62
|
+
export function formatVersion(version) {
|
|
63
|
+
return `${version.major}.${version.minor}.${version.patch}`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Increments a semantic version according to the specified release type.
|
|
67
|
+
*
|
|
68
|
+
* Rules:
|
|
69
|
+
* - patch: Increments PATCH version
|
|
70
|
+
* - minor: Increments MINOR version, resets PATCH to 0
|
|
71
|
+
* - major: Increments MAJOR version, resets MINOR and PATCH to 0
|
|
72
|
+
*
|
|
73
|
+
* @param version - Current semantic version
|
|
74
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
75
|
+
* @returns New semantic version after increment
|
|
76
|
+
*/
|
|
77
|
+
export function bumpVersion(version, releaseType) {
|
|
78
|
+
switch (releaseType) {
|
|
79
|
+
case 'patch':
|
|
80
|
+
return {
|
|
81
|
+
major: version.major,
|
|
82
|
+
minor: version.minor,
|
|
83
|
+
patch: version.patch + 1,
|
|
84
|
+
};
|
|
85
|
+
case 'minor':
|
|
86
|
+
return {
|
|
87
|
+
major: version.major,
|
|
88
|
+
minor: version.minor + 1,
|
|
89
|
+
patch: 0,
|
|
90
|
+
};
|
|
91
|
+
case 'major':
|
|
92
|
+
return {
|
|
93
|
+
major: version.major + 1,
|
|
94
|
+
minor: 0,
|
|
95
|
+
patch: 0,
|
|
96
|
+
};
|
|
97
|
+
default:
|
|
98
|
+
throw new Error(`Invalid release type: ${releaseType}. Must be 'patch', 'minor', or 'major'`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Increments a version string according to the specified release type.
|
|
103
|
+
*
|
|
104
|
+
* @param versionString - Current version string
|
|
105
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
106
|
+
* @returns New version string after increment
|
|
107
|
+
* @throws Error if version string is invalid
|
|
108
|
+
*/
|
|
109
|
+
export function bumpVersionString(versionString, releaseType) {
|
|
110
|
+
const version = parseVersion(versionString);
|
|
111
|
+
const bumped = bumpVersion(version, releaseType);
|
|
112
|
+
return formatVersion(bumped);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Selects the appropriate npm distribution tag based on the environment.
|
|
116
|
+
*
|
|
117
|
+
* Rules:
|
|
118
|
+
* - staging environment → "beta" tag
|
|
119
|
+
* - production environment → "latest" tag
|
|
120
|
+
*
|
|
121
|
+
* @param environment - The deployment environment (staging or production)
|
|
122
|
+
* @returns The npm distribution tag to use for publishing
|
|
123
|
+
*/
|
|
124
|
+
export function selectNpmTag(environment) {
|
|
125
|
+
switch (environment) {
|
|
126
|
+
case 'staging':
|
|
127
|
+
return 'beta';
|
|
128
|
+
case 'production':
|
|
129
|
+
return 'latest';
|
|
130
|
+
default:
|
|
131
|
+
throw new Error(`Invalid environment: ${environment}. Must be 'staging' or 'production'`);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Calculates what the new version would be without modifying any files.
|
|
136
|
+
*
|
|
137
|
+
* This function is used in dry run mode to preview version changes.
|
|
138
|
+
*
|
|
139
|
+
* @param currentVersion - The current version string
|
|
140
|
+
* @param releaseType - Type of release (patch, minor, or major)
|
|
141
|
+
* @returns Dry run result with current and calculated new version
|
|
142
|
+
* @throws Error if version string is invalid
|
|
143
|
+
*
|
|
144
|
+
* Validates: Requirements 15.2
|
|
145
|
+
*/
|
|
146
|
+
export function calculateDryRunVersion(currentVersion, releaseType) {
|
|
147
|
+
const newVersion = bumpVersionString(currentVersion, releaseType);
|
|
148
|
+
if (isDryRunEnabled()) {
|
|
149
|
+
logDryRunAction(`Bump version from ${currentVersion} to ${newVersion} (${releaseType})`);
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
currentVersion,
|
|
153
|
+
newVersion,
|
|
154
|
+
releaseType,
|
|
155
|
+
isDryRun: true,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=version-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manager.js","sourceRoot":"","sources":["../../src/version/version-manager.ts"],"names":[],"mappings":"AAAA;;;;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AAC;IAClG,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,aAAqB,EAAE,WAAwB;IAC/E,MAAM,OAAO,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACjD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC;AAYD;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,WAAwB;IACnD,QAAQ,WAAW,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC;QAChB,KAAK,YAAY;YACf,OAAO,QAAQ,CAAC;QAClB;YACE,MAAM,IAAI,KAAK,CAAC,wBAAwB,WAAW,qCAAqC,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC;AAYD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CACpC,cAAsB,EACtB,WAAwB;IAExB,MAAM,UAAU,GAAG,iBAAiB,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAElE,IAAI,eAAe,EAAE,EAAE,CAAC;QACtB,eAAe,CAAC,qBAAqB,cAAc,OAAO,UAAU,KAAK,WAAW,GAAG,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO;QACL,cAAc;QACd,UAAU;QACV,WAAW;QACX,QAAQ,EAAE,IAAI;KACf,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eui/mcp",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "MCP server for EUI Angular component library using Compodoc documentation",
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"eui-mcp": "./dist/main.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"dev": "tsc --watch",
|
|
18
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
19
|
+
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
|
|
20
|
+
"test:coverage": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage",
|
|
21
|
+
"start": "node dist/main.js",
|
|
22
|
+
"lint": "eslint src --ext .ts",
|
|
23
|
+
"version": "npm run changelog && git add CHANGELOG.md",
|
|
24
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
25
|
+
"changelog:simple": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
26
|
+
"release:patch": "npm version patch -m 'chore(release): %s [skip ci]'",
|
|
27
|
+
"release:minor": "npm version minor -m 'chore(release): %s [skip ci]'",
|
|
28
|
+
"release:major": "npm version major -m 'chore(release): %s [skip ci]'"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"mcp",
|
|
32
|
+
"model-context-protocol",
|
|
33
|
+
"angular",
|
|
34
|
+
"documentation",
|
|
35
|
+
"eui"
|
|
36
|
+
],
|
|
37
|
+
"author": "",
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
41
|
+
"chokidar": "^3.5.3",
|
|
42
|
+
"zod": "^3.22.4"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/jest": "^29.5.11",
|
|
46
|
+
"@types/node": "^20.10.6",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "^6.17.0",
|
|
48
|
+
"@typescript-eslint/parser": "^6.17.0",
|
|
49
|
+
"conventional-changelog-cli": "^4.1.0",
|
|
50
|
+
"eslint": "^8.56.0",
|
|
51
|
+
"fast-check": "^3.15.0",
|
|
52
|
+
"jest": "^29.7.0",
|
|
53
|
+
"semver": "^7.7.3",
|
|
54
|
+
"ts-jest": "^29.1.1",
|
|
55
|
+
"ts-node": "^10.9.2",
|
|
56
|
+
"typescript": "^5.3.3"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=18.0.0"
|
|
60
|
+
}
|
|
61
|
+
}
|