All notable changes to the Visual Studio Code extension Template Pig will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Changed how
pig.shouldOpenDocument(…)
works so it’s hopefully more consistent.
- Add ability to control which template files are left open by implementing
pig.shouldOpenDocument(…)
.
- Add ability to add a
pig.transformContext(…)
method to your.pig.js
which adds additional context. This can be useful when you’re using the ability to rerun your last template and yourpig.executeAsync(…)
and you don’t need to ask new questions but you do want to provide more computed values to your template items. - Fix bug with rerunning your last template.
- You can now rerun your last template with the same answers (effectively skipping
pig.executeAsync(…)
). This can be useful when you’re debugging a template item’s contents contents or thegetDestinationPath(…)
implementation.
getRelativePath(ancestorUri, descendantUri)
now returns the path with forward slashes instead of back slashes; it was annoying to havecase 'Foo\\Bar.txt'
ingetDestinationPath(…)
implementations.
- You can now embed JavaScript in between
<pig>
…</pig>
at the beginning of a template item to initialize helpers that are specific to that file.- A single trailing newline will be stripped after the closing
</pig>
tag; everything after that will be considered template content.
- A single trailing newline will be stripped after the closing
- Make most variables/functions available globally in
.pig.js
also available in template items.
- Fix bugs
.pig.js
now haslog(…)
in context from Template Pig.
getFolderContents(…)
now takes in an options object as 2nd parameter.getFolderContents(…)
can now yield non-empty folders if you specify{ yieldNonEmptyFolders: true }
.getFolderContents(…)
can now exclude custom files instead of/in addition to.pig.js
,.pignore
, and.pigignore
if you specify{ excludeFiles: ['example.txt'] }
.
- Fix bugs
getDestinationPath(…)
’s first argument is no longer thesourcePath
, but instead is an object with thesourcePath
,uri
, anddirent
object.getFolderContents(…)
now returns anasync
generator whichyield
s all files, but only folders which don’t yield other descendant items.- Files named
.pig.js
,.pignore
, and.pigignore
aren’tyield
ed.
- Files named
- Cleaned up some internal things to more correctly refer to things as paths and URIs.
.pig.js
now hasUri
in context fromvscode
..pig.js
now hasgetFileContent(…)
,getFolderContents(…)
,getRelativePath(…)
, andtoFileUri(…)
in context from Template Pig.- See
README.md
for method details.
- See
.pig.js
now has bothQuickPickItemKind
andQuickInputButtons
in context fromvscode
.
- Uncaught exceptions now reported to user when getting metadata from a template, calling
executeAsync(…)
, rendering templates, or callinggetDestinationPath(…)
with buttons to view the stack trace or open the file that likely caused the issue.
- Alias
change-case
’sparamCase
method tokebabCase
. - Alias
change-case
’snoCase
method to bothlowerSentenceCase
andspaceCase
.
- Declare VS Code configuration contributions so settings show up in Settings UI / JSON IntelliSense.
- Change settings root key from
template-pig
totemplatePig
so VS Code Settings UI formats it as "Template Pig" instead of "Template-pig".
- Initial release