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

Install schematic is not following sourceRoot for assets path #59

Closed
edbzn opened this issue Sep 4, 2019 · 3 comments · Fixed by #60
Closed

Install schematic is not following sourceRoot for assets path #59

edbzn opened this issue Sep 4, 2019 · 3 comments · Fixed by #60
Assignees

Comments

@edbzn
Copy link
Contributor

edbzn commented Sep 4, 2019

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request
[ ] Other... Please describe:

Current behavior

Hi,

I'm using the Nx monorepo style and when running the install schematic, the assets path is not taking my sourceRoot from angular.json file.

It results in creating the i18n directory in the wrong place : src/assets/i18n instead of apps/my-app/src/assets/i18n in my case.

Expected behavior

Following the sourceRoot when creating the translations directory.

What is the motivation / use case for changing the behavior?

Improve support of monorepo.

@itayod
Copy link
Contributor

itayod commented Sep 4, 2019

@Edouardbozon What path did you enter in the 3rd question (✍ Which folder will contain the translation files?)?

@edbzn
Copy link
Contributor Author

edbzn commented Sep 4, 2019

@itayod I entered the default value src/assets/i18n. It confused me because I expected this path to be relative to my application directory apps/my-app, not the project root. Just like others files added by the schematic.

@itayod
Copy link
Contributor

itayod commented Sep 5, 2019

@Edouardbozon thanks for your input, I changed the script so the given path will be relative to the application as you suggested.

We also decided to remove this question from ng-add, as assetes/i18n it's pretty much the standard library for the translation files, and install it under the correct relative path.

I still left the option to set a different path that will also be relative to the project using -path flag :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants