@ucdjs/release-scripts 0.1.0-beta.22 → 0.1.0-beta.24

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.d.mts CHANGED
@@ -1,192 +1,66 @@
1
- //#region src/core/workspace.d.ts
2
- interface WorkspacePackage {
3
- name: string;
4
- version: string;
5
- path: string;
6
- packageJson: PackageJson;
7
- workspaceDependencies: string[];
8
- workspaceDevDependencies: string[];
9
- }
10
- //#endregion
11
- //#region src/shared/types.d.ts
12
- type BumpKind = "none" | "patch" | "minor" | "major";
13
- type GlobalCommitMode = false | "dependencies" | "all";
14
- interface CommitGroup {
15
- /**
16
- * Unique identifier for the group
17
- */
18
- name: string;
19
- /**
20
- * Display title (e.g., "Features", "Bug Fixes")
21
- */
22
- title: string;
23
- /**
24
- * Conventional commit types to include in this group
25
- */
26
- types: string[];
27
- }
28
- interface SharedOptions {
29
- /**
30
- * Repository identifier (e.g., "owner/repo")
31
- */
32
- repo: `${string}/${string}`;
33
- /**
34
- * Root directory of the workspace (defaults to process.cwd())
35
- */
36
- workspaceRoot?: string;
37
- /**
38
- * Specific packages to prepare for release.
39
- * - true: discover all packages
40
- * - FindWorkspacePackagesOptions: discover with filters
41
- * - string[]: specific package names
42
- */
43
- packages?: true | FindWorkspacePackagesOptions | string[];
44
- /**
45
- * GitHub token for authentication
46
- */
47
- githubToken: string;
48
- /**
49
- * Interactive prompt configuration
50
- */
51
- prompts?: {
52
- /**
53
- * Enable package selection prompt (defaults to true when not in CI)
54
- */
55
- packages?: boolean;
56
- /**
57
- * Enable version override prompt (defaults to true when not in CI)
58
- */
59
- versions?: boolean;
60
- };
61
- /**
62
- * Commit grouping configuration
63
- * Used for changelog generation and commit display
64
- * @default DEFAULT_COMMIT_GROUPS
65
- */
66
- groups?: CommitGroup[];
67
- }
68
- interface PackageJson {
69
- name: string;
70
- version: string;
71
- dependencies?: Record<string, string>;
72
- devDependencies?: Record<string, string>;
73
- peerDependencies?: Record<string, string>;
74
- private?: boolean;
75
- [key: string]: unknown;
76
- }
1
+ import { Context, Effect, Schema } from "effect";
2
+ import { CommandExecutor } from "@effect/platform";
3
+
4
+ //#region src/options.d.ts
77
5
  interface FindWorkspacePackagesOptions {
78
- /**
79
- * Package names to exclude
80
- */
81
6
  exclude?: string[];
82
- /**
83
- * Only include these packages (if specified, all others are excluded)
84
- */
85
7
  include?: string[];
86
- /**
87
- * Whether to exclude private packages (default: false)
88
- */
89
8
  excludePrivate?: boolean;
90
9
  }
91
- interface PackageRelease {
92
- /**
93
- * The package being updated
94
- */
95
- package: WorkspacePackage;
96
- /**
97
- * Current version
98
- */
99
- currentVersion: string;
100
- /**
101
- * New version to release
102
- */
103
- newVersion: string;
104
- /**
105
- * Type of version bump
106
- */
107
- bumpType: BumpKind;
108
- /**
109
- * Whether this package has direct changes (vs being updated due to dependency changes)
110
- */
111
- hasDirectChanges: boolean;
112
- }
113
- //#endregion
114
- //#region src/publish.d.ts
115
- interface PublishOptions extends SharedOptions {}
116
- declare function publish(_options: PublishOptions): void;
117
- //#endregion
118
- //#region src/release.d.ts
119
- interface ReleaseOptions extends SharedOptions {
10
+ interface ReleaseScriptsOptionsInput {
11
+ dryRun?: boolean;
12
+ repo: `${string}/${string}`;
13
+ workspaceRoot?: string;
14
+ packages?: true | FindWorkspacePackagesOptions | string[];
15
+ githubToken: string;
120
16
  branch?: {
121
- /**
122
- * Branch name for the release PR (defaults to "release/next")
123
- */
124
17
  release?: string;
125
- /**
126
- * Default branch name (e.g., "main")
127
- */
128
18
  default?: string;
129
19
  };
130
- /**
131
- * Whether to enable safety safeguards (e.g., checking for clean working directory)
132
- * @default true
133
- */
134
- safeguards?: boolean;
135
- /**
136
- * Pull request configuration
137
- */
20
+ globalCommitMode?: "dependencies" | "all" | "none";
138
21
  pullRequest?: {
139
- /**
140
- * Title for the release pull request
141
- */
142
22
  title?: string;
143
- /**
144
- * Body for the release pull request
145
- *
146
- * If not provided, a default body will be generated.
147
- *
148
- * NOTE:
149
- * You can use custom template expressions, see [h3js/rendu](https://github.com/h3js/rendu)
150
- */
151
23
  body?: string;
152
24
  };
25
+ types?: Record<string, {
26
+ title: string;
27
+ }>;
153
28
  changelog?: {
154
- /**
155
- * Whether to generate or update changelogs
156
- * @default true
157
- */
158
29
  enabled?: boolean;
159
- /**
160
- * Custom changelog entry template (ETA format)
161
- */
162
30
  template?: string;
31
+ emojis?: boolean;
163
32
  };
164
- globalCommitMode?: GlobalCommitMode;
165
33
  }
166
- interface ReleaseResult {
167
- /**
168
- * Packages that will be updated
169
- */
170
- updates: PackageRelease[];
171
- /**
172
- * URL of the created or updated PR
173
- */
174
- prUrl?: string;
175
- /**
176
- * Whether a new PR was created (vs updating existing)
177
- */
178
- created: boolean;
179
- }
180
- declare function release(options: ReleaseOptions): Promise<ReleaseResult | null>;
181
34
  //#endregion
182
- //#region src/verify.d.ts
183
- interface VerifyOptions extends SharedOptions {
184
- branch?: {
185
- release?: string;
186
- default?: string;
35
+ //#region src/services/workspace.service.d.ts
36
+
37
+ declare const WorkspacePackageSchema: Schema.Struct<{
38
+ name: typeof Schema.String;
39
+ version: typeof Schema.String;
40
+ path: typeof Schema.String;
41
+ packageJson: Schema.Struct<{
42
+ name: typeof Schema.String;
43
+ private: Schema.optional<typeof Schema.Boolean>;
44
+ version: Schema.optional<typeof Schema.String>;
45
+ dependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
46
+ devDependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
47
+ peerDependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
48
+ }>;
49
+ workspaceDependencies: Schema.Array$<typeof Schema.String>;
50
+ workspaceDevDependencies: Schema.Array$<typeof Schema.String>;
51
+ }>;
52
+ type WorkspacePackage = Schema.Schema.Type<typeof WorkspacePackageSchema>;
53
+ //#endregion
54
+ //#region src/index.d.ts
55
+ interface ReleaseScripts {
56
+ verify: () => Promise<void>;
57
+ prepare: () => Promise<void>;
58
+ publish: () => Promise<void>;
59
+ packages: {
60
+ list: () => Promise<readonly WorkspacePackage[]>;
61
+ get: (packageName: string) => Promise<WorkspacePackage | null>;
187
62
  };
188
- safeguards?: boolean;
189
63
  }
190
- declare function verify(options: VerifyOptions): Promise<void>;
64
+ declare function createReleaseScripts(options: ReleaseScriptsOptionsInput): Promise<ReleaseScripts>;
191
65
  //#endregion
192
- export { type PublishOptions, type ReleaseOptions, type ReleaseResult, type VerifyOptions, publish, release, verify };
66
+ export { ReleaseScripts, createReleaseScripts };