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

"newProjectRoot": "./" throws error #14108

Closed
rcketscientist opened this issue Apr 8, 2019 · 3 comments · Fixed by #14227
Closed

"newProjectRoot": "./" throws error #14108

rcketscientist opened this issue Apr 8, 2019 · 3 comments · Fixed by #14227
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken
Milestone

Comments

@rcketscientist
Copy link

rcketscientist commented Apr 8, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

For simple lib/demo use cases I would prefer to have a flat project
-demo
-lib

However, newProjectRoot: "./" will fail to generate new projects (at least on win).

🔬 Minimal Reproduction

ng new alloy-window-manager --newProjectRoot=./ --style=scss --createApplication=false
ng g library alloy-window-manager --prefix=awm

will generate this:

🔥 Exception or Error



Schematic input does not validate against the Schema: {"name":"alloy-window-manager","commonModule":false,"flat":true,"path":".//alloy-window-manager/src/lib","project":"alloy-window-manager"}
Errors:
Data path ".path" should match format "path".

"newProjectRoot": "" expects projects to be at the device root...
"newProjectRoot": "projects" works

🌍 Your Environment




Angular CLI: 7.1.4
Node: 10.14.2
OS: win32 x64
Angular: 7.1.4
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.11.4
@angular-devkit/core         7.1.4
@angular-devkit/schematics   7.1.4
@schematics/angular          7.1.4
@schematics/update           0.11.4
rxjs                         6.3.3
typescript                   3.1.6
@rcketscientist
Copy link
Author

Saw the update in 7.3.8, but still fails.
Removing newProjectRoot=> newProjectRoot: "" which tries to build at the device root and fails.

@alan-agius4
Copy link
Collaborator

Hi, thanks for reporting this. Indeed the path should be an empty string.

However, as you correct spotted there is an issue when trying to build the generated libs/apps.

alexeagle pushed a commit that referenced this issue Apr 22, 2019
… string

When `newProjectRoot` the paths are prefixed with an `/` example `/project-name/tsconfig.lib.json` which results in these being marked as absolute paths, which causes build failures.

Fixes #14108
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: schematics/angular freq1: low Only reported by a handful of users who observe it rarely severity3: broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants