forked from cncjs/cncjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
637 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
tmp | ||
node_modules | ||
npm-debug.log | ||
/dist | ||
/coverage | ||
/.nyc_output | ||
/coverage | ||
/dist | ||
/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
tmp | ||
npm-debug.log | ||
/coverage | ||
/.nyc_output | ||
/coverage | ||
/output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,68 @@ | ||
sudo: required | ||
os: | ||
- linux | ||
dist: trusty | ||
|
||
services: | ||
- docker | ||
|
||
language: node_js | ||
|
||
os: | ||
- linux | ||
- osx | ||
|
||
node_js: | ||
- '5' | ||
- '4' | ||
- '0.12' | ||
- '0.10' | ||
- '5' | ||
|
||
env: | ||
global: | ||
- CXX=g++-4.8 | ||
- secure: "KPf6trtYLBDc2S/fF7H4VkNOAQ2Gc9sFj3v8aHOhNWDagACEHaPjIZdr3MGmzXji2EyQqtm6SxBxzdMbe1BNY5GRALgGI2fSyra+VwjhUeOB/UJ8oZuxhqnywbF77lbZgUYK/kOWHgCKGQxRsVZyytgK2CihOwPwzSp/CWUhBjlyjtDpUOMJXfc0USg05imR9LcwdW9o84uXGyI3XwHhqsA5szlu09Oxz+O//TMCHobb8o9b13N8Oxhdu9mgzynXC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/lvqY2fKvIC1zuzg8mQI1GUrcb+phWgrkacxQp7T4lb2iEu1JEnYoOfv/V7ChpvsbDZrtRRx3V+VLBn/gdliFgCdHbNGDlUH6ZkI4KxbGE6AEChQTMrYXJd/SjlGKvmA/jQkweyIkcIjJfQotcwWGWnPWl889RZtjIe90bqW/hao3Nl11oRDvlkYS25oXAxp1I8aC66nEryM5NXqY8FZ1MyMcujK+aF70IUoNG91dCaksIWyJbC3V+P7O5N5R7RE+8ya21XVYf+3rFjzTnKbgTXH4KE8k6mo+bOsc1o+gN0X9EoqBeO4iKM+WXc334o3WRn+F4J9FMBbO4eNvVBA/BLhl2nBsoOii1OpoHRIZkr5JAX91ws9s/hxCvGYHm7txIVG7dfljYdK20=" # GITHUB_TOKEN | ||
- GOPATH=$HOME/gopath | ||
- PATH=$HOME/gopath/bin:$PATH | ||
|
||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 | ||
- icnsutils | ||
- graphicsmagick | ||
- gcc-multilib | ||
- g++-multilib | ||
|
||
before_install: | ||
- git --version | ||
- git config --global user.name "Travis CI" | ||
- git config --global user.email "[email protected]" | ||
- go version | ||
- go env | ||
# https://github.com/aktau/github-release | ||
- go get github.com/aktau/github-release | ||
- github-release --version | ||
# | ||
# https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build#os-x | ||
# | ||
# Use brew to install required packages. | ||
# | ||
# To build app in distributable format for Windows on OS X: | ||
# $ brew install Caskroom/cask/xquartz wine mono | ||
# | ||
# To build app in distributable format for Linux on OS X: | ||
# $ brew install ruby gnu-tar libicns graphicsmagick | ||
# | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi | ||
- gem install fpm | ||
# npm v3 | ||
- npm install -g npm | ||
|
||
script: | ||
- npm run build | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm run electron-builder:darwin-x64; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then npm run electron-builder:linux-x64; fi | ||
|
||
after_success: | ||
- npm run coveralls | ||
- npm run coverage-clean | ||
- ./.travis/build-docker-image.sh | ||
- if [[ "$TRAVIS_NODE_VERSION" != "5" ]]; then exit 0; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then bash -c 'scripts/travis-release-darwin-x64.sh'; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash -c 'scripts/travis-release-linux-x64.sh'; fi | ||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then bash -c 'scripts/travis-docker-build.sh'; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# http:https://www.appveyor.com/docs/appveyor-yml | ||
|
||
version: "{build}-{branch}" | ||
|
||
cache: | ||
- node_modules | ||
- '%APPDATA%\npm-cache' | ||
- '%USERPROFILE%\.electron' | ||
|
||
init: | ||
- git --version | ||
- git config --global core.autocrlf false | ||
- git config --global user.name "AppVeyor" | ||
- git config --global user.email "[email protected]" | ||
- go version | ||
- go env | ||
|
||
environment: | ||
matrix: | ||
- nodejs_version: "4" | ||
- nodejs_version: "5" | ||
GOROOT: c:\go | ||
GOPATH: c:\gopath | ||
GITHUB_TOKEN: | ||
secure: 8GAPx69HrhLHtbsZyBG9KhOWHVnltZlWZuj2EQjRmAgG7t/vvzWxmTRsDM5uhwYx | ||
|
||
platform: | ||
- x64 | ||
|
||
matrix: | ||
# Enable fast fail strategy | ||
fast_finish: true | ||
|
||
install: | ||
- set PATH=%GOROOT%\bin;%GOPATH%\bin;%PATH% | ||
- go get github.com/aktau/github-release | ||
- github-release --version | ||
- ps: Install-Product node $env:nodejs_version $env:platform | ||
- npm install -g npm | ||
- npm install | ||
|
||
build_script: | ||
- node --version | ||
- npm --version | ||
- npm run build | ||
- npm run electron-packager:win32-x64 | ||
- cmd: cd output\current && 7z.exe -a cncjs-win32-x64.zip cncjs-win32-x64 | ||
|
||
deploy_script: | ||
- ps: if($env:nodejs_version -eq '5') { | ||
bash -c 'scripts/appveyor-release-win32-x64.sh'; } | ||
|
||
test: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path'); | ||
var program = require('commander'); | ||
var pkg = require('../package.json'); | ||
var cnc = require('../dist/cncjs/cnc').default; | ||
|
||
// Defaults to 'production' | ||
process.env.NODE_ENV = process.env.NODE_ENV || 'production'; | ||
|
||
// Change working directory to 'dist/app' | ||
process.chdir(path.resolve(__dirname, '../dist/app')); | ||
|
||
function increaseVerbosityLevel(val, total) { | ||
return total + 1; | ||
} | ||
|
||
function parseMountPoint(val) { | ||
val = val || ''; | ||
|
||
if (val.indexOf(':') >= 0) { | ||
var r = val.match(/(?:([^:]*)(?::(.*)))/); | ||
return { | ||
url: r[1] || '/static', | ||
path: r[2] | ||
}; | ||
} | ||
|
||
return { | ||
url: '/static', | ||
path: val | ||
}; | ||
} | ||
|
||
program | ||
.version(pkg.version) | ||
.usage('[options]') | ||
.option('-p, --port <port>', 'set listen port (default: 8000)', parseInt, 8000) | ||
.option('-H, --host <host>', 'set listen address or hostname (default: 0.0.0.0)', '0.0.0.0') | ||
.option('-b, --backlog <backlog>', 'set listen backlog (default: 511)', parseInt, 511) | ||
.option('-c, --config <filename>', 'set config file (default: ~/.cncrc)') | ||
.option('-v, --verbose', 'increase the verbosity level', increaseVerbosityLevel, 0) | ||
.option('-m, --mount [<url>:]<path>', 'set the mount point for serving static files (default: /static:static)', parseMountPoint, { url: '/static', path: 'static' }) | ||
.parse(process.argv); | ||
|
||
var app = require('../dist/app'); | ||
app.run({ | ||
port: program.port, | ||
host: program.host, | ||
backlog: program.backlog, | ||
config: program.config, | ||
verbose: program.verbose, | ||
mount: program.mount | ||
cnc(function(server) { | ||
const address = server.address(); | ||
console.log('Started the server at http:https://%s:%d/.', address.address, address.port); | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import fs from 'fs'; | ||
import path from 'path'; | ||
import gulp from 'gulp'; | ||
import babel from 'gulp-babel'; | ||
import pkg from '../../package.json'; | ||
|
||
export default (options) => { | ||
gulp.task('bootstrap:babel', (callback) => { | ||
const src = [ | ||
'src/*.js' | ||
]; | ||
return gulp.src(src) | ||
.pipe(babel()) | ||
.pipe(gulp.dest('dist/cncjs')); | ||
}); | ||
gulp.task('bootstrap:pkg', (callback) => { | ||
// Copy necessary properties from 'package.json' to 'src/package.json' | ||
const _pkg = require('../../src/package.json'); | ||
|
||
_pkg.name = pkg.name; | ||
_pkg.version = pkg.version; | ||
_pkg.description = pkg.description; | ||
_pkg.homepage = pkg.homepage; | ||
_pkg.author = pkg.author; | ||
_pkg.license = pkg.license; | ||
_pkg.dependencies = pkg.dependencies; | ||
|
||
fs.writeFileSync(path.resolve(__dirname, '../../src/package.json'), JSON.stringify(_pkg, null, 2), 'utf8'); | ||
|
||
return gulp.src('src/package.json') | ||
.pipe(gulp.dest('dist/cncjs')); | ||
}); | ||
gulp.task('bootstrap', ['bootstrap:babel', 'bootstrap:pkg']); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.