Name: node-mothership
Owner: Reddit
Description: CLI tools for running platform projects
Created: 2016-04-25 21:38:25.0
Updated: 2018-05-08 19:06:22.0
Pushed: 2016-04-25 22:40:27.0
Homepage: null
Size: 13
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A set of tools for building isomorphic web apps with @r/framework. Provides a build system, server GUI, project generator, and some helpful utilities.
ership generate reddit-mobile
nerating project "reddit-mobile"...
ilding directory structure...
README
server.js
client.js
config.js
middleware/
assets/
tests/
nerating package.json...
stalling npm modules...
ilding initial packages...
lete! Run `mothership launch` to run the server.
ership launch
ching reddit-mobile at localhost:4444...
ched 4 processes.
ching repl...
it-mobile-app~$ debug web
ing all logging for web requests...
/ (80ms)
The easiest way to install is through NPM - just run
npm install -g @r/mothership
. This will add a binary, mothership
, to your
global node modules. If you want to use mothership's libraries, such as the
build process, you can instead run npm install @r/mothership --save
in your
project. If installed locally, you can add npm scripts
such as "start": "@r/mothership launch"
to your package.json.
Alternatively, clone this repository and run npm install -g
from the
directory.
mothership provides a binary for functions involving setting up and launching @r/framework applications.
mothership generate
will use a template to generate a new directory structure
for a web project. It will set up a barebones application with one
“Hello World” page, from which you can begin building your application. It will
also run the first build for you, so you can launch the server and begin working
immediately. It will not overwrite any existing files. It will run git init
if
git
is available and there is not an existing repository.
--bare
does not set up any pages or routes; it will only create the
directory structure and a minimal package.json file--no-build
skips the first build process--dry-run
will print out what the structure will be, but will not write
any files.--force
will overwrite any existing, conflicting files.mothership launch
will launch a webserver. It runs in dev mode by default,
which will watch for file changes and reload web servers, and will launch a
terminal interface which includes a CLI and REPL.
--no-interface
turns off the terminal interface.--no-watch
turns off the filesystem watcher.--server
is an alias which combines both --no-interface
and --no-watch
.mothership provides libraries to help build @r/framework applications.
mothership.Build
provides utilities for using webpack to build web
applications.
ompile.js
t { Build } = import "@r/mothership";
t options = {};
t build = new Build(options);
d.run();
d.watch();
Build uses all standard webpack configuration options. Defaults are lised below:
t COMMON_CONFIG = {
tput: {
path: path.join(__dirname, 'bin'),
filename: "[name].js",
solve: {
extensions: ['', '.js'],
dule: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader")
},
{
test: /\.less$/,
loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
},
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: [
'es2015',
'stage-2',
'react',
],
plugins: [
'transform-class-properties',
'transform-runtime',
],
},
},
],
ugins: [
new ExtractTextPlugin('[name].css'),
stcss: [
autoprefixer({
browsers: ['last 2 versions'],
}),