-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_unstable_packages.ts
46 lines (40 loc) · 1.15 KB
/
get_unstable_packages.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import $ from "@david/dax";
import {
getWorkspacePackageConfigs,
isUnstable,
type PackageConfig,
} from "./utils.ts";
type PackageProfile = PackageConfig & {
startedAt: Date;
};
async function getProfile(config: PackageConfig): Promise<PackageProfile> {
const date =
await $`git log --follow --format=%ad --date=short ${config.path} | tail -1`
.cwd("std")
.text();
return {
...config,
startedAt: new Date(date),
};
}
async function main() {
const configs = await getWorkspacePackageConfigs();
const unstables = configs.filter(isUnstable).map((config) =>
getProfile(config)
);
const unstableProfiles = await Promise.all(unstables);
unstableProfiles.forEach((profile) => {
profile.exports = {};
});
console.log(unstableProfiles.length, "unstable packages:");
for (const profile of unstableProfiles) {
console.log(` %c${profile.name}:`, "color: magenta");
console.log(" version:", profile.version);
console.log(" startedAt:", profile.startedAt.toISOString());
}
await Deno.writeTextFile(
"unstable_packages.json",
JSON.stringify(unstableProfiles, null, 2) + "\n",
);
}
main();