scottmcpherson / meteor-io Goto Github PK
View Code? Open in Web Editor NEWA Command-line Tool for Meteor to Create Custom Commands, Generators, and Scaffolding
A Command-line Tool for Meteor to Create Custom Commands, Generators, and Scaffolding
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
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)
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)
After installing meteor-io with
$ npm install -g meteor-io
I get an error on whatever io command I try
$ io --help
node: bad option: --harmony-rest-parameters
Any idea? Thanks!
When running io for the first time, io currently requires an existing directory to be passed in. It should create the directory if it does not exist.
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.
I'm currently trying to run "io" after installing with npm on Arch Linux.
This line breaks the "io" command. https://github.com/scottmcpherson/meteor-io/blob/master/bin/io#L1
See this forum discussion. https://bbs.archlinux.org/viewtopic.php?id=168479 The second reply gives a workaround. The problem centers around not being able to pass in that many parameters.
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.
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
It might be nice to have a default react component:
ComponentName = React.createClass({
mixins: [ReactMeteorData],
getMeteorData(params) {
return {};
},
render() {
return (
);
}
});
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
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.