@mxpicture/build-api 0.2.10 → 0.2.12
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.
|
@@ -7,7 +7,7 @@ export declare class Changeset {
|
|
|
7
7
|
constructor(paths: WorkspacePaths);
|
|
8
8
|
run(): Promise<void>;
|
|
9
9
|
protected readPackages(): Promise<PackageJson[]>;
|
|
10
|
-
protected range4Compare(): string
|
|
10
|
+
protected range4Compare(): Promise<string>;
|
|
11
11
|
protected findChangedPackages(range: string, packages: PackageJson[]): Promise<string[]>;
|
|
12
12
|
protected findChangedInPackage(range: string, pkg: PackageJson): Promise<string[]>;
|
|
13
13
|
protected write(changed: string[]): Promise<void>;
|
|
@@ -10,7 +10,7 @@ export class Changeset {
|
|
|
10
10
|
this.paths = paths;
|
|
11
11
|
}
|
|
12
12
|
async run() {
|
|
13
|
-
const range = this.range4Compare();
|
|
13
|
+
const range = await this.range4Compare();
|
|
14
14
|
const packages = await this.readPackages();
|
|
15
15
|
const changed = await this.findChangedPackages(range, packages);
|
|
16
16
|
// 4) If nothing changed, exit quietly
|
|
@@ -25,11 +25,11 @@ export class Changeset {
|
|
|
25
25
|
return (await readPackageJsons(this.paths.repoRoot)).map((p) => p.content);
|
|
26
26
|
}
|
|
27
27
|
// 2) Determine range to compare: last Changesets tag if available, else initial commit
|
|
28
|
-
range4Compare() {
|
|
28
|
+
async range4Compare() {
|
|
29
29
|
let lastTag = "";
|
|
30
30
|
try {
|
|
31
31
|
// Tags like @your-scope/pkg-a@0.1.1 or pkg-a@0.1.1 are created by Changesets on publish
|
|
32
|
-
lastTag = execAsync("git tag --list --sort=-creatordate | head -n 1")
|
|
32
|
+
lastTag = (await execAsync("git tag --list --sort=-creatordate | head -n 1"))
|
|
33
33
|
.toString()
|
|
34
34
|
.trim();
|
|
35
35
|
}
|