This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca8506b
commit 6b85c28
Showing
23 changed files
with
335 additions
and
18 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,5 @@ | ||
--- | ||
'nx-plugin-graphql-mesh': major | ||
--- | ||
|
||
Add `serve` executor |
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
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
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
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
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
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
25 changes: 25 additions & 0 deletions
25
libs/nx-plugin-graphql-mesh/src/executors/serve/hasher.spec.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Hasher, HasherContext } from '@nrwl/devkit'; | ||
|
||
import { serveHasher } from './hasher'; | ||
|
||
describe('serveHasher', () => { | ||
it('should generate hash', async () => { | ||
const mockHasher: Hasher = { | ||
hashTask: jest.fn().mockReturnValue({ value: 'hashed-task' }), | ||
} as unknown as Hasher; | ||
const hash = await serveHasher( | ||
{ | ||
id: 'my-task-id', | ||
target: { | ||
project: 'proj', | ||
target: 'target', | ||
}, | ||
overrides: {}, | ||
}, | ||
{ | ||
hasher: mockHasher, | ||
} as unknown as HasherContext | ||
); | ||
expect(hash).toEqual({ value: 'hashed-task' }); | ||
}); | ||
}); |
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,12 @@ | ||
import { CustomHasher } from '@nrwl/devkit'; | ||
|
||
/** | ||
* This is a boilerplate custom hasher that matches | ||
* the default Nx hasher. If you need to extend the behavior, | ||
* you can consume workspace details from the context. | ||
*/ | ||
export const serveHasher: CustomHasher = async (task, context) => { | ||
return context.hasher.hashTask(task); | ||
}; | ||
|
||
export default serveHasher; |
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,8 @@ | ||
import type { DevExecutorSchema } from '../dev/schema'; | ||
import type { StartExecutorSchema } from '../start/schema'; | ||
|
||
export interface ServeExecutorSchema | ||
extends DevExecutorSchema, | ||
StartExecutorSchema { | ||
dev: boolean; | ||
} |
Oops, something went wrong.