Tag: yeoman

维护带有现场的Yeoman发电机

我有一个Yeoman生成器(我维护)支撑Node.js站点。 每个网站然后得到定制。 在定制过程中,我会find一些function,我已经添加到网站(A),我想在我正在定制(B)的网站中使用,也应该返回到生成器中其他网站将需要它。 为了让问题简单化,让我们想象一下,我在Site B中添加了一个单独的模块和相关的testing到站点A. 我可以做的是手动将文件从站点A复制/粘贴到生成器,然后也到站点B. 我可以手动将站点A的文件添加到生成器中。 我想find一种自动的方法来解决从发生器到先前生成的站点的单向丢失文件。 也就是说,Yeoman有没有办法追溯添加生成器的新文件?

在OSX上安装Yeoman

我在OSX上设置ASP.NET 5与Visual Studio代码,但安装Yeoman时有错误。 我正在使用以下命令。 npm install -g yo grunt-cli generator-aspnet bower 并得到这些错误 npm ERR! tar.unpack untar error /Users/username/.npm/grunt-cli/0.1.13/package.tgz npm ERR! tar.unpack untar error /Users/username/.npm/generator-aspnet/0.0.60/package.tgz npm ERR! tar.unpack untar error /Users/username/.npm/yo/1.4.7/package.tgz npm ERR! Darwin 14.0.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "yo" "grunt-cli" "generator-aspnet" "bower" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! […]

如何控制spawnCommand方法在哪里执行

我怎样才能理解和控制从spawnCommand运行? 我正在创build一个哟发生器,作为过程的一部分,我需要调用一个外部工具。 我想这样做的方法是通过从spawnCommand调用powershell脚本。 我遇到了spawnCommand在path中有空格的问题,所以我只是将其封装在powershell文件中。 我看到一些关于superspawn的东西,但是无法运行。 无论如何,我的主要问题是,我正在尝试调用powershell,并将其脚本文件作为参数,但它找不到脚本文件。 这里是代码: signatureKeyFile: function() { var done = this.async(); this.spawnCommand('powershell', ['sign.ps1'], { cwd: this.destinationPath('.') }).on('close', done); }, 我尝试使用procmon来查看它执行的目录,并更好地理解它。 看起来它在很多地方尝试,但似乎所有的环境path。 它不会尝试yo生成器的源或目标path,或者至less这是我看来的。 所以我的问题是1)哪个工作目录spawnCommand默认运行? 2)我怎样才能控制,所以它可以find这个PowerShell文件? spawnCommand不会让我在path中使用空格,所以我不能给它一个完整的path,所以在我看来。 非常感谢!

Yeomanrecursion提示,callback不运行

我对Yeoman很新,但即时通讯尝试实现recursion提示。 受jhipster中的EntityGenerator启发( https://github.com/jhipster/generator-jhipster/tree/master/generators/entity )。 然而似乎有一个地方阻止循环发生的错误。 我的代码如下: var yeoman = require('yeoman-generator'); var inputFields = []; module.exports = yeoman.Base.extend({ prompting: { askForName: askForName, askForFields: askForFields } }); function askForData() { var prompts = [{ type: 'input', name: 'name', message: 'Name?', default: 'Slim Shady' }]; return this.prompt(prompts).then(function (props) { this.props = props; this.async(); }.bind(this)); } function askForFields() { […]

在yeoman生成器中,不发出结束事件,因此不会驱动“on”方法

背景 我正在为Angular SPA创build脚手架生成器(单页应用程序)。 它将依赖于由标准angular度发生器(“angular度”)设置的环境,并且还依赖于标准angular度子发生器来生成应用所需的一些额外的服务和控制器。 换句话说,我正在“装饰”一个基本的angular度应用程序。 如果用户以前安装了一个angular度的应用程序(我寻找标记文件,并在我的代码中设置booleon'angularAppFound'),生成器将正常工作。 但是,我希望它也是'一站式',因为如果他们没有angular度的应用程序已经设置,我的发电机将为他们调用angular发生器,在我之前安装我的额外的angular度文物运行 。 显然,如果angular度应用程序不适用,我的依赖任务将不起作用。 数据 我的代码如下所示: // need this to complete before running other task subgeneratorsApp: function () { if (!this.angularAppFound) { var done = this.async(); this.log('now creating base Angular app…'); // doesn't work (does not drive .on) //this.composeWith('angular', {args: [ this.appName ]} ) // works (drives .on) this.invoke('angular', {args: […]

jhipster不被识别为内部或外部命令,可操作程序或batch file

我跟着这里https://jhipster.github.io/installation/和JHipster快速启动,但在我的Windows 10上,我已经得到了“jioster不被识别为内部或外部的命令,可操作的程序或batch file”还有,我试过键入“yo jhipster”,就是这样的 D:\ CODE \ jHipster> yo jhipster错误jhipster 你似乎没有安装名为“jijster”的发电机。 但是,帮助正在进行中: 你可以通过npmsearchyeoman-generator或通过http://yeoman.io/generators/查看可用的生成器。 用npm install generator-jhipster安装它们。 看到你所有安装的发电机运行哟没有任何参数。 添加–help选项也会显示子生成器。 如果哟找不到发生器,请运行哟医生来排除系统故障。 现在对Windows的剂量jijster支持? 我已经在2016年之前使用过它,并且运行良好,但是现在它不能像文档所说的那样工作。 文件是正确的吗?

Grunt失败生成“path.join的参数必须是string”错误

更新到节点0.10.0,现在当Grunt服务器仍然工作时,Grunt(build)和Grunt Test在运行“useminPrepare:html”(useminPrepare)任务时返回“path.join的参数必须是string”错误,有效地失败。 设置:节点:0.10.0 Yeoman:1.0.0-beta.3 Grunt:grunt-cli v0.1.6,grunt v0.4.0rc7 我知道有一些修复,但尝试所有build议的解决scheme(npmcaching清除,Grunt重新安装等)没有成功。 任何帮助赞赏。

是否可以在yeoman生成器安装后运行grunt命令?

基本上我想在我的生成器完成安装依赖关系后运行grunt ,我发现你可以添加一个callback函数到installDependencies方法中,在所有事情都被安装完成后运行: this.on('end', function () { this.installDependencies({ skipInstall: options['skip-install'], callback: function () { console.log('All done!'); } }); }); 但是我不知道如何运行这个grunt任务(就像去往terminal并运行“grunt”一样)

WebStorm 7 – Yeoman Angular丢失的源映射`加载资源失败:服务器响应状态为404(Not Found)

使用WebStorm 7.0.1运行yeomanangular发生器grunt服务器抛出: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/jquery/jquery.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/angular/angular.js.map:0 Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/bootstrap-affix.js.map:0 Failed to load resource: the server responded with […]

命令“grunt server”的罗盘错误

我正在运行一个项目,我安装了nodeJs,ruby,yeoman,compass等。现在我正在用命令>grunt server或>grunt server –force运行我的项目 但它给我指南针的错误。 E:\CRM_workspace\CRM_from_repo\ria>grunt server –force Running "server" task >> The `server` task has been deprecated. Use `grunt serve` to start a server. Running "serve" task Running "clean:server" (clean) task Cleaning .tmp…OK Running "concurrent:server" (concurrent) task Running "copy:styles" (copy) task Done, without errors. Running "compass:server" (compass) task directory .tmp/styles/ create .tmp/styles/main.css (3.069s) Warning: […]