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

Adds monorepo bootstrap #377

Merged
merged 8 commits into from
Feb 7, 2017
Merged

Adds monorepo bootstrap #377

merged 8 commits into from
Feb 7, 2017

Conversation

delambo
Copy link
Member

@delambo delambo commented Feb 3, 2017

  • Moves all packages to the /packages directory
  • Changes the bootstrap script from ugly bash code to some decent looking JavaScript which should mostly work cross-platform
  • symlinks local packages across the monorepo package dependencies

packages.forEach(pkg => installPackage(pkg.path));

// Symlink monorepo package dependencies to local packages.
packages.forEach((pkg) => {

Choose a reason for hiding this comment

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

how does this system resolve dependency clashes when you flatten here? for example: if one of your monorepo packages depends on [given module]@2.2.0 and a sibling package depends on version [given module]@1.9.0. Do you assume that your project will include both versions of dependency?

Copy link
Member Author

Choose a reason for hiding this comment

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

All of the kyt-specific dependencies in the monorepo should be in sync with the latest published versions. Symlinking makes it easy to do local development on a specific kyt package and its respective kyt dependencies (eg changes to kyt-core and kyt-utils). It's true that this makes the assumption that things will stay in sync, but the symlinks are also easy to override after bootstrap if there is an issue or you want to test against a specific version. Let me know if I can clarify more.

Copy link

@elisechant elisechant Feb 3, 2017

Choose a reason for hiding this comment

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

so the assumption is that the last package which contains dependency of said version will be the chosen version as it was the last symlinked? Wondering if this has caused or might cause interdependency related errors in the past/future? Do you have a recommended approach to ensuring the dependencies as you say as "latest published versions"? do you suggest to use @latest for example? Or how do you sanity check this in terms of upgrading workflow?
Should this code be improved by emitting warnings in this event of version conflicts?

Copy link
Contributor

Choose a reason for hiding this comment

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

This tool is just for local development so you can make changes without having to constantly reinstall node_modules. All published packages will have pinned dependencies.

For example:
I want to add a new utility to kyt-utils to use in a command in kyt-core. When I bootstrap for local development kyt-utils is symlinked in my node_modules for kyt-core and I can make changes directly in my files and see those changes as I run and test kyt-core locally. When I'm ready to commit changes I would update and publish a new version of kyt-utils and then use that pinned version as the dependency of kyt-core.

Dependencies that we don't manage (eg. jest, shelljs) will always use versions from npm even in local development.

@delambo delambo changed the title [WIP] adds monorepo bootstrap Adds monorepo bootstrap Feb 3, 2017
CONTRIBUTING.md Outdated

### bootstrap

Bootstrap` will set you up with a clean slate. Every time it is run, it will remove and re-install the node_modules across all of the kyt packages. It will also link `kyt-cli` so you can run it locally on the command line.
Bootstrap` will set you up with a clean slate. Every time it is run, it will remove and re-install the node_modules across all of the packages, npm link `kyt-cli` and `kyt` so you can run them locally on the command line, and symlink local monorepo dependencies..
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you need to move the `

@@ -0,0 +1 @@
{"main":{"js":"http://localhost:3001/main.js"}}
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add these files to the gitignore

@@ -24,6 +24,7 @@
},
"devDependencies": {
"enzyme": "^2.4.1",
"kyt": "next",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we double check to make sure this works during setup

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 think we should pin it to the latest published version of kyt. Updated.

@@ -23,6 +23,7 @@
},
"devDependencies": {
"enzyme": "^2.4.1",
"kyt": "0.3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be 0.4.0 since these have .babelrc's yeah?

@ccpricenytimes ccpricenytimes merged commit 844ca18 into master Feb 7, 2017
@ccpricenytimes ccpricenytimes deleted the better-bootstrap branch February 7, 2017 23:07
tizmagik added a commit that referenced this pull request Feb 17, 2017
* master: (26 commits)
  Expand version range of yarn for Travis (#400)
  update migration guide to 0.4.0 (#398)
  Update CHANGELOG.md
  adds 040 final version (#392)
  0.4.0 docs (#338)
  adds yarn version check to bootstrap (#391)
  Making kyt a dependency rather than a devDependency (#387)
  adds more functional tests (#388)
  rc5 (#384)
  fixes stylelintrc glob so that it respects file extensions (#383)
  prep work for rc3 (#381)
  Interactive setup (#378)
  Update webpack.base.js (#365)
  Adds monorepo bootstrap (#377)
  fixes linter peer dependencies (#380)
  Fix typo (#379)
  kyt-cli version bump (#376)
  updates the kyt-cli version (#370)
  fixes cli starter kyt path bug (#369)
  Adds prep for 0.4.0 release candidate (#368)
  ...
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