Skip to content
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

workspaces phase 1: aggregated install #60

Merged
merged 2 commits into from
May 5, 2017
Merged

workspaces phase 1: aggregated install #60

merged 2 commits into from
May 5, 2017

Conversation

bestander
Copy link
Member

No description provided.

@cpojer
Copy link

cpojer commented May 4, 2017

This is lovely! I'm 100 % supportive of this plan. Can we call it experimentalWorkspace in the first iteration?

@bestander
Copy link
Member Author

How about we disable this feature behind and experimental-workspaces flag?

@cpojer
Copy link

cpojer commented May 4, 2017

So for every workspace feature I'd have to type out --experimental-workspaces or do I put that in my yarnrc?

@bestander
Copy link
Member Author

In .yarnrc:

yarn-offline-mirror "tarballs"
disable-self-update-check true
experimental-workspaces true

@cpojer
Copy link

cpojer commented May 4, 2017

Sounds good.

@jamiebuilds
Copy link
Contributor

This isn't really how RFCs are supposed to work... there's a lot of missing details here that should be added

@bestander
Copy link
Member Author

I am open to suggestions here, @thejameskyle.
Can you point to which details are missing?

@jamiebuilds
Copy link
Contributor

I added a lot more detail to my original RFC here: https://gist.github.com/thejameskyle/1e0f781de728ec1f2597a0bdbe071675

@jamiebuilds
Copy link
Contributor

#62

@dherges
Copy link

dherges commented May 6, 2017

Looking at workspaces (or: multi-project builds, or: multi-modules) from a Gradle (or: maven) perspective, there's that dependencyManagement feature where version numbers are managed by the parent project. Child projects specity what dependency they need and take it with the version number as managed by the parent.

In a multi-project yarn set-up, we do this by writing a "x.y.z" (or some other placeholder) to the child package.json. The parent package.json specifies version numbers. It looks like this:

package.json

{
  "name": "parent",
  "private": true,
  "dependencies": {
    "a": "1.0.0",
    "b": "^2.4.7"
  }
}

packages/common/package.json:

{
  "name": "common",
  "dependencies": {
    "a": "x.y.z"
  }
}

packages/utils/package.json:

{
  "name": "core",
  "dependencies": {
    "a": "x.y.z",
    "b": "x.y.z"
  }
}

I think it could be super-helpful to add a "parent" or "inherit" virtual version number (instead of the "x.y.z" in the example, naming and label can be discussed), telling yarn to re-use the version from the parent package.

@ljharb
Copy link

ljharb commented May 6, 2017

@dherges that would risk a nonstandard version string being published out to the ecosystem. The inner package package.jsons need to be coded as if the parent workspace doesn't exist, since when published, it won't.

@dherges
Copy link

dherges commented May 8, 2017

@ljharb yes, you're right. it would require to build an effective package.json and prevent the original package.json from being published.

@ljharb
Copy link

ljharb commented May 8, 2017

@dherges which is a very error-prone approach, considering anyone might run npm publish by accident, instead of yarn publish.

@dherges
Copy link

dherges commented May 8, 2017

@ljharb partially, yes. we work around this by managing publishConfig and private fields in our build scripts and then only final package.json has the right publishConfig applied. doing this would require yarn workspaces to assume a lot of about the build system, e.g. manage a source folder, manage a dist folder, and so on.

@bestander bestander changed the title workspaces install RFC first draft workspaces phase 1: aggregated install May 12, 2017
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.

5 participants