@contractspec/bundle.workspace 4.1.3 → 4.2.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/dist/index.js +871 -11
- package/dist/node/index.js +871 -11
- package/dist/services/upgrade/guided-upgrade.d.ts +10 -0
- package/dist/services/upgrade/guided-upgrade.test.d.ts +1 -0
- package/dist/services/upgrade/index.d.ts +1 -0
- package/dist/services/upgrade/types.d.ts +24 -0
- package/dist/services/upgrade/upgrade-service.d.ts +2 -0
- package/dist/services/versioning/index.d.ts +3 -0
- package/dist/services/versioning/release-files.d.ts +19 -0
- package/dist/services/versioning/release-formatters.d.ts +8 -0
- package/dist/services/versioning/release-plan.d.ts +7 -0
- package/dist/services/versioning/release-service.d.ts +13 -0
- package/dist/services/versioning/release-service.test.d.ts +1 -0
- package/dist/services/versioning/release-service.types.d.ts +55 -0
- package/package.json +13 -13
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GuidedUpgradeAnalysisResult, GuidedUpgradeApplyResult, UpgradeOptions } from './types';
|
|
2
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
3
|
+
import type { LoggerAdapter } from '../../ports/logger';
|
|
4
|
+
interface ServiceAdapters {
|
|
5
|
+
fs: FsAdapter;
|
|
6
|
+
logger: LoggerAdapter;
|
|
7
|
+
}
|
|
8
|
+
export declare function analyzeGuidedUpgrade(adapters: ServiceAdapters, options: UpgradeOptions): Promise<GuidedUpgradeAnalysisResult>;
|
|
9
|
+
export declare function applyGuidedUpgrade(adapters: ServiceAdapters, options: UpgradeOptions): Promise<GuidedUpgradeApplyResult>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Types for upgrading ContractSpec SDK and configuration.
|
|
5
5
|
*/
|
|
6
|
+
import type { AgentPromptBundle, AgentTarget, UpgradePlan, UpgradePlanStep } from '@contractspec/lib.contracts-spec';
|
|
6
7
|
/**
|
|
7
8
|
* Options for running an upgrade.
|
|
8
9
|
*/
|
|
@@ -17,6 +18,10 @@ export interface UpgradeOptions {
|
|
|
17
18
|
dryRun?: boolean;
|
|
18
19
|
/** Use @latest tag instead of caret range. */
|
|
19
20
|
useLatest?: boolean;
|
|
21
|
+
/** Generated upgrade manifest candidate paths. */
|
|
22
|
+
manifestPaths?: string[];
|
|
23
|
+
/** Preferred agent prompt target. */
|
|
24
|
+
agentTarget?: AgentTarget;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Result of a package upgrade check.
|
|
@@ -71,4 +76,23 @@ export interface UpgradeApplyResult {
|
|
|
71
76
|
error?: string;
|
|
72
77
|
/** Summary message. */
|
|
73
78
|
summary: string;
|
|
79
|
+
/** Applied deterministic autofixes. */
|
|
80
|
+
appliedAutofixes?: string[];
|
|
81
|
+
/** Remaining non-automatic steps. */
|
|
82
|
+
remainingSteps?: UpgradePlanStep[];
|
|
83
|
+
/** Human-readable follow-up checklist. */
|
|
84
|
+
humanChecklist?: string[];
|
|
85
|
+
/** Generated agent prompt for unresolved work. */
|
|
86
|
+
promptBundle?: AgentPromptBundle;
|
|
87
|
+
/** Upgrade plan that drove the apply step. */
|
|
88
|
+
plan?: UpgradePlan;
|
|
89
|
+
}
|
|
90
|
+
export interface GuidedUpgradeAnalysisResult {
|
|
91
|
+
packageManager: string;
|
|
92
|
+
manifestPath?: string;
|
|
93
|
+
plan: UpgradePlan;
|
|
94
|
+
humanChecklist: string[];
|
|
95
|
+
}
|
|
96
|
+
export interface GuidedUpgradeApplyResult extends UpgradeApplyResult {
|
|
97
|
+
manifestPath?: string;
|
|
74
98
|
}
|
|
@@ -38,4 +38,6 @@ export declare function getDefaultVersioningConfig(): Record<string, unknown>;
|
|
|
38
38
|
* Get default hooks configuration.
|
|
39
39
|
*/
|
|
40
40
|
export declare function getDefaultHooksConfig(): Record<string, string[]>;
|
|
41
|
+
export declare function getDefaultReleaseConfig(): Record<string, unknown>;
|
|
42
|
+
export declare function getDefaultUpgradeConfig(): Record<string, unknown>;
|
|
41
43
|
export {};
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { formatChangelogJson, formatConventionalChangelog, formatKeepAChangelog, } from './changelog-formatter';
|
|
7
7
|
export * from './conventional-commits';
|
|
8
|
+
export * from './release-formatters';
|
|
9
|
+
export * from './release-service.types';
|
|
8
10
|
export * from './types';
|
|
9
11
|
export { analyzeVersions, analyzeVersionsFromCommits, applyVersionBump, generateChangelogs, } from './versioning-service';
|
|
12
|
+
export { buildReleaseArtifacts, checkReleaseArtifacts, initReleaseArtifacts, } from './release-service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReleaseCapsule, ReleaseCapsulePackage } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
3
|
+
export interface WorkspacePackageInfo {
|
|
4
|
+
name: string;
|
|
5
|
+
dir: string;
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ParsedChangesetFile {
|
|
9
|
+
slug: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
packages: ReleaseCapsulePackage[];
|
|
12
|
+
}
|
|
13
|
+
export declare function listChangesetFiles(fs: FsAdapter, workspaceRoot: string): Promise<string[]>;
|
|
14
|
+
export declare function readChangesets(fs: FsAdapter, workspaceRoot: string): Promise<ParsedChangesetFile[]>;
|
|
15
|
+
export declare function readReleaseCapsules(fs: FsAdapter, workspaceRoot: string, changesets: ParsedChangesetFile[]): Promise<Map<string, ReleaseCapsule>>;
|
|
16
|
+
export declare function discoverWorkspacePackages(fs: FsAdapter, workspaceRoot: string): Promise<WorkspacePackageInfo[]>;
|
|
17
|
+
export declare function matchChangedFilesToPackages(changedFiles: string[], packages: WorkspacePackageInfo[]): string[];
|
|
18
|
+
export declare function renderChangesetMarkdown(summary: string, packages: ReleaseCapsulePackage[]): string;
|
|
19
|
+
export declare function renderReleaseCapsuleYaml(capsule: ReleaseCapsule): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentTarget, GeneratedReleaseManifest, GeneratedReleaseManifestEntry, UpgradePlan } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
export declare function renderMaintainerSummary(entry: GeneratedReleaseManifestEntry): string;
|
|
3
|
+
export declare function renderCustomerPatchNote(entry: GeneratedReleaseManifestEntry): string;
|
|
4
|
+
export declare function renderMigrationGuide(entry: GeneratedReleaseManifestEntry): string;
|
|
5
|
+
export declare function renderPatchNotes(manifest: GeneratedReleaseManifest): string;
|
|
6
|
+
export declare function renderCustomerGuide(manifest: GeneratedReleaseManifest): string;
|
|
7
|
+
export declare function renderUpgradeChecklist(plan: UpgradePlan): string;
|
|
8
|
+
export declare function renderUpgradePrompt(agent: AgentTarget, plan: UpgradePlan): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AgentTarget, type GeneratedReleaseManifest, type GeneratedReleaseManifestEntry, type UpgradePlan } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
export interface InstalledPackageVersion {
|
|
3
|
+
name: string;
|
|
4
|
+
currentVersion?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function selectUpgradeReleases(manifest: GeneratedReleaseManifest, packages: InstalledPackageVersion[]): GeneratedReleaseManifestEntry[];
|
|
7
|
+
export declare function createUpgradePlan(manifest: GeneratedReleaseManifest, packages: InstalledPackageVersion[], agentTargets: AgentTarget[], renderPrompt: (agent: AgentTarget, plan: UpgradePlan) => string): UpgradePlan;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FsAdapter } from '../../ports/fs';
|
|
2
|
+
import type { GitAdapter } from '../../ports/git';
|
|
3
|
+
import type { LoggerAdapter } from '../../ports/logger';
|
|
4
|
+
import type { ReleaseBuildOptions, ReleaseBuildResult, ReleaseCheckOptions, ReleaseCheckResult, ReleaseInitOptions, ReleaseInitResult } from './release-service.types';
|
|
5
|
+
interface ServiceAdapters {
|
|
6
|
+
fs: FsAdapter;
|
|
7
|
+
git: GitAdapter;
|
|
8
|
+
logger: LoggerAdapter;
|
|
9
|
+
}
|
|
10
|
+
export declare function initReleaseArtifacts(adapters: ServiceAdapters, options?: ReleaseInitOptions): Promise<ReleaseInitResult>;
|
|
11
|
+
export declare function buildReleaseArtifacts(adapters: ServiceAdapters, options?: ReleaseBuildOptions): Promise<ReleaseBuildResult>;
|
|
12
|
+
export declare function checkReleaseArtifacts(adapters: ServiceAdapters, options?: ReleaseCheckOptions): Promise<ReleaseCheckResult>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AgentTarget, GeneratedReleaseManifest, ReleaseCapsulePackage, UpgradePlan, VersionBumpType } from '@contractspec/lib.contracts-spec';
|
|
2
|
+
export interface ReleaseInitOptions {
|
|
3
|
+
workspaceRoot?: string;
|
|
4
|
+
baseline?: string;
|
|
5
|
+
slug?: string;
|
|
6
|
+
summary?: string;
|
|
7
|
+
releaseType?: VersionBumpType;
|
|
8
|
+
packages?: string[];
|
|
9
|
+
dryRun?: boolean;
|
|
10
|
+
force?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ReleaseInitResult {
|
|
13
|
+
slug: string;
|
|
14
|
+
changesetPath: string;
|
|
15
|
+
capsulePath: string;
|
|
16
|
+
changesetContent: string;
|
|
17
|
+
capsuleContent: string;
|
|
18
|
+
packages: ReleaseCapsulePackage[];
|
|
19
|
+
releaseType: VersionBumpType;
|
|
20
|
+
isBreaking: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface ReleaseBuildOptions {
|
|
23
|
+
workspaceRoot?: string;
|
|
24
|
+
outputDir?: string;
|
|
25
|
+
dryRun?: boolean;
|
|
26
|
+
agentTargets?: AgentTarget[];
|
|
27
|
+
}
|
|
28
|
+
export interface ReleaseBuildResult {
|
|
29
|
+
outputDir: string;
|
|
30
|
+
manifestPath: string;
|
|
31
|
+
upgradeManifestPath: string;
|
|
32
|
+
patchNotesPath: string;
|
|
33
|
+
customerGuidePath: string;
|
|
34
|
+
promptPaths: Record<string, string>;
|
|
35
|
+
manifest: GeneratedReleaseManifest;
|
|
36
|
+
upgradePlan: UpgradePlan;
|
|
37
|
+
releasesBuilt: number;
|
|
38
|
+
}
|
|
39
|
+
export interface ReleaseCheckOptions {
|
|
40
|
+
workspaceRoot?: string;
|
|
41
|
+
baseline?: string;
|
|
42
|
+
outputDir?: string;
|
|
43
|
+
strict?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface ReleaseCheckStatus {
|
|
46
|
+
name: string;
|
|
47
|
+
ok: boolean;
|
|
48
|
+
message: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ReleaseCheckResult {
|
|
51
|
+
success: boolean;
|
|
52
|
+
errors: string[];
|
|
53
|
+
warnings: string[];
|
|
54
|
+
checks: ReleaseCheckStatus[];
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.workspace",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Workspace utilities for monorepo development",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"contractspec",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
20
20
|
"publish:pkg:canary": "bun publish:pkg --tag canary",
|
|
21
|
-
"build": "bun run
|
|
21
|
+
"build": "bun run build:bundle && bun run build:types",
|
|
22
22
|
"build:bundle": "contractspec-bun-build transpile",
|
|
23
23
|
"build:types": "contractspec-bun-build types",
|
|
24
24
|
"dev": "contractspec-bun-build dev",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ai-sdk/anthropic": "3.0.64",
|
|
35
35
|
"@ai-sdk/openai": "3.0.48",
|
|
36
|
-
"@contractspec/biome-config": "3.8.
|
|
37
|
-
"@contractspec/lib.ai-agent": "8.0.
|
|
38
|
-
"@contractspec/lib.ai-providers": "3.7.
|
|
39
|
-
"@contractspec/lib.contracts-spec": "5.0
|
|
40
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
41
|
-
"@contractspec/lib.contracts-transformers": "3.7.
|
|
42
|
-
"@contractspec/lib.source-extractors": "2.7.
|
|
43
|
-
"@contractspec/module.workspace": "4.1.
|
|
44
|
-
"@contractspec/lib.utils-typescript": "3.7.
|
|
36
|
+
"@contractspec/biome-config": "3.8.7",
|
|
37
|
+
"@contractspec/lib.ai-agent": "8.0.5",
|
|
38
|
+
"@contractspec/lib.ai-providers": "3.7.13",
|
|
39
|
+
"@contractspec/lib.contracts-spec": "5.1.0",
|
|
40
|
+
"@contractspec/lib.contracts-integrations": "3.8.9",
|
|
41
|
+
"@contractspec/lib.contracts-transformers": "3.7.17",
|
|
42
|
+
"@contractspec/lib.source-extractors": "2.7.17",
|
|
43
|
+
"@contractspec/module.workspace": "4.1.4",
|
|
44
|
+
"@contractspec/lib.utils-typescript": "3.7.13",
|
|
45
45
|
"ai": "6.0.138",
|
|
46
46
|
"chalk": "^5.6.2",
|
|
47
47
|
"chokidar": "^5.0.0",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"zod": "^4.3.5"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@contractspec/tool.typescript": "3.7.
|
|
57
|
+
"@contractspec/tool.typescript": "3.7.13",
|
|
58
58
|
"@types/bun": "^1.3.11",
|
|
59
59
|
"@types/micromatch": "^4.0.10",
|
|
60
60
|
"@types/node": "^25.3.5",
|
|
61
61
|
"typescript": "^5.9.3",
|
|
62
|
-
"@contractspec/tool.bun": "3.7.
|
|
62
|
+
"@contractspec/tool.bun": "3.7.13"
|
|
63
63
|
},
|
|
64
64
|
"exports": {
|
|
65
65
|
".": {
|