Skip to content
fkei edited this page Dec 20, 2013 · 1 revision

Summary

beez-project コマンドを使用して雛形プロジェクトを作成します。

Command options

  • プロジェクト名
    • option: -n example
  • 作成先ディレクトリ
    • option: -o ~/
  • デバッグモード
    • option: -d
  • テンプレート名
    • option: -b [simple|github|todos]

作成コマンド実行

$ beez-project -n example -o ~/Desktop -b todos
Create Project: example

  Project Directory: ~/Desktop/example

  Create File:
     vendor
       beez.js
       beez.min.js
       zepto.js
       zepto.min.js
       underscore.js
       underscore-min.js
       backbone.localStorage.js
       backbone.localStorage-min.js
       backbone.js
       backbone-min.js
       handlebars.runtime.js
       handlebars.runtime.min.js
       require.js
       require.min.js
     .jsdoc.json
     .jshintignore
     .jshintrc
     Gruntfile.js
     package.json
     build.local.js
     conf
       local
       local.json
       mockdata
     s
       core
       index


   ===============================
   Let me get started right away!!
      Foundation Server Start
   ===============================


    $ cd ~/Desktop/example
    $ npm install grunt-cli -g
    $ npm install .
    $ grunt foundation


 ---> Good luck to you :)

プロジェクト起動

ローカル環境にWebサーバーを起動して、雛形プロジェクト(Todos Service) を起動させます。

beez-foundation がローカルにインストールされている必要があります。

$ cd ~/Desktop/example
$ npm install grunt-cli -g # すでにインストールしてある場合はSkip
$ npm install .
$ grunt foundation
>> [environment] project name: example
>> [environment] project directory: ~/Desktop/example
>> [options] env: local

Running "exec:beez_foundation" (exec) task

##
## Start
## 		Beez Foundation Servers!!
##
##
## 	Express server listening on port:1109
## 		Static Server start [ success ]
## 		compress: [on]
## 		Please try to access.
## 			http://0.0.0.0:1109
##
## 	Express server listening on port:1121
## 		Mock Server start [ success ]
## 		compress: [on]
## 		Please try to access.
## 			http://0.0.0.0:1121
##

ブラウザで確認

ローカルサーバーにアクセス

http://0.0.0.0:1109/m/example/s/index/local.develop.html

トップページ

Static Serverの使い方

port:1109 で listen されています

beez-foundation#wiki/1.x-StaticServer

Mock Serverの使い方

port:1121 で listen されています。

beez-foundation#wiki/1.x-MockServer

フォルダ構成

.
├── Gruntfile.js # Grunt file
├── build.local.js # `r.js`ビルド用の設定ファイル.環境別に作成してください
├── conf
│   ├── local
│   │   ├── develop.json # 開発用の設定ファイル
│   │   └── release.json # リリース用の設定ファイル
│   ├── local.json # `local` 環境用の設定ファイル
│   └── mockdata # モックデータディレクトリ
│       ├── index.json
│       └── now.json
├── node_modules
├── package.json # プロジェクトで利用しているnode.js設定ファイル
├── s # ソースディレクトリ
│   ├── core # コアモジュール (共通モジュール)
│   │   ├── i18n
│   │   │   ├── en.js
│   │   │   └── ja.js
│   │   └── index.js
│   ├── index # index モジュール (起点)
│   │   ├── hbs
│   │   │   └── info.hbs
│   │   ├── index.html.hbs # 唯一のHTML file (Handlebars)
│   │   ├── index.js # Index Controller
│   │   ├── model
│   │   │   └── index.js
│   │   ├── require.beez.js.hbs # require.config + data-main
│   │   ├── styl
│   │   │   ├── _sprite-logo-1.png
│   │   │   ├── _sprite-logo-2.jpg
│   │   │   ├── _sprite-logo-3.png
│   │   │   ├── index.styl
│   │   │   └── info.styl
│   │   └── view
│   │       ├── index.js
│   │       └── info.js
│   └── todos # todos サブモジュール
│       ├── collection
│       │   └── todos.js
│       ├── hbs
│       │   ├── footer.hbs
│       │   ├── header.hbs
│       │   ├── main.hbs
│       │   └── todo.hbs
│       ├── i18n
│       │   ├── en.js
│       │   └── ja.js
│       ├── index.js
│       ├── model
│       │   └── todo.js
│       ├── styl
│       │   ├── footer.styl
│       │   ├── header.styl
│       │   └── main.styl
│       └── view
│           ├── footer.js
│           ├── header.js
│           ├── main.js
│           └── todo.js
└── vendor # 3rd party library
    ├── backbone-min.js
    ├── backbone.js
    ├── backbone.localStorage-min.js
    ├── backbone.localStorage.js
    ├── beez.js
    ├── beez.min.js
    ├── handlebars.runtime.js
    ├── handlebars.runtime.min.js
    ├── require.js
    ├── require.min.js
    ├── underscore-min.js
    ├── underscore.js
    ├── zepto.js
    └── zepto.min.js

13 directories, 32 files

ステップ数

プログラムコード

$ cd ~/Desktop/example/s
$ ohcount -s
Examining 65 file(s)

                          Ohloh Line Count Summary

Language          Files       Code    Comment  Comment %      Blank      Total
----------------  -----  ---------  ---------  ---------  ---------  ---------
javascript           23        805        155      16.1%        186       1146
css                   5         58          0       0.0%          0         58
html                  2         28          0       0.0%          0         28
----------------  -----  ---------  ---------  ---------  ---------  ---------
Total                30        891        155      14.8%        186       1232

Clone this wiki locally