{"action":"created","issue":{"url":"https://api.github.com/repos/reptar/reptar/issues/71","repository_url":"https://api.github.com/repos/reptar/reptar","labels_url":"https://api.github.com/repos/reptar/reptar/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/reptar/reptar/issues/71/comments","events_url":"https://api.github.com/repos/reptar/reptar/issues/71/events","html_url":"https://github.com/reptar/reptar/pull/71","id":208743328,"number":71,"title":"WIP: v3 - The simplification. ","user":{"login":"hswolff","id":322576,"avatar_url":"https://avatars3.githubusercontent.com/u/322576?v=3","gravatar_id":"","url":"https://api.github.com/users/hswolff","html_url":"https://github.com/hswolff","followers_url":"https://api.github.com/users/hswolff/followers","following_url":"https://api.github.com/users/hswolff/following{/other_user}","gists_url":"https://api.github.com/users/hswolff/gists{/gist_id}","starred_url":"https://api.github.com/users/hswolff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hswolff/subscriptions","organizations_url":"https://api.github.com/users/hswolff/orgs","repos_url":"https://api.github.com/users/hswolff/repos","events_url":"https://api.github.com/users/hswolff/events{/privacy}","received_events_url":"https://api.github.com/users/hswolff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2017-02-19T20:20:31Z","updated_at":"2017-03-25T17:23:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/reptar/reptar/pulls/71","html_url":"https://github.com/reptar/reptar/pull/71","diff_url":"https://github.com/reptar/reptar/pull/71.diff","patch_url":"https://github.com/reptar/reptar/pull/71.patch"},"body":"Thoughts on v3:\r\n\r\nThe overarching goals for V3 is to make Reptar simpler and easier to use.\r\n\r\n# Removing Plugins, Move to Middleware\r\n\r\nHaving an API requires maintaining the API, as well as learning how to use the API. It would be better to just use the Reptar instance directly, and any exposed objects and methods on the Reptar instance. This will remove the need to maintain an external API as well as help users of Reptar learn how Reptar itself works, as you'll be interacting directly with Reptar.\r\n\r\nThis means that `plugins` will be removed from the `config.yml` file.\r\n\r\nYou'll only be able to add middleware via a new local (to your project) `reptar.js` file. This will be considered a more advanced use case and as such will require usage of JavaScript. Sharing of middleware will continue to be done via NPM packages.\r\n\r\nQuestion: When you run `reptar build` in your project, if it finds the presence of the `reptar.js` file it will use that to configure middleware. What should it do with that file? Look for an exported `configure` function to call to allow you to configure reptar as you want? I still want to support the rest of the Reptar CLI tools, so there needs to be some way to configure Reptar without replacing it.\r\n\r\n```javascript\r\n// reptar.js\r\n\r\nconst excerptMiddleware = require('reptar-middleware-excerpt');\r\n\r\nexports.configure = function(reptarInstance) {\r\n  // Shared middleware.\r\n  reptarInstance.use(excerptMiddleware);\r\n\r\n  reptarInstance.use(function middlewareFunction(destination, reptar) {\r\n    // Do what you want, custom middleware.\r\n  });\r\n\r\n  reptarInstance.config.set(newConfigFile);\r\n\r\n  // Or whatever else.\r\n}\r\n```\r\n\r\n# Remove Collections as a built-in type, have it be a built-in middleware\r\n\r\nThis is to further emphasize the simplicity of Reptar. Reptar is comprised of utility functions, which help with reading files from the disk and rendering Markdown to HTML and then writing back to disk.\r\n\r\nThat being the case the `collectionsMiddleware` will just ingest all the Markdown files in your site and then use them to create Collections and CollectionPages.\r\n\r\nI have this mostly working locally already. External API should remain the same but this is a step towards being more easily de-coupled from Reptar core.\r\n\r\n# Data files will also be moved as a built-in middleware\r\n\r\nThis is even simpler to do and will be done just for organization sake.\r\n\r\n# Remove and rewrite current 1st-part plugins to be middleware\r\n\r\nThis is namely\r\n\r\n- reptar-excerpt\r\n- reptar-html-minifier\r\n\r\nQuestion with `reptar-html-minifier`: This is done after files are rendered. So perhaps there should be support for `afterWare` - code that runs after Reptar is done running.\r\n\r\n```javascript\r\n// reptar.js\r\n\r\nexports.configure = function(reptarInstance) {\r\n  reptarInstance.useAfter(function afterWareFunction(destination, reptar) {\r\n    // Do what you want, custom middleware.\r\n  });\r\n}\r\n```\r\n\r\n# Rethink Themes\r\n\r\nMy main problem with how themes work right now is that all they're truly concerned with is defining how to process JavaScript and LESS/SASS files. This leads me to believe that Themes aren't really necessary. What we need to have is someway to define how to process JavaScript/LESS/SASS (asset files).\r\n\r\nI'm not sure what that looks like yet but ideally Reptar can understand any `.js` file in your site and know how to process it. Perhaps it can be as simple as that, process every JS/LESS/SASS file and just copy it over to your destination site.\r\n\r\nI was worried about a whitelist or blacklist on which files to include or exclude for processing however it's probably safe to process every file. It doesn't mean that every file will be included in your site. So you can have one `main.js` and one `main.less` that includes other files, and only that file will be included in your template file.\r\n\r\n# Add support for React Templates\r\n\r\nSo you can render all your files with React as the template engine.\r\n\r\n# Create API\r\n\r\nCreate an API for querying and mutating the files in your site. This will lead the way for an admin dashboard!"},"comment":{"url":"https://api.github.com/repos/reptar/reptar/issues/comments/289226233","html_url":"https://github.com/reptar/reptar/pull/71#issuecomment-289226233","issue_url":"https://api.github.com/repos/reptar/reptar/issues/71","id":289226233,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars2.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2017-03-25T17:23:52Z","updated_at":"2017-03-25T17:23:52Z","body":"\n[![Coverage Status](https://coveralls.io/builds/10771925/badge)](https://coveralls.io/builds/10771925)\n\nCoverage decreased (-1.08%) to 88.199% when pulling **ee871a19fc0f68697bb7b066a4f3d097a6a0cc4b on v3** into **453d64215133edf01ad1381f6be437d599ad025c on master**.\n"}}
{"actor":{"display_login":"coveralls"}}