Skip to content

Conversation

@lukebatchelor
Copy link
Member

This is the initial refactoring for pyarn add.

It add yarn.add and symlinkPackageDependencies.

TODO:

  • symlinkPackagesDependencies
  • refactor install
  • tests for install
  • pyarn [w|ws|p] add + tests

@@ -0,0 +1,77 @@
// @flow

import { getFixturePath } from 'jest-fixtures';
Copy link
Member Author

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

Copy link
Member Author

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'
Copy link
Member

@jamiebuilds jamiebuilds Sep 22, 2017

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

Copy link
Member Author

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

Copy link
Member

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

Copy link
Member Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg.isSamePackage(project.pkg)

Copy link
Member Author

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 () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants