summaryrefslogtreecommitdiff
path: root/tools/release/deno_workspace.ts
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-03-01 15:40:32 -0500
committerGitHub <noreply@github.com>2022-03-01 15:40:32 -0500
commit4be0365fb8251a8614f16e6162f4f43c9885d2a3 (patch)
tree22a9a476053487c8ac22e53e20aea4bb483fbb97 /tools/release/deno_workspace.ts
parent6a030a5396f9c838b4d4523f43ab2d9e2f502e04 (diff)
chore(tools): use automation scripts from automation repo (#13796)
Diffstat (limited to 'tools/release/deno_workspace.ts')
-rw-r--r--tools/release/deno_workspace.ts70
1 files changed, 70 insertions, 0 deletions
diff --git a/tools/release/deno_workspace.ts b/tools/release/deno_workspace.ts
new file mode 100644
index 000000000..725d647df
--- /dev/null
+++ b/tools/release/deno_workspace.ts
@@ -0,0 +1,70 @@
+// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
+
+import { path, Repo } from "./deps.ts";
+
+export class DenoWorkspace {
+ #repo: Repo;
+
+ static get rootDirPath() {
+ const currentDirPath = path.dirname(path.fromFileUrl(import.meta.url));
+ return path.resolve(currentDirPath, "../../");
+ }
+
+ static async load(): Promise<DenoWorkspace> {
+ return new DenoWorkspace(
+ await Repo.load("deno", DenoWorkspace.rootDirPath),
+ );
+ }
+
+ private constructor(repo: Repo) {
+ this.#repo = repo;
+ }
+
+ get repo() {
+ return this.#repo;
+ }
+
+ get crates() {
+ return this.#repo.crates;
+ }
+
+ /** Gets the dependency crates used for the first part of the release process. */
+ getDependencyCrates() {
+ return [
+ this.getBenchUtilCrate(),
+ this.getSerdeV8Crate(),
+ this.getCoreCrate(),
+ ...this.getExtCrates(),
+ this.getRuntimeCrate(),
+ ];
+ }
+
+ getSerdeV8Crate() {
+ return this.getCrate("serde_v8");
+ }
+
+ getCliCrate() {
+ return this.getCrate("deno");
+ }
+
+ getCoreCrate() {
+ return this.getCrate("deno_core");
+ }
+
+ getRuntimeCrate() {
+ return this.getCrate("deno_runtime");
+ }
+
+ getBenchUtilCrate() {
+ return this.getCrate("deno_bench_util");
+ }
+
+ getExtCrates() {
+ const extPath = path.join(this.#repo.folderPath, "ext");
+ return this.crates.filter((c) => c.manifestPath.startsWith(extPath));
+ }
+
+ getCrate(name: string) {
+ return this.#repo.getCrate(name);
+ }
+}