Releases: yeoman/generator
v0.17.1
Fixes
Generator#help()
doesn't outputundefined
default value for options.Generator#arguments()
would sometime create endless loop and crash the process.- Generators queue hash won't run private methods (
_
prefixed methods name). - Generator will wait for the Storage to be persisted (if necessary) before triggering the
end
event. Generator#log()
can now use falsy value to replace string placeholder.
Storage
Storage#set()
andStorage#defaults()
now return the content of the store.- Can now be used by multiple Generator instances (e.g. with composability) without having one generator overwrite the config saved by another.
Testing (RunContext
)
-
Deprecate
RunContext#onEnd()
for a real event:runContext.on('end, cb)
. -
Rename
RunContext#withPrompt()
toRunContext#withPrompts()
-
Add
RunContext#withGenerators()
to stub sub-generators called by the tested generator. -
RunContext#inDir()
now take a callback, and the callback can perform async task usingthis.async()
-
Multiple minor improvements (
ready
event to modify env, etc) -
Lots of fixes
Kudos to @blai for the large effort he put into fixing and improving the testing helper.
generator#user.git
- Move getter property to methods for explicit performance side-effect.
user.git.name()
,user.git.email()
,user.github.username()
v0.17.0
v0.17.0-pre.4
Generators
- Fix
appendStyles
andappendScripts
signature to matchappendFiles
. - option defaults no longer display if default value is an empty string.
- Default options value is now undefined (unless specified otherwise)
- Lots of improvements to the options parsing (kudos to @jridgewell for the awesome work)
Testing helpers
RunContext#withPrompt
andhelpers.mockPrompt()
can now work without argument - in which case it'll use the default value of each prompt questions.- A
RunContent
now automatically mock it's generator prompt. - Fix multiple bugs with the new
RunContext
API. - When a prompt is mocked, it's validation errors are now retrievable on
this.prompt.errors
. That'll allow you to test your validations methods against incorrect input.
v0.17.0-pre.3
Composability
- Added the Gruntfile editor API. This API allow multiple generators to write to the Gruntfile without causing conflicts. Read documentation.
Bugs
- Fix errors thrown when
git
command isn't installed on user computer. - Fix error that'd prevent tasks to be runned with a 0.17 based generator and current version or
yo
. - Make sure the system always create a default generator name.
v0.17.0-pre.1
This is a prerelease, install as npm install yeoman-generator --tag pre
.
Base Generator
Base#template()
now accept a forth parameter being the_.templateSettings
Base#template()
now accept template variables declarations in the destination file name. (e.g.this.template('<%=foo%>-template.js');
)Base#appname
now usebower.json
name property by default, then fallback topackage.json
then to the folder name.Base.template()
now keep the source file mode.Base#run()
is now based on grouped-queue to allow easier generator composition.- Updates to File-utils 0.2
- Removes support for Node.js 0.8 (it's been more than one year since Node 0.10 release, time to update!).
Composability
- Generators are now runned as part of a Run loop. The rationnale is explained here: #433
- Added the
Generator#composeWith()
method. Rationnale here #484
We also worked on new documentation. Here's the temporary section about Composability and the run queue.
- Running context: https://github.com/yeoman/yeoman.io/blob/master/app/authoring/running-context.md
- Composability: https://github.com/yeoman/yeoman.io/blob/master/app/authoring/composability.md
Environment
- The
x:app
alias is now defined by default at runtime. No need for consumer to define it themselve anymore. - Namespaces with
npm linked
package are now based on the NPM path rather than the real path. (You won't need to name your base foldergenerator-X
anymore - although it remains a best practice to do so)
Tests helpers
mockPrompt()
now uses the prompts defaults values as values by default. This mean you don't need to defined them manually each time - only options you wish to changes.- Added
RunContext
API to allow easier testing for Generator's author. See documentation
v0.16.0
Generators test utilities
- All previous
yeoman.test.assertX
method are available asyeoman.assert.x
. - Fix bug offucring with
test.testDirectory
on Windows when the test directory was the CWD. - Cleanup and new assertions methods (thanks to @smackesey on PR #436)
- New:
assertFileContent
(check a file exist and its content match a regex) - New:
assertNoFileContent
(check a file content doesn't match a regex) - New:
assertNoFile
(check a file doesn't exist) - Renamed:
before
->setUpTestDirectory
- Deprecated:
assertFile
with regex to match content. UseassertFileContent
instead. - We added deprecation log notice for now. But the methods/signature will be removed in the 1.0 Generator system.
- New:
Environement
- Fix bugs with path resolution. Now only the CWD directory is walked up, and we fixed bug with Windows paths that could wind up in an infinite loop.
Misc
- Start working on better JSDoc markup to generate automatic API documentation.
v0.15.0
Env
- Finding modules on your disk should now be more reliable. When
NODE_PATH
env variable is set, we use it to find global modules - you should set it to point to your global module install directory to ensure maximum reliability.
Adapters
Adapters are the big new feature. They should allow text editors from presenting a custom UI based on top of the Generator API. More detail on our wiki: https://github.com/yeoman/generator/wiki/Using-yeoman-in-non-cli-environment
Base Generator
- the
remote
method now bindfile-utils
scoped environment to the remote object returned in the callback. - Generators can now all be extended with the
.extend()
method (similar to backbone inheritance way). This makes for a cleaner syntax and easier extension chain.
var yo = require('yeoman-generator');
var myGenerator = yo.generators.Base.extend({
method1: function () {}
})
Misc
v0.14.2
v0.14.1
v0.14.0
Generator system
New Features
- Copying large folder could cause a recursion error. Two new methods (
generators.bulkCopy
andgenerators.bulkDirectory
) have been added to allow large folder being copied without template and conflict processing on each contained file. (example use case: transferring every file in the Wordpress repo) (#350) - Added a new file handling system. Generator now get access to
this.src
andthis.dest
who're scoped file utility relative to thesourceRoot
anddestinationRoot
. The file utility is based on theGrunt.file
interface but add scope and filters (write filters to beautify, transcode, etc and validate filters to check conflicts). (For examples and discussion see #378 and #313)
Bugs
- Fix bug with arguments inversed in the wiring methods (#174)
- Fix bug causing the
end
event to be triggered multiple time (Bug #302 -> Fix #402) - Options/args passed to
runHook
are now cloned, so the hooked generator won't modify the state of these objects in the main one. generators
fetching methods likeextract
,fetch
,tarball
now rely on the NPMdownload
module.
Runner system (Environment)
- Fix and improve
env.help
output (#364 and #398) - Now detect correctly symlinked npm modules (e.g. using
npm link
) - breaking
env.register
now only take a string (filepath or NPM module name) to make sure the metadata it assign to the generator are relevant (namespace
,resolved
). If you want to register a stubbed generator for easy testing, then useenv.registerStub
, but know the metadata might be missing or erroneous. - breaking Removal of
env.remote
andenv.engine
. This shouldn't change anything as they were broked or not used.
Maintenance
- Added support for test coverage using Coveralls reports.
- Way better support for running test suite on Windows. It should run now.
See all: v0.13.4...v0.14.0