@3fn/core 13.0.0 → 14.1.0
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/.kiro/agents/ada-prompt.md +80 -132
- package/.kiro/agents/ada-prompt.md.attribution.json +45 -0
- package/.kiro/agents/ada.json +44 -59
- package/.kiro/agents/ada.json.attribution.json +13 -0
- package/.kiro/agents/data-prompt.md +83 -74
- package/.kiro/agents/data-prompt.md.attribution.json +53 -0
- package/.kiro/agents/data.json +31 -38
- package/.kiro/agents/data.json.attribution.json +13 -0
- package/.kiro/agents/kenya-prompt.md +83 -72
- package/.kiro/agents/kenya-prompt.md.attribution.json +53 -0
- package/.kiro/agents/kenya.json +27 -35
- package/.kiro/agents/kenya.json.attribution.json +13 -0
- package/.kiro/agents/leonardo-prompt.md +176 -234
- package/.kiro/agents/leonardo-prompt.md.attribution.json +45 -0
- package/.kiro/agents/leonardo.json +28 -36
- package/.kiro/agents/leonardo.json.attribution.json +13 -0
- package/.kiro/agents/lina-prompt.md +110 -151
- package/.kiro/agents/lina-prompt.md.attribution.json +53 -0
- package/.kiro/agents/lina.json +46 -59
- package/.kiro/agents/lina.json.attribution.json +13 -0
- package/.kiro/agents/sparky-prompt.md +89 -72
- package/.kiro/agents/sparky-prompt.md.attribution.json +53 -0
- package/.kiro/agents/sparky.json +37 -37
- package/.kiro/agents/sparky.json.attribution.json +13 -0
- package/.kiro/agents/stacy-prompt.md +74 -48
- package/.kiro/agents/stacy-prompt.md.attribution.json +45 -0
- package/.kiro/agents/stacy.json +28 -30
- package/.kiro/agents/stacy.json.attribution.json +13 -0
- package/.kiro/agents/thurgood-prompt.md +94 -138
- package/.kiro/agents/thurgood-prompt.md.attribution.json +45 -0
- package/.kiro/agents/thurgood.json +31 -35
- package/.kiro/agents/thurgood.json.attribution.json +13 -0
- package/.kiro/steering/AI-Collaboration-Principles.md +3 -3
- package/.kiro/steering/Civitas-System-Overview.md +7 -16
- package/.kiro/steering/DesignerPunk-Systems-Overview.md +6 -6
- package/.kiro/steering/Spec-Feedback-Protocol.md +2 -11
- package/.kiro/steering/Task-Completion-Protocol.md +98 -17
- package/.kiro/steering/core-goals.md +3 -3
- package/.kiro/steering/personal-note.md +1 -1
- package/.kiro/steering/start-up-tasks.md +17 -6
- package/application-mcp-server/src/index.ts +26 -0
- package/dist/ComponentTokens.android.kt +12 -12
- package/dist/ComponentTokens.ios.swift +12 -12
- package/dist/ComponentTokens.web.css +3 -3
- package/dist/DesignTokens.android.kt +1 -1
- package/dist/DesignTokens.dtcg.json +8 -5
- package/dist/DesignTokens.figma.json +2 -2
- package/dist/DesignTokens.ios.swift +1 -1
- package/dist/DesignTokens.web.css +1 -1
- package/dist/android/DesignTokens.android.kt +1 -1
- package/dist/blend/OklchBlendCalculator.js +1 -0
- package/dist/blend/ThemeAwareBlendUtilities.web.d.ts +13 -2
- package/dist/blend/ThemeAwareBlendUtilities.web.js +6 -1
- package/dist/browser/designerpunk.esm.js +36 -90
- package/dist/browser/designerpunk.esm.min.js +33 -36
- package/dist/browser/designerpunk.umd.js +36 -90
- package/dist/browser/designerpunk.umd.min.js +47 -50
- package/dist/browser/tokens.css +3 -3
- package/dist/build/tokens/defineComponentTokens.d.ts +10 -0
- package/dist/build/tokens/defineComponentTokens.js +26 -0
- package/dist/components/core/Avatar-Base/avatar.tokens.d.ts +21 -26
- package/dist/components/core/Avatar-Base/avatar.tokens.js +31 -34
- package/dist/components/core/Avatar-Base/index.d.ts +1 -1
- package/dist/components/core/Avatar-Base/index.js +2 -2
- package/dist/components/core/Avatar-Base/platforms/web/Avatar.web.js +24 -5
- package/dist/components/core/Button-CTA/examples/BasicUsage.d.ts +16 -28
- package/dist/components/core/Button-CTA/examples/BasicUsage.js +18 -43
- package/dist/components/core/Button-CTA/platforms/web/ButtonCTA.web.d.ts +3 -15
- package/dist/components/core/Button-CTA/platforms/web/ButtonCTA.web.js +9 -58
- package/dist/components/core/Button-CTA/types.d.ts +0 -24
- package/dist/components/core/Button-CTA/types.js +6 -0
- package/dist/components/core/Button-Icon/buttonIcon.tokens.d.ts +28 -14
- package/dist/components/core/Button-Icon/buttonIcon.tokens.js +35 -20
- package/dist/components/core/Input-Text-Base/types.d.ts +13 -1
- package/dist/components/core/Input-Text-Password/platforms/web/InputTextPassword.web.js +11 -2
- package/dist/generators/DTCGFormatGenerator.js +8 -0
- package/dist/generators/TokenFileGenerator.js +7 -2
- package/dist/integration/BuildErrorHandler.js +2 -2
- package/dist/ios/DesignTokens.ios.swift +1 -1
- package/dist/mcp/application-mcp.js +24 -0
- package/dist/mcp/docs-mcp.js +130 -15
- package/dist/mcp/product-mcp.js +25 -0
- package/dist/tokens/OpacityTokens.js +1 -1
- package/dist/tokens/component/progress.d.ts +65 -5
- package/dist/tokens/component/progress.js +79 -18
- package/dist/tokens/semantic/BlendTokens.d.ts +10 -3
- package/dist/tokens/semantic/BlendTokens.js +17 -5
- package/dist/tokens/semantic/OpacityTokens.d.ts +4 -4
- package/dist/tokens/semantic/OpacityTokens.js +4 -4
- package/dist/types/ComponentTypes.d.ts +1 -1
- package/dist/types/generated/TokenTypes.d.ts +1 -1
- package/dist/types/generated/TokenTypes.js +1 -1
- package/dist/validators/StemmaTokenUsageValidator.js +3 -2
- package/dist/web/DesignTokens.web.css +1 -1
- package/governance/BUILD-SYSTEM-SETUP.md +1 -2
- package/governance/Component-Development-Guide.md +23 -13
- package/governance/Component-Development-Standards.md +21 -20
- package/governance/Component-Family-Avatar.md +6 -7
- package/governance/Component-Family-Badge.md +19 -20
- package/governance/Component-Family-Button.md +30 -43
- package/governance/Component-Family-Chip.md +14 -15
- package/governance/Component-Family-Container.md +12 -13
- package/governance/Component-Family-Data-Display.md +1 -2
- package/governance/Component-Family-Divider.md +1 -2
- package/governance/Component-Family-Form-Inputs.md +65 -65
- package/governance/Component-Family-Icon.md +9 -10
- package/governance/Component-Family-Loading.md +1 -2
- package/governance/Component-Family-Modal.md +1 -2
- package/governance/Component-Family-Navigation.md +1 -2
- package/governance/Component-Family-Progress.md +0 -1
- package/governance/Component-Inheritance-Structures.md +219 -99
- package/governance/Component-MCP-Document-Template.md +6 -5
- package/governance/Component-Primitive-vs-Semantic-Philosophy.md +1 -1
- package/governance/Component-Quick-Reference.md +33 -33
- package/governance/Component-Readiness-Status.md +59 -44
- package/governance/Component-Templates.md +57 -61
- package/governance/Contract-System-Reference.md +7 -7
- package/governance/MCP-Integration-Guide.md +1 -1
- package/governance/Process-Cross-Reference-Standards.md +31 -13
- package/governance/Process-Development-Workflow.md +49 -59
- package/governance/Process-File-Organization.md +25 -28
- package/governance/Process-Hook-Operations.md +22 -11
- package/governance/Process-Orchestration-Model-Selection.md +92 -0
- package/governance/Process-Spec-Planning.md +98 -52
- package/governance/Process-Task-Type-Definitions.md +80 -4
- package/governance/Product-Handoff-Protocol.md +2 -0
- package/governance/Rosetta-System-Architecture.md +13 -11
- package/governance/Test-Behavioral-Contract-Validation.md +38 -31
- package/governance/Test-Failure-Audit-Methodology.md +1 -1
- package/governance/Token-Family-Accessibility.md +1 -2
- package/governance/Token-Family-Blend.md +18 -16
- package/governance/Token-Family-Blur.md +0 -1
- package/governance/Token-Family-Border.md +1 -2
- package/governance/Token-Family-Color.md +0 -1
- package/governance/Token-Family-Glow.md +1 -2
- package/governance/Token-Family-Layering.md +0 -1
- package/governance/Token-Family-Motion.md +1 -2
- package/governance/Token-Family-Opacity.md +0 -1
- package/governance/Token-Family-Radius.md +1 -2
- package/governance/Token-Family-Responsive.md +1 -2
- package/governance/Token-Family-Shadow.md +1 -2
- package/governance/Token-Family-Sizing.md +0 -1
- package/governance/Token-Family-Spacing.md +1 -2
- package/governance/Token-Family-Typography.md +1 -2
- package/governance/Token-Governance.md +8 -8
- package/governance/Token-Quick-Reference.md +47 -34
- package/governance/Token-Resolution-Patterns.md +1 -1
- package/governance/Token-Semantic-Structure.md +1 -1
- package/governance/Web-Authoring-Standards.md +5 -5
- package/governance/browser-distribution-guide.md +1 -4
- package/governance/classification-map.md +474 -0
- package/governance/completion-documentation-guide.md +23 -37
- package/governance/component-meta-authoring-guide.md +1 -1
- package/governance/cross-platform-vs-platform-specific-decision-framework.md +1 -1
- package/governance/platform-implementation-guidelines.md +2 -3
- package/governance/release-management-system.md +28 -63
- package/governance/rosetta-system-principles.md +8 -6
- package/governance/stemma-system-principles.md +18 -17
- package/mcp-server/src/index.ts +24 -6
- package/mcp-server/src/indexer/DocumentIndexer.ts +119 -9
- package/mcp-server/src/indexer/__tests__/bare-id-crossrefs.test.ts +250 -0
- package/mcp-server/src/indexer/cross-ref-parser.ts +29 -1
- package/mcp-server/src/indexer/index-health.ts +27 -2
- package/mcp-server/src/query/__tests__/find-docs-calibration.test.ts +11 -26
- package/mcp-server/src/relocation-integrity-gate/__tests__/relocation-integrity-gate.test.ts +72 -5
- package/mcp-server/src/relocation-integrity-gate/relocation-integrity-gate.ts +81 -24
- package/mcp-server/src/tools/list-cross-references.ts +2 -2
- package/package.json +24 -26
- package/src/__tests__/browser-distribution/css-bundling.test.ts +6 -4
- package/src/__tests__/console-allowlist.json +14 -0
- package/src/__tests__/console-fail-setup.ts +169 -0
- package/src/__tests__/integration/Spec107-DesignLanguageContext.test.ts +16 -0
- package/src/__tests__/stemma-system/behavioral-contract-validation.test.ts +70 -17
- package/src/__tests__/stemma-system/contract-catalog-name-validation.test.ts +28 -0
- package/src/__tests__/stemma-system/form-inputs-contracts.test.ts +223 -16
- package/src/__tests__/stemma-system/input-text-native-base-call-alignment.test.ts +298 -0
- package/src/blend/OklchBlendCalculator.ts +3 -0
- package/src/blend/ThemeAwareBlendUtilities.android.kt +3 -0
- package/src/blend/ThemeAwareBlendUtilities.ios.swift +3 -0
- package/src/blend/ThemeAwareBlendUtilities.web.ts +9 -1
- package/src/blend/__tests__/InteractionStateAudit.test.ts +12 -9
- package/src/build/errors/__tests__/ErrorHandler.integration.test.ts +8 -0
- package/src/build/errors/__tests__/ErrorHandler.test.ts +5 -0
- package/src/build/tokens/__tests__/defineComponentTokens.test.ts +113 -0
- package/src/build/tokens/defineComponentTokens.ts +43 -1
- package/src/build/workflow/__tests__/CICDIntegration.test.ts +12 -1
- package/src/cli/__tests__/init.test.ts +45 -11
- package/src/components/core/Avatar-Base/Avatar-Base.schema.yaml +1 -1
- package/src/components/core/Avatar-Base/__tests__/Avatar.accessibility.test.ts +121 -7
- package/src/components/core/Avatar-Base/__tests__/Avatar.image.test.ts +3 -0
- package/src/components/core/Avatar-Base/__tests__/Avatar.test.ts +15 -6
- package/src/components/core/Avatar-Base/avatar.tokens.ts +31 -34
- package/src/components/core/Avatar-Base/contracts.yaml +11 -1
- package/src/components/core/Avatar-Base/index.ts +1 -1
- package/src/components/core/Avatar-Base/platforms/web/Avatar.web.ts +24 -5
- package/src/components/core/Badge-Count-Base/contracts.yaml +1 -1
- package/src/components/core/Badge-Label-Base/contracts.yaml +1 -1
- package/src/components/core/Button-CTA/Button-CTA.schema.yaml +2 -12
- package/src/components/core/Button-CTA/README.md +3 -6
- package/src/components/core/Button-CTA/__tests__/ButtonCTA.test.ts +35 -89
- package/src/components/core/Button-CTA/__tests__/setup.test.ts +0 -2
- package/src/components/core/Button-CTA/__tests__/test-utils.ts +0 -2
- package/src/components/core/Button-CTA/contracts.yaml +6 -29
- package/src/components/core/Button-CTA/examples/BasicUsage.html +2 -14
- package/src/components/core/Button-CTA/examples/BasicUsage.tsx +17 -44
- package/src/components/core/Button-CTA/platforms/android/ButtonCTA.android.kt +12 -20
- package/src/components/core/Button-CTA/platforms/ios/ButtonCTA.ios.swift +12 -51
- package/src/components/core/Button-CTA/platforms/web/ButtonCTA.web.css +2 -26
- package/src/components/core/Button-CTA/platforms/web/ButtonCTA.web.ts +18 -71
- package/src/components/core/Button-CTA/types.ts +10 -28
- package/src/components/core/Button-Icon/buttonIcon.tokens.ts +43 -27
- package/src/components/core/Chip-Base/__tests__/ChipBase.test.ts +13 -0
- package/src/components/core/Chip-Filter/__tests__/ChipFilter.test.ts +13 -0
- package/src/components/core/Chip-Input/__tests__/ChipInput.test.ts +13 -0
- package/src/components/core/Input-Text-Base/Input-Text-Base.schema.yaml +30 -2
- package/src/components/core/Input-Text-Base/README.md +25 -2
- package/src/components/core/Input-Text-Base/__tests__/focusIndicators.test.ts +16 -15
- package/src/components/core/Input-Text-Base/contracts.yaml +90 -0
- package/src/components/core/Input-Text-Base/platforms/android/InputTextBase.android.kt +26 -12
- package/src/components/core/Input-Text-Base/platforms/ios/InputTextBase.ios.swift +195 -59
- package/src/components/core/Input-Text-Base/types.ts +13 -1
- package/src/components/core/Input-Text-Email/Input-Text-Email.schema.yaml +5 -1
- package/src/components/core/Input-Text-Email/README.md +8 -7
- package/src/components/core/Input-Text-Email/platforms/android/InputTextEmail.android.kt +1 -4
- package/src/components/core/Input-Text-Email/platforms/ios/InputTextEmail.ios.swift +2 -16
- package/src/components/core/Input-Text-Password/Input-Text-Password.schema.yaml +10 -3
- package/src/components/core/Input-Text-Password/README.md +9 -8
- package/src/components/core/Input-Text-Password/contracts.yaml +5 -0
- package/src/components/core/Input-Text-Password/platforms/android/InputTextPassword.android.kt +17 -7
- package/src/components/core/Input-Text-Password/platforms/ios/InputTextPassword.ios.swift +22 -20
- package/src/components/core/Input-Text-Password/platforms/web/InputTextPassword.web.ts +11 -2
- package/src/components/core/Input-Text-PhoneNumber/Input-Text-PhoneNumber.schema.yaml +5 -1
- package/src/components/core/Input-Text-PhoneNumber/README.md +9 -8
- package/src/components/core/Input-Text-PhoneNumber/platforms/android/InputTextPhoneNumber.android.kt +2 -5
- package/src/components/core/Input-Text-PhoneNumber/platforms/ios/InputTextPhoneNumber.ios.swift +3 -17
- package/src/components/core/Nav-Header-App/contracts.yaml +1 -1
- package/src/components/core/Nav-SegmentedChoice-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Connector-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Label-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Indicator-Node-Base/contracts.yaml +1 -1
- package/src/components/core/Progress-Stepper-Base/__tests__/StepperBase.test.ts +5 -2
- package/src/components/core/Progress-Stepper-Detailed/__tests__/StepperDetailed.test.ts +5 -2
- package/src/generators/DTCGFormatGenerator.ts +6 -0
- package/src/generators/TokenFileGenerator.ts +7 -2
- package/src/generators/__tests__/DTCGConfigOptions.test.ts +14 -5
- package/src/integration/BuildErrorHandler.ts +2 -2
- package/src/tokens/OpacityTokens.ts +1 -1
- package/src/tokens/__tests__/OpacityTokens.test.ts +3 -1
- package/src/tokens/__tests__/ProgressTokenCompliance.test.ts +5 -3
- package/src/tokens/__tests__/ProgressTokenFormulas.test.ts +11 -11
- package/src/tokens/__tests__/ProgressTokenTranslation.test.ts +22 -20
- package/src/tokens/component/progress.ts +83 -21
- package/src/tokens/semantic/BlendTokens.ts +26 -5
- package/src/tokens/semantic/OpacityTokens.ts +4 -4
- package/src/types/ComponentTypes.ts +1 -1
- package/src/types/generated/TokenTypes.ts +1 -1
- package/src/validators/StemmaTokenUsageValidator.ts +3 -2
- package/token-index/components.yaml +8 -8
- package/token-index/semantics.yaml +1 -2
- package/src/tools/release/__tests__/ChangeClassifier.test.ts +0 -133
- package/src/tools/release/__tests__/ChangeExtractor.test.ts +0 -222
- package/src/tools/release/__tests__/GitHubPublisher.test.ts +0 -240
- package/src/tools/release/__tests__/NotesRenderer.test.ts +0 -142
- package/src/tools/release/__tests__/NpmPublisher.test.ts +0 -289
- package/src/tools/release/__tests__/PipelineIntegration.test.ts +0 -188
- package/src/tools/release/__tests__/ReleasePipeline.test.ts +0 -192
- package/src/tools/release/__tests__/SemanticVersionValidator.test.ts +0 -49
- package/src/tools/release/__tests__/SummaryScanner.test.ts +0 -141
- package/src/tools/release/__tests__/TagResolver.test.ts +0 -91
- package/src/tools/release/__tests__/VersionCalculator.test.ts +0 -270
- package/src/tools/release/__tests__/helpers/NpmMockHelper.ts +0 -80
- package/src/tools/release/cli/ReleasePipeline.ts +0 -165
- package/src/tools/release/cli/release-tool.ts +0 -107
- package/src/tools/release/pipeline/ChangeClassifier.ts +0 -61
- package/src/tools/release/pipeline/ChangeExtractor.ts +0 -87
- package/src/tools/release/pipeline/NotesRenderer.ts +0 -66
- package/src/tools/release/pipeline/SummaryScanner.ts +0 -70
- package/src/tools/release/pipeline/TagResolver.ts +0 -40
- package/src/tools/release/pipeline/VersionCalculator.ts +0 -375
- package/src/tools/release/publishers/GitHubPublisher.ts +0 -228
- package/src/tools/release/publishers/NpmPublisher.ts +0 -196
- package/src/tools/release/release-config.json +0 -5
- package/src/tools/release/types/index.ts +0 -282
- package/src/tools/release/validators/SemanticVersionValidator.ts +0 -67
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* npm Publisher for Release Tool
|
|
3
|
-
*
|
|
4
|
-
* Handles npm registry publishing, validation, and rollback.
|
|
5
|
-
* Extracted from src/release/publishing/NpmPublisher.ts.
|
|
6
|
-
* Gated behind npmPublishEnabled config flag.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { execSync } from 'child_process';
|
|
10
|
-
import * as fs from 'fs';
|
|
11
|
-
import * as path from 'path';
|
|
12
|
-
import { PackagePublish, PublishResult } from '../types';
|
|
13
|
-
|
|
14
|
-
export interface NpmConfig {
|
|
15
|
-
registry?: string;
|
|
16
|
-
token?: string;
|
|
17
|
-
timeout?: number;
|
|
18
|
-
maxRetries?: number;
|
|
19
|
-
retryDelay?: number;
|
|
20
|
-
dryRun?: boolean;
|
|
21
|
-
otp?: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface NpmAuthStatus {
|
|
25
|
-
authenticated: boolean;
|
|
26
|
-
username?: string;
|
|
27
|
-
email?: string;
|
|
28
|
-
registry: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export interface PackageInfo {
|
|
32
|
-
name: string;
|
|
33
|
-
version: string;
|
|
34
|
-
exists: boolean;
|
|
35
|
-
publishedVersions: string[];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export class NpmPublisher {
|
|
39
|
-
private config: NpmConfig;
|
|
40
|
-
private authenticated: boolean = false;
|
|
41
|
-
|
|
42
|
-
constructor(config: NpmConfig = {}) {
|
|
43
|
-
this.config = {
|
|
44
|
-
registry: 'https://registry.npmjs.org/',
|
|
45
|
-
timeout: 60000, maxRetries: 3, retryDelay: 2000, dryRun: false,
|
|
46
|
-
...config,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
async validateAuthentication(): Promise<NpmAuthStatus> {
|
|
51
|
-
try {
|
|
52
|
-
const whoami = this.execNpmCommand('whoami', { throwOnError: false });
|
|
53
|
-
if (whoami.success && whoami.stdout) {
|
|
54
|
-
const username = whoami.stdout.trim();
|
|
55
|
-
const profile = this.execNpmCommand('profile get --json', { throwOnError: false });
|
|
56
|
-
let email: string | undefined;
|
|
57
|
-
if (profile.success && profile.stdout) {
|
|
58
|
-
try { email = JSON.parse(profile.stdout).email; } catch { /* ignore */ }
|
|
59
|
-
}
|
|
60
|
-
this.authenticated = true;
|
|
61
|
-
return { authenticated: true, username, email, registry: this.config.registry || 'https://registry.npmjs.org/' };
|
|
62
|
-
}
|
|
63
|
-
this.authenticated = false;
|
|
64
|
-
return { authenticated: false, registry: this.config.registry || 'https://registry.npmjs.org/' };
|
|
65
|
-
} catch (error) {
|
|
66
|
-
this.authenticated = false;
|
|
67
|
-
throw new Error(`npm authentication validation failed: ${this.getErrorMessage(error)}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async packageVersionExists(packageName: string, version: string): Promise<boolean> {
|
|
72
|
-
try {
|
|
73
|
-
const result = this.execNpmCommand(`view ${packageName}@${version} version --json`, { throwOnError: false });
|
|
74
|
-
return result.success && result.stdout.trim() !== '';
|
|
75
|
-
} catch { return false; }
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
async getPackageInfo(packageName: string): Promise<PackageInfo> {
|
|
79
|
-
try {
|
|
80
|
-
const result = this.execNpmCommand(`view ${packageName} versions --json`, { throwOnError: false });
|
|
81
|
-
if (result.success && result.stdout) {
|
|
82
|
-
try {
|
|
83
|
-
const versions = JSON.parse(result.stdout);
|
|
84
|
-
const publishedVersions = Array.isArray(versions) ? versions : [versions];
|
|
85
|
-
return { name: packageName, version: publishedVersions[publishedVersions.length - 1] || '0.0.0', exists: publishedVersions.length > 0, publishedVersions };
|
|
86
|
-
} catch { /* fall through */ }
|
|
87
|
-
}
|
|
88
|
-
return { name: packageName, version: '0.0.0', exists: false, publishedVersions: [] };
|
|
89
|
-
} catch (error) {
|
|
90
|
-
throw new Error(`Failed to get package info: ${this.getErrorMessage(error)}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
async validatePackage(pkg: PackagePublish): Promise<{ valid: boolean; errors: string[] }> {
|
|
95
|
-
const errors: string[] = [];
|
|
96
|
-
const packageJsonPath = path.join(pkg.path, 'package.json');
|
|
97
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
98
|
-
errors.push(`package.json not found at ${packageJsonPath}`);
|
|
99
|
-
return { valid: false, errors };
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
103
|
-
if (packageJson.name !== pkg.name) errors.push(`Package name mismatch: expected ${pkg.name}, got ${packageJson.name}`);
|
|
104
|
-
if (packageJson.version !== pkg.version) errors.push(`Version mismatch: expected ${pkg.version}, got ${packageJson.version}`);
|
|
105
|
-
if (!packageJson.name) errors.push('Package name is required');
|
|
106
|
-
if (!packageJson.version) errors.push('Package version is required');
|
|
107
|
-
if (packageJson.version && !this.isValidSemver(packageJson.version)) errors.push(`Invalid semver version: ${packageJson.version}`);
|
|
108
|
-
} catch (error) {
|
|
109
|
-
errors.push(`Failed to read package.json: ${this.getErrorMessage(error)}`);
|
|
110
|
-
}
|
|
111
|
-
return { valid: errors.length === 0, errors };
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
async publishPackage(pkg: PackagePublish): Promise<PublishResult> {
|
|
115
|
-
try {
|
|
116
|
-
if (!this.authenticated) {
|
|
117
|
-
const authStatus = await this.validateAuthentication();
|
|
118
|
-
if (!authStatus.authenticated) throw new Error('Not authenticated with npm registry. Run "npm login" first.');
|
|
119
|
-
}
|
|
120
|
-
const validation = await this.validatePackage(pkg);
|
|
121
|
-
if (!validation.valid) throw new Error(`Package validation failed: ${validation.errors.join(', ')}`);
|
|
122
|
-
const versionExists = await this.packageVersionExists(pkg.name, pkg.version);
|
|
123
|
-
if (versionExists) throw new Error(`Package ${pkg.name}@${pkg.version} already exists in registry`);
|
|
124
|
-
return await this.publishWithRetry(pkg);
|
|
125
|
-
} catch (error) {
|
|
126
|
-
return { success: false, packageName: pkg.name, version: pkg.version, error: this.getErrorMessage(error) };
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
async publishPackages(packages: PackagePublish[]): Promise<PublishResult[]> {
|
|
131
|
-
const results: PublishResult[] = [];
|
|
132
|
-
for (const pkg of packages) {
|
|
133
|
-
const result = await this.publishPackage(pkg);
|
|
134
|
-
results.push(result);
|
|
135
|
-
if (!result.success && !this.config.dryRun) {
|
|
136
|
-
for (const remaining of packages.slice(packages.indexOf(pkg) + 1)) {
|
|
137
|
-
results.push({ success: false, packageName: remaining.name, version: remaining.version, error: 'Publishing stopped due to previous failure' });
|
|
138
|
-
}
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return results;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async unpublishPackage(packageName: string, version: string): Promise<boolean> {
|
|
146
|
-
try {
|
|
147
|
-
const exists = await this.packageVersionExists(packageName, version);
|
|
148
|
-
if (!exists) throw new Error(`Package ${packageName}@${version} does not exist in registry`);
|
|
149
|
-
const result = this.execNpmCommand(`unpublish ${packageName}@${version} --force`, { throwOnError: true });
|
|
150
|
-
return result.success;
|
|
151
|
-
} catch (error) {
|
|
152
|
-
throw new Error(`Failed to unpublish package: ${this.getErrorMessage(error)}`);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
private async publishWithRetry(pkg: PackagePublish, attempt: number = 1): Promise<PublishResult> {
|
|
157
|
-
try {
|
|
158
|
-
let command = `publish ${pkg.path}`;
|
|
159
|
-
if (pkg.access) command += ` --access ${pkg.access}`;
|
|
160
|
-
if (pkg.registry) command += ` --registry ${pkg.registry}`;
|
|
161
|
-
if (this.config.otp) command += ` --otp ${this.config.otp}`;
|
|
162
|
-
if (this.config.dryRun) command += ` --dry-run`;
|
|
163
|
-
this.execNpmCommand(command, { throwOnError: true });
|
|
164
|
-
return { success: true, packageName: pkg.name, version: pkg.version, url: `${pkg.registry || this.config.registry}package/${pkg.name}` };
|
|
165
|
-
} catch (error) {
|
|
166
|
-
if (attempt < (this.config.maxRetries || 3)) {
|
|
167
|
-
await new Promise((r) => setTimeout(r, this.config.retryDelay || 2000));
|
|
168
|
-
return this.publishWithRetry(pkg, attempt + 1);
|
|
169
|
-
}
|
|
170
|
-
throw error;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
private execNpmCommand(command: string, options: { throwOnError?: boolean } = {}): { success: boolean; stdout: string; stderr: string } {
|
|
175
|
-
try {
|
|
176
|
-
let fullCommand = `npm ${command}`;
|
|
177
|
-
if (this.config.registry && !command.includes('--registry')) fullCommand += ` --registry ${this.config.registry}`;
|
|
178
|
-
const stdout = execSync(fullCommand, { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'pipe'], timeout: this.config.timeout });
|
|
179
|
-
return { success: true, stdout: stdout || '', stderr: '' };
|
|
180
|
-
} catch (error: any) {
|
|
181
|
-
if (options.throwOnError) throw new Error(`npm command failed: ${error.stderr?.toString() || error.message}`);
|
|
182
|
-
return { success: false, stdout: error.stdout?.toString() || '', stderr: error.stderr?.toString() || '' };
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
private isValidSemver(version: string): boolean {
|
|
187
|
-
return /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(version);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
private getErrorMessage(error: unknown): string {
|
|
191
|
-
if (error instanceof Error) return error.message;
|
|
192
|
-
if (typeof error === 'string') return error;
|
|
193
|
-
if (error && typeof error === 'object' && 'message' in error) return String((error as any).message);
|
|
194
|
-
return 'Unknown error occurred';
|
|
195
|
-
}
|
|
196
|
-
}
|
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared types for the release tool pipeline.
|
|
3
|
-
*
|
|
4
|
-
* Organized into three sections:
|
|
5
|
-
* 1. Pipeline types — the new system's domain model (design.md interfaces)
|
|
6
|
-
* 2. Calculator types — shapes consumed by the extracted VersionCalculator
|
|
7
|
-
* 3. Publisher types — shapes consumed by the extracted publishers
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// ============================================================
|
|
11
|
-
// 1. PIPELINE TYPES — new release tool domain model
|
|
12
|
-
// ============================================================
|
|
13
|
-
|
|
14
|
-
/** Git tag information from TagResolver */
|
|
15
|
-
export interface TagInfo {
|
|
16
|
-
tag: string;
|
|
17
|
-
commit: string;
|
|
18
|
-
date: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/** Parsed summary document from SummaryScanner */
|
|
22
|
-
export interface SummaryDoc {
|
|
23
|
-
path: string;
|
|
24
|
-
specName: string;
|
|
25
|
-
taskNumber: number;
|
|
26
|
-
raw: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Extracted change from a single summary doc (ChangeExtractor output) */
|
|
30
|
-
export interface ExtractedChange {
|
|
31
|
-
specName: string;
|
|
32
|
-
taskTitle: string;
|
|
33
|
-
taskType: string;
|
|
34
|
-
whatWasDone: string;
|
|
35
|
-
whyItMatters: string;
|
|
36
|
-
keyChanges: string[];
|
|
37
|
-
impact: string[];
|
|
38
|
-
deliverables?: DeliverableEntry[];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/** Structured deliverable from optional ## Deliverables section */
|
|
42
|
-
export interface DeliverableEntry {
|
|
43
|
-
priority: '🔴' | '🟡' | '🔵';
|
|
44
|
-
type: string;
|
|
45
|
-
description: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** Priority tier for change classification */
|
|
49
|
-
export type Priority = 'breaking' | 'prominent' | 'context';
|
|
50
|
-
|
|
51
|
-
/** Classified change (ChangeClassifier output) */
|
|
52
|
-
export interface ClassifiedChange {
|
|
53
|
-
change: ExtractedChange;
|
|
54
|
-
priority: Priority;
|
|
55
|
-
deliverableType: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Pipeline-level version recommendation */
|
|
59
|
-
export interface PipelineRecommendation {
|
|
60
|
-
currentVersion: string;
|
|
61
|
-
recommendedVersion: string;
|
|
62
|
-
bumpType: 'major' | 'minor' | 'patch' | 'none';
|
|
63
|
-
rationale: string;
|
|
64
|
-
confidence: number;
|
|
65
|
-
changes: ClassifiedChange[];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** Rendered release notes (NotesRenderer output) */
|
|
69
|
-
export interface RenderedNotes {
|
|
70
|
-
public: string;
|
|
71
|
-
internal: string;
|
|
72
|
-
json: ReleaseData;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/** Structured intermediate for testability */
|
|
76
|
-
export interface ReleaseData {
|
|
77
|
-
version: string;
|
|
78
|
-
previousVersion: string;
|
|
79
|
-
date: string;
|
|
80
|
-
changes: ClassifiedChange[];
|
|
81
|
-
recommendation: PipelineRecommendation;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/** Release tool configuration */
|
|
85
|
-
export interface ReleaseConfig {
|
|
86
|
-
npmPublishEnabled: boolean;
|
|
87
|
-
repoUrl: string;
|
|
88
|
-
outputDir: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// ============================================================
|
|
92
|
-
// 2. CALCULATOR TYPES — extracted VersionCalculator shapes
|
|
93
|
-
// ============================================================
|
|
94
|
-
|
|
95
|
-
export interface BreakingChange {
|
|
96
|
-
id: string;
|
|
97
|
-
title: string;
|
|
98
|
-
description: string;
|
|
99
|
-
affectedAPIs: string[];
|
|
100
|
-
migrationGuidance?: string;
|
|
101
|
-
source: string;
|
|
102
|
-
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface Feature {
|
|
106
|
-
id: string;
|
|
107
|
-
title: string;
|
|
108
|
-
description: string;
|
|
109
|
-
benefits: string[];
|
|
110
|
-
requirements: string[];
|
|
111
|
-
artifacts: string[];
|
|
112
|
-
source: string;
|
|
113
|
-
category: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface BugFix {
|
|
117
|
-
id: string;
|
|
118
|
-
title: string;
|
|
119
|
-
description: string;
|
|
120
|
-
issueReference?: string;
|
|
121
|
-
affectedComponents: string[];
|
|
122
|
-
source: string;
|
|
123
|
-
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface Improvement {
|
|
127
|
-
id: string;
|
|
128
|
-
title: string;
|
|
129
|
-
description: string;
|
|
130
|
-
type: 'performance' | 'usability' | 'maintainability' | 'security' | 'accessibility' | 'other';
|
|
131
|
-
impact: 'low' | 'medium' | 'high';
|
|
132
|
-
source: string;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export interface DocumentationChange {
|
|
136
|
-
id: string;
|
|
137
|
-
title: string;
|
|
138
|
-
description: string;
|
|
139
|
-
type: 'readme' | 'api-docs' | 'examples' | 'comments' | 'other';
|
|
140
|
-
source: string;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface ExtractedChanges {
|
|
144
|
-
breakingChanges: BreakingChange[];
|
|
145
|
-
newFeatures: Feature[];
|
|
146
|
-
bugFixes: BugFix[];
|
|
147
|
-
improvements: Improvement[];
|
|
148
|
-
documentation: DocumentationChange[];
|
|
149
|
-
metadata: ExtractionMetadata;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface ExtractionMetadata {
|
|
153
|
-
documentsAnalyzed: number;
|
|
154
|
-
extractionConfidence: number;
|
|
155
|
-
ambiguousItems: string[];
|
|
156
|
-
filteredItems: string[];
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export interface VersionRecommendation {
|
|
160
|
-
currentVersion: string;
|
|
161
|
-
recommendedVersion: string;
|
|
162
|
-
bumpType: 'major' | 'minor' | 'patch' | 'none';
|
|
163
|
-
rationale: string;
|
|
164
|
-
confidence: number;
|
|
165
|
-
evidence: ChangeEvidence[];
|
|
166
|
-
preReleaseInfo?: PreReleaseInfo;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface ChangeEvidence {
|
|
170
|
-
type: 'breaking' | 'feature' | 'fix' | 'improvement';
|
|
171
|
-
description: string;
|
|
172
|
-
source: string;
|
|
173
|
-
impact: 'high' | 'medium' | 'low';
|
|
174
|
-
count?: number;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface PreReleaseInfo {
|
|
178
|
-
isPreRelease: boolean;
|
|
179
|
-
preReleaseType?: 'alpha' | 'beta' | 'rc';
|
|
180
|
-
preReleaseNumber?: number;
|
|
181
|
-
canPromote?: boolean;
|
|
182
|
-
nextPreRelease?: string;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface ValidationResult {
|
|
186
|
-
valid: boolean;
|
|
187
|
-
errors: string[];
|
|
188
|
-
warnings: string[];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface ParsedVersion {
|
|
192
|
-
major: number;
|
|
193
|
-
minor: number;
|
|
194
|
-
patch: number;
|
|
195
|
-
preRelease: string | null;
|
|
196
|
-
build: string | null;
|
|
197
|
-
raw: string;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
// ============================================================
|
|
201
|
-
// 3. PUBLISHER TYPES — extracted publisher shapes
|
|
202
|
-
// ============================================================
|
|
203
|
-
|
|
204
|
-
export interface GitHubRelease {
|
|
205
|
-
tagName: string;
|
|
206
|
-
name: string;
|
|
207
|
-
body: string;
|
|
208
|
-
draft: boolean;
|
|
209
|
-
prerelease: boolean;
|
|
210
|
-
artifacts: Artifact[];
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface GitTag {
|
|
214
|
-
name: string;
|
|
215
|
-
message: string;
|
|
216
|
-
commit: string;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
export interface Artifact {
|
|
220
|
-
name: string;
|
|
221
|
-
path: string;
|
|
222
|
-
contentType: string;
|
|
223
|
-
size: number;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export interface ReleaseResult {
|
|
227
|
-
success: boolean;
|
|
228
|
-
version: string;
|
|
229
|
-
releasedPackages: string[];
|
|
230
|
-
githubReleaseUrl?: string;
|
|
231
|
-
npmPackageUrls: string[];
|
|
232
|
-
duration: number;
|
|
233
|
-
errors: ReleaseError[];
|
|
234
|
-
releasedAt: Date;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
export interface ReleaseError {
|
|
238
|
-
code: string;
|
|
239
|
-
message: string;
|
|
240
|
-
severity: 'error' | 'warning';
|
|
241
|
-
package?: string;
|
|
242
|
-
step?: string;
|
|
243
|
-
stackTrace?: string;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
export interface TagResult {
|
|
247
|
-
success: boolean;
|
|
248
|
-
tagName: string;
|
|
249
|
-
error?: string;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export interface UploadResult {
|
|
253
|
-
success: boolean;
|
|
254
|
-
artifactName: string;
|
|
255
|
-
url?: string;
|
|
256
|
-
error?: string;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
export interface RepositoryInfo {
|
|
260
|
-
owner: string;
|
|
261
|
-
name: string;
|
|
262
|
-
fullName: string;
|
|
263
|
-
defaultBranch: string;
|
|
264
|
-
private: boolean;
|
|
265
|
-
url: string;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export interface PackagePublish {
|
|
269
|
-
name: string;
|
|
270
|
-
version: string;
|
|
271
|
-
path: string;
|
|
272
|
-
registry: string;
|
|
273
|
-
access: 'public' | 'restricted';
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export interface PublishResult {
|
|
277
|
-
success: boolean;
|
|
278
|
-
packageName: string;
|
|
279
|
-
version: string;
|
|
280
|
-
url?: string;
|
|
281
|
-
error?: string;
|
|
282
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Semantic Version Validator for Release Tool
|
|
3
|
-
*
|
|
4
|
-
* Lightweight validation layer on top of VersionCalculator.
|
|
5
|
-
* The original SemanticVersionValidator (330 lines) was coupled to
|
|
6
|
-
* SemanticVersioningRules config and VersionBump types from the old system.
|
|
7
|
-
* This version delegates to VersionCalculator for parsing and validation,
|
|
8
|
-
* adding only the format and progression checks the pipeline needs.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { VersionCalculator } from '../pipeline/VersionCalculator';
|
|
12
|
-
import { ValidationResult } from '../types';
|
|
13
|
-
|
|
14
|
-
export class SemanticVersionValidator {
|
|
15
|
-
private calculator: VersionCalculator;
|
|
16
|
-
|
|
17
|
-
constructor(calculator?: VersionCalculator) {
|
|
18
|
-
this.calculator = calculator || new VersionCalculator();
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
validateFormat(version: string): ValidationResult {
|
|
22
|
-
const errors: string[] = [];
|
|
23
|
-
const warnings: string[] = [];
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
this.calculator.parseVersion(version);
|
|
27
|
-
} catch {
|
|
28
|
-
errors.push(`Version '${version}' does not follow semantic versioning specification`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return { valid: errors.length === 0, errors, warnings };
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
validateProgression(
|
|
35
|
-
from: string,
|
|
36
|
-
to: string,
|
|
37
|
-
bumpType: 'major' | 'minor' | 'patch' | 'none',
|
|
38
|
-
): ValidationResult {
|
|
39
|
-
const errors: string[] = [];
|
|
40
|
-
const warnings: string[] = [];
|
|
41
|
-
|
|
42
|
-
const fromValidation = this.validateFormat(from);
|
|
43
|
-
const toValidation = this.validateFormat(to);
|
|
44
|
-
|
|
45
|
-
if (!fromValidation.valid) {
|
|
46
|
-
errors.push(...fromValidation.errors);
|
|
47
|
-
return { valid: false, errors, warnings };
|
|
48
|
-
}
|
|
49
|
-
if (!toValidation.valid) {
|
|
50
|
-
errors.push(...toValidation.errors);
|
|
51
|
-
return { valid: false, errors, warnings };
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Delegate to VersionCalculator's existing validation
|
|
55
|
-
const recommendation = {
|
|
56
|
-
currentVersion: from,
|
|
57
|
-
recommendedVersion: to,
|
|
58
|
-
bumpType,
|
|
59
|
-
rationale: '',
|
|
60
|
-
confidence: 1,
|
|
61
|
-
evidence: [],
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const result = this.calculator.validateSemanticVersioning(recommendation);
|
|
65
|
-
return result;
|
|
66
|
-
}
|
|
67
|
-
}
|