-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nx-flutter): migrate Project Graph generation to
v2
API
- Loading branch information
Showing
4 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { CreateDependencies } from "@nx/devkit"; | ||
|
||
import { createDependenciesIf } from "@nxrocks/common"; | ||
import { NX_FLUTTER_PKG } from "../index"; | ||
import { isFlutterProject } from "../utils/flutter-utils"; | ||
import { getPackageInfo } from '../utils/deps-utils'; | ||
|
||
|
||
export const createDependencies: CreateDependencies = (_, ctx) => createDependenciesIf(NX_FLUTTER_PKG, ['pubspec.yaml'], isFlutterProject, getPackageInfo, ctx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { createNodesFor } from "@nxrocks/common"; | ||
import { NX_FLUTTER_PKG } from "../index"; | ||
|
||
// wrapped iton a () to avoid the 'Cannot access 'NX_FLUTTER_PKG' before initialization' | ||
export const createNodesFn = () => createNodesFor(['pubspec.yaml'], NX_FLUTTER_PKG); |
11 changes: 7 additions & 4 deletions
11
packages/nx-flutter/src/project-graph.ts → ...lutter/src/graph/process-project-graph.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export const NX_FLUTTER_PKG = '@nxrocks/nx-flutter'; | ||
|
||
export { projectGenerator } from './generators/project/generator'; | ||
export { processProjectGraph } from './project-graph'; | ||
export { processProjectGraph } from './graph/process-project-graph'; | ||
export { createDependencies } from './graph/create-dependencies'; | ||
import { createNodesFn } from './graph/create-nodes'; | ||
|
||
export const NX_FLUTTER_PKG = '@nxrocks/nx-flutter'; | ||
export const createNodes = createNodesFn(); |