-
Notifications
You must be signed in to change notification settings - Fork 118
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
0 parents
commit 7af7dd1
Showing
14 changed files
with
2,663 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
|
||
# 4 space indentation | ||
[**.*] | ||
indent_style = space | ||
indent_size = 4 |
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,19 @@ | ||
{ | ||
"extends": "eslint:recommended", | ||
"env": { | ||
"browser": false, | ||
"commonjs": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
}, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"semi": ["error", "always"], | ||
"no-console": "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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Created by https://www.gitignore.io/api/node | ||
|
||
### Node ### | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules | ||
jspm_packages | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
### Typings ### | ||
## Ignore downloaded typings | ||
/typings | ||
|
||
## Ignore distribution folder | ||
dist/ |
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,2 @@ | ||
# Rocketlets Server | ||
The core server piece which manages and controls everything. |
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 @@ | ||
const gulp = require('gulp'); | ||
const del = require('del'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
const tsc = require('gulp-typescript'); | ||
const shell = require('gulp-shell'); | ||
const spawn = require('child_process').spawn; | ||
|
||
const tsp = tsc.createProject('tsconfig.json'); | ||
|
||
gulp.task('clean-generated', function _cleanTypescript() { | ||
const distFiles = ['./dist/**/*.*']; | ||
return del(distFiles); | ||
}); | ||
|
||
gulp.task('compile-ts', ['clean-generated'], function _compileTypescript() { | ||
return tsp.src().pipe(sourcemaps.init()) | ||
.pipe(tsp()) | ||
.pipe(sourcemaps.write('.')) | ||
.pipe(gulp.dest('dist')); | ||
}); | ||
|
||
let server; | ||
gulp.task('run-server', ['compile-ts'], function _runTheServer() { | ||
if (server) server.kill(); | ||
|
||
server = spawn('node', ['server.js'], { stdio: 'inherit' }); | ||
server.on('close', (code) => { | ||
if (code === 8) { | ||
gulp.log('Error detected, waiting for changes....'); | ||
} | ||
}); | ||
}); | ||
|
||
process.on('exit', () => { | ||
if (server) server.kill(); | ||
}); | ||
|
||
gulp.task('defult', ['compile-ts', 'run-server'], function _watchCodeAndRun() { | ||
gulp.watch('src/**/*.ts', ['compile-ts', 'run-server']); | ||
}); | ||
|
||
//Tasks for getting it ready and publishing | ||
gulp.task('npm-files', function _npmFileGathering() { | ||
return gulp.src(['README.md', 'LICENSE', 'package.json']).pipe(gulp.dest('dist')); | ||
}); | ||
|
||
gulp.task('pack', ['clean-generated', 'compile-ts', 'npm-files'], shell.task([ | ||
'cd dist && npm pack' | ||
])); | ||
|
||
gulp.task('publish', ['clean-generated', 'compile-ts', 'npm-files'], shell.task([ | ||
'cd dist && npm publish && npm pack' | ||
])); |
Oops, something went wrong.