Skip to content

CapsuleCat/SpaceKitty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Space Kitty

MIT License npm version

For Meteor 1.2+ and Node v5.4.0+.

Full documentation available on the website.

An opinionated Meteor framework and command line utility for quickly creating Meteor projects.

npm install -g space-kitty

Getting Started

npm install -g space-kitty
kitty meow
kitty create MyProject
cd MyProject
meteor

Opinions

  • CamelCase file names and class names (except for migrations, which are timestamps and dashed)
  • React is used for views
  • Namespaced components are the norm
  • Automatic BEM classnames
  • SCSS
  • Materialize
  • Flow Router for routing
  • percolate:migrations for data migrations

Opinion Reasoning

  • There is no reason to pick CamelCase over dash delimited. However, much of the community uses CamelCase.
  • Migrations are dashed because of the timestamp that proceeds them.
  • React is a very thin and flexible view layer.
  • Blaze is being deprecated by MDG.
  • BEM is used to keep in the spirit of React styles.
  • BEM keeps a shallow hierarchy, making CSS faster to render.
  • SCSS is used due to the shortcomings of inline React styles, namely psuedo-selectors and media queries are not supported.
  • Materialize is included by default, feel free to swap this out with no repercussions.
  • Flow Router is preferred over Iron Router within the Meteor community.
  • Percolate migrations were chosen due to their popularity and simplicity.

Commands

meow

kitty meow

Make sure you have the CLI installed correctly, should just print Meow to the stdout.

db:seed

This will take all of your seeds and run them.

See make:seeder and make:model-factory.

create

kitty create ProjectName

This command will copy the project scaffolding into ./ProjectName.

make:collection

kitty make:collection [Namespace] CollectionName [--self-publishes] [--with-schema] [--local] [--class]

This command will create a Mongo Collection:

lib
└──collections
    └──[Namespace]
        └── CollectionName.js

make:command

kitty make:command [Namespace] CommandName [--server|client|(both)]

This command will create a command (defaults to both a client and server):

lib
└──commands
    └──[Namespace]
        └── CommandName.js

You can then call your command using dispatch(CommandName, arg1, arg2) or dispatchAsync(CommandName, arg1, arg2, callback);.

make:meteor-method

kitty make:meteor-method [Namespace] MethodName

This command will create a new file containing a single Meteor method.

server
└──methods
    └──[Namespace]
        └── MethodName.js

The side-effect of using this command is that you will have many different files with one Meteor method in each of them, which is different than how most developers are used to writing Meteor methods.

make:migration

kitty make:migration [Namespace] MigrationName

This command will create a Migration using percolate:migrations:

server
└──migrations
    └──[Namespace]
        └── timestamp-migration-name.js

Migrations are automatically versioned by the timestamp of when they were created.

The migration package and project scaffolding will not be created until you create your first migration. The .meteor/packages files will have percolate:migrations added to it if does not already exist. server/RunMigrations.js will automatically be created if it does not already exist.

make:seeder

kitty make:migration [Namespace] SeedName

This will generate a seed for you, and assumes the SeedName is the same as the name of the Model Factory that you would like to use. By default, a seeder assumes you have made a Model Factory:

Seeder.Todos = function () {
  $factory(Todos).create(10).insertAll();
}

This will be created in:

server
└──migrations
    └──seeds
        └── NamespaceSeedName.js

make:view

kitty make:view [Namespace] ViewName

This command will create a module consisting of:

client
└──components
    └──[Namespace]
        └── ViewName
            ├── ViewName.jsx
            └── _ViewName.scss

It will also add an import statement to client/styles/main.scss to import your new .scss file.

remind-me

Space Kitty is there for you by having reminders on how to do common stuff:

remind-me:meteor-call
remind-me:react-loops