From 964ac1542a0ab6d0471c967719c375dab7f2377c Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 9 Sep 2020 14:53:13 +0200 Subject: [PATCH] refactor(dev-infra): move existing env-stamp command into subfolder (#38656) Moves the existing `ng-dev release env-stamp` command into a subfolder so that the staging/publish tool can have its own dedicated folder (without being polluted by the env-stamp logic). Every subcommand should be in its own folder. PR Close #38656 --- dev-infra/release/BUILD.bazel | 5 +---- dev-infra/release/cli.ts | 11 ++++++++--- dev-infra/release/{ => stamping}/env-stamp.ts | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) rename dev-infra/release/{ => stamping}/env-stamp.ts (97%) diff --git a/dev-infra/release/BUILD.bazel b/dev-infra/release/BUILD.bazel index 065521461e..24e5c87c45 100644 --- a/dev-infra/release/BUILD.bazel +++ b/dev-infra/release/BUILD.bazel @@ -3,16 +3,13 @@ load("@npm_bazel_typescript//:index.bzl", "ts_library") ts_library( name = "release", srcs = glob([ - "*.ts", + "**/*.ts", ]), module_name = "@angular/dev-infra-private/release", visibility = ["//dev-infra:__subpackages__"], deps = [ "//dev-infra/utils", - "@npm//@types/node", - "@npm//@types/shelljs", "@npm//@types/yargs", - "@npm//shelljs", "@npm//yargs", ], ) diff --git a/dev-infra/release/cli.ts b/dev-infra/release/cli.ts index bd2646260e..cc568af79a 100644 --- a/dev-infra/release/cli.ts +++ b/dev-infra/release/cli.ts @@ -6,12 +6,17 @@ * found in the LICENSE file at https://angular.io/license */ import * as yargs from 'yargs'; -import {buildEnvStamp} from './env-stamp'; + +import {buildEnvStamp} from './stamping/env-stamp'; /** Build the parser for the release commands. */ export function buildReleaseParser(localYargs: yargs.Argv) { - return localYargs.help().strict().demandCommand().command( - 'build-env-stamp', 'Build the environment stamping information', {}, () => buildEnvStamp()); + return localYargs.help() + .strict() + .demandCommand() + .command( + 'build-env-stamp', 'Build the environment stamping information', {}, + () => buildEnvStamp()); } if (require.main === module) { diff --git a/dev-infra/release/env-stamp.ts b/dev-infra/release/stamping/env-stamp.ts similarity index 97% rename from dev-infra/release/env-stamp.ts rename to dev-infra/release/stamping/env-stamp.ts index b425e5ece0..184b63d7d6 100644 --- a/dev-infra/release/env-stamp.ts +++ b/dev-infra/release/stamping/env-stamp.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.io/license */ -import {exec as _exec} from '../utils/shelljs'; +import {exec as _exec} from '../../utils/shelljs'; /** * Log the environment variables expected by bazel for stamping.