alien
v0.2.5
Published
Fe development tools
Downloads
26
Readme
Require
- rsync (http://rsync.samba.org/)
Installation
$ npm install alien -gQuick Start
before we run the commands of alien, we should have a project first
create a project
(directory structure)
project
├─┬src
│ ├─┬scripts
│ │ └──...
│ └─┬styles
│ └──...
└─.configyou can checkout (https://github.com/purplecalm/alien.git) to get a test case
start a server
before start server, make sure the working directory contains project
$ alien serverserver has three modes, [SRC|DEV|PRD]
- SRC: source mode, return every file, esay to debug
- DEV: package mode, return files' package
- PRD: product mode, return minified code
$ alien server -m DEVpack
packing exports files
(File .config) e.g
{
"exports": [
"scripts/index.js",
"styles/index.css"
]
}before run pack, make sure the project is working directory
$ alien packresult
project
├─┬dev(package directory)
│ ├─┬scripts
│ │ └──[email protected]
│ └─┬styles
│ └──[email protected]
├─┬src
│ ├─┬scripts
│ │ └──...
│ └─┬styles
│ └──...
└─.configmin
minify exports files
(File .config) e.g
{
"exports": [
"scripts/index.js",
"styles/index.css"
]
}before run min, make sure the project is working directory
$ alien minresult
project
├─┬prd(product directory)
│ ├─┬scripts
│ │ └──[email protected]
│ └─┬styles
│ └──[email protected]
├─┬ver(versions directory)
│ ├─┬scripts
│ │ └──index.js.ver (bc23723a6ebdd528a774264d37173293)
│ └─┬styles
│ └──index.css.ver (db47495f5329bd6a6df53228034d4746)
├─┬src
│ ├─┬scripts
│ │ └──...
│ └─┬styles
│ └──...
└─.configsync
sync all package to target server
make sure you installed rsync (find it here http://rsync.samba.org/)
set dev environment in .config (File .config) e.g
{
"dev": {
"host": "127.0.0.1",
"path": "/home/q/www/project/"
}
}before run sync
- make sure the project is working directory
- make sure you packed your project before
$ alien syncwe also run pack and sync together
$ alien pack && alien synchelp
Aha!
