| Sep | OCT | Nov |
| 23 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: github.com
|
fixes #17813 |
| const sourceRoot = clientProject.sourceRoot || 'src'; | ||
| const serverPath = options.appDir? | ||
| `${sourceRoot}/${options.appDir}` : | ||
| sourceRoot; |
appDir option should be removed - it didn't work in the first place, so just deprecate it now and remove it later, and there is no harm done.
In other schematics, buildDefaultPath() is used to hardcode an apporlib sub-directory (depending on the project type) and it will come into conflict with this; you want other schematics to also work for projects that have used the app-shell schematics.
Alternatively, this could be implemented for all schematics, and have it fallback to the current behavior of buildDefaultPath(). I've actually submitted a similar feature suggestion, but for removing the sub-directory for all schematics, see #17598.
But I'm not sure if either of these should be implemented, we need to make sure that existing tutorials on how to generate components will continue to work in the future (including for projects that have used app-shell).
5fe0bf3toe437829
|
@alan-agius4 it's open for review. |
|
@santoshyadav198613, I’ll review it tomorrow. Thanks. |
|
Hi @santoshyadav198613,
Firstly thanks for the PR This changes however doesn't seem to be addressed the problem in the right place. The problem with appDir is actually located in the universal schematic.
In fact, it's right that the app-shell schematic is failing, because At the very least there are two places that you need to change.
|
| @@ -10,6 +10,21 @@ import { Schema as ApplicationOptions } from '../application/schema'; | |||
| import { Schema as WorkspaceOptions } from '../workspace/schema'; | |||
| import { Schema as AppShellOptions } from './schema'; | |||
|
|
|||
| function createServerFile(appTree: UnitTestTree): void { | |||
| @@ -33,8 +33,7 @@ | |||
| "appDir": { | |||
| "type": "string", | |||
| "format": "path", | |||
| "description": "The name of the application directory.", | |||
| "default": "app" | |||
|
Hi@alan-agius4 , |
|
@santoshyadav198613, yes I believe so. The
We might need to use the |
e437829to2924bc7
344e6fdto4ec8641
4fb9216toa5fa1ec
664dbf4to1b41589
fix(@schematics/angular): add appDir option
Loading status checks…
ba44abc
fixes #17813
1b41589toba44abc
|
Hi@alan-agius4 , |
| it('should create the shell component with appDir option provided', async () => { | ||
| const defaultOptions: AppShellOptions = { | ||
| clientProject: 'bar', | ||
| appDir: '/projects/bar/src/app/server', |
appDir should be a directory example myApp and not a path in the workspace.
Also, expect(tree.exists('/projects/bar/src/app/app-shell/app-shell.component.ts')).toBe(true); doesn't seem good, because the app-shell should be created in the provided appDir.
Collaborator
|
@santoshyadav198613, will try to look at this in the coming days. |
|
@santoshyadav198613, just to let you know that I didn’t forget about this! Apologies for taking so long to look at this. |
Requested changes must be addressed to merge this pull request.
Labels cla: yes No milestoneSuccessfully merging this pull request may close these issues.
4 participants Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. ●© 2020 GitHub, Inc. ●Terms ●Privacy ● ●Security ●Status ●Help ●Contact GitHub ●Pricing ●API ●Training ●Blog ●About You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.