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(core): switch over to angular 10 #3056

Merged
merged 4 commits into from Jul 7, 2020

Conversation

FrozenPandaz
Copy link
Collaborator

@FrozenPandaz FrozenPandaz commented May 22, 2020

Current Behavior (This is the behavior we have today, before the PR is merged)

We use angular-devkit 9.1

There's 1 tsconfig.json per project which is used by editors to typecheck files which doesn't catch things like describe and it being used in application code.

The version of rxjs is 6.5.4

Expected Behavior (This is the new behavior we can expect after the PR is merged)

We use angular 10 + angular-devkit 10

The tsconfig.json of a project is now a solution tsconfig.json which has references to other tsconfig files which are used for builds and linting.

The version of rxjs is 6.5.5

Issue

@FrozenPandaz FrozenPandaz marked this pull request as draft May 22, 2020 20:02
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 2 times, most recently from d6824b9 to 81b107b Compare June 12, 2020 16:44
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 10 times, most recently from 13b2a0d to b73806f Compare June 19, 2020 20:23
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 2 times, most recently from e53dfec to b552ee7 Compare June 20, 2020 07:01
@FrozenPandaz FrozenPandaz changed the base branch from 10.x to master June 20, 2020 16:15
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 12 times, most recently from 91e2398 to 6061bed Compare June 21, 2020 16:20
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 12 times, most recently from cdf05e1 to f78c91b Compare June 26, 2020 20:14
@@ -696,6 +696,12 @@ export default function (schema: Schema): Rule {
addLintFiles(options.appProjectRoot, options.linter, {
onlyGlobal: true,
}),
// TODO: Remove this after Angular 10.1.0
updateJsonInTree('tsconfig.json', () => ({
Copy link
Member

Choose a reason for hiding this comment

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

Why is this reqiured?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Angular schematics try to modify a tsconfig.json solution in the root of the repository. In 10.1.0 they will change it to having a tsconfig.json in the project directory.

For now, this is a hack that adds a tsconfig.json to the tree for the schematic to modify then deletes it.

Copy link
Contributor

@royling royling Jan 4, 2021

Choose a reason for hiding this comment

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

@FrozenPandaz currently this hack is breaking my workspace schematic that is leveraging @nrwl/angular to generate a new application in the project, even though angular 10.2.x is used.

The problem is tsconfig.json in the repository root got deleted after creating a new app with the workspace schematic. But tsconfig.json is still referenced by other existing apps.

For now, I cannot upgrade my repo to use Angular/Nx 11 due to some other libs sticking to Angular 10.
Do you think it's ok to remove this hack in Nx 10.x to support this scenario? Thanks!

const content = updateJestConfigContent(originalContent);
host.overwrite(configPath, content);
};
: chain([
Copy link
Member

Choose a reason for hiding this comment

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

why was this inlined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This adds files that can't be in a solution style tsconfig.json to the tsconfig.spec.json.

The tsconfig.spec.json is created by the jest-project schematic so this updates it after it's done.

if (workspace.projects.get(context.target.project).sourceRoot) {
return workspace.projects.get(context.target.project).sourceRoot;
export async function getSourceRoot(context: BuilderContext): Promise<string> {
const projectMeta = await context.getProjectMetadata(context.target.project);

This comment was marked as resolved.

};
}

export default function (schema: any): Rule {

This comment was marked as resolved.

}
const dirEntry = host.getDir(_dir);
dirEntry.subfiles.forEach((file) => {
if (ig.ignores(join(_dir, file))) {
Copy link
Member

Choose a reason for hiding this comment

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

I think the ignored above should be sufficient. The recursive call will return nothing if it's ignored, right?

@beeman beeman mentioned this pull request Jul 7, 2020
@FrozenPandaz FrozenPandaz force-pushed the 10.x-angular branch 2 times, most recently from 1813ecd to 2648b88 Compare July 7, 2020 15:20
@FrozenPandaz FrozenPandaz marked this pull request as ready for review July 7, 2020 20:44
@FrozenPandaz FrozenPandaz changed the title WIP feat(core): switch over to devkit 10-rc.0 feat(core): switch over to angular 10 Jul 7, 2020
@FrozenPandaz FrozenPandaz merged commit a7b7af2 into nrwl:master Jul 7, 2020
@FrozenPandaz FrozenPandaz deleted the 10.x-angular branch July 7, 2020 21:02
Doginal pushed a commit to Doginal/nx that referenced this pull request Nov 25, 2020
* feat(core): switch over to devkit 10-rc.0

* feat(core): implement solution tsconfigs wip

* feat(angular): add angular migrations

* fix(angular): modify angularjs tests
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2023
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.

None yet

3 participants