Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
engelgabriel committed Aug 24, 2017
2 parents 179bae2 + 3703b72 commit 58ba3e4
Show file tree
Hide file tree
Showing 49 changed files with 13,473 additions and 665 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"jquery": true
},
"rules": {
"no-var": 2,
"prefer-const": 2,
"no-multi-spaces": 2,
"no-eval": 2,
"no-extend-native": 2,
Expand Down
35 changes: 18 additions & 17 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
## My Setup
<!-- INSTRUCTION: Answer the questions below about your current setup -->
- __My OS name and version__:
- __My current app version__:

<!--
INSTRUCTION: Answer the questions below by checking items with x, like:
- [x] Checked Item
-->
- [ ] I have tested with the latest application version
- [ ] I can simulate the issue easily

## Description
Thanks for opening an issue! A few things to keep in mind:
<!-- INSTRUCTION: Add more information about your issue and how to simulate the problem if it is possible -->
- Before reporting a bug, please try reproducing your issue with the latest version.
- Please verify that the bug is related to the Rocket.Chat Desktop app, and NOT the
main web app by testing in Chrome/Firefox.
- If the issue occurs in the browser, report to github.com/RocketChat/Rocket.Chat instead
-->

#### Current Behavior
## My Setup
- Operating System:
- App Version:

<!-- INSTRUCTION: Explain the current behavior and attach screen shots if it is possible -->
<!-- Answer questions by putting x in box, e.g. [x] -->
- [ ] I have tested with the latest version
- [ ] I can simulate the issue easily

#### Expected Behavior
## Description
<!-- If relevant, attach screenshots, and how to reproduce -->

<!-- INSTRUCTION: Explain the expected behavior and attach screen shots if it is possible -->
### Current Behavior
<!-- What do you think should happen? -->

### Expected Behavior
<!-- What actually happens? -->
95 changes: 95 additions & 0 deletions .github/changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
const { readFileSync: readFile } = require('fs');
const { resolve } = require('path');
const gitUrl = 'https://github.com/RocketChat/Rocket.Chat.Electron';

const parserOpts = {
headerPattern: /^(\[([A-z]+)\] )?(.*)$/m,
headerCorrespondence: [
'stype',
'type',
'subject'
],
mergePattern: /^Merge pull request #(.*) from .*$/,
mergeCorrespondence: ['pr']
};

const LABELS = {
BREAK: {
title: 'BREAKING CHANGES',
collapse: false
},
NEW: {
title: 'New Features',
collapse: false
},
FIX: {
title: 'Bug Fixes',
collapse: false
},
DOC: {
title: 'Documentation',
collapse: true
},
OTHER: {
title: 'Others',
collapse: true
}
};

const sort = Object.keys(LABELS);

const writerOpts = {
transform: (commit) => {
if (!commit.pr) {
return;
}

commit.type = (commit.type || 'OTHER').toUpperCase();
if (LABELS[commit.type] == null) {
return;
}

commit.pr_url = gitUrl + '/pull/' + commit.pr;

const issues = [];

if (typeof commit.hash === 'string') {
commit.hash = commit.hash.substring(0, 7);
}

if (typeof commit.subject === 'string') {
// GitHub issue URLs.
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => {
issues.push(issue);
return `[#${issue}](${gitUrl}/issues/${issue})`;
});
// GitHub user URLs.
commit.subject = commit.subject.replace(/@([a-zA-Z0-9_]+)/g, '[@$1](https://github.com/$1)');
}

// remove references that already appear in the subject
commit.references = commit.references.filter(({ issue }) => issues.includes(issue));

return commit;
},
groupBy: 'type',
commitGroupsSort: (a, b) => sort.indexOf(a.title) > sort.indexOf(b.title),
finalizeContext: (context) => {
context.commitGroups.forEach((g) => Object.assign(g, LABELS[g.title.toUpperCase()]));
return context;
},
commitsSort: ['subject']
};

writerOpts.mainTemplate = readFile(resolve(__dirname, 'templates/template.hbs'), 'utf-8');
writerOpts.headerPartial = readFile(resolve(__dirname, 'templates/header.hbs'), 'utf-8');
writerOpts.commitPartial = readFile(resolve(__dirname, 'templates/commit.hbs'), 'utf-8');
writerOpts.footerPartial = readFile(resolve(__dirname, 'templates/footer.hbs'), 'utf-8');

module.exports = {
gitRawCommitsOpts: {
merges: null
},
parserOpts: parserOpts,
writerOpts: writerOpts
};
40 changes: 40 additions & 0 deletions .github/templates/commit.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{!-- pr reference --}}- {{#if pr}}[#{{pr}}]({{pr_url}}){{/if}}

{{~!-- subject --}} {{subject}}

{{~!-- commit references --}}
{{~#if references~}}
, closes
{{~#each references}} {{#if @root.linkReferences~}}
[
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}#{{this.issue}}](
{{~#if @root.repository}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if this.repository}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}
{{~else}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~/if}}
{{~else}}
{{~@root.repoUrl}}
{{~/if}}/
{{~@root.issue}}/{{this.issue}})
{{~else}}
{{~#if this.owner}}
{{~this.owner}}/
{{~/if}}
{{~this.repository}}#{{this.issue}}
{{~/if}}{{/each}}
{{~/if}}

11 changes: 11 additions & 0 deletions .github/templates/footer.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{#if noteGroups}}
{{#each noteGroups}}

### {{title}}

{{#each notes}}
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
{{/each}}
{{/each}}

{{/if}}
26 changes: 26 additions & 0 deletions .github/templates/header.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<a name="{{version}}"></a>
{{#if isPatch~}}
##
{{~else~}}
#
{{~/if}} {{#if @root.linkCompare~}}
[{{version}}](
{{~#if @root.repository~}}
{{~#if @root.host}}
{{~@root.host}}/
{{~/if}}
{{~#if @root.owner}}
{{~@root.owner}}/
{{~/if}}
{{~@root.repository}}
{{~else}}
{{~@root.repoUrl}}
{{~/if~}}
/compare/{{previousTag}}...{{currentTag}})
{{~else}}
{{~version}}
{{~/if}}
{{~#if title}} "{{title}}"
{{~/if}}
{{~#if date}} ({{date}})
{{/if}}
22 changes: 22 additions & 0 deletions .github/templates/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{> header}}

{{#each commitGroups}}

{{#if collapse}}
<details>
<summary>{{title}}</summary>
{{else}}
### {{title}}
{{/if}}

{{#each commits}}
{{> commit root=@root}}
{{/each}}
{{#if collapse}}
</details>
{{/if}}

{{/each}}
{{> footer}}


34 changes: 20 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
language: node_js
node_js: 7
cache:
yarn: true
directories:
- node_modules

matrix:
include:
- os: linux
dist: trusty
sudo: false
services:
- docker
script:
- docker run --rm -v ${PWD}:/project -e GH_TOKEN=${GH_TOKEN} -e TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} rocketchat/electron.builder /bin/bash -l -c "npm install && npm run release -- --x64 --ia32"
addons:
apt:
packages:
- rpm
- g++-multilib
- libxss-dev:i386
- os: osx
osx_image: xcode7.3.1
language: generic
node_js:
- '6'
before_script:
- chmod +x ./scripts/travis-build.sh
script: ./scripts/travis-build.sh
cache:
directories:
- node_modules
osx_image: xcode8.3

install:
- yarn
script:
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then export CSC_IDENTITY_AUTO_DISCOVERY=false; fi
- yarn release -- --x64 --ia32

branches:
only:
Expand Down
Loading

0 comments on commit 58ba3e4

Please sign in to comment.