Skip to content

Commit

Permalink
file.render: remove eco dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jun 19, 2018
1 parent 3532bde commit 61e161c
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 212 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,10 @@

## Trunk

Backward incompatibilities:

* file.render: remove eco dependency

Management:

* package: remove fs.realpath dependency
Expand Down
4 changes: 1 addition & 3 deletions lib/file/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions lib/file/render.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 1 addition & 9 deletions lib/misc/string.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions lib/misc/template.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

137 changes: 55 additions & 82 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -43,7 +43,6 @@
"tilde-expansion": "~0.0.0"
},
"optionalDependencies": {
"eco": "~1.1.0-rc-3",
"season": "^6.0.2"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/file/index.coffee.md
Expand Up @@ -385,7 +385,6 @@ require('nikita').file({
## Dependencies

path = require 'path'
eco = require 'eco'
nunjucks = require 'nunjucks/src/environment'
misc = require '../misc'
diff = require '../misc/diff'
Expand Down
1 change: 0 additions & 1 deletion src/file/render.coffee.md
Expand Up @@ -87,7 +87,6 @@ require('nikita').file.render({
extension = path.extname options.source
switch extension
when '.j2' then options.engine = 'nunjunks'
when '.eco' then options.engine = 'eco'
else throw Error "Invalid Option: extension '#{extension}' is not supported"
# Read source
@fs.readFile
Expand Down
5 changes: 0 additions & 5 deletions src/misc/string.coffee
Expand Up @@ -62,11 +62,6 @@ module.exports =
else
@log message: "Option filter not a function and ignored", level: 'WARN', module: 'nikita/lib/write'
options.content = env.renderString options.content.toString(), options.context
when 'eco'
try
eco = require 'eco'
catch e then throw Error "Uninstalled Package: the optional package \"echo\" is not installed"
options.content = eco.render options.content.toString(), options.context
else throw Error "Invalid engine: #{options.engine}"
catch err
throw (if typeof err is 'string' then Error(err) else err)
Expand Down
2 changes: 0 additions & 2 deletions src/misc/template.coffee
Expand Up @@ -4,8 +4,6 @@ module.exports = (string, options) ->
options.engine ?= 'nunjunks'
return switch options.engine
when 'nunjunks' then (new nunjucks.Environment()).renderString string, options
when 'eco' then eco.render string, options
else throw Error "Invalid engine: #{options.engine}"

eco = require 'eco'
nunjucks = require 'nunjucks/src/environment'

0 comments on commit 61e161c

Please sign in to comment.