diff --git a/.gitignore b/.gitignore index 2152cd9..cfb0492 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules php wp +sqlite plugins/*/ \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ff75d16..ec48eda 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,5 @@ "editor.renderWhitespace": "boundary", "editor.insertSpaces": false, "editor.tabSize": 4, - "files.eol": "\n", - "editor.wordWrap": "wordWrapColumn", - "editor.wordWrapColumn": 80 + "files.eol": "\n" } \ No newline at end of file diff --git a/README.md b/README.md index d83441a..1d7990d 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,14 @@ Bring the power of Node.JS to your WordPress environment! ### Running the server +Steps 1-3 will have an automated option later. + 1. Download php zip from https://php.net and place the extracted files under `/php`. 2. Download WordPress from https://wordpress.org and place the extracted files under `/wp`. -3. [Optional] If you're on Linux, edit the config file to point to your `php-cgi` bin file. +3. [Optional / Haven't tested] If you're on Linux, edit the config file to point to your `php-cgi` bin file. 4. Run `npm install` to install dependencies (Express). 5. Run `node .` to start the server. ### Versioning -Due to certain reasons, our versioning bumps from `v.0.1.0` to `v.1.1.0`. Due to this, the project should be considered unstable until `v.2.0.0` which will be the first public release version. \ No newline at end of file +Due to certain reasons, our versioning bumps from `v.0.1.0` to `v.1.1.0`. Due to this, the project should be considered unstable until `v.2.0.0` which will be WordBoxed's first stable release version. \ No newline at end of file diff --git a/config.js b/config.js index b8c813a..2ad4693 100644 --- a/config.js +++ b/config.js @@ -7,5 +7,6 @@ module.exports = port: 8080, phpBin: normalize(__dirname + '/php/php-cgi.exe'), wpPath: normalize(__dirname + '/wp'), + sqlite: '', plugins: [] } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 63c0310..d82419e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { - "name": "wordboxed", - "version": "0.0.1", + "name": "w", + "version": "1.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -13,6 +13,14 @@ "negotiator": "0.6.1" } }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "requires": { + "color-convert": "1.9.1" + } + }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -40,6 +48,29 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, "content-disposition": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", @@ -93,6 +124,11 @@ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, "etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -178,6 +214,11 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=" + }, "http-errors": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", @@ -355,6 +396,14 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "requires": { + "has-flag": "2.0.0" + } + }, "type-is": { "version": "1.6.15", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", diff --git a/package.json b/package.json index c79a53a..bc7d1fa 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ }, "homepage": "https://github.com/codefeathers/wordboxed#readme", "dependencies": { + "chalk": "^2.3.0", "express": "^4.16.2" } } diff --git a/server.js b/server.js index 38db661..7bde126 100644 --- a/server.js +++ b/server.js @@ -1,16 +1,43 @@ 'use strict' const express = require('express') -const php = require("./php") +const php = require('./php') +const chalk = require('chalk') + const config = require('./config') const plugins = require('./plugins/main') +const fancyIntro = +chalk.yellow(` + +---------------------------------- +| .---. | +| /. ./| | +| .--'. ' ; | +| /__./ \\ : | | +| .--'. ' \\' . | +| /___/ \\ | ' ' | +| ; \\ \\; : | +| \\ ; | | +| . \\ .\\ ; | +| \\ \\ ' \\ | | +| : ' |--" | +| \\ \\ ; | +| '---" | +---------------------------------- + WordBoxed + The modern WordPress environment +----------------------------------`) + chalk.green(` + Server running at port ${config.port} +---------------------------------- +`) + const app = express() app .use("/", php.cgi(config.wpPath, config.phpBin)) .listen(config.port) -console.log(`⚡ Server listening at ${config.port}!`) +console.log(fancyIntro) plugins() // Run any plugins you need to while server runs