{"action":"created","issue":{"url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/1","repository_url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt","labels_url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/1/comments","events_url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/1/events","html_url":"https://github.com/adiktofsugar/grunt-nunjucks-alt/issues/1","id":312102947,"number":1,"title":"bump nunjucks?","user":{"login":"waffledonkey","id":12648350,"avatar_url":"https://avatars2.githubusercontent.com/u/12648350?v=4","gravatar_id":"","url":"https://api.github.com/users/waffledonkey","html_url":"https://github.com/waffledonkey","followers_url":"https://api.github.com/users/waffledonkey/followers","following_url":"https://api.github.com/users/waffledonkey/following{/other_user}","gists_url":"https://api.github.com/users/waffledonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/waffledonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waffledonkey/subscriptions","organizations_url":"https://api.github.com/users/waffledonkey/orgs","repos_url":"https://api.github.com/users/waffledonkey/repos","events_url":"https://api.github.com/users/waffledonkey/events{/privacy}","received_events_url":"https://api.github.com/users/waffledonkey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-04-06T20:12:46Z","updated_at":"2018-04-29T10:11:52Z","closed_at":null,"author_association":"NONE","body":"Can I talk you into bumping your Nunjucks dependency to 3.0.0\r\n\r\n`\"nunjucks\": \"^3.0.0\"`\r\n\r\nThis is because ancient nunjucks needs ancient fsevents which no longer builds or I'd even be up for nunjucks as an [optionalDependencies](https://docs.npmjs.com/files/package.json#optionaldependencies)\r\n\r\nAlso, if you're feeling generous would you consider changing line 59 of the task to:\r\n\r\n`var environment = options.env || new nunjucks.Environment([fileLoader]);`\r\n\r\nI use a custom environment with filters like 'layout' and 'partial' so that I can do this sort of syntax:\r\n\r\n`{% extends 'base' | layout %}`\r\n\r\nversus having to have the complete relative path back to the layout in each template.  You already support a custom env, but your only honoring it for pre-compiling not rendering.\r\n"},"comment":{"url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/comments/385240540","html_url":"https://github.com/adiktofsugar/grunt-nunjucks-alt/issues/1#issuecomment-385240540","issue_url":"https://api.github.com/repos/adiktofsugar/grunt-nunjucks-alt/issues/1","id":385240540,"user":{"login":"waffledonkey","id":12648350,"avatar_url":"https://avatars2.githubusercontent.com/u/12648350?v=4","gravatar_id":"","url":"https://api.github.com/users/waffledonkey","html_url":"https://github.com/waffledonkey","followers_url":"https://api.github.com/users/waffledonkey/followers","following_url":"https://api.github.com/users/waffledonkey/following{/other_user}","gists_url":"https://api.github.com/users/waffledonkey/gists{/gist_id}","starred_url":"https://api.github.com/users/waffledonkey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waffledonkey/subscriptions","organizations_url":"https://api.github.com/users/waffledonkey/orgs","repos_url":"https://api.github.com/users/waffledonkey/repos","events_url":"https://api.github.com/users/waffledonkey/events{/privacy}","received_events_url":"https://api.github.com/users/waffledonkey/received_events","type":"User","site_admin":false},"created_at":"2018-04-29T10:11:52Z","updated_at":"2018-04-29T10:11:52Z","author_association":"NONE","body":"It does sort of work.  I broke up my static class from one that returns nunjucks and one that does filter work which has some benefits to me anyway.  The issue I face now is that while it does write a file, the file is empty.\r\n\r\nYou seem to be switching from nunjucks.precompile for pre-compiling and environment.render for rendering, but if I recall correctly the reason my original static class returned an instance of Nunjucks and not an instance of Environment was because environment didn't have a render method -- but I'm not taking any errors related to that it's just not producing any results.  Err.  It writes files, they're just empty.\r\n\r\n```\r\n[D] started file routes/homepage/index.html 42ms elapsed\r\n[D] templateName for routes/homepage/index.html is homepage/index.html\r\n[D] templateData { error: \r\n   { title: 'Error: dummy error',\r\n     stack: 'at /path/to/foo.js:1:1\\n at /path/to/bar.js:2:1' } }\r\n[D] rendered 50ms elapsed\r\n>> Wrote homepage/index.html as .tmp/routes/homepage/index.html\r\n\r\nDone.\r\n\r\nls -l .tmp/routes/homepage/index.html\r\n-rw-r--r--  1 redacted  staff  0 Apr 29 02:14 .tmp/routes/homepage/index.html\r\n```\r\n\r\nI have views alongside their corresponding routes (`index.js; express.Router`) inside of `routes`\r\n\r\n```\r\nroutes\r\n    _layouts\r\n    _partials\r\n    homepage\r\n        index.js\r\n        index.html\r\n    error.html\r\n    index.js\r\n```\r\nIf I specify a `searchPaths` of `routes` it can find `error.html` but it's resulting content is empty and it cannot find `homepage/index.html` at all.  if I specify `searchpaths` as `routes/**` it can find both `error.html` and `homepage/index.html` but the resulting files for both are empty.  The same occurs if I don't specify searchPaths.\r\n\r\nI guess I'm struggling with the correlation between cwd, baseDir, searchPaths and src.  I don't use baseDir, but trying made no difference. My src is consistently: `routes/**/*.html`, I typically omit `cwd` -- though it varies wildly between `'.'`, `process.cwd()` and `'routes'` -- and changing `srcPaths` similarly varies wildly between whether it can find a thing or not.  Usually it can find the template to be able to resolve it to a name, but then can't find the file to render it which doesn't make much sense to me because it found it to resolve it to a name... :(\r\n\r\nWhile I have you, if we can use globbing in src and src can be an array, then why do we need searchPaths?\r\n"}}
{"actor":{"display_login":"waffledonkey"}}