-
-
Notifications
You must be signed in to change notification settings - Fork 486
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
make the .bootstraprc location customizable #90
Conversation
Forgot to mention in the description that this PR also allows use of |
@pherris This looks really good. I'd like to see this applied to the some examples with the docs referring to that. I'll use that to manually test. Of course, bonus points if you could lead the way and get us going with some automated tests. CC: @alexfedoseev |
got the basic test framework added, but needs some real tests... Copied directory structure from the react_on_rails repo. |
@justin808 I need to make a call on whether or not to start using my fork instead of this repo - do you think merging and releasing this PR is in the near future? Is there anything else you see needing to be completed? |
+1 looking forward to merging |
+1 |
@justin808 love the project and the work you guys are doing! I am wondering what's the hold up on this pr? I'd like to see this come in and it looks like all of the conditions for merge were met... Is there something else that needs to be done, or can we get this approved? Thanks! |
That's what I need to merge this. We just need a sample in this repo that I can pull and verify the change. Also, if others besides the author have verified the change, that would be great. @alexfedoseev and I are slammed working on our new product. CC: @outdooricon, @s2ugimot, @yuki-takei, @pherris |
@pherris @yuki-takei @s2ugimot @outdooricon I'd like to get this one merged. Please see my prior comment. |
Sorry, I was slammed at work last week. I'll get the examples updated early On Saturday, June 25, 2016, Justin Gordon [email protected] wrote:
|
That feature would be extremely helpful for me 👍. |
@lo1tuma Please see the conversation above. I just need a PR that has this. |
I updated the basic example but was not able to fully test it due to the interdependencies between the basic example which depends on The symptom I saw was having to The basic test code was added some time ago, so @justin808 I believe this was the only outstanding item. |
@pherris FYI -- it's pretty common to have issues with npm link. I'll try this out. |
I have a few questions. I'm going to ask @alexfedoseev to review and mark the files reviewed once he's OK with the changes. Review status: 0 of 11 files reviewed at latest revision, 6 unresolved discussions. CONTRIBUTING.md, line 20 [r4] (raw file):
@pherris Given your last comment on this issue, should we change this part of the README.md? examples/basic/.bootstraprc, line 1 [r4] (raw file):
Why was this file deleted? examples/basic/.gitignore, line 220 [r4] (raw file):
Why are you adding this to .gitignore? examples/basic/package.json, line 12 [r4] (raw file):
Why are we using all caps for the option? Why not: Note, examples/basic/webpack.dev.config.js, line 7 [r4] (raw file):
Do we need to have this in all caps? const boostraprcLocation = process.argv.find(val => val.includes('--bootstraprc-location')).split('=')[1]; examples/basic/webpack.dev.config.js, line 24 [r4] (raw file):
Why the other changes here? Comments from Reviewable |
I tried the following and got errors. I did be sure to run
Review status: 0 of 11 files reviewed at latest revision, 6 unresolved discussions. Comments from Reviewable |
@pherris I'm guessing that we should be testing this by installing locally. I used to just release to npm to do some testing, but it's really not necessary. Review status: 0 of 11 files reviewed at latest revision, 7 unresolved discussions. a discussion (no related file): Comments from Reviewable |
sheesh - you guys aren't using this plugin in this example. I'll need to look into when/why that made it into the code - is it being used in the downstream webpack_react_on_rails code maybe? In the mean time I'll update this pr. Review status: 0 of 11 files reviewed at latest revision, 8 unresolved discussions. CONTRIBUTING.md, line 20 [r4] (raw file):
|
To test locally I ran |
the comments about |
|
@justin808 I think the PR as it stands is working well with I will push another commit with a separate example using the customized location (mostly the same as the basic example). |
Review status: 0 of 27 files reviewed at latest revision, 14 unresolved discussions. a discussion (no related file):
|
@pherris Let me know if you want to screen share and discuss any of the comments. I'm eager to get this one wrapped up (and not distract @alexfedoseev too much). |
@pherris Any update on this one? |
Sorry, guys, I need to close few more cards before I'll get to this PR. Hope to review it in the next couple of days. |
Review status: 0 of 27 files reviewed at latest revision, 14 unresolved discussions. a discussion (no related file):
|
Review status: 0 of 29 files reviewed at latest revision, 12 unresolved discussions. a discussion (no related file):
|
require('./lib/bootstrap.loader?extractStyles!./no-op.js'); |
'bootstrap-loader/extractStyles', |
README.md, line 111 [r7] (raw file):
Previously, justin808 (Justin Gordon) wrote…
Could we have different scripts in package.json rather than duplicating the directory structure of the examples/basic and examples/custom-bootstrap-location? Seems like a lot of maintenance work to have duplicated files.
Another way around the duplicated files is to use a relative sym link added to the git project. "relative" is key.
examples/basic/.gitignore, line 221 [r8] (raw file):
# the npm run ... commands can create this file but we don't want it checked in .bootstraprc
OK -- consider making this at top level. I believe
/.bootstraprc
would do it.
examples/basic/package.json, line 14 [r8] (raw file):
"build": "npm run clean && webpack --config webpack.prod.config.js", "prod": "npm run build && nodemon --watch app/markup --ext html server.prod.js", "bs3": "rm -f .bootstraprc && cp .bootstraprc-3-example .bootstraprc",
cp -f
and you would not need the rm -f
, right?
examples/basic/package.json, line 19 [r8] (raw file):
"bs4:dev": "npm run bs4 && npm start", "bs3:prod": "npm run bs3 && npm run prod", "bs4:prod": "npm run bs4 && npm run prod"
We should have options here for specifying the path.
examples/custom-bootstraprc-location/.bootstraprc-3-example, line 1 [r7] (raw file):
Previously, justin808 (Justin Gordon) wrote…
I really don't like the duplication of all these files.
See my previous comment about having different scripts.
examples/basic/webpack.dev.config.js, line 24 [r4] (raw file):
Previously, justin808 (Justin Gordon) wrote…
We'll need to check with @alexfedoseev
Comments from Reviewable
Review status: all files reviewed at latest revision, 14 unresolved discussions. examples/custom-bootstraprc-location/webpack.prod.config.js, line 15 [r8] (raw file):
Comments from Reviewable |
I'm getting a little PR-review fatigue & had some other work to catch up on. Will review again now. Review status: all files reviewed at latest revision, 14 unresolved discussions. CONTRIBUTING.md, line 20 [r4] (raw file):
|
Review status: all files reviewed at latest revision, 14 unresolved discussions. README.md, line 111 [r7] (raw file):
|
Review status: 7 of 12 files reviewed at latest revision, 14 unresolved discussions. a discussion (no related file):
|
Review status: 7 of 12 files reviewed at latest revision, 14 unresolved discussions. examples/basic/.bootstraprc, line 28 [r7] (raw file):
|
Reviewed 2 of 4 files at r1, 1 of 3 files at r2, 1 of 1 files at r3, 3 of 6 files at r8, 7 of 24 files at r9. a discussion (no related file):
|
Review status: 9 of 13 files reviewed at latest revision, 15 unresolved discussions. examples/basic/package.json, line 16 [r9] (raw file):
|
Review status: 9 of 13 files reviewed at latest revision, 15 unresolved discussions. examples/basic/webpack.prod.config.js, line 37 [r9] (raw file):
|
Reviewed 4 of 4 files at r10. a discussion (no related file):
|
Review status: all files reviewed at latest revision, 12 unresolved discussions. a discussion (no related file): In the contributing section, please list the exact numbered steps so that future contributors can verify that didn't break these nice examples. @alexfedoseev should
When I use npm link, I got this error:
When I used:
That works... Here's the IIFE error:
➜ ~/shakacode/bootstrap-loader/examples/basic (pherris-master) npm i --save-dev ../..
➜ ~/shakacode/bootstrap-loader/examples/basic (pherris-master) ✗ npm run bs3:dev ✹ [21:50:28]
[nodemon] 1.9.1 examples/basic/webpack.bootstrap.config.js, line 7 [r10] (raw file):
This crashes due to operator precedence issues. You can wrap the IIFE with parens, like this: const bootstraprcCustomLocation = (() => {
const matchedArgument = process.argv.find(val => val.includes('--bootstraprc-location'));
return matchedArgument && matchedArgument.split('=')[1];
})(); but why bother? Why not just have a few extra lines, or just create a function and call it? An IIFE is overkill here. Comments from Reviewable |
@pherris I'd like to get this merged soon. There're some other PRs coming after this one. See my comments. CC: @alexfedoseev |
Reviewed 2 of 3 files at r11, 1 of 1 files at r12. CONTRIBUTING.md, line 47 [r12] (raw file):
good enough -- I can change this after the merge We should list all the ones to run. README.md, line 64 [r7] (raw file):
|
@pherris Please fix the reference to your local path, and squash all the commits down to one with a nice commit message. Then we can merge and release and 🎆 🎉 |
@justin808 In the sample projects: |
Be in the correct directory:
Then install after each change:
@vpanjganj Once this goes in, we'll cut the v2 beta release. |
examples/basic/package.json, line 54 [r12] (raw file):
|
src/bootstrap.loader.js, line 83 [r13] (raw file):
Strings must use singlequote Comments from Reviewable |
src/bootstrap.loader.js, line 86 [r13] (raw file):
Strings must use singlequote Comments from Reviewable |
node_package/tests/configCreation.test.js, line 5 [r13] (raw file):
Unexpected string concatenation prefer-template Comments from Reviewable |
See #114. CC: @alexfedoseev @pherris @vpanjganj |
I've published 1.1.0-beta.1 from #114. I'm awaiting review comments and somebody to verify that the new build works. |
I needed the option to run multiple variations of the
.bootstraprc
file against the same project. This fork lets developers pass in the location of their.bootstraprc
file and cleans up some of the inter-dependencies betweenbootstrap.loader.js
andbootstrap.config.js
around creation of theconfig
object.Also should address #75.
This change is