Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@angular/cli): implement deploy command #15105

Merged
merged 1 commit into from Jul 31, 2019

Conversation

mgechev
Copy link
Member

@mgechev mgechev commented Jul 17, 2019

Implementation of the ng deploy command. Find the design document here.

// cc @vikerman @StephenFluin @clydin @alan-agius4 @filipesilva

@mgechev mgechev force-pushed the minko/deploy branch 3 times, most recently from 31b1dde to f64e55b Compare July 18, 2019 22:20
@StephenFluin
Copy link
Contributor

StephenFluin commented Jul 18, 2019 via email

@mgechev mgechev force-pushed the minko/deploy branch 2 times, most recently from 8398e08 to 42b8dde Compare July 18, 2019 23:01
@mgechev mgechev marked this pull request as ready for review July 18, 2019 23:05
@mgechev mgechev added the target: major This PR is targeted for the next major release label Jul 18, 2019
Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some initial requests about the commits themselves. I don't have access to the design doc yet.

@@ -26,6 +26,7 @@ const metricsTableRe = /<!--METRICS_TABLE_BEGIN-->([\s\S]*)<!--METRICS_TABLE_END
function _exec(command: string, args: string[], opts: { cwd?: string }, logger: logging.Logger) {
const { status, error, stdout } = spawnSync(command, args, {
stdio: ['ignore', 'pipe', 'inherit'],
maxBuffer: 1024 * 1024,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be in it's own commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesterday I was looking at a similar problem in e4e04e2 and now I know that 1024 * 1024 is actually the default.

Is this change actually doing something? I guess only if maxBuffer was being passed as a smaller value in opts but I don't find maxBuffer referenced anywhere in scripts.

Copy link
Member Author

@mgechev mgechev Jul 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a leftover, just removed it.

packages/angular_devkit/build_angular/src/deploy/index.ts Outdated Show resolved Hide resolved
packages/angular_devkit/build_angular/builders.json Outdated Show resolved Hide resolved
@mgechev mgechev force-pushed the minko/deploy branch 7 times, most recently from 22a2218 to ede7321 Compare July 26, 2019 23:46
Copy link
Contributor

@filipesilva filipesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple questions and minor requests, otherwise LGTM.

@@ -26,6 +26,7 @@ const metricsTableRe = /<!--METRICS_TABLE_BEGIN-->([\s\S]*)<!--METRICS_TABLE_END
function _exec(command: string, args: string[], opts: { cwd?: string }, logger: logging.Logger) {
const { status, error, stdout } = spawnSync(command, args, {
stdio: ['ignore', 'pipe', 'inherit'],
maxBuffer: 1024 * 1024,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yesterday I was looking at a similar problem in e4e04e2 and now I know that 1024 * 1024 is actually the default.

Is this change actually doing something? I guess only if maxBuffer was being passed as a smaller value in opts but I don't find maxBuffer referenced anywhere in scripts.

{
"$schema": "http://json-schema.org/schema",
"$id": "ng-cli://commands/deploy.json",
"description": "Invokes the deploy builder for a specified project. If no project is specified, the CLI will invoke the deploy builder for the default project in thw workspace.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: thw -> the

@@ -74,12 +75,13 @@ export abstract class ArchitectCommand<
}
}

if (targetProjectNames.length === 0) {
throw new Error(`No projects support the '${this.target}' target.`);
if (!options.help && (targetProjectNames.length === 0)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does !options.help need to added to this condition and the one below it? If I call ng deploy --help this still looks like the error that shows up.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't have a default dummy builder, the command is going to always throw when the user invokes ng deploy --help.

@mgechev mgechev force-pushed the minko/deploy branch 3 times, most recently from 0038e7f to c2f50d4 Compare July 30, 2019 17:41
@mgechev mgechev added the needs: discussion On the agenda for team meeting to determine next steps label Jul 30, 2019
@mgechev
Copy link
Member Author

mgechev commented Jul 30, 2019

As discussed today, there's some inconsistent behavior in the CLI in handling the --help option.

If we improve it, the implementation of ng deploy would be simpler and more consistent with the rest of the commands. Adding it for further discussion so we can sync on the work breakdown this Thursday :).

@mgechev mgechev force-pushed the minko/deploy branch 5 times, most recently from d68992e to ea91049 Compare July 30, 2019 19:21
@mgechev mgechev removed the needs: discussion On the agenda for team meeting to determine next steps label Jul 30, 2019
@vikerman vikerman merged commit 5df50ba into angular:master Jul 31, 2019
@mgechev mgechev deleted the minko/deploy branch July 31, 2019 16:57
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants