<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Víctor Lara on Medium]]></title>
        <description><![CDATA[Stories by Víctor Lara on Medium]]></description>
        <link>https://medium.com/@redteamwins?source=rss-d2db46cb0891------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*exW6itdsNbDD0IVI</url>
            <title>Stories by Víctor Lara on Medium</title>
            <link>https://medium.com/@redteamwins?source=rss-d2db46cb0891------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 04:14:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@redteamwins/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I integrated a Xee connected car in Home Assistant]]></title>
            <link>https://medium.com/@redteamwins/how-i-integrated-a-xee-connected-car-in-home-assistant-dd609a91213c?source=rss-d2db46cb0891------2</link>
            <guid isPermaLink="false">https://medium.com/p/dd609a91213c</guid>
            <category><![CDATA[domotique]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[cars]]></category>
            <category><![CDATA[home-assistant]]></category>
            <dc:creator><![CDATA[Víctor Lara]]></dc:creator>
            <pubDate>Mon, 26 Nov 2018 20:31:05 GMT</pubDate>
            <atom:updated>2018-11-26T20:35:33.515Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m totally into domotize my home, I have a lot of stuff, all managed by the awesome <a href="https://www.home-assistant.io/">Home Assistant</a> platform.</p><p>This black friday, a big mechanical workshops company in my country, (Midas, in Spain) made a promotion: a device, which they install in my car, and they provide GPS tracking, a lot of information of your car, car updates notifications… only for 12€, (What a deal!!), so I decided to investigate more.</p><p>After some research, I find that the Device is a Xee connect, it’s a device made by a French company, called <a href="https://www.xee.com/">Xee</a>, that mades this product. They have open api, developer accounts, a lot of online documentation, a full github repo, and even an account in Medium to share information!!</p><p>THAT’S SO COOL!</p><p>It’s really fun to go with people totally based on that philosophy, so, of course, I went to my closest workshop, get the device installed in a couple of hours. I installed the worskshop app, they show me how it works (pretty easy), and went home to investigate a little more.</p><p>I installed Xee app when I arrived home, check both apps, and try to integrate the device into my Home Assistant instance to get all the data, so I can make cool things!</p><p>Disclaimer: First of all, this is the walk that I took to get this, A LOT of things can be improved, and I love that you can share all your’s discovers, I had nothing of information of anybody who had accomplished this, and it’s a “one-day proyect”.</p><p>TALK IS CHEAP, SHOW ME THE CODE</p><p>Calm down, firstly we need a Xee Dev account, just get one from their page, create a new application, and use this configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2l_gIDJbu7VB2uRxqX-6pw.png" /></figure><p>From now on, the Key is going to be refferer as client-id</p><p>Now, from a browser, call this api:</p><p><a href="https://api.xee.com/v4/oauth/authorize?response_type=code&amp;client_id=f77a7f776848799e8bee90aae4ec6f14&amp;scope=vehicles.read+vehicles.signals.read+vehicles.locations.read">https://api.xee.com/v4/oauth/authorize?response_type=code&amp;client_id={{client_id}}&amp;scope=vehicles.read+vehicles.signals.read+vehicles.locations.read</a></p><p>A login screen will appear, log in with your USER xee account. The browser will redirect you to a page like this:</p><p><a href="http://localhost/?code=ds3Imncv49RWFD4mfds30dmor5jr4RNMfLnFnuje093j&amp;state=">http://localhost/?code=<strong>ds3Imncv49RWFD4mfds30dmor5jr4RNMfLnFnuje093j</strong>&amp;state=</a></p><p>Note that code. This is the authorization code generated by the authorization server. This code expires after 1 minute, and can be used only once.</p><p>Now, with postman, create a call with this parameters: (<a href="https://dev.xee.com/v4-openapi/#section/Authentication">API</a>)</p><p>POST <a href="https://api.xee.com/v4/oauth/token">https://api.xee.com/v4/oauth/token</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*9eLhgPeSIpo28a95aIPwaw.png" /><figcaption>Headers config</figcaption></figure><p>The autorization is a string with this format:</p><pre>Basic base64(“application_key:application_secret”)</pre><p>So, to obtain it, we go to any base64 converter, paste your “application_key:application_secret”, and you get it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*flrs3RKek6H5PKM2UIyOdQ.png" /><figcaption>Body Config</figcaption></figure><p>Where the code is the one obtained previously in or browser.</p><p>Now we send it, and we get:</p><pre>{<br>    &quot;access_token&quot;: &quot;{{access_token}}&quot;,<br>    &quot;expires_in&quot;: 86400,<br>    &quot;refresh_token&quot;: &quot;{{refresh_token}}&quot;,<br>    &quot;scope&quot;: &quot;vehicles.locations.read vehicles.read vehicles.signals.read&quot;,<br>    &quot;token_type&quot;: &quot;Bearer&quot;<br>}</pre><p>Ok, now we are totally logged in my xee acount, and with the access_token, we can call the API to get the ID of my car.</p><p>GET <a href="https://api.xee.com/v4/users/me/vehicles">https://api.xee.com/v4/users/me/vehicles</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*IO02zxFBc456gRr5v_yiFA.png" /></figure><p>In the token, use the access_token from before.</p><pre>[<br>    {<br>        &quot;id&quot;: &quot;--------------------------------&quot;,<br>        &quot;userId&quot;: &quot;--------------------------------&quot;,<br>        &quot;fleetId&quot;: null,<br>        &quot;name&quot;: &quot;-----&quot;,<br>        &quot;brand&quot;: &quot;&quot;,<br>        &quot;model&quot;: &quot;&quot;,<br>        &quot;kType&quot;: null,<br>        &quot;licensePlate&quot;: &quot;&quot;,<br>        &quot;firstEntryIntoService&quot;: null,<br>        &quot;device&quot;: {<br>            &quot;id&quot;: &quot;-----&quot;,<br>            &quot;brand&quot;: &quot;XEE&quot;,<br>            &quot;vehicleId&quot;: &quot;THIS IS THE VEHICLE ID&quot;<br>        },<br>        &quot;createdAt&quot;: &quot;2018-11-19T18:53:41.139724Z&quot;,<br>        &quot;updatedAt&quot;: &quot;2018-11-20T07:22:18.449072Z&quot;<br>    }<br>]</pre><p>So we got the vehicle id, now we are ready to call the endpoint that retrieve that car information, and consume it in HA.</p><p>Now let’s test the status endpoint, with the same configuration as previously:</p><pre>{<br>    &quot;vehicleId&quot;: &quot;EDITED&quot;,<br>    &quot;createdAt&quot;: &quot;2018-11-19T18:53:41.987823041Z&quot;,<br>    &quot;updatedAt&quot;: &quot;2018-11-26T19:39:45.753328972Z&quot;,<br>    &quot;signals&quot;: [<br>        {<br>            &quot;name&quot;: &quot;AirCondSwitchSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:21.668Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;BatteryVoltage&quot;,<br>            &quot;value&quot;: 12.55,<br>            &quot;date&quot;: &quot;2018-11-26T19:37:39.154Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;ComputedAccActivity&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:44.138Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;ComputedBatteryEngineStart&quot;,<br>            &quot;value&quot;: 14.193,<br>            &quot;date&quot;: &quot;2018-11-21T06:52:12.34Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;ComputedEngineState&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:26.643Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;ComputedFuelLevel&quot;,<br>            &quot;value&quot;: 42,<br>            &quot;date&quot;: &quot;2018-11-20T07:28:19.304Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;CoolantPressure&quot;,<br>            &quot;value&quot;: 6.4,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:17.582Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;EngineSpeed&quot;,<br>            &quot;value&quot;: 823.68,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:23.729Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;FrontLeftSeatBeltSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:20.668Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;FuelLevel&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:23.53Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;GpsSpeed&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:34.942Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;HazardSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.127Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;HeadLightSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.128Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;HighBeamSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:39.376Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;HighSpeedWiperSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.104Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;IgnitionSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:21.617Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;IntermittentWiperSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:52:18.063Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;LeftIndicatorSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T17:18:39.053Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;LockSts&quot;,<br>            &quot;value&quot;: 1,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:41.36Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;LowBeamSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:39.875Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;LowSpeedWiperSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T16:40:49.794Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;ManualWiperSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.104Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;Odometer&quot;,<br>            &quot;value&quot;: 103999,<br>            &quot;date&quot;: &quot;2018-11-20T17:17:39.766Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;OutdoorTemp&quot;,<br>            &quot;value&quot;: 9.5,<br>            &quot;date&quot;: &quot;2018-11-21T06:53:00.446Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;RearFogLightSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.128Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;RearWiperSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T07:26:33.104Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;RightIndicatorSts&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-20T17:17:46.944Z&quot;<br>        },<br>        {<br>            &quot;name&quot;: &quot;VehiculeSpeed&quot;,<br>            &quot;value&quot;: 0,<br>            &quot;date&quot;: &quot;2018-11-21T06:55:16.357Z&quot;<br>        }<br>    ],<br>    &quot;location&quot;: {<br>        &quot;altitude&quot;: EDITED,<br>        &quot;latitude&quot;: EDITED,<br>        &quot;longitude&quot;: EDITED,<br>        &quot;heading&quot;: EDITED,<br>        &quot;date&quot;: &quot;2018-11-21T06:55:42.022Z&quot;,<br>        &quot;nbSat&quot;: EDITED,<br>        &quot;hacc&quot;: 0<br>    },<br>    &quot;accelerometer&quot;: {<br>        &quot;x&quot;: -EDITED,<br>        &quot;y&quot;: -EDITED,<br>        &quot;z&quot;: -EDITED,<br>        &quot;date&quot;: &quot;2018-11-19T18:58:35.517Z&quot;<br>    },<br>    &quot;gyroscope&quot;: null,<br>    &quot;loan&quot;: null<br>}</pre><p>THIS IS AWESOME!! We really have A LOT of data of our car! It’s what I want in Home Assistant!!</p><p>Let’s move there!</p><p>First of all, create a restful sensor</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/54d5e3153bee2fc16620cd549e1226fc/href">https://medium.com/media/54d5e3153bee2fc16620cd549e1226fc/href</a></iframe><p>With the json_attributes, we are going to take the three info items that we are going to read.</p><p>Now create the sensors:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04d088828bc35029a129050b8d04ee65/href">https://medium.com/media/04d088828bc35029a129050b8d04ee65/href</a></iframe><p>Pretty self-explanatory.</p><p>Now, lets make a group in the interface to show them:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45d7cbd755f0fa30ee352d7de4a5f238/href">https://medium.com/media/45d7cbd755f0fa30ee352d7de4a5f238/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/1*iByNT8ccb2rBE5DiIuTqDA.png" /><figcaption>YAY!!!!</figcaption></figure><p>Also, as I’m kind of a “day-dream” person, sometimes I don’t remember where I park, so I think a Google Maps card with my parking location whould be awesome!!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b931d15ffe93d40b5d3e1b3f2c64ed2/href">https://medium.com/media/5b931d15ffe93d40b5d3e1b3f2c64ed2/href</a></iframe><p>And here it is!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*5jXLMO76QJWmi9cjPQdK_w.png" /></figure><p>SO IT’S DONE!</p><p>No, sorry.</p><p>Do you remember the token that we get before?</p><p><a href="https://medium.com/@XeeTech/token-expiration-from-hour-to-days-9b3314c15a7b">It expires every 48h</a></p><p>So we need to refresh it, my quick &amp; dirty solution is to make a cron in my Home Assistant machine:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c22d83a8e36a11fff6dc522865ca600b/href">https://medium.com/media/c22d83a8e36a11fff6dc522865ca600b/href</a></iframe><p>And that’s all!</p><p>Now you can do whatever you want! Use those sensors and create some magic!</p><p>I hope this can help people to create new things! If you get better ways to do the things (like automate the refresh) or improve this, please comment!</p><p>HAPPY CODING!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd609a91213c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What should be the workflow in a Javascript open-source module from a CI point of view.]]></title>
            <link>https://medium.com/@redteamwins/what-should-be-the-workflow-in-a-javascript-open-source-module-from-a-ci-point-of-view-518e7b0efe7b?source=rss-d2db46cb0891------2</link>
            <guid isPermaLink="false">https://medium.com/p/518e7b0efe7b</guid>
            <category><![CDATA[eslint]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Víctor Lara]]></dc:creator>
            <pubDate>Sat, 28 Jul 2018 16:09:15 GMT</pubDate>
            <atom:updated>2018-07-30T08:47:58.842Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi! The purpose of this article is to recreate a full workflow that, in my opinion, should be applyed as a base to any big software creation.</p><p>The project is a really small JS module, which has been fullfilled with all the tools needed in a continuos integration flow.</p><p>I am not really an expert with this kind of tools, but I really enjoy playing with them, and I want to share with you my small experience and my point of view.</p><p>I have tryied to keep all the tools at their default configuration, to avoid complications. And check how they work in the most regular way.</p><p>We are going to start by the steps of the development, and explaining every tool used.</p><h3><strong>Development</strong></h3><p>During this phase, the developer codes the features.</p><h4><strong>Code Style</strong></h4><ul><li><a href="https://eslint.org/">Eslint</a>: Eslint provides linting capabilities to JS, so every developer should attach to the same code-style rules. Recommended reading: <a href="https://eslint.org/docs/about/">https://eslint.org/docs/about/</a></li><li><a href="https://www.npmjs.com/package/eslint-config-airbnb-base">eslint-config-airbnb-base</a>: This package provides Airbnb’s base JS .eslintrc (without React plugins) as an extensible shared config. This base is the “de facto” standard for ES6 linting rules.</li><li><a href="https://github.com/prettier/prettier">Prettier</a>: Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. It adds more power to eslint in the formatting rules. Recommended reading: <a href="https://prettier.io/docs/en/comparison.html">https://prettier.io/docs/en/comparison.html</a></li></ul><h4><strong>Testing</strong></h4><p>There is a test folder with the tests for the library. They has been written using the most regular JS frameworks</p><ul><li><a href="https://mochajs.org/">Mocha</a></li><li><a href="http://www.chaijs.com/">Chai</a></li><li><a href="http://sinonjs.org/">Sinon</a> Is not used in this project, but for complex testing is always needed to test any kind of API calls. It provides stubs, spies and mocks. Their documentation is recommended to know their power.</li></ul><h4><strong>Code coverage</strong></h4><p>Represents the percentage of code that has been tested. In this project we use:</p><ul><li><a href="https://github.com/istanbuljs/nyc">nyc</a>: This is the new version of istambuljs, it generates an output of code coverage.</li><li><a href="https://codecov.io/">codecov</a>: Upload coverage reports, link with github and allow to review the changes on pull requests.</li></ul><h4><strong>Build</strong></h4><p>As the code is written in ES6, it can’t be used directly in node, so it has to be transpiled to UMD. In this project we use webpack.</p><ul><li><a href="https://webpack.js.org/">webpack</a></li></ul><h4><strong>Version Control</strong></h4><ul><li><a href="https://github.com/">Github</a>: All you know it.</li><li><a href="https://github.com/typicode/husky">Husky</a>: A tool to add git hooks in client side, totally integrated for JS projects.</li></ul><h4><strong>Continous Integration</strong></h4><ul><li><a href="https://travis-ci.org/">TravisCI</a>: Free CI for open-source projects.</li><li><a href="https://github.com/semantic-release/semantic-release">semantic-release</a>: Fully automated version management and package publishing. It’s a really powerful package. it’s used to create Git tags, changelogs, handlying the version number using <a href="https://semver.org/">semver</a>, and enforcing the developers to maintain a sanitized git repository and using commit convention.</li></ul><h4><strong>Deployment</strong></h4><ul><li><a href="https://www.npmjs.com/">npm</a>: We use <a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> as a package repository</li><li><a href="https://bower.io/">bower</a>: We also deploy on bower (thanks to git tags generated by semantic-release).</li></ul><h3>Sample feature workflow</h3><p>This is the project github page: <a href="https://github.com/vlaraort/ultimate-string-replace">https://github.com/vlaraort/ultimate-string-replace</a></p><p>With all this tools correctly configured, this will be the usual workflow:</p><ul><li>The developer clones the project.</li><li>Make a local git branch.</li><li>Make their changes.</li><li>Make their tests.</li><li>git push.</li></ul><p>At this moment, husky enters in action, launches the following script:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*d_iHNlFkO7UPUjIEYHnYTA.png" /></figure><p>npm build<strong> </strong>launches webpack, so a build is generated just before every push.</p><p>npm run lint launches eslint ., so it will check all the .js files and apply the rules. It also runs prettier. There is also another command npm run lint:fix to trigger autofix for both libraries.</p><p>npm run test launches :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*P8EOm_DwJy8fLiEdpKXTHA.png" /></figure><p>in this command nyc is launched to generate code coverage, and mocha will run all the test. babel-core/register. is to allow developers to write ES6 code in the tests.</p><p>If some of this steps fails, the git push is going to be cancelled, so the developer should fix all their errors before commiting. This way, we ensure that all the people in the team will work with order and control about what is commited and what changes they produce.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*To5OXbC-Z7DAS3Y7S1K5MA.png" /><figcaption>successful push</figcaption></figure><p>At the moment that the branch reaches the remote, Travis enters in the game. Thanks to the travis.yml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*eLlTtTr6JdyKQsafRPeyQQ.png" /></figure><p>As we have registered our project in travis-ci, a new pipeline will be launched</p><p>This is the project travis page: <a href="https://travis-ci.org/vlaraort/ultimate-string-replace">https://travis-ci.org/vlaraort/ultimate-string-replace</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CZyVb35nLFSH3isI-2kIQ.png" /><figcaption>Travis capture, triggered by a branch called error_control</figcaption></figure><p>As you can see, the 4 instances of node has been triggered, as it was indicated in the property node_js. the line 12, 13 and 14 are needed for make greenkeeper with node v10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*QwkzFzXEnqJ8bb0f62LYrg.png" /></figure><p>This is the start of the build log, as you can see, travis clones the project, sets credentials and node, run npm install, npm run greenkeeper-lockfile-update and npm test.</p><p>If everything went ok, continues:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/847/1*MVHSsXzySwik9-Hh-ISvKQ.png" /></figure><p>Here, travis starts with our after-success scripts:</p><ul><li>npm run coverage:ci: will run nyc report --reporter=lcovonly &amp;&amp; codecov , this will generate the code coverage output, and will send the data to codecov.</li></ul><p>This is the project codecov dashboard: <a href="https://codecov.io/gh/vlaraort/ultimate-string-replace">https://codecov.io/gh/vlaraort/ultimate-string-replace</a></p><p>Here, you have tons of analitycs of the test quality and coverage of the code, this is really usefull to track the quality and the possible changes of the code.</p><ul><li>npm run travys-deploy-once: This is just to be able to test in 4 different node versions, and only make the deploy once if all the builds have worked.</li><li>npm semantic release: Here starts one of my favourite parts. All the semantic-release automations.</li></ul><p>According to the documentation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*qB6Kp9F8fTeJryyDRD9hYA.png" /></figure><p>So, mainly, semantic release checks the github repository to get the commits of the last release</p><p>Analyze the commits between HEAD and the branch tag.</p><p>As all the commits should be in <a href="https://gist.github.com/stephenparish/9941e89d80e2bc58a153">angular commit convention</a>, this way, semantic-version can detect when the commits are related with a feature, so increment one minor version, a fix, so it bumps a fix version, or checking the “BREAKING CHANGE” string inside the commit, wich corresponds with a mayor version.</p><p>If a version has been bumped, and the branch is master, a release will start. semantic version will generate a changelog and a git tag, push it to github, and then publish to npm a new version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*LqYnINZY3nPdkRSQ7ZR1zw.png" /><figcaption>This is the releases page of the repo, with all the changes documented, and all the versions correctly tagged. Pretty uh?</figcaption></figure><p>Project releases page: <a href="https://github.com/vlaraort/ultimate-string-replace/releases">https://github.com/vlaraort/ultimate-string-replace/releases</a></p><p>If the branch is not master, then there is not release, but this can be parametrized to use only in develop, publishing to private repos, or whatever fills your requirements and way of working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UWYza_ZwSg8EINwX1zD8-g.png" /></figure><p>Also, if there is no “feat” or “fix” commits, that means that the code has not changed, so no release will be done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*im1KAHj9MEBwDQPvcLhxaA.png" /></figure><p>So our developer has pushed their branch, checked that the is no issues with their code, fulfill the code coverage, and pass all their test. So it’s time to make a PR!</p><p>Thanks to travis, when the developer opens a PR, he can see the build status info</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*eTeJ5uMqyvh31pmpFJmrgw.png" /></figure><p>And can only merge when everything is fine (ensuring quality!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*Ix_zqAmXppMMV6FPn7AbFg.png" /></figure><p>In the Pull Request page, you can see all the automations that have runned only opening the PR, wich can limit the merge possibility.</p><p>Also you have a more detailed codecov message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*Y_1NA3mBy9qa5n3ar4pZUA.png" /></figure><p>And, when you merge, (can also be done automatically!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*pI3S1z28Hs_uvm3at03wAA.png" /></figure><p>Now, the master branch with the new changes, starts building, and when it’s done, a new version and a new git tag will be released.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*mkAGMYVem9zoqdj_w67ZeQ.png" /><figcaption>Semantic version also posts the status :)</figcaption></figure><p>This is the PR page: <a href="https://github.com/vlaraort/ultimate-string-replace/pull/5">https://github.com/vlaraort/ultimate-string-replace/pull/5</a></p><p>And that’s all! the code are from a branch to be released in just a couple of clicks. Ensuring that everything is correct.</p><p>Thank you for reading and happy coding! :)</p><p>PS: This is my first article in medium, so all the comments, improvements and corrections will be appreciated :)</p><p>If you liked it, and you want a more detailed article about some of the points, clap and write it in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=518e7b0efe7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>