GithubHelp home page GithubHelp logo

scottmcpherson / meteor-io Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 5.0 83 KB

A Command-line Tool for Meteor to Create Custom Commands, Generators, and Scaffolding

JavaScript 98.26% HTML 1.18% Shell 0.56%

meteor-io's People

Contributors

scottmcpherson avatar stanlindsey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

meteor-io's Issues

Fails on create

Can't seem to be able to create a new project, here's the output:

C:\Users\leonardoc
λ io create io-test
fs.js:856
  return binding.readdir(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, scandir 'C:\Users\leonardoc\AppData\Roaming\npm\node_modules\meteor-io\bin\lib\generators'
    at Error (native)
    at Object.fs.readdirSync (fs.js:856:18)
    at requireDir (C:\Users\leonardoc\AppData\Roaming\npm\node_modules\meteor-io\node_modules\require-dir\index.js:25:20)
    at Command.loadUserGenerators (C:\Users\leonardoc\AppData\Roaming\npm\node_modules\meteor-io\lib\command.js:69:29)
    at Command.run (C:\Users\leonardoc\AppData\Roaming\npm\node_modules\meteor-io\lib\command.js:34:10)
    at Object.<anonymous> (C:\Users\leonardoc\AppData\Roaming\npm\node_modules\meteor-io\bin\io:7:13)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)

Using nodejs 5.0.0 on win7 x64

Issue during Create for the latest version in mac

io create test
Error: unrecognized flag --harmony-rest-parameters
Try --help for options

/usr/local/lib/node_modules/meteor-io/lib/command.js:9
class Command extends Utils {
^^^^^
SyntaxError: Unexpected reserved word
at Module._compile (module.js:439:25)
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)
at require (module.js:380:17)
at Object. (/usr/local/lib/node_modules/meteor-io/lib/io.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Create project fail.

i follow your tutorial here but i'm getting error everytime..

npm install -g meteor-io
ok passed.

io
*ok passed
*

After you specify a directory, io will create a director that looks similar to this:
yes, io created for me some directory.

io create project-name
*and ....
*

mac$ io create project-name
fs.js:856
  return binding.readdir(pathModule._makeLong(path));
                 ^

Error: ENOENT: no such file or directory, scandir '/usr/local/lib/node_modules/meteor-io/lib/Desktop/meteormain/io/generators'
    at Error (native)
    at Object.fs.readdirSync (fs.js:856:18)
    at requireDir (/usr/local/lib/node_modules/meteor-io/node_modules/require-dir/index.js:25:20)
    at Command.loadUserGenerators (/usr/local/lib/node_modules/meteor-io/lib/command.js:83:29)
    at Command.run (/usr/local/lib/node_modules/meteor-io/lib/command.js:35:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/meteor-io/bin/io:7:13)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)


Unexpected reserved word

Running on windows:

D:\Documents\GitHub>npm install -g meteor-io
D:\AppData\Roaming\npm\io -> D:\AppData\Roaming\npm\node_modules\meteor-io\bin\i
o
[email protected] D:\AppData\Roaming\npm\node_modules\meteor-io
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected]
└── [email protected] ([email protected], [email protected], [email protected], es6-iterator@0
.1.3, [email protected], [email protected])

D:\Documents\GitHub>io
Error: unrecognized flag --harmony-rest-parameters
Try --help for options

D:\AppData\Roaming\npm\node_modules\meteor-io\lib\command.js:9
class Command extends Utils {
^^^^^
SyntaxError: Unexpected reserved word
    at Module._compile (module.js:439:25)
    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)
    at require (module.js:380:17)
    at Object.<anonymous> (D:\AppData\Roaming\npm\node_modules\meteor-io\lib\io.
js:1:77)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Let me know if you need any diagnostic steps.

if (self.isDir(ioDest)) always returns false

o/

Looks like the isDir method is always returning false and triggering the 'not valid directory error':

Directory: test
/usr/local/lib/node_modules/meteor-io/lib/commands/setup.js:93
    throw new Error('Not a valid directory');

I replaced "if (self.isDir(ioDest))" with "if (ioDest)" and it creates the directory fine. Though obviously there is no validation.

I still appear to get errors down the line. When attempting to create a project etc.
I have updated Node to v5.

ENOENT: config.json' on Windows

Node.js latest stable 5.0.0

First we need to set up an io directory.

Specify a directory where you would like to store your generators, templates, an
d config.

Directory: ./

Created dir:  io
Created dir:  io\templates
Created dir:  io\generators
Created dir:  io\.io

{ [Error: ENOENT: no such file or directory, stat 'D:\AppData\Roaming\npm\node_m
odules\meteor-io\bin\lib\templates\templates\config.json']
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'D:\\AppData\\Roaming\\npm\\node_modules\\meteor-io\\bin\\lib\\templates
\\templates\\config.json' }

Let me know if you need anything doing to figure this out :D

Add default react component

It might be nice to have a default react component:

ComponentName = React.createClass({

  mixins: [ReactMeteorData],

  getMeteorData(params) {
    return {};
  },

  render() {
    return (

    );
  }
});

how would you go about generating a variable number of, say, helper methods?

I see how you can interpolate data, but that seems to rely on the base template being pretty static. Imagine you want to build a modal popup that lets developers specify the names of helper methods (or events, etc) to add, and then generate empty function definitions in the helpers and events map--how would I go about that? What is the best practices way you would recommend? What about a an api method to generate a map of methods/properties?

Here's how I'd imagine doing that now:

Template.{{name}}.helpers({
{{helpers}}
});

this.writeTemplateWithData({
      src: [this.ioTemplatesPath, 'template.js'],
      dest: [this.config.dest, fileBaseName + '.js'],
      data: { name: templateName, helpers: formattedStringOfHelpers }
});

It just seems that formatting the helpers string might get annoying, and being able to provide an array of helper names could be something that makes sense as a core api feature. Here's an example of how it could look :

Template.{{name}}.helpers({
    {{io.helpers helperNames}}
});

this.writeTemplateWithData({
      src: [this.ioTemplatesPath, 'template.js'],
      dest: [this.config.dest, fileBaseName + '.js'],
      data: { name: templateName, helperNames: ['selected', 'posts', 'etc'] }
});

The next step would be being able to provide a value for the function as well, so in this example helperNames could be an array of arrays, where each child array has 2 items: the name and then the function string. It would also be nice if there was a way to generate an ES6 class

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.