Skip to content

Fix ng_package tests not working on Windows - #27829

Closed
devversion wants to merge 5 commits into
angular:masterfrom
devversion:fix/ng_package-invalid-separators-windows
Closed

devversion wants to merge 5 commits into
angular:masterfrom
devversion:fix/ng_package-invalid-separators-windows

Conversation

@devversion

Copy link
Copy Markdown
Member

See individual commits for description of changes.

  • fix(bazel): ng_package creates invalid typings reexport on windows
  • fix(bazel): packager not properly removing amd directives on windows
  • test(bazel): fix all ng_package tests not working on windows
  • test(bazel): re-enable ng_package golden testing on ci

Currently when building a package on Windows, the typings re-export for secondary entry-points is not valid TypeScript. Similarly the metadata and the "package.json" files use non-posix paths and cause inconsistency within the NPM package.

For example:

_package.json_
```
  "esm5": "./esm5\\core.js",
  "esm2015": "./esm2015\\core.js",
```

_testing.d.t.s_ (of the `core` package)
```
export * from './testing\testing';
```
* Enables the ng_package golden testing on the CI
* Fixes the ng_package golden testing for Windows
@devversion devversion added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: bazel Issues related to the published `@angular/bazel` build rules labels Dec 25, 2018
@ngbot ngbot Bot added this to the needsTriage milestone Dec 25, 2018
@mary-poppins

This comment has been minimized.

@devversion

devversion commented Dec 25, 2018 •

Copy link
Copy Markdown
Member Author

@IgorMinar for your comment #27827 (review): there already were a few tests that should have detected these Windows issues if we would run with Buildkite.

Since these tests didn't even run on CI, and also didn't work Windows, I've just fixed those for Windows and made sure that these can run on CircleCI now. Also added a few more requested test cases.

@mary-poppins

Copy link
Copy Markdown

You can preview 0427bb3 at https://pr27829-0427bb3.ngbuilds.io/.

deps = ["@ngdeps//diff"],
# We don't want to run the example_package golden test with Ivy yet. Currently the golden
# file is based on non-ivy output and therefore won't work for ngc and Ivy at the same time.
# TODO: We should be able to have another golden for ivy-aot as well.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a Jira issue for that (to make sure we don't forget about it 😁)?

@devversion devversion Dec 27, 2018 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't have access to Jira as Material doesn't use Jira. I have it on my personal list as a follow-up though.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We currently have a separate ivy build, but I don't think that's the plan for releasing Ivy - I think we still want all the bits in a single package? so this todo might not make sense - we should assert on the content of the entire ivy-and-prior compat package.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure if my comment is a bit confusing, but I basically meant that we should somehow assert that in Ivy-mode the package output is also correct.

Since pre-ivy and ivy output different JS, we need two goldens. One for Ivy and one for pre-ivy.

deps = ["@ngdeps//diff"],
# We don't want to run the example_package golden test with Ivy yet. Currently the golden
# file is based on non-ivy output and therefore won't work for ngc and Ivy at the same time.
# TODO: We should be able to have another golden for ivy-aot as well.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We currently have a separate ivy build, but I don't think that's the plan for releasing Ivy - I think we still want all the bits in a single package? so this todo might not make sense - we should assert on the content of the entire ivy-and-prior compat package.

@alexeagle alexeagle added action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 7, 2019
@alexeagle

Copy link
Copy Markdown
Contributor

Caretaker: pullapprove not turning green, but it's approved by me

@alexeagle
alexeagle removed the request for review from IgorMinar January 7, 2019 21:18
@alexeagle alexeagle removed the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label Jan 7, 2019
@kara kara closed this in 4caf654 Jan 7, 2019
kara pushed a commit that referenced this pull request Jan 7, 2019
* Enables the ng_package golden testing on the CI
* Fixes the ng_package golden testing for Windows

PR Close #27829
kara pushed a commit that referenced this pull request Jan 7, 2019
…27829)

Currently when building a package on Windows, the typings re-export for secondary entry-points is not valid TypeScript. Similarly the metadata and the "package.json" files use non-posix paths and cause inconsistency within the NPM package.

For example:

_package.json_
```
  "esm5": "./esm5\\core.js",
  "esm2015": "./esm2015\\core.js",
```

_testing.d.t.s_ (of the `core` package)
```
export * from './testing\testing';
```

PR Close #27829
kara pushed a commit that referenced this pull request Jan 7, 2019
* Enables the ng_package golden testing on the CI
* Fixes the ng_package golden testing for Windows

PR Close #27829
AndrewKushnir pushed a commit that referenced this pull request Jan 16, 2019
…27829)

Currently when building a package on Windows, the typings re-export for secondary entry-points is not valid TypeScript. Similarly the metadata and the "package.json" files use non-posix paths and cause inconsistency within the NPM package.

For example:

_package.json_
```
  "esm5": "./esm5\\core.js",
  "esm2015": "./esm2015\\core.js",
```

_testing.d.t.s_ (of the `core` package)
```
export * from './testing\testing';
```

PR Close #27829
AndrewKushnir pushed a commit that referenced this pull request Jan 16, 2019
* Enables the ng_package golden testing on the CI
* Fixes the ng_package golden testing for Windows

PR Close #27829
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: bazel Issues related to the published `@angular/bazel` build rules cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants