Skip to content

Commit

Permalink
First incomplete commit
Browse files Browse the repository at this point in the history
  • Loading branch information
graywolf336 committed Jul 3, 2017
0 parents commit 7af7dd1
Show file tree
Hide file tree
Showing 14 changed files with 2,663 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
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
19 changes: 19 additions & 0 deletions .eslintrc.json
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"
}
}
48 changes: 48 additions & 0 deletions .gitignore
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/
2 changes: 2 additions & 0 deletions README.md
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.
53 changes: 53 additions & 0 deletions gulpfile.js
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'
]));
Loading

0 comments on commit 7af7dd1

Please sign in to comment.