Skip to content

refactor: Consolidate adding dependencies #11131

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

Merged
merged 1 commit into from
Jun 8, 2018

Conversation

Brocco
Copy link
Contributor

@Brocco Brocco commented Jun 6, 2018

No description provided.

@Brocco Brocco requested a review from hansl as a code owner June 6, 2018 18:04
@Brocco Brocco mentioned this pull request Jun 6, 2018
@Brocco Brocco force-pushed the add-pkg-json-deps branch from f7c4c37 to 5ce058c Compare June 7, 2018 17:06
@@ -350,6 +345,6 @@ export default function (options: ApplicationOptions): Rule {
move(sourceDir),
]), MergeStrategy.Overwrite),
schematic('e2e', e2eOptions),
]);
])(host, context);
Copy link
Contributor

@hansl hansl Jun 8, 2018

Choose a reason for hiding this comment

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

Please undo.

@@ -257,6 +255,6 @@ export default function (options: LibraryOptions): Rule {
context.addTask(new NodePackageInstallTask());
}
},
]);
])(host, context);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please undo.

node: JsonAstObject,
propertyName: string,
value: JsonValue,
indent = 4,
Copy link
Contributor

Choose a reason for hiding this comment

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

Default for most JSON is 2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indent is defaulted to 4, because the typical use case is to add a value to an existing object (i.e. dependencies, devDependencies) It could be removed as a default to make it more explicit.

import { UnitTestTree } from '@angular-devkit/schematics/testing';
import { insertPropertyInAstObjectInOrder } from './json-utils';

type Pojo = {
Copy link
Contributor

@hansl hansl Jun 8, 2018

Choose a reason for hiding this comment

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

Not Pojso? ;)

@Brocco Brocco force-pushed the add-pkg-json-deps branch from 5ce058c to 9cecfb1 Compare June 8, 2018 17:41
return JSON.parse(tree.readContent(filePath));
}

it('should insert a first prop', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

You should have a test where you call insertProperty... multiple times in a row.

@Brocco Brocco force-pushed the add-pkg-json-deps branch from 9cecfb1 to 04695d2 Compare June 8, 2018 18:01
@filipesilva filipesilva merged commit d3b49a5 into angular:master Jun 8, 2018
@gkalpak gkalpak mentioned this pull request Jun 11, 2018
@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 12, 2019
@Brocco Brocco deleted the add-pkg-json-deps branch November 28, 2022 02:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants