cleverbeagle / pup Goto Github PK
View Code? Open in Web Editor NEWThe Ultimate Boilerplate for Products.
Home Page: https://cleverbeagle.com/pup
The Ultimate Boilerplate for Products.
Home Page: https://cleverbeagle.com/pup
Just noticing that the props collected in the ...rest
on <Authenticated />
are not ultimately passed along to the component being rendered once authentication passes. This appears to be an issue on the <Public />
component, too.
Wether it's through okgrow:analytics
or react-ga
, I am having difficulties setting it up with React Router v4 😢
If you try build for mobile don't forget add whitelist to load external sources need it by Pup.
Example of mobile-config.js:
App.info({
author: 'cleverbeagle',
description: 'Testing mobile PUP',
email: '[email protected]',
id: 'com.meteor.examples.test_pup_heroku',
name: 'test-pup',
website: 'http://cleverbeagle.com/pup/v1',
version: '1.0.0',
});
// Target Android 4.2 version
App.setPreference('android-targetSdkVersion', '17');
// Whitelist enable access to img file from amazon
App.accessRule('https://s3-us-west-2.amazonaws.com');
// Whitelist enable access to css file from bootstrapcdn
App.accessRule('https://maxcdn.bootstrapcdn.com');
Suppose, you have mondoDB into mlab server and your meteor server app into heroku.
The build command example will be(debug mode):
MONGO_URL=mongodb://user:[email protected]:35532/meteor meteor build ../out_apk --debug --verbose --server=https://test-pup.herokuapp.com
That command will create a ../out_apk/debug.apk file to install into our mobile phone.
NOTE: change "user" and "password" with your credentials ;) and your target version for Android.
Thank you so much for open sourcing this boilerplate. I'm really enjoying it and am learning a lot. I'm fairly new when it comes to React and Meteor so my question may be very basic.
How would you recommend adding a <Checkbox>
to DocumentEditor.js
for example?
I have a checkbox "working" with Meteor, but relying on state
for the checkbox leaves the view out of sync when I refresh the page. ref=
doesn't seem to work either as it does for other inputs on the form.
Thank you kindly!
Should also see where it's possible to swap out underscore usage.
This can be a bit cleaner more focused. As a bonus, it should also redirect users to a place where they can actually manage their profile on that service.
Hi there!
I'm trying to install pup but I'm getting the following error:
npm ERR! path /Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/@cleverbeagle/seeder-3f2800ee/node_modules/abab
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/@cleverbeagle/seeder-3f2800ee/node_modules/abab' -> '/Users/willy/Coding/learning/tutorials/pup/node_modules/.staging/abab-d5a1be50'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/willy/.npm/_logs/2017-08-03T10_12_21_407Z-debug.log
Are there any issues for NPM 5.3.0 and Node v8.2.1 which I'm using? My operating system ist OSX Sierra 10.12.6
NOTE:
Afterremoving cleverbeagle/seeder & cleverbeagle/dates from the package.json, the installation completed.
There might be an issue with these packages and my configuration.
When I'm trying to install these packages manually, I'm getting these log files for cleverbeagle/dates and cleverbeagle/seeder
2017-08-03T10_21_01_633Z-debug.txt
2017-08-03T10_23_32_196Z-debug.txt
Hey there,
Just moving some of my code from my prototype to this as the base (your login/signup is much nicer than the thing I built!) and I noticed that by default the on-user-create.js file isn't imported anywhere in the base template meaning the code is never actually executed. Not sure if this is meant or not but I didn't see it documented anywhere so I figured I'd mention it.
Maybe I missed it, but hopefully, this helps anyone in the future that puts stuff in there not realising.
I'm trying to add a google-maps-react to pup, using [https://github.com/istarkov/google-map-react] (Test outside Pup all goes ok, but inside Pup the map is no showed, I think because the "container" has not a fix size (and maps needs his parent have a fix size, or maps goes 0x size)
I try add a SimpleMap.scss file like this to component:
/* CSS declarations go here */
.SimpleMap {
width: 800px;
max-width: 100%;
height: 500px;
}
But without results.... Another idea, thanks ?
Full code of component SimpleMap.js:
import { Meteor } from 'meteor/meteor';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { render } from 'react-dom';
import GoogleMapReact from 'google-map-react';
import { createContainer } from 'meteor/react-meteor-data';
import Markers from '../../../api/Markers/Markers';
import Loading from '../../components/Loading/Loading';
// Read from settings.development.json.
const APIKEY = Meteor.settings.public.APIKEY;
// ES5 users
function _onClick(obj){
console.log(obj.x, obj.y, obj.lat, obj.lng);
//console.log(Object.getOwnPropertyNames(obj));
}
const AnyReactComponent = ({ text }) => (
<div style={{
position: 'relative', color: 'white', background: 'red',
height: 40, width: 60, top: -20, left: -30,
}}>
{text}
</div>
);
const GoogleMapConfig = {
key: APIKEY,
language: 'es'
};
const SimpleMap = ({ loading, markers, defaultProps, match, history }) => (!loading ? (
<div className="SimpleMap">
<GoogleMapReact
bootstrapURLKeys={GoogleMapConfig}
onClick={_onClick}
defaultCenter={defaultProps.center}
defaultZoom={defaultProps.zoom}
>
<AnyReactComponent
lat={40.436374}
lng={-3.694358}
text={'Another anodyne point over map'}
/>
</GoogleMapReact>
</div>
) : <Loading />);
SimpleMap.propTypes = {
loading: PropTypes.bool.isRequired,
markers: PropTypes.arrayOf(PropTypes.object).isRequired,
match: PropTypes.object.isRequired,
history: PropTypes.object.isRequired,
defaultProps: PropTypes.object.isRequired,
};
export default createContainer(() => {
const subscription = Meteor.subscribe('markers');
return {
loading: !subscription.ready(),
markers: Markers.find().fetch(),
defaultProps: {
center: {lat: 59.95, lng: 30.33},
zoom: 8},
};
}, SimpleMap);
@pilarArr this will be for packages only, not the Meteor version (let's keep it at 1.5.0 for now).
An issue is being printed to the console that reads Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
. This error is coming from the react-bootstrap
package that's a dependency of Pup.
The authors of this package will need to fix this error and release an update. Once they do, we'll upgrade and this error should be removed.
You can directly access the methods name by using the property methods :
name(name) { return _.contains(methods, name); },
Need to be able to meet these requirements: https://developers.google.com/web/progressive-web-apps/checklist.
Of note, the service worker is a no-go in Meteor unless we implement a monkey patch like this.
Just noticed this. The process adds just enough boilerplate to the <App />
component that it'd be nice to just have a <VerifyEmailAlert />
component.
This comes up far too often and is common in nearly all products. Need to implement a simple verification flow and display a message to users in the app until they verify.
I noticed that when you change the email in the profile page, it doesn't prompt you to verify that email since it only changes the address field and the verified stays true.
Also when you log in with Facebook or Google. It prompts you send a verification email to an empty field. I'm not sure what would be the way around that. If assuming the email if already verified by Facebook or re check the verification.
Is it an expected behavior that a fail attempt to login rerender the login.js page ?
(Meaning that what you typed dissapear and make the page blink..)
Once we've got a basic set of tests up and running, make sure to remove the "Planned" flag on the http://cleverbeagle.com/pup/v1/introduction page.
The section titled settings-production.json talks about "staging" when instead it should be "production".
Note that there are two instances of "staging" that should be changed.
I complete following the "Getting Started", but when I get to npm start
, I saw the following information.
npm start
> pup@ start /Users/simon/workspace/MyProject/MakerLab
> meteor --settings settings-development.json
[[[[[ ~/workspace/MyProject/MakerLab ]]]]]
=> Started proxy.
=> Started MongoDB.
=> Errors prevented startup:
While loading package fourseven:[email protected]:
error: Command failed: /Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/npm rebuild --update-binary
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/darwin-x64-46_binding.node":
socket hang up
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node',
gyp verb cli '/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp verb download using dist-url https://nodejs.org/dist
gyp verb check python checking for Python executable "python2" in the PATH
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Property description must be an object: Error: not found: python2
gyp ERR! stack at getNotFoundError
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! stack at Function.defineProperty (native)
gyp ERR! stack at EventEmitter.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:185:14)
gyp ERR! stack at EventEmitter.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:281:23)
gyp ERR! stack at Object.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/lib/configure.js:389:18)
gyp ERR! stack at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Darwin 16.6.0
gyp ERR! command "/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node"
"/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose"
"--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/.temp-1rbbfhm/node_modules/node-sass
gyp ERR! node -v v4.8.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/nodejs/node-gyp/issues>
Build failed with error code: 7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/simon/.npm/_logs/2017-07-12T14_29_12_877Z-debug.log
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.3/darwin-x64-46_binding.node":
socket hang up
Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.
export HTTP_PROXY=http://example.com:1234
or configure npm proxy via
npm config set proxy http://example.com:8080
gyp info it worked if it ends with ok
gyp verb cli [ '/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node',
gyp verb cli '/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp verb download using dist-url https://nodejs.org/dist
gyp verb check python checking for Python executable "python2" in the PATH
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack TypeError: Property description must be an object: Error: not found: python2
gyp ERR! stack at getNotFoundError
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! stack at Function.defineProperty (native)
gyp ERR! stack at EventEmitter.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:185:14)
gyp ERR! stack at EventEmitter.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/npmlog/log.js:281:23)
gyp ERR! stack at Object.<anonymous>
(/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/lib/configure.js:389:18)
gyp ERR! stack at F (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:68:16)
gyp ERR! stack at E (/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:80:29)
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/which/which.js:89:16
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/index.js:42:5
gyp ERR! stack at /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15)
gyp ERR! System Darwin 16.6.0
gyp ERR! command "/Users/simon/.meteor/packages/meteor-tool/.1.5.0.17ci6hi++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node"
"/Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose"
"--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/simon/.meteor/packages/fourseven_scss/.4.5.4.7ue0g6++os+web.browser+web.cordova/plugin.compileScssBatch.os/npm/node_modules/meteor/compileScssBatch/node_modules/.temp-1rbbfhm/node_modules/node-sass
gyp ERR! node -v v4.8.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in `node-gyp`.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! <https://github.com/nodejs/node-gyp/issues>
Build failed with error code: 7
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/simon/.npm/_logs/2017-07-12T14_29_12_877Z-debug.log
=> Your application has errors. Waiting for file change.
This should help us to avoid bare inputs unless absolutely necessary.
so i have been trying to modify pup to merge the New Document and Edit document pages into basically one Upsert document page (since the editor is the exact same i figured it would be easy) but it is very strange: when I merge them (this potentially supplying a doc
that is null
) the fields have their defaultValue
populated correctly but they arent displaying in the actual browser. I have googled around this problem and apparently it could potentially be due to some sort of javascript clearing the field without my knowledge? how can I diagnose what is going on here?
sorry for the very open ended question, hoping someone familiar with meteor is able to point me in the right direction.
This is an oversight. We have configuration for the app's SMTP url, but in order to actually send email—independent of the accounts emails—you have to install the email
package (or another provider's package) on your own. Ideally, we should configure some stuff like a welcome email so it's clear how to put it to use.
The console throws an error because doc
is a required prop of ViewDocument
and the return
statement setup causes ViewDocument
to render before the new ID is truly returned. There is a subsequent render after the erroneous one that passing in the doc
prop so the app still functions.
I am not enough of an expert to know if what I did is the correct fix, but here is it:
Error in console:
Warning: Failed prop type: The prop `doc` is marked as required in `ViewDocument`, but its value is `undefined`.
Problematic code found in imports/api/Documents/methods.js
'documents.insert': function documentsInsert(doc) {
check(doc, {
title: String,
body: String,
});
try {
return Documents.insert({owner: this.userId, ...doc});
} catch (exception) {
throw new Meteor.Error('500', exception);
}
},
Changing the return statement to this alleviated the issue:
const documentId = Documents.insert({owner: this.userId, ...doc});
return documentId;
There's a lot of internal code for Meteor that will need mocking. There are quite a few third-party solutions to this already, but they're a bit piecemeal. It'd be best to sample from these existing implementations and combine them into something that we can manage and expand under Pup.
Need mocking for:
trying to deploy Pup to heroku and i got this error:
2017-06-21T06:12:21.023519+00:00 heroku[web.1]: Starting process with command `.meteor/heroku_build/bin/node $NODEJS_PARAMS .meteor/heroku_build/app/main.js`
2017-06-21T06:12:24.740982+00:00 app[web.1]: /app/.meteor/heroku_build/app/programs/server/node_modules/fibers/future.js:280
2017-06-21T06:12:24.741010+00:00 app[web.1]: throw(ex);
2017-06-21T06:12:24.741023+00:00 app[web.1]: ^
2017-06-21T06:12:24.741025+00:00 app[web.1]:
2017-06-21T06:12:24.741032+00:00 app[web.1]: TypeError: Cannot read property 'OAuth' of undefined
2017-06-21T06:12:24.741039+00:00 app[web.1]: at meteorInstall.imports.startup.server.accounts.oauth.js (imports/startup/server/accounts/oauth.js:4:23)
2017-06-21T06:12:24.741040+00:00 app[web.1]: at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741040+00:00 app[web.1]: at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741041+00:00 app[web.1]: at meteorInstall.imports.startup.server.accounts.index.js (imports/startup/server/accounts/index.js:1:14)
2017-06-21T06:12:24.741042+00:00 app[web.1]: at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741042+00:00 app[web.1]: at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741049+00:00 app[web.1]: at meteorInstall.imports.startup.server.index.js (imports/startup/server/index.js:1:14)
2017-06-21T06:12:24.741050+00:00 app[web.1]: at fileEvaluate (packages/modules-runtime.js:333:9)
2017-06-21T06:12:24.741050+00:00 app[web.1]: at require (packages/modules-runtime.js:228:16)
2017-06-21T06:12:24.741051+00:00 app[web.1]: at meteorInstall.server.main.js (server/main.js:1:14)
2017-06-21T06:12:24.850781+00:00 heroku[web.1]: State changed from starting to crashed
2017-06-21T06:12:24.843187+00:00 heroku[web.1]: Process exited with status 1
even though i have set my settings-production.json
file it is running into this ugly error. what else is causing this issue?
In your docs says, when executing an action
If a piece of code fails, it can pass its error to the action.reject() method, which stops the JavaScript Promise and sends the error back to the client. If an action is successful, it can call to action.resolve() to resolve the JavaScript Promise and send a response back to the client.
Is that true? Because as per my understanding, JS will execute all remaining code, if any, before actually returning the promise value.
So if I have a reject and then I call another action, it will run the 2nd action even if the 1st one has been rejected
const action1 = ({ ... }) => {
try {
throw new Meteor.Error('500', 'Error msg');
} catch (exception) {
action.reject(`[handler.action1] ${exception}`);
}
};
const handler = ({ ... }, promise) => {
try {
action = promise;
action1(...);
action2(...); //this will be executed
action.resolve();
} catch (exception) {
action.reject(`[handler] ${exception}`);
}
};
What would be the best way to prevent further execution after a promise has been rejected?
Thanks
This has come up in a few tutorials now and makes sense as a permanent feature.
Since the methods of the documents are imported on the startup of the server :
import '../../api/Documents/methods';
Seems clearer to me if the methods are located in the server folder since we don't import this file on client anymore. (Like we used to do with base)
(UPDATE--UPDATE)
PUP for Mobile
Note: Previously, I had install: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip android sdk tools, to avoid this issue (linux and mac)
meteor/meteor#8464
SOLUTION FOR development/debug MODE
meteor build ../out_apk --debug --verbose --server=192.168.43.20:3000
(note: change 192.168.43.20 by your local ip)
Then copy into mobile and can execute it. All Ok.
But if I try without --debug, then I can build apk, but mobile doesn't install it (says "application damaged". I have the option 'install from unknows origins" activate into my android phone )
Maybe the problem (I don't know how test that) is when run command: meteor run android-device ..... This meteor command try to install the apk (with not debug option, so this apk is NOT SIGNED) and mobile lock installation.....
SOLUTION FOR production MODE
You MUST use 'meteor build' command (not use 'meteor run android-device') and you must sign your app before upload to the mobile terminal. (See https://guide.meteor.com/mobile.html#submitting-android)
Example to got a signed apk:
( Note: The id of apk is com.meteor.examples.pup, that must be set into file mobile-config.js)
meteor build ../out_apk --verbose --server=192.168.43.20:3000
(note: change 192.168.43.20 by your local ip)
keytool -genkey -alias com.meteor.examples.pup -keyalg RSA -keysize 2048 -validity 10000
cd ../out_apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 release-unsigned.apk com.meteor.examples.pup
Finally, to see SHA1 key (and others keys from signed apk, you need it to configure google oauth services)
keytool -exportcert -list -v
Example of file 'mobile-config.js'
App.info({
author: 'cleverbeagle',
description: 'Testing mobile PUP',
email: '[email protected]',
id: 'com.meteor.examples.pup',
name: 'test-pup',
website: 'http://cleverbeagle.com/pup/v1',
version: '1.0.0',
});
Note:
I think that maybe this is not a issue, but would be good add a 'note',addendum, or tutorial (or add to original tutorial) for users to try compile PUP for mobile.
(END UPDATE--END UPDATE)
Trying to compile PUP for android device will got 'Starting app', but nothing more, nothing happens with mobile.
NOTE: Compiling basic Meteor example ( https://github.com/meteor/simple-todos) for mobile is all OK (so I think enviroment is ok for mobile compilation)
Note: I had use: https://dl.google.com/android/repository/tools_r25.2.3-linux.zip android sdk tools, to avoid this issue (linux and mac)
meteor/meteor#8464
echo $ANDROID_HOME
/home/juanma/Android/Sdk
java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
(Note: Try it also with Oracle SDK, same result :( )
ifconfig wlp4s0
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.20 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::4d22:82cd:365c:ab63 prefixlen 64 scopeid 0x20
ether ac:b5:7d:b2:ca:61 txqueuelen 1000 (Ethernet)
RX packets 144317 bytes 199849276 (190.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 50004 bytes 5046455 (4.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/juanma/Android/Sdk/tools:/home/juanma/Android/Sdk/platform-tools
cat mobile-config.js
App.info({
author: 'cleverbeagle',
description: 'Testing mobile PUP',
email: '[email protected]',
id: 'com.meteor.examples.pup',
name: 'test-pup',
website: 'http://cleverbeagle.com/pup/v1',
version: '1.0.0',
});
meteor add-platform android
Subproject Path: CordovaLib
android: added platform
meteor run android-device --settings settings-development.json --mobile-server=192.168.43.20
=> Started proxy.
%% support for subdirectories is deprecated and will be removed in Cordova@7
Subproject Path: CordovaLibns [==== ] 14% 134.6s
Subproject Path: CordovaLibns [=============== ] 57% 20.5s
WARNING: It looks like you are using OAuth2 login in your app. Meteor's OAuth2 implementation does not currently work with mobile apps in local
development mode, except in the iOS simulator. You can run the iOS simulator with 'meteor run ios'. For additional workarounds, see
https://github.com/meteor/meteor/wiki/OAuth-for-mobile-Meteor-clients.
WARNING: You are testing your app on a remote device. For the mobile app to be able to connect to the local server, make sure your device is on the
same network, and that the network configuration allows clients to talk to each other (no client isolation).
Starting your app (Till infinite......... :( )
Here the same, but added --verbose option:
output_log_pup_verbose.txt
This is a lil' function used in <App />
to determine whether we're rendering a name
object with name.first
and name.last
or a string (password-based users vs. OAuth).
Add integration tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them. It may be helpful to include an example of a third-party module (e.g., GitHub API) being integrated into some code and show how to mock it, etc.
Currently, when you try to access a document by typing random id (localhost:3000/documents/sdqlifhqsdhlfh/edit) for example, you will get this warning :
printer.js:170 Warning: Failed prop type: The prop
doc
is marked as required inEditDocument
, but its value isundefined
.
in EditDocument (created by ReactMeteorDataComponent)
in ReactMeteorDataComponent (created by Route)
in Route (created by Authenticated)
in Authenticated (created by App)
in Switch (created by App)
in div (created by Grid)
in Grid (created by App)
in div (created by App)
in Router (created by BrowserRouter)
in BrowserRouter (created by App)
in App (created by ReactMeteorDataComponent)
in ReactMeteorDataComponent
(Removing the required type of the proptypes and setting a default value would fix it ? is it the cleanest way ?)
If I import the necessary react-bootstrap components and replace the App.js/App function with:
const App = props => (
<Form inline>
<FormGroup controlId="formInlineName">
<ControlLabel>Name</ControlLabel>
{' '}
<FormControl type="text" placeholder="Jane Doe" />
</FormGroup>
{' '}
<FormGroup controlId="formInlineEmail">
<ControlLabel>Email</ControlLabel>
{' '}
<FormControl type="email" placeholder="[email protected]" />
</FormGroup>
{' '}
<Button type="submit">
Send invitation
</Button>
</Form>
);
The form doesn't render per the react-bootstrap component docs. See (https://react-bootstrap.github.io/components.html#forms-inline). Specifically, the ControlLabel components do not render inline.
To ensure that the documentation stays in sync with the repo, it'd be nice if we could just specify a file path on GitHub and load the raw content of the file into the docs. This way we don't have to fight with manually updating snippets/things getting out of date.
I noted that currently for OAuth the callback function (in OAuthLoginButton) only sends a message during failure and does nothing during success (e.g. push to /documents). Is that intentional or am I missing something obvious? I would've thought it would be desirable to have the OAuth logins/signup consistently show a message / push to /documents as well.
Thanks, I appreciate the insight.
The method to send verification link has a different name in the rate limiter.
https://github.com/cleverbeagle/pup/blob/master/imports/api/Users/server/methods.js#L32
I try to build the boilerplate for probuction on a Ubuntu GNU/Linux 16.04 machine. To do that I used these commands:
git clone https://github.com/cleverbeagle/pup.git pup2
cd pup2
npm install
meteor build ~/builds
cp settings-development.json ~/builds/settings.json
Afterwards I went to folder ~/builds
and I did typed these commands:
cd ~/builds
tar -xvf pup2.tar.gz
cd bundle
cd programs/server
npm install
cd ../../
export MONGO_URL="mongodb://localhost:27017/tesedb";
export ROOT_URL="192.168.30.137:3821";
export PORT=3821;
export METEOR_SETTINGS="$(cat ../settings.json)"
node main.js
The last command (node main.js
) returns the following error:
/home/pcmagas/builds/bundle/programs/server/boot.js:391
}).run();
^TypeError: Cannot read property 'slice' of null
at packages/meteor.js:1221:19
at packages/meteor.js:1233:4
at packages/meteor.js:1380:3
at /home/pcmagas/builds/bundle/programs/server/boot.js:338:34
at Array.forEach (native)
at Function..each..forEach (/home/pcmagas/builds/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /home/pcmagas/builds/bundle/programs/server/boot.js:158:5
at /home/pcmagas/builds/bundle/programs/server/boot.js:387:5
at Function.run (/home/pcmagas/builds/bundle/programs/server/profile.js:510:12)
at /home/pcmagas/builds/bundle/programs/server/boot.js:386:11
Right now the logout page is just a stylized way to promote something to users on logout. It'd be neat if this page actually performed the logout event on componentDidMount()
. This way we could redirect to that page (without having it do so in the <Authenticated />
component) directly while also getting the desired outcome of logging out.
Add unit tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them.
Just saw that the current password retrieved from the form is never used in the profile page. (to modify your password)
Would be interesting to send the hashed password to check it in the meteor call, instead of just overriding it with the new one.
Add acceptance tests for Pup features (where it makes sense) and ensure we have clear documentation for how these work and how developers can expand upon them. This will rely heavily on Enzyme.
I'm not sure if this goes here, but this link (http://cleverbeagle.com/pup/v1/the-basics/linting) is not working.
It's located in File Structure, on the paragraph on package.json
Hi, when creating an action within a meteor method, if you throw an Meteor.Error with a custom code, when you catch from the client, the error code is always 500 because the catch on the method always return 500
} catch((exception) => {
throw new Meteor.Error('500', exception);
});
I changed it on my code, but I though it was a good idea to adjust it here as well
Thanks
Took me ages to finally track this down. If collection2
denies an insert/update based on schema validation, nothing happens at all on the client, and nothing is printed in the server console.
This can be resolved by changing the best practice method code to listen for the error from collection2
as per its documentation
try {
const documentId = doc._id;
Documents.update(documentId, { $set: doc }, (error) => {
if (error) throw new Meteor.Error('500', error.message);
});
return documentId; // Return _id so we can redirect to document after update.
} catch (exception) {
throw new Meteor.Error('500', exception);
}
I think the boilerplate code should be updated accordingly?
Right now the checkboxes next to checklist items are just for show. Would be neat if these actually persisted in local storage so you could come back later.
It says failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.