Created
August 31, 2020 10:59
-
-
Save mightyhorst/58e4b4ee805bfe9487da51872c683b16 to your computer and use it in GitHub Desktop.
4. yarn workspaces - example imported files
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
/** | |
* @namespace @monorepo/common | |
* @desc barrel file to export the common files | |
*/ | |
export * from './models'; |
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
/** | |
* @namespace @monorepo/common | |
* @interface IUser | |
*/ | |
export interface IUser{ | |
email: string; | |
name: string; | |
} |
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
/** | |
* @namespace @monorepo/nestjs | |
*/ | |
import {IUser} from '@monorepo/common'; | |
export class UserService{ | |
users: IUser[] = []; | |
getUsers(): IUser{ | |
return [ | |
{ | |
email: 'nick@master-class.io', | |
name: 'Nick Mitchell' | |
} | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment