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

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,6 +1,3 @@
1
- import { Context, Effect, Schema } from "effect";
2
- import { CommandExecutor } from "@effect/platform";
3
-
4
1
  //#region src/options.d.ts
5
2
  interface FindWorkspacePackagesOptions {
6
3
  exclude?: string[];
@@ -13,6 +10,7 @@ interface ReleaseScriptsOptionsInput {
13
10
  workspaceRoot?: string;
14
11
  packages?: true | FindWorkspacePackagesOptions | string[];
15
12
  githubToken: string;
13
+ safeguards?: boolean;
16
14
  branch?: {
17
15
  release?: string;
18
16
  default?: string;
@@ -22,10 +20,7 @@ interface ReleaseScriptsOptionsInput {
22
20
  title?: string;
23
21
  body?: string;
24
22
  };
25
- types?: Record<string, {
26
- title: string;
27
- color?: string;
28
- }>;
23
+ types?: Record<string, CommitTypeRule>;
29
24
  changelog?: {
30
25
  enabled?: boolean;
31
26
  template?: string;
@@ -37,35 +32,88 @@ interface ReleaseScriptsOptionsInput {
37
32
  };
38
33
  prompts?: {
39
34
  versions?: boolean;
35
+ packages?: boolean;
40
36
  };
41
37
  }
42
38
  //#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>;
39
+ //#region src/core/workspace.d.ts
40
+ interface WorkspacePackage {
41
+ name: string;
42
+ version: string;
43
+ path: string;
44
+ packageJson: PackageJson;
45
+ workspaceDependencies: string[];
46
+ workspaceDevDependencies: string[];
47
+ }
48
+ //#endregion
49
+ //#region src/shared/types.d.ts
50
+ type BumpKind = "none" | "patch" | "minor" | "major";
51
+ interface CommitTypeRule {
52
+ /**
53
+ * Display title (e.g., "Features", "Bug Fixes")
54
+ */
55
+ title: string;
56
+ /**
57
+ * Commit types to include in this group (defaults to the map key)
58
+ */
59
+ types?: string[];
60
+ }
61
+ interface PackageJson {
62
+ name: string;
63
+ version: string;
64
+ dependencies?: Record<string, string>;
65
+ devDependencies?: Record<string, string>;
66
+ peerDependencies?: Record<string, string>;
67
+ private?: boolean;
68
+ [key: string]: unknown;
69
+ }
70
+ interface PackageRelease {
71
+ /**
72
+ * The package being updated
73
+ */
74
+ package: WorkspacePackage;
75
+ /**
76
+ * Current version
77
+ */
78
+ currentVersion: string;
79
+ /**
80
+ * New version to release
81
+ */
82
+ newVersion: string;
83
+ /**
84
+ * Type of version bump
85
+ */
86
+ bumpType: BumpKind;
87
+ /**
88
+ * Whether this package has direct changes (vs being updated due to dependency changes)
89
+ */
90
+ hasDirectChanges: boolean;
91
+ }
92
+ //#endregion
93
+ //#region src/types.d.ts
94
+ interface ReleaseResult {
95
+ /**
96
+ * Packages that will be updated
97
+ */
98
+ updates: PackageRelease[];
99
+ /**
100
+ * URL of the created or updated PR
101
+ */
102
+ prUrl?: string;
103
+ /**
104
+ * Whether a new PR was created (vs updating existing)
105
+ */
106
+ created: boolean;
107
+ }
60
108
  //#endregion
61
109
  //#region src/index.d.ts
62
110
  interface ReleaseScripts {
63
111
  verify: () => Promise<void>;
64
- prepare: () => Promise<void>;
112
+ prepare: () => Promise<ReleaseResult | null>;
65
113
  publish: () => Promise<void>;
66
114
  packages: {
67
- list: () => Promise<readonly WorkspacePackage[]>;
68
- get: (packageName: string) => Promise<WorkspacePackage | null>;
115
+ list: () => Promise<WorkspacePackage[]>;
116
+ get: (packageName: string) => Promise<WorkspacePackage | undefined>;
69
117
  };
70
118
  }
71
119
  declare function createReleaseScripts(options: ReleaseScriptsOptionsInput): Promise<ReleaseScripts>;