{"action":"created","issue":{"url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/13","repository_url":"https://api.github.com/repos/skilld-labs/docker-frontend","labels_url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/13/comments","events_url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/13/events","html_url":"https://github.com/skilld-labs/docker-frontend/pull/13","id":220159320,"number":13,"title":"Package.json management added. Yarn included.","user":{"login":"iberdinsky-skilld","id":10120083,"avatar_url":"https://avatars1.githubusercontent.com/u/10120083?v=3","gravatar_id":"","url":"https://api.github.com/users/iberdinsky-skilld","html_url":"https://github.com/iberdinsky-skilld","followers_url":"https://api.github.com/users/iberdinsky-skilld/followers","following_url":"https://api.github.com/users/iberdinsky-skilld/following{/other_user}","gists_url":"https://api.github.com/users/iberdinsky-skilld/gists{/gist_id}","starred_url":"https://api.github.com/users/iberdinsky-skilld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iberdinsky-skilld/subscriptions","organizations_url":"https://api.github.com/users/iberdinsky-skilld/orgs","repos_url":"https://api.github.com/users/iberdinsky-skilld/repos","events_url":"https://api.github.com/users/iberdinsky-skilld/events{/privacy}","received_events_url":"https://api.github.com/users/iberdinsky-skilld/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-04-07T09:27:02Z","updated_at":"2017-06-30T19:15:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/skilld-labs/docker-frontend/pulls/13","html_url":"https://github.com/skilld-labs/docker-frontend/pull/13","diff_url":"https://github.com/skilld-labs/docker-frontend/pull/13.diff","patch_url":"https://github.com/skilld-labs/docker-frontend/pull/13.patch"},"body":"\r\n# What that commit about:\r\n\r\nWe have several issues with current npm docker-frontend build:\r\n- List of packages is hard fixed and unversioned.\r\n    ```sh\r\n    ENV NPM_PACKAGES \"bower \\\r\n      breakpoint-sass \\\r\n      browser-sync \\\r\n      ... \r\n      typey \\\r\n      zen-grids\"\r\n    ```\r\n- If we want to add any new module to any project we have to update docker-frontend repo and its docker hub. \r\n- Current build not uses package.json from project and not uses package.json from [Zen](https://github.com/skilld-labs/zen/blob/8.x-7.x/STARTERKIT/package.json)\r\n- If we plan to move to bowerless projects and use only node modules this build became useless. \r\n\r\n\r\n# What has been done here?\r\n\r\n- Npm changed to [Yarn](https://yarnpkg.com/en/). It anounced as npm on steroids. https://www.sitepoint.com/yarn-vs-npm/ It is faster, has a lot of packaging features. But main reason of yarn: I couldn't do next things with npm. Maybe anyone can. \r\n- Instead of hardfixed list i'm using:\r\n  ```sh\r\n  ADD https://raw.githubusercontent.com/skilld-labs/zen/8.x-7.x/STARTERKIT/package.json .\r\n  ```\r\n  It seems good to use last version of modules. And actual list.\r\n- Once installed module uses yarn caching.\r\n- If project's package.json has any different modules inside then docker-entrypoint it will add required on first run. next time it will use cache. \r\n```sh\r\n//second run\r\n$ n\r\nyarn install v0.22.0\r\n[1/4] Resolving packages...\r\nsuccess Already up-to-date.\r\nDone in 1.06s.\r\nyarn run v0.22.0\r\n$ \"/work/node_modules/.bin/gulp\"\r\n[09:01:08] Using gulpfile /work/gulpfile.js\r\n[09:01:08] Starting 'clean:css'...\r\n[09:01:08] Starting 'clean:styleguide'...\r\n``` \r\n- Build not uses docker-frontend:latest now and became standalone for testing purposes.\r\n\r\n# How to test?\r\n\r\n1. `cd zen` \r\n2. `docker build -t front .`\r\n3. `cd anyproject_theme` \r\n4. `alias n='docker run -p 3000:3000 -p 3001:3001 --rm -it -v $(pwd):/work front '` \r\n5. `n` \r\n6. If all ok add to anyproject_theme's package.json any new modules. Via npm, yarn or even copypaste from [that commit](https://github.com/xArturia/zen/blob/672784a95b44950e52965eb4195b8494ce03f046/STARTERKIT/package.json).\r\n7. Repeat step 5) \r\n\r\n# Main thing here.\r\n\r\nThis is obviously not a final build. Just a mix of different ideas. Build became slower but smarter. Yarn has a lot of new [features](https://yarnpkg.com/en/docs/cli/). Or we can find similar on npm and make it work. Anyway we have a lot of space to make it faster. Please test it well. Thanks"},"comment":{"url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/comments/312351416","html_url":"https://github.com/skilld-labs/docker-frontend/pull/13#issuecomment-312351416","issue_url":"https://api.github.com/repos/skilld-labs/docker-frontend/issues/13","id":312351416,"user":{"login":"andypost","id":73713,"avatar_url":"https://avatars0.githubusercontent.com/u/73713?v=3","gravatar_id":"","url":"https://api.github.com/users/andypost","html_url":"https://github.com/andypost","followers_url":"https://api.github.com/users/andypost/followers","following_url":"https://api.github.com/users/andypost/following{/other_user}","gists_url":"https://api.github.com/users/andypost/gists{/gist_id}","starred_url":"https://api.github.com/users/andypost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andypost/subscriptions","organizations_url":"https://api.github.com/users/andypost/orgs","repos_url":"https://api.github.com/users/andypost/repos","events_url":"https://api.github.com/users/andypost/events{/privacy}","received_events_url":"https://api.github.com/users/andypost/received_events","type":"User","site_admin":false},"created_at":"2017-06-30T19:15:16Z","updated_at":"2017-06-30T19:15:16Z","body":"Also better to create separate image (and docker tag) for this image, see #20 "}}
{"actor":{"display_login":"andypost"}}