-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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(store): add support of standalone API for ng-add store #3874
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { TargetDefinition } from '@angular-devkit/core/src/workspace'; | ||
import { getWorkspace } from './config'; | ||
import { Tree } from '@angular-devkit/schematics'; | ||
import { SchematicsException, Tree } from '@angular-devkit/schematics'; | ||
|
||
export interface WorkspaceProject { | ||
root: string; | ||
projectType: string; | ||
architect: { | ||
[key: string]: TargetDefinition; | ||
}; | ||
} | ||
|
||
export function getProject( | ||
|
@@ -52,3 +56,20 @@ export function isLib( | |
|
||
return project.projectType === 'library'; | ||
} | ||
|
||
export function getProjectMainFile( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We keep our https://github.com/ngrx/platform/blob/master/modules/schematics-core/utility/project.ts And then run yarn copy:schematics To copy it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm... I just tried to do the steps you described but it seems like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm maybe it's an operating system path issue in our script. To not hold this up, if everything is good, we'll merge it and I'll follow up with the schematics-core move. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, so from my side no actions are needed anymore? :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right :) |
||
host: Tree, | ||
options: { project?: string | undefined; path?: string | undefined } | ||
) { | ||
if (isLib(host, options)) { | ||
throw new SchematicsException(`Invalid project type`); | ||
} | ||
const project = getProject(host, options); | ||
const projectOptions = project.architect['build'].options; | ||
|
||
if (!projectOptions?.main) { | ||
throw new SchematicsException(`Could not find the main file`); | ||
} | ||
|
||
return projectOptions.main as string; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ export interface Schema { | |
*/ | ||
minimal?: boolean; | ||
skipESLintPlugin?: boolean; | ||
standalone?: boolean; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as other comment about
schematics-core