These are chat archives for reactioncommerce/reaction

14th
Jul 2016
Aaron Judd
@aaronjudd
Jul 14 2016 03:33
@kvnkwon I think @hrath2015 has deployed to Heroku. are you using master or development? I don’t think we’ve tried with the development branch. what kind of errors are you seeing?
Brent Hoover
@zenweasel
Jul 14 2016 03:34
@aaronjudd Actually I think we fixed his problem in a private chat. .gitignore issues
Aaron Judd
@aaronjudd
Jul 14 2016 03:35
ah, cool
@haggarwal90 not yet. but it’s high on our list. we’ve been a little busy with conversion to Meteor 1.4 / module structure but should be wrapping that up this week and back to features.
Kevin Kwon
@kvnkwon
Jul 14 2016 04:36
Ah sorry, but yep the problem was fixed!
hrath2015
@hrath2015
Jul 14 2016 09:45
@zenweasel on latest dev branch after running the app node_modules directory contains 350+ folder. is this expected?
Brent Hoover
@zenweasel
Jul 14 2016 09:46
Hmmm, well I would expect a lot more node stuff, but I couldn’t say how much
hrath2015
@hrath2015
Jul 14 2016 09:50
OK thanks
Brent Hoover
@zenweasel
Jul 14 2016 09:51
Looking at my installation
hrath2015
@hrath2015
Jul 14 2016 09:52
because when I do meteor npm list --depth=0 only shows what is in package.json which are handful
Brent Hoover
@zenweasel
Jul 14 2016 09:52
Yeah, but it’s the dependencies of the dependencies that kill you
348 here
hrath2015
@hrath2015
Jul 14 2016 09:53
OK
Brent Hoover
@zenweasel
Jul 14 2016 09:53
Is it causing a problem or you were just curious?
hrath2015
@hrath2015
Jul 14 2016 09:54
No problem at all. Just curious
Brent Hoover
@zenweasel
Jul 14 2016 09:55
Yeah, also moving to something like lodash where you have a lot of small packages rather than one huge one like underscore
Hey, while I got you on the line I got a question for you
hrath2015
@hrath2015
Jul 14 2016 09:57
yes
Brent Hoover
@zenweasel
Jul 14 2016 09:57
Wanted to see if you could try the new reaction-cli on your Windows box
npm install -g reaction-cli
Should replace the bash script so it will be more cross-platform compatible
hrath2015
@hrath2015
Jul 14 2016 09:58
do I need to shutdown anything
while RC running I can do it
Brent Hoover
@zenweasel
Jul 14 2016 10:00
Hmmm, yeah theoretically. Though normally you would use it for running reaction
You could try doing reaction test (no ./)
hrath2015
@hrath2015
Jul 14 2016 10:01
install done
Brent Hoover
@zenweasel
Jul 14 2016 10:02
you could try reaction init in a new directory (will just clone the repo)
hrath2015
@hrath2015
Jul 14 2016 10:04
I did reaction in my existing install
Brent Hoover
@zenweasel
Jul 14 2016 10:04
And it started reaction Ok?
hrath2015
@hrath2015
Jul 14 2016 10:05
got error

Check C:\Users\rath\AppData\Roaming\npm\node_modules\reaction-cli\node_modules\inquirer\node_modules\external-editor\node_modules\spawn
ils

module.js:340
throw err;
^
Error: Cannot find module 'lodash'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\hrathore\AppData\Roaming\npm\node_modules\reaction-cli\dist\commands\run.js:8:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Brent Hoover
@zenweasel
Jul 14 2016 10:05
Hmmm, ok. :worried:
hrath2015
@hrath2015
Jul 14 2016 10:05
Looks it is expexting lodash in gloabal scope
Brent Hoover
@zenweasel
Jul 14 2016 10:05
Yep
hrath2015
@hrath2015
Jul 14 2016 10:06
let me try init
same
that is on reaction git page right?
Brent Hoover
@zenweasel
Jul 14 2016 10:08
No, different thing
Well, actually let me look
hrath2015
@hrath2015
Jul 14 2016 10:09
is this not same https://github.com/reactioncommerce/reaction-cli
OK
Brent Hoover
@zenweasel
Jul 14 2016 10:09
Yeah, that’s it
hrath2015
@hrath2015
Jul 14 2016 10:10
let me know if u wanna test me locally. I can pull the code and build and test
Brent Hoover
@zenweasel
Jul 14 2016 10:10
Cool, I appreciate it
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 10:55
Hi I was reading the reacion-route/common/init.js

saw following code

//
// add group and routes to routing table
//
let uniqRoutes = new Set(newRoutes);
for (let route of uniqRoutes) {
// allow overriding of prefix in route definitions
// define an "absolute" url by excluding "/"
if (route.route.substring(0, 1) !== "/") {
route.route = "/" + route.route;
shop.newGroup = ReactionRouter.group({
prefix: ""
});
} else if (shopCount <= 1) {
shop.newGroup = ReactionRouter.group({
prefix: ""
});
} else {
shop.newGroup = ReactionRouter.group({
prefix: "/" + prefix
});
}

is this some special feature? like i can add any prefix as per mmy wish

example : http://localhost:4005/reaction/myprefix/tag/shop

Brent Hoover
@zenweasel
Jul 14 2016 10:57
Yes, it’s a feature of FlowRouter.
So for example you could define an “admin” group so you don’t need to keep adding that to every route
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:01

ok . i m reading it. Actually i want to implement like follow

parse the url and check the prefix
if prefix match to myprefix then add some session attribute and then i can use the session attribute in any template

Brent Hoover
@zenweasel
Jul 14 2016 11:02
not sure if that would work or not
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:02
okk..
Brent Hoover
@zenweasel
Jul 14 2016 11:02
I think you could use triggers to set session variables, but not sure if you can use triggers on a group
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:03
hmm but my main issue is to parse the url and match the prefix
if i found matching prefix then handle it
Brent Hoover
@zenweasel
Jul 14 2016 11:04
Oh, it looks like you can have group triggers
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:04
reading ur trigger link as well..
Brent Hoover
@zenweasel
Jul 14 2016 11:06
var adminRoutes = FlowRouter.group({
  prefix: '/admin',
  name: 'admin',
  triggersEnter: [function(context, redirect) {
    console.log('running group triggers');
  }]
});
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:07
hmm
i have to use ReactionRouter at place of FlowRouter? right?
looks like solution to my problem but not sure .. will give it a try
Brent Hoover
@zenweasel
Jul 14 2016 11:09
Yeah, but ReactionRouter === FlowRouter pretty much. Just a “Reaction Enhanced” FlowRouter
Himanshu Aggarwal
@haggarwal90
Jul 14 2016 11:09
cool. Trying
Michael Jenny
@prinzdezibel
Jul 14 2016 16:09
@haggarwal90 See also: reactioncommerce/reaction#1098
hrath2015
@hrath2015
Jul 14 2016 17:12
@zenweasel I could test reaction init for cli package
blob
one suggestion. we should have meteor npm install also as part of installation. Post that cd reaction && reaction
hrath2015
@hrath2015
Jul 14 2016 17:20
@zenweasel noticed while testing reaction pull that meteor npm install is carried out
hrath2015
@hrath2015
Jul 14 2016 17:31
reaction run is showing all flickering screen totally jumbled up. I wanted to capture a a video but I had to uninstall the software due to security policy. tool a screen shot though. Here it is..
blob
U can see started proxy and started mongodb is repeated and actually screen is all jumbled up. Like Matrix movie screen saver from old time.
1 more screen shot after 2 min passed
blob
Jeremy Shimko
@jshimko
Jul 14 2016 17:38
I’m not sure what to do about that. That sounds like an issue with the way the Windows command prompt displays Node's process.stdout when it’s rapidly updating.
Under the hood, that’s a bash script being run by a Node process and the bash output is being piped through process.stdout
Other than that, it sounds like everything’s working, right?
hrath2015
@hrath2015
Jul 14 2016 17:40
I know. I was only testing it.
as requested by @zenweasel
Jeremy Shimko
@jshimko
Jul 14 2016 17:41
Yep, I know. He asked me if I wanted him to ask you. :)
and I said yes :)
hrath2015
@hrath2015
Jul 14 2016 17:41
I will try to debug why that behavior
Infact the simple command from reaction pull is logged 4 times.
blob
when i did git pull from cmd prompt only once. it is doing all what is needed but not pretty on eye.
is everything fine on linux
Jeremy Shimko
@jshimko
Jul 14 2016 18:14
yes
I added your suggestion to run meteor npm install in reaction init. Give it a try.
npm i -g reaction-cli
hrath2015
@hrath2015
Jul 14 2016 18:19
I tried after updating node to 0.10.46 and npm as 2.15.1. still same result
Jeremy Shimko
@jshimko
Jul 14 2016 18:19
The screen flickering?
hrath2015
@hrath2015
Jul 14 2016 18:21
yes.
I uninstall and install again. Noticed following warning:
npm WARN engine shelljs@0.7.0: wanted: {"node":">=0.11.0","iojs":"*"} (current: {"node":"0.10.46","npm":"2.15.1"})
npm WARN engine deep-extend@0.4.1: wanted: {"node":">=0.12.0","iojs":">=1.0.0"} (current: {"node":"0.10.46","npm":"2.15.1"})
I guess shelljs may be behaving that way as it needs >=11. I will update to 12 and try. Will report back
Jeremy Shimko
@jshimko
Jul 14 2016 18:23
Ah… I know what it is. Don’t use such an old version of Node for anything other than Meteor. Meteor ships with its own Node and NPM, so you can safely run the latest version of them for everything else you do with Node on your machine. In other words, you don’t need to have Node 0.10.46 installed. Just upgrade to 6.x.
I use n to manage my Node versions and hop between them.
https://github.com/tj/n
hrath2015
@hrath2015
Jul 14 2016 18:25
sure. I was using nvm on my linux machine
Jeremy Shimko
@jshimko
Jul 14 2016 18:25
You can just run:
# install first
npm i -g n

# then
n stable

# or
n 0.10.46
hrath2015
@hrath2015
Jul 14 2016 18:26
thanks
Jeremy Shimko
@jshimko
Jul 14 2016 18:26
Anyway, Node 0.10.46 is the issue. I can reproduce it on OS X.
In general, I just run n stable somewhat regularly and that’s been completely reliable.
Jeremy Shimko
@jshimko
Jul 14 2016 18:38
I added the Node version requirement to the package.json, so it should prompt on install now. Thanks for your help there.
$ npm i -g reaction-cli
npm WARN engine reaction-cli@0.2.7: wanted: {"node":">=0.12.0"} (current: {"node":"0.10.46","npm":"2.15.1”})
hrath2015
@hrath2015
Jul 14 2016 18:49
And we are good
I have tested it works fine
Jeremy Shimko
@jshimko
Jul 14 2016 18:49
Awesome. Thanks!
hrath2015
@hrath2015
Jul 14 2016 18:50
:thumbsup:
Jeremy Shimko
@jshimko
Jul 14 2016 18:54

Not sure if you noticed yet, but I also added an rc alias for reaction.

rc --help

And another for the update command

rc up
hrath2015
@hrath2015
Jul 14 2016 18:54
cool
one more thing.. it is doing all on master branch. Wanna provide option to specify the branch
there is big gap between master and dev during long dev cycle
Jeremy Shimko
@jshimko
Jul 14 2016 18:56
Good point. How about -b and --branch?
hrath2015
@hrath2015
Jul 14 2016 18:57
--branch should be fine or can keep both if not too much to accomodate
Jeremy Shimko
@jshimko
Jul 14 2016 18:58
Nope, would just be a simple alias that points to the same thing
hrath2015
@hrath2015
Jul 14 2016 18:58
OK then. Thanks. Time for me to sleep now
Jeremy Shimko
@jshimko
Jul 14 2016 18:59
The docs will probably say --branch, but I always like having short options for stuff I type often.
hrath2015
@hrath2015
Jul 14 2016 18:59
catch up later
Jeremy Shimko
@jshimko
Jul 14 2016 18:59
Thanks again for your help
hrath2015
@hrath2015
Jul 14 2016 18:59
np. tc
Jeremy Shimko
@jshimko
Jul 14 2016 19:24
@hrath2015 You can now choose a branch with -b or --branch.
reaction init --branch development

# or short form
rc init -b development

# or to specify the folder to clone to
reaction init --branch development somename

# this also works (command options order doesn’t matter)
reaction init somename --branch development
Aaron Judd
@aaronjudd
Jul 14 2016 21:36
@jshimko that’s pretty sweet. working well for me :clap:
Brent Hoover
@zenweasel
Jul 14 2016 21:46
@jshimko Awesome. Will be great to have something that works well for Windows folks
Spencer Norman
@spencern
Jul 14 2016 23:23
@zenweasel how would I go about calling the StripeAPI tests with an API key in dev?
Spencer Norman
@spencern
Jul 14 2016 23:27
ah, ok, so set the API key in the code (but don’t commit)?
Brent Hoover
@zenweasel
Jul 14 2016 23:28
Yeah, a smarter thing would be to set this as an ENV variable and leave it out of the code
Spencer Norman
@spencern
Jul 14 2016 23:28
yeah
Brent Hoover
@zenweasel
Jul 14 2016 23:28
I mean, that’s what I should have done
but I just created those tests when I was writing the code and found them useful
it’s more the method tests that I would like to see created
Spencer Norman
@spencern
Jul 14 2016 23:29
:+1: Makes sense. I saw the describe.skip blocks and figured it was something that was being come back to but understand now.
Brent Hoover
@zenweasel
Jul 14 2016 23:30
Yeah, I need to reenable those ASAP, those are the very last tests that I need to get working again
I forget what the deal was. I thought I would redo them when I redid Stripe but then Aaron ended up rewriting Stripe
but most of them are enabled