Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wireswiss committed Jul 21, 2016
0 parents commit 0cf9bf4
Show file tree
Hide file tree
Showing 528 changed files with 58,760 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "temp/bower_components"
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
15 changes: 15 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Reference: https://help.github.com/articles/dealing-with-line-endings/

# enforce LF line endings
* text eol=lf

# Denote all files that are truly binary and should not be modified.
*.eot binary
*.jar binary
*.jpg binary
*.otf binary
*.png binary
*.svg binary
*.ttf binary
*.woff binary
*.woff2 binary
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
*.pyc
.DS_Store
.grunt
.Icon
/_SpecRunner.html
/app/ext
/aws/s3
/aws/static
/aws/templates/**/*.html
/aws/templates/auth
/aws/version
/deploy
/dist
/docs
/nbproject
/node_modules
/temp
/test/_SpecRunner.html
/test/coverage
/test/js/*
/Web.config
aws-keys.json
Gruntfile.js
npm-debug.log
strings-ar.coffee
strings-fr.coffee
strings-it.coffee
strings-pt.coffee
strings-ru.coffee

# Automatically created files
/doc

# IntelliJ
# http://devnet.jetbrains.com/docs/DOC-1186
/.idea/**/*.xml
!/.idea/codeStyleSettings.xml
!/.idea/modules.xml
46 changes: 46 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/wire-webapp.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: required
dist: trusty

# https://docs.travis-ci.com/user/installing-dependencies/#Installing-Packages-with-the-APT-Addon
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable

# http://docs.travis-ci.com/user/languages/javascript-with-nodejs/
language: node_js
node_js:
- node

# https://blog.travis-ci.com/2013-12-05-speed-up-your-builds-cache-your-dependencies
cache:
directories:
- bower_components
- node_modules

env:
global:
# RAYGUN_USERNAME
- secure: "xMiUg9p7HCDUarPgsb5CVuTTnYWAZfJf1a8AJA0WKLg1XY3hN/CayYE4jxor+hW2GZVhAeUFPHJXo0OpF9yhXdspVG4i6p/ZAq97N2rlGIHXngTGp6J3pCRtC1wIJqG9g45lST84IfrP0yqnMcY2rnQkE0ZbY9Qn4gIvCEjXJpzA8aI4Lqr/K/LI3cYdnlgPu0s9E2I/Kl0ZenDqD9W0TFyufWNXzH8HqyrEw7UjRM9d8oosYydM5bNmW4oCrMrLMDcqbwC8PPvJUrJKt8tubDuqDDNVECiSE2Rz8FPA3r017heQOOGinzAiUkMVHlJEdcPxBViPhGE6BN10QC1vR6uxaM/9UBIUodLfculzhZ5xcHYgEVHC1w4M5+zoa4F8iecUMMwT1+qC6Na/apTpUNy+OLguK4Se7dTKtfd4+FTbWZANI8xT5duVNnJ//rH6U06OpXDKNvWlYyGl2zZr0gcTXGqxKU+7kVjNZa1k6ltOgy86pTm4VAOLBGfqUbSwRVhW3aqJKS/yjsAkT9oLKuB3T0osVPcsSxS4MmODUmUazr7UMZr8t2S0L0v0NE/Q1I+gykqEzV8ecd9s6RXaWQiwZXgSjMe3UR3qrFO+r1fbwXIo45biPyd1rDFR1Y/dPHxDCPOV6fXjWXp68r5d9tcZTc6xjU1vgoplJfxAyhA="
# RAYGUN_PASSWORD
- secure: "29BtoWU0D68HVLqJ5iG3QNs+B2ytaZsTRsgW5T0WBCWS8b4cOOFLjwQHh5f+Qr0oPjU+cwQ0Sequ9wzGK882lhoT5SyddURhnj2CxWko0zmeNst2YpjEEdrgvtqQMGG+SXizjG9gcPcf52mF0du7LdICh1pN5HZMVckPD02t4+quZn0SpwdvQSCdWtivSNSenguhdJg9z6ulKKJUV3nqvdJsSAC48q9awEfc59dvo8nf7v44bTlIcqGkiCMpR2pxPXjwOvogWQcUZvd2onSZvtOJWOega5iAc0PvSs9p2eLpY82lQSlvsLxaytSiQw50rDLYi1p4ouUn//DUH0Ir8A3g57MRzXkMLs1JDXOJyTbPgLkOdB/TmlryQ2iT0XnHp4ncjWrWjmgQPDKizk7HFeSvMPKjo9V2F46FwXClq1b/U1jP5PVOQHwtujVVmp9CXvBedz1SLaY2GIe0uLexFis1P5UZSCmtP/GpnO47JIguYU43Xkre2hdn1pnpCHiDv4xWISfinBZa+gncjAEodKkApysx48cK6nbZ8HLPnMGDk04oZO+zFz2IprkkefdoKJ32J6BnBtQqmJAXwPaC+AiIEcHWTbHRtZM0NvaxsQFB/MPCy+A2H1amC63wE/CJZbGf2sNQZCNUwsFq8awRxHt8frSS/9Rw+Wg6jDMZp+w="

# http://docs.travis-ci.com/user/gui-and-headless-browsers
before_install:
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

# http://docs.travis-ci.com/user/pull-requests/
script:
- npm test

notifications:
email: false
146 changes: 146 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#
# Wire
# Copyright (C) 2016 Wire Swiss GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#

# @formatter:off
module.exports = (grunt) ->
require('load-grunt-tasks') grunt

path = require 'path'

config =
aws:
port: 5000
server:
port: 8888

dir =
app_: 'app'
app:
demo: 'app/demo'
ext: 'app/ext'
page: 'app/page'
script: 'app/script'
style: 'app/style'
template_dist: 'app/page/template/_dist'
aws_: 'aws'
aws:
s3: 'aws/s3'
static: 'aws/static'
templates: 'aws/templates'
deploy: 'deploy'
dist: 'dist'
docs:
api: 'docs/api'
coverage: 'docs/coverage'
temp: 'temp'
test_: 'test'
test:
api: 'test/api'
coffee: 'test/coffee'
coverage: 'test/coverage'
js: 'test/js'
lib: 'test/lib'
unit_tests: 'test/unit_tests'

grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
config: config
dir: dir
aws_s3: require "./grunt/config/aws_s3"
bower: require "./grunt/config/bower"
clean: require "./grunt/config/clean"
codo: require './grunt/config/codo'
coffee: require "./grunt/config/coffee"
coffeelint: require "./grunt/config/coffeelint"
compress: require "./grunt/config/compress"
connect: require "./grunt/config/connect"
copy: require "./grunt/config/copy"
includereplace: require "./grunt/config/includereplace"
karma: require "./grunt/config/karma"
less: require "./grunt/config/less"
open: require "./grunt/config/open"
path: require "path"
shell: require "./grunt/config/shell"
todo: require "./grunt/config/todo"
uglify: require "./grunt/config/uglify"
watch: require "./grunt/config/watch"
postcss: require "./grunt/config/postcss"

###############################################################################
# Tasks
###############################################################################
grunt.loadTasks 'grunt/tasks'
grunt.registerTask 'default', ['prepare_dist', 'host']
grunt.registerTask 'init', ['clean:ext', 'clean:temp', 'bower', 'scripts']

###############################################################################
# Deploy to different environments
###############################################################################
grunt.registerTask 'app_deploy', ['gitinfo', 'aws_deploy']
grunt.registerTask 'app_deploy_edge', ['gitinfo', 'set_version:edge', 'aws_deploy']
grunt.registerTask 'app_deploy_staging', ['gitinfo', 'set_version:staging', 'aws_deploy']
grunt.registerTask 'app_deploy_prod', ['gitinfo', 'set_version:prod', 'aws_deploy']
grunt.registerTask 'app_deploy_taco', ['gitinfo', 'set_version:taco', 'aws_deploy']

grunt.registerTask 'app_deploy_travis', (target) ->
if target in ['prod', 'staging']
grunt.task.run "set_version:#{target}", 'init', "prepare_#{target}", 'aws_prepare'
else if target is 'dev'
grunt.task.run "set_version:staging", 'init', "prepare_staging", 'aws_prepare'
else
grunt.fail.warn 'Invalid target specified. Valid targets are: "prod" & "staging"'

###############################################################################
# Test Related
###############################################################################
grunt.registerTask 'test', ->
grunt.task.run ['clean:docs_coverage', 'scripts', 'test_init', 'test_prepare', 'karma:test']

grunt.registerTask 'test_prepare', (test_name) ->
scripts = grunt.config 'scripts'
# Little hack because of a configuration bug in "grunt-karma":
# @see https://github.com/karma-runner/grunt-karma/issues/21#issuecomment-27518692
prepare_file_names = (file_name_array) =>
return (file_name.replace 'deploy/', '' for file_name in file_name_array)

helper_files = grunt.config.get 'karma.options.files'
app_files = prepare_file_names scripts.app
component_files = prepare_file_names scripts.component
vendor_files = prepare_file_names scripts.vendor
test_files = if test_name then ["../test/js/#{test_name}Spec.js"] else ['../test/**/*Spec.js']

files = [].concat helper_files, vendor_files, component_files, app_files, test_files
grunt.config 'karma.options.files', files

grunt.registerTask 'test_init', ['prepare_dist', 'prepare_test']

grunt.registerTask 'test_run', (test_name) ->
grunt.config 'karma.options.reporters', ['progress']
grunt.task.run ['scripts', 'newer:coffee:dist', 'newer:coffee:test', "test_prepare:#{test_name}", 'karma:test']

###############################################################################
# Documentation
###############################################################################
grunt.registerTask 'generate_docs', (command) ->
switch command
when 'all'
grunt.task.run ['clean:docs', 'codo:app', 'test:coverage']
else
grunt.task.run ['clean:docs', 'codo:app']

# @formatter:on
Loading

0 comments on commit 0cf9bf4

Please sign in to comment.