-
Notifications
You must be signed in to change notification settings - Fork 86
Pyarn add - take 2 - initial refactoring #27
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
Conversation
| @@ -0,0 +1,77 @@ | |||
| // @flow | |||
|
|
|||
| import { getFixturePath } from 'jest-fixtures'; | |||
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.
This util is not finished yet. I realised I needed to have all of symlinking working first.
| @@ -0,0 +1,31 @@ | |||
| // @flow | |||
|
|
|||
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.
Unfinished, as it was waiting on symlinking
| dependencies: '', | ||
| devDependencies: '--dev', | ||
| peerDependencies: '--peer', | ||
| optionalDependencies: '--optional' |
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.
I think it'd be better to have this conversion up in the commands rather than in the utilities
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.
I thought we said in the last PR that the utility should convert js options to cli options and commands should be converting from flags to js options?
https://github.com/pyarn/pyarn/pull/17/files#r138537987
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.
Ohhh, I read this code backwards, I thought you were converting flags to types not types to flags
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.
Yea, I might refactor using Keys later https://flow.org/en/docs/types/utilities/#toc-keys
| dependencies: Array<Dependency>, | ||
| type?: configDependencyType | ||
| ) { | ||
| const isProjectPackage = project.pkg.dir === pkg.dir; |
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.
pkg.isSamePackage(project.pkg)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.
Ah yea, I was waiting for the remove PR.
|
|
||
| test('removing a dependency that is used by a workspace', async () => { | ||
| let { tempDir } = await copyFixtureIntoTempDir( | ||
| test.only('removing a dependency that is used by a workspace', async () => { |
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.
.only
This is the initial refactoring for pyarn add.
It add yarn.add and symlinkPackageDependencies.
TODO: