forked from denoland/deno_core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deno_core_workspace.ts
52 lines (40 loc) · 1.04 KB
/
deno_core_workspace.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
47
48
49
50
51
52
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { $, Crate, Repo } from "./deps.ts";
export { Crate };
export class DenoWorkspace {
#repo: Repo;
static get rootDirPath() {
return $.path(import.meta).join("../../").resolve().toString();
}
static async load(): Promise<DenoWorkspace> {
return new DenoWorkspace(
await Repo.load({
name: "deno_core",
path: DenoWorkspace.rootDirPath,
}),
);
}
private constructor(repo: Repo) {
this.#repo = repo;
}
get repo() {
return this.#repo;
}
static get manifest() {
return $.path.join(this.rootDirPath, "Cargo.toml");
}
get crates() {
return this.#repo.crates;
}
/** Gets the deno_core dependency crates that should be published. */
getDenoCoreDependencyCrates() {
return this.getDenoCoreCrate()
.immediateDependenciesInRepo().map((c) => c.crate);
}
getDenoCoreCrate() {
return this.getCrate("deno_core");
}
getCrate(name: string) {
return this.#repo.getCrate(name);
}
}