-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update engine * Start adding use of validate method * Prepare 4.0.0-alpha.1 * Update metalsmith-engine-jstransformer * Improve test error handling * Prepare 4.0.0-alpha.2 * Update error handling * Update travis config * Update package.json and refactor * Use es6 for default options * Add transformer engine * Update tests * Remove metalsmith-engine-jstransformer * Add tests * Add tests * Add tests * Ignore catch statement for coverage * Update readme * Update jest * Update dev dependencies * Drop node 4 support
- Loading branch information
ismay
authored
Jan 4, 2018
1 parent
2bb7857
commit 5ba61b6
Showing
64 changed files
with
2,207 additions
and
1,030 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"presets": [ | ||
["env", { "targets": { "node": 4 } }] | ||
["env", { "targets": { "node": 6 } }] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
{ | ||
"extends": "airbnb-base", | ||
"extends": ["airbnb-base", "prettier"], | ||
"env": { | ||
"node": true | ||
}, | ||
"rules": { | ||
"semi": 0, | ||
"arrow-parens": 0, | ||
"comma-dangle": 0, | ||
"function-paren-newline": 0 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,141 +1,120 @@ | ||
3.0.1 - August 2, 2017 | ||
---------------------- | ||
### 4.0.0 - January 4, 2018 | ||
* breaking: dropped node 4 support | ||
* breaking: the filename property is no longer set automatically, use https://github.com/MoOx/metalsmith-filenames | ||
* removed metalsmith-engine-jstransformer for ease of maintenance | ||
|
||
### 4.0.0-alpha.2 - October 7, 2017 | ||
* update metalsmith-engine-jstransformer to 1.0.0-alpha.2 | ||
|
||
### 4.0.0-alpha.1 - October 7, 2017 | ||
* update metalsmith-engine-jstransformer to 1.0.0-alpha.1 | ||
|
||
### 3.0.1 - August 2, 2017 | ||
* update metalsmith-engine-jstransformer to 0.1.2 | ||
|
||
3.0.0 - July 26, 2017 | ||
--------------------- | ||
### 3.0.0 - July 26, 2017 | ||
* dropped support for iojs and node 0.12 | ||
* allow arrays for pattern option as well | ||
|
||
2.0.1 - January 1, 2017 | ||
----------------------- | ||
### 2.0.1 - January 1, 2017 | ||
* correct publishing mistake | ||
|
||
2.0.0 - January 1, 2017 | ||
----------------------- | ||
### 2.0.0 - January 1, 2017 | ||
* abstract templating, allows user to choose which engine to use for rendering (breaking change) | ||
|
||
2.0.0-beta.1 - September 11, 2016 | ||
------------------------------- | ||
### 2.0.0-beta.1 - September 11, 2016 | ||
* switch to jstransformers for rendering (breaking change) | ||
|
||
1.4.4 - May 3, 2016 | ||
------------------- | ||
### 1.4.4 - May 3, 2016 | ||
* normalize partial name for windows | ||
|
||
1.4.3 - February 11, 2016 | ||
------------------------- | ||
### 1.4.3 - February 11, 2016 | ||
* add rename option | ||
* prevent path issue on windows | ||
|
||
1.3.3 - January 27, 2016 | ||
------------------------ | ||
### 1.3.3 - January 27, 2016 | ||
* update consolidate and lodash.omit | ||
|
||
1.3.2 - October 17, 2015 | ||
------------------------ | ||
### 1.3.2 - October 17, 2015 | ||
* update fs-readdir-recursive | ||
|
||
1.3.1 - August 6, 2015 | ||
---------------------- | ||
### 1.3.1 - August 6, 2015 | ||
* pass unrecognised `partials` options to consolidate | ||
|
||
1.3.0 - August 6, 2015 | ||
---------------------- | ||
### 1.3.0 - August 6, 2015 | ||
* add swig include test | ||
* add error handling for unrecognised engines | ||
* code style, dependency and readme updates | ||
* add partials option and test | ||
|
||
1.2.1 - July 23, 2015 | ||
--------------------- | ||
### 1.2.1 - July 23, 2015 | ||
* update swig | ||
|
||
1.2.0 - July 23, 2015 | ||
--------------------- | ||
### 1.2.0 - July 23, 2015 | ||
* update dependencies | ||
* update and add badges | ||
|
||
1.1.1 - July 20, 2015 | ||
--------------------- | ||
### 1.1.1 - July 20, 2015 | ||
* is-utf8 should be a dependency | ||
* add eslint | ||
* add release badge | ||
|
||
1.1.0 - July 19, 2015 | ||
--------------------- | ||
### 1.1.0 - July 19, 2015 | ||
* update tests | ||
* ignore binary files | ||
* add travis ci and david dm badges to readme | ||
* add gitattributes and editorconfig to repo | ||
|
||
1.0.1 - November 22, 2014 | ||
----------------------- | ||
### 1.0.1 - November 22, 2014 | ||
* change name to metalsmith-in-place | ||
|
||
1.0.0 - November 18, 2014 | ||
----------------------- | ||
### 1.0.0 - November 18, 2014 | ||
* render files in-place by default | ||
* remove `default`, `directory` and `inPlace` | ||
|
||
0.6.0 - October 3, 2014 | ||
----------------------- | ||
### 0.6.0 - October 3, 2014 | ||
* fix to use `path` for metalsmith `1.0.0` | ||
|
||
0.5.2 - July 9, 2014 | ||
-------------------- | ||
### 0.5.2 - July 9, 2014 | ||
* fix breaking binary files | ||
|
||
0.5.1 - June 11, 2014 | ||
--------------------- | ||
### 0.5.1 - June 11, 2014 | ||
* fix race condition with stringify file contents | ||
|
||
0.5.0 - April 29, 2014 | ||
---------------------- | ||
### 0.5.0 - April 29, 2014 | ||
* pass in options to consolidate.js | ||
|
||
0.4.0 - April 2, 2014 | ||
--------------------- | ||
### 0.4.0 - April 2, 2014 | ||
* add `default` option | ||
|
||
0.3.0 - March 10, 2014 | ||
---------------------- | ||
### 0.3.0 - March 10, 2014 | ||
* add `inPlace` option | ||
* change `pattern` option to just filter | ||
|
||
0.2.1 - March 10, 2014 | ||
---------------------- | ||
### 0.2.1 - March 10, 2014 | ||
* fix bug in matching pattern logic | ||
|
||
0.2.0 - March 8, 2014 | ||
--------------------- | ||
### 0.2.0 - March 8, 2014 | ||
* add rendering files in place with a `pattern` | ||
|
||
0.1.0 - March 5, 2014 | ||
--------------------- | ||
### 0.1.0 - March 5, 2014 | ||
* add `string` engine convenience | ||
|
||
0.0.6 - February 7, 2014 | ||
------------------------ | ||
### 0.0.6 - February 7, 2014 | ||
* fix `directory` option bug | ||
|
||
0.0.5 - February 7, 2014 | ||
------------------------ | ||
### 0.0.5 - February 7, 2014 | ||
* stringify `contents` on the original file data | ||
|
||
0.0.4 - February 6, 2014 | ||
------------------------ | ||
### 0.0.4 - February 6, 2014 | ||
* switch to `extend` from `defaults` to avoid cloning | ||
* add debug statements | ||
|
||
0.0.3 - February 6, 2014 | ||
------------------------ | ||
### 0.0.3 - February 6, 2014 | ||
* fix to use buffers | ||
|
||
0.0.2 - February 5, 2014 | ||
------------------------ | ||
### 0.0.2 - February 5, 2014 | ||
* mix in metadata | ||
|
||
0.0.1 - February 4, 2014 | ||
------------------------ | ||
### 0.0.1 - February 4, 2014 | ||
:sparkles: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`metalsmith-in-place should catch errors from the engine 1`] = `"Default error from ErrorEngine"`; | ||
exports[`metalsmith-in-place should return an error for an invalid pattern 1`] = `"invalid pattern, the pattern option should be a string or array."`; | ||
|
||
exports[`metalsmith-in-place should throw an error for an engine with an invalid render property 1`] = `"invalid engine, the render property should be a function."`; | ||
|
||
exports[`metalsmith-in-place should throw an error for an engine without a render method 1`] = `"invalid engine, the engine instance should have a render method."`; | ||
|
||
exports[`metalsmith-in-place should throw an error for an invalid engine 1`] = `"invalid engine, the engine should be a constructor."`; | ||
|
||
exports[`metalsmith-in-place should throw an error for an invalid pattern 1`] = `"invalid pattern, the pattern option should be a string or array."`; | ||
|
||
exports[`metalsmith-in-place should throw an error for invalid options 1`] = `"invalid options, this plugin expects a single options object."`; | ||
exports[`metalsmith-in-place should return an error when there are no valid files to process 1`] = `"no files to process, check whether you have a jstransformer installed."`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const jstransformer = require('jstransformer') | ||
const toTransformer = require('inputformat-to-jstransformer') | ||
|
||
const cache = {} | ||
|
||
module.exports = function getTransformer(ext) { | ||
if (ext in cache) { | ||
return cache[ext] | ||
} | ||
|
||
const transformer = toTransformer(ext) | ||
cache[ext] = transformer ? jstransformer(transformer) : false | ||
|
||
return cache[ext] | ||
} |
Oops, something went wrong.