@ucdjs/release-scripts 0.1.0-beta.34 → 0.1.0-beta.35

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.
@@ -1,5 +1,5 @@
1
+ import * as path from "node:path";
1
2
  import * as fs from "node:fs";
2
- import * as path$2 from "node:path";
3
3
 
4
4
  //#region node_modules/.pnpm/eta@4.5.1/node_modules/eta/dist/index.mjs
5
5
  var EtaError = class extends Error {
@@ -77,22 +77,22 @@ function resolvePath(templatePath, options) {
77
77
  path: templatePath,
78
78
  views: this.config.views
79
79
  });
80
- templatePath += path$2.extname(templatePath) ? "" : defaultExtension;
80
+ templatePath += path.extname(templatePath) ? "" : defaultExtension;
81
81
  if (baseFilePath) {
82
82
  if (this.config.cacheFilepaths && this.filepathCache[cacheIndex]) return this.filepathCache[cacheIndex];
83
83
  if (absolutePathRegExp.exec(templatePath)?.length) {
84
84
  const formattedPath = templatePath.replace(/^\/*|^\\*/, "");
85
- resolvedFilePath = path$2.join(views, formattedPath);
86
- } else resolvedFilePath = path$2.join(path$2.dirname(baseFilePath), templatePath);
87
- } else resolvedFilePath = path$2.join(views, templatePath);
85
+ resolvedFilePath = path.join(views, formattedPath);
86
+ } else resolvedFilePath = path.join(path.dirname(baseFilePath), templatePath);
87
+ } else resolvedFilePath = path.join(views, templatePath);
88
88
  if (dirIsChild(views, resolvedFilePath)) {
89
89
  if (baseFilePath && this.config.cacheFilepaths) this.filepathCache[cacheIndex] = resolvedFilePath;
90
90
  return resolvedFilePath;
91
91
  } else throw new EtaFileResolutionError(`Template '${templatePath}' is not in the views directory`);
92
92
  }
93
93
  function dirIsChild(parent, dir) {
94
- const relative = path$2.relative(parent, dir);
95
- return relative && !relative.startsWith("..") && !path$2.isAbsolute(relative);
94
+ const relative = path.relative(parent, dir);
95
+ return relative && !relative.startsWith("..") && !path.isAbsolute(relative);
96
96
  }
97
97
  const absolutePathRegExp = /^\\|^\//;
98
98
  /* istanbul ignore next */
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import { Context, Effect, Schema } from "effect";
2
- import { CommandExecutor } from "@effect/platform";
1
+ import "commit-parser";
3
2
 
4
3
  //#region src/options.d.ts
5
4
  interface FindWorkspacePackagesOptions {
@@ -13,6 +12,7 @@ interface ReleaseScriptsOptionsInput {
13
12
  workspaceRoot?: string;
14
13
  packages?: true | FindWorkspacePackagesOptions | string[];
15
14
  githubToken: string;
15
+ safeguards?: boolean;
16
16
  branch?: {
17
17
  release?: string;
18
18
  default?: string;
@@ -22,10 +22,7 @@ interface ReleaseScriptsOptionsInput {
22
22
  title?: string;
23
23
  body?: string;
24
24
  };
25
- types?: Record<string, {
26
- title: string;
27
- color?: string;
28
- }>;
25
+ types?: Record<string, CommitTypeRule>;
29
26
  changelog?: {
30
27
  enabled?: boolean;
31
28
  template?: string;
@@ -37,35 +34,88 @@ interface ReleaseScriptsOptionsInput {
37
34
  };
38
35
  prompts?: {
39
36
  versions?: boolean;
37
+ packages?: boolean;
40
38
  };
41
39
  }
42
40
  //#endregion
43
- //#region src/services/workspace.service.d.ts
44
- declare const WorkspacePackageSchema: Schema.Struct<{
45
- name: typeof Schema.String;
46
- version: typeof Schema.String;
47
- path: typeof Schema.String;
48
- packageJson: Schema.Struct<{
49
- name: typeof Schema.String;
50
- private: Schema.optional<typeof Schema.Boolean>;
51
- version: Schema.optional<typeof Schema.String>;
52
- dependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
53
- devDependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
54
- peerDependencies: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
55
- }>;
56
- workspaceDependencies: Schema.Array$<typeof Schema.String>;
57
- workspaceDevDependencies: Schema.Array$<typeof Schema.String>;
58
- }>;
59
- type WorkspacePackage = Schema.Schema.Type<typeof WorkspacePackageSchema>;
41
+ //#region src/core/workspace.d.ts
42
+ interface WorkspacePackage {
43
+ name: string;
44
+ version: string;
45
+ path: string;
46
+ packageJson: PackageJson;
47
+ workspaceDependencies: string[];
48
+ workspaceDevDependencies: string[];
49
+ }
50
+ //#endregion
51
+ //#region src/shared/types.d.ts
52
+ type BumpKind = "none" | "patch" | "minor" | "major";
53
+ interface CommitTypeRule {
54
+ /**
55
+ * Display title (e.g., "Features", "Bug Fixes")
56
+ */
57
+ title: string;
58
+ /**
59
+ * Commit types to include in this group (defaults to the map key)
60
+ */
61
+ types?: string[];
62
+ }
63
+ interface PackageJson {
64
+ name: string;
65
+ version: string;
66
+ dependencies?: Record<string, string>;
67
+ devDependencies?: Record<string, string>;
68
+ peerDependencies?: Record<string, string>;
69
+ private?: boolean;
70
+ [key: string]: unknown;
71
+ }
72
+ interface PackageRelease {
73
+ /**
74
+ * The package being updated
75
+ */
76
+ package: WorkspacePackage;
77
+ /**
78
+ * Current version
79
+ */
80
+ currentVersion: string;
81
+ /**
82
+ * New version to release
83
+ */
84
+ newVersion: string;
85
+ /**
86
+ * Type of version bump
87
+ */
88
+ bumpType: BumpKind;
89
+ /**
90
+ * Whether this package has direct changes (vs being updated due to dependency changes)
91
+ */
92
+ hasDirectChanges: boolean;
93
+ }
94
+ //#endregion
95
+ //#region src/types/release.d.ts
96
+ interface ReleaseResult {
97
+ /**
98
+ * Packages that will be updated
99
+ */
100
+ updates: PackageRelease[];
101
+ /**
102
+ * URL of the created or updated PR
103
+ */
104
+ prUrl?: string;
105
+ /**
106
+ * Whether a new PR was created (vs updating existing)
107
+ */
108
+ created: boolean;
109
+ }
60
110
  //#endregion
61
111
  //#region src/index.d.ts
62
112
  interface ReleaseScripts {
63
113
  verify: () => Promise<void>;
64
- prepare: () => Promise<void>;
114
+ prepare: () => Promise<ReleaseResult | null>;
65
115
  publish: () => Promise<void>;
66
116
  packages: {
67
- list: () => Promise<readonly WorkspacePackage[]>;
68
- get: (packageName: string) => Promise<WorkspacePackage | null>;
117
+ list: () => Promise<WorkspacePackage[]>;
118
+ get: (packageName: string) => Promise<WorkspacePackage | undefined>;
69
119
  };
70
120
  }
71
121
  declare function createReleaseScripts(options: ReleaseScriptsOptionsInput): Promise<ReleaseScripts>;