diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..65be2f5 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# editorconfig.org +root = true + +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = false + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d45eeeb --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +.DS_Store +*.sublime-project +*.sublime-workspace +node_modules +.tmp +temp +.sass-cache +.idea +validation-report.json +validation-status.json \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..239f33d --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,212 @@ +'use strict'; + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// +// ╔╗ ╔═╗ ╔═╗ ╔═╗ ╔╦╗ +// ╠╩╗ ║╣ ╠═╣ ╚═╗ ║ +// ╚═╝ ╚═╝ ╩ ╩ ╚═╝ ╩ +// Created by Dominik Wilkowski +// +// @desc Beast.js is an ANSI node game +// @author Dominik Wilkowski +// @website https://github.com/dominikwilkowski/beast.js +// @issues https://github.com/dominikwilkowski/beast.js/issues +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// External dependencies +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Custom functions +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Settings +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +const SETTINGS = function() { + return { + 'folders': { + 'dev': 'dev/', + 'prod': 'prod/', + }, + 'files': { + 'dev': 'dev.js', + 'prod': 'index.js', + 'Packagejson': 'package.json', + }, + }; +}; + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Grunt module +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +module.exports = (grunt) => { + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Dependencies +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-text-replace'); + grunt.loadNpmTasks('grunt-wakeup'); + grunt.loadNpmTasks('grunt-font'); + require('time-grunt')(grunt); + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Grunt tasks +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + grunt.initConfig({ + + + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + // Package content + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + SETTINGS: SETTINGS(), + pkg: grunt.file.readJSON( SETTINGS().files.Packagejson ), + + +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- +// Replace version +//-------------------------------------------------------------------------------------------------------------------------------------------------------------- + replace: { + dev: { + src: [ + '<%= SETTINGS.folders.dev %><%= SETTINGS.files.dev %>', + ], + overwrite: true, + replacements: [ + { + from: '[Debug]', + to: 'true', + }, + { + from: '[Name]', + to: '<%= pkg.name %>', + }, + { + from: '[Version]', + to: 'v<%= pkg.version %>', + }, + ], + }, + + prod: { + src: [ + '<%= SETTINGS.folders.prod %><%= SETTINGS.files.prod %>', + ], + overwrite: true, + replacements: [ + { + from: '[Debug]', + to: 'false', + }, + { + from: '[Name]', + to: '<%= pkg.name %>', + }, + { + from: '[Version]', + to: 'v<%= pkg.version %>', + }, + ], + }, + }, + + + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + // Concat files + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + concat: { + dev: { + src: [ + '<%= SETTINGS.folders.dev %>*.js', + '!<%= SETTINGS.folders.dev %><%= SETTINGS.files.dev %>', + ], + dest: '<%= SETTINGS.folders.dev %><%= SETTINGS.files.dev %>', + }, + prod: { + src: [ + '<%= SETTINGS.folders.dev %>/*.js', + '!<%= SETTINGS.folders.dev %><%= SETTINGS.files.dev %>', + ], + dest: '<%= SETTINGS.folders.prod %><%= SETTINGS.files.prod %>', + }, + }, + + + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + // Banners + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + font: { + options: { + maxLength: 11, + font: 'chrome', + align: 'center', + colors: ['green', 'cyan', 'white'], + }, + + title: { + text: '<%= pkg.name %>', + }, + }, + + + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + // Wakeup + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + wakeup: { + wakeme: { + options: { + randomize: true, + notifications: true, + }, + }, + }, + + + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + // Watch + //---------------------------------------------------------------------------------------------------------------------------------------------------------- + watch: { + node: { + files: [ + '<%= SETTINGS.folders.dev %>/*.js', + '!<%= SETTINGS.folders.dev %><%= SETTINGS.files.dev %>', + ], + tasks: [ + '_build', + 'wakeup', + ], + }, + }, + + }); + + + + //------------------------------------------------------------------------------------------------------------------------------------------------------------ + // Private tasks + //------------------------------------------------------------------------------------------------------------------------------------------------------------ + grunt.registerTask('_build', [ + 'concat', + 'replace', + ]); + + + //------------------------------------------------------------------------------------------------------------------------------------------------------------ + // Build tasks + //------------------------------------------------------------------------------------------------------------------------------------------------------------ + grunt.registerTask('default', [ //run build with watch + 'font:title', + '_build', + 'wakeup', + 'watch', + ]); + +}; \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..50eba3a --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +```shell + ╔╗ ╔═╗ ╔═╗ ╔═╗ ╔╦╗ + ╠╩╗ ║╣ ╠═╣ ╚═╗ ║ + ╚═╝ ╚═╝ ╩ ╩ ╚═╝ ╩ +``` + +[![NPM](https://nodei.co/npm/beast.js.png?downloads=true)](https://nodei.co/npm/beast.js/) + + +> TODO + + +## Contributing +Please look at the coding style and work with it, not against it ;) + + +## Test +TODO + + +## Release History +* 0.1.0 - alpha test + + +## License +Copyright (c) 2016 Dominik Wilkowski. Licensed under the [GNU GPLv3](https://github.com/dominikwilkowski/beast.js/blob/master/LICENSE). \ No newline at end of file diff --git a/dev/010-init.js b/dev/010-init.js new file mode 100644 index 0000000..e69de29 diff --git a/dev/dev.js b/dev/dev.js new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..a6a0ca4 --- /dev/null +++ b/package.json @@ -0,0 +1,58 @@ +{ + "name": "beast.js", + "description": "ANSI Beast for node", + "version": "0.1.0", + "homepage": "https://github.com/dominikwilkowski/beast.js", + "author": { + "name": "Dominik Wilkowski", + "email": "Hi@Dominik-Wilkowski.com", + "url": "http://dominik-wilkowski.com/" + }, + "contributors": { + "name": "Dominik Wilkowski", + "email": "Hi@Dominik-Wilkowski.com", + "url": "http://dominik-wilkowski.com/" + }, + "repository": { + "type": "git", + "url": "git://github.com/dominikwilkowski/beast.js.git" + }, + "bugs": { + "url": "https://github.com/dominikwilkowski/beast.js/issues" + }, + "engines": { + "node": ">=6.0.0" + }, + "devDependencies": { + "grunt": "^1.0.1", + "grunt-contrib-concat": "^1.0.1", + "grunt-contrib-watch": "^1.0.0", + "grunt-font": "0.0.13", + "grunt-text-replace": "^0.4.0", + "grunt-wakeup": "0.1.3", + "time-grunt": "^1.3.0" + }, + "peerDependencies": {}, + "dependencies": { + "chalk": "^1.0.0", + "window-size": "^0.2.0" + }, + "keywords": [ + "game", + "ansi", + "beast", + "ascii", + "pretty" + ], + "main": "prod/index.js", + "bin": { + "beast": "./prod/index.js" + }, + "licenses": [ + { + "type": "GNU-GPL", + "url": "https://github.com/dominikwilkowski/beast.js/blob/master/LICENSE" + } + ], + "license": "GNU-GPLv3" +} \ No newline at end of file diff --git a/prod/index.js b/prod/index.js new file mode 100644 index 0000000..e69de29