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

Export default options so other dependent packages can test against changing properties #631

Merged
merged 2 commits into from
Aug 26, 2016
Merged

Export default options so other dependent packages can test against changing properties #631

merged 2 commits into from
Aug 26, 2016

Conversation

jbenesch
Copy link
Contributor

See: #625

I also had questions around dependencies. When I tried to run gulp from react-server-cli package I was getting an error like so:

JASONs-Mac-Pro:react-server-cli jason$ npm run prepublish
path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received null
    at assertPath (path.js:7:11)

What I realized was that because gulp wasn't a part of this package, it was trying to use a globally installed version I had which was out of date. I have always been under the belief that packages should force using local packages by using npm scripts. By adding gulp as a devDep, running npm run prepublish will always work.

Would love to hear your thoughts?

Thanks!

@@ -48,6 +48,9 @@
},
"devDependencies": {
"babel-preset-react-server": "^0.4.4",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-eslint": "^3.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this is great.

We've gone back and forth here. It's nice to factor out devDependencies into the repo root to cut down on bootstrap time and storage requirements. But for modules where we use the "bin" script that breaks things. In this case I think adding it back into the package is the right move.

Eventually I'd like to have a lerna bootstrap --hoist-external or something that will let us define deps where they're actually used but then install them at the root and link bin scripts in where needed. Some day. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I'm missing the correct dev entry point... but when I cloned and then ran npm run bootstrap I hit the same gulp error.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we probably have other packages that will need similar treatment. 😬

@doug-wade
Copy link
Collaborator

doug-wade commented Aug 26, 2016

Re: installing gulp as a dev dependency -- I dig it. We shouldn't rely on globally-installed tools at all, and personally I'd like to see us go one step further and find some way to prefer the locally-installed gulp even if there is a globally-installed gulp

@jbenesch jbenesch changed the title Export default options so other dependent packages can test against changing properties React-server-cli: Export default options so other dependent packages can test against changing properties Aug 26, 2016
@gigabo
Copy link
Contributor

gigabo commented Aug 26, 2016

Your original title was actually good. We use lerna-changelog to generate our release notes. It automatically groups changes by package.

image

@gigabo gigabo added the enhancement New functionality. label Aug 26, 2016
@jbenesch jbenesch changed the title React-server-cli: Export default options so other dependent packages can test against changing properties Export default options so other dependent packages can test against changing properties Aug 26, 2016
@gigabo
Copy link
Contributor

gigabo commented Aug 26, 2016

Thanks @jbenesch!

@gigabo gigabo merged commit 36d9f75 into redfin:master Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants