Boulangerie/charettejs

语言: CoffeeScript

git: https://github.com/Boulangerie/charettejs

CharetteJS是一个可轻松维护微服务工作流的库
CharetteJS is a lib to maintain easily a microservice workflow
README.md (中文)

Build Status
Gitter Chat

Charette JS

这个软件包将关闭困难以维护单一的工作流架构!

如何使用它

安装包:

npm和-S charettejs

安装插件后,可以使用以下JavaScript代码在Gruntfile中启用它:

// Initialize Charette Typescript
grunt.loadNpmTasks('charettejs')

您可以轻松覆盖charette的配置:

grunt.config('myTask', {
  target: 'config'
})

// or merge

grunt config.merge({
  task: {
    target: 'config'
  }
})

然后,您将能够覆盖任何任务的grunt配置。

您可以在示例文件夹中找到示例。

为什么

这个项目的想法是将你需要的所有默认内容都集中到你的子项目中。 - Grunt任务 - 配置文件 - NPM依赖关系 - Bower依赖 - 你需要的助手+测试 - 子项目使用的所有有用的东西

好的,那么为什么不使用发电机!他们做的工作?! 不,他们没有。

发电机

生成器(如Yeoman)是一个可以帮助您引导新项目的工具。 它将提供所有最佳实践和漂亮的快捷方式,以自动重复的东西。

但是,如果您使用微服务方法,生成器将填充子项目的体系结构一次。 如果您想更新所有项目的版本,则必须对每个项目应用更新。

如何发展

  • 获取存储库
  • 链接charettejs包本地
cd charettejs
npm link
  • 进入./sample文件夹
cd sample
npm i
  • 你将能够使用charettejs的东西运行任何grunt任务

如何更新bower组件

bower i -S my-component # Install my-component in `bower.json`
bower-installer -p -r   # Copy `main` files into `bower.json`

bower-installer必须通过npm安装

npm i -g bower-installer

它将使用新的bower依赖项更新您的bower.json,并将哪些文件保存到供应商文件夹中。

如何更新TypeScript定义

tsd install my-component --save

必须通过npm作为全局包安装tsd

npm i -g tsd

它将从DefinitelyTyped中获取typescript定义并将定义放到typings文件夹中。

特征

CharetteJS选项

grunt.config('charette', {
  name: 'CharetteJS',  // The lib name
  distName: 'myoutput' // The dist/myoutput.js file
})

CharetteJS咕噜咕噜的任务

建立

咕噜咕噜 没有ascii艺术的书呆子不是真正的书呆子! 我们在这里......只需在控制台中显示项目名称即可。 Github grunt-asciify

咕噜咕噜 NPM很棒!因此,使用它意味着发布semver包。 让我们使用这个咕噜声 Github咕噜咕噜

grunt clean和grunt cleanWorkspace 该项目将在./dist文件夹中构建ts输出 我们需要确保此文件夹存在且为空 Github grunt-contrib-clean

GH-页 Github允许我们推送gh-pages分支并免费获得静态主机! 让我们用它:D Github gh-pages

grunt html2js 好吧,在JS文件中写HTML是... beurk! html2js将获取/ src /文件夹中的所有* .tpl.html文件,并将它们打包到AngularJS模块中! Github grunt-html2js

因果报应

ngAnnotate

安全 如果某些调试值仍在源文件中,通常需要手动检查。 部署时感到紧张,保持简单!

size_report

模板

tslint

TS

丑化

本文使用googletrans自动翻译,仅供参考, 原文来自github.com

en_README.md

Build Status
Gitter Chat

Charette JS

This package will turn OFF the hardship to maintain a single workflow architecture !

How to use it

Install the package :

npm i -S charettejs

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

// Initialize Charette Typescript
grunt.loadNpmTasks('charettejs')

You can easily override configuration for charette :

grunt.config('myTask', {
  target: 'config'
})

// or merge

grunt config.merge({
  task: {
    target: 'config'
  }
})

Then you'll be able to override grunt config for any tasks.

You can find an example in sample folder.

Why

The idea of this project is to grab all default stuff that you need into your sub-projects.
- Grunt tasks
- Configuration files
- NPM Dependencies
- Bower Dependencies
- Helpers that you need + testing
- All usefull stuff used by sub-project

Okay, so why don't use generator ! They do the job ?!
No they don't.

Generators

A generator (like Yeoman) is a tool that helps you to bootstrap new project.
It'll provide all best practices and handsome shortcuts to automate repetitive stuff.

But if you work in a microservice approach, generator will populate the architecture for the sub-project once.
If you wanna update a version for all your projects, you must apply the update on each one..

How develop

  • Get the repository
  • Link charettejs package locally
cd charettejs
npm link
  • Go into ./sample folder
cd sample
npm i
  • You'll be able to run any grunt task using the charettejs stuff

How update bower component

bower i -S my-component # Install my-component in `bower.json`
bower-installer -p -r   # Copy `main` files into `bower.json`

bower-installer has to be install through npm

npm i -g bower-installer

It will update your bower.json with new bower dependencies AND which files keep into vendorsfolder.

How update TypeScript definitions

tsd install my-component --save

tsd must be install through npm as global package

npm i -g tsd

It will grab typescript definitions from DefinitelyTyped and put definitions to typings folder.

Feature

CharetteJS options

grunt.config('charette', {
  name: 'CharetteJS',  // The lib name
  distName: 'myoutput' // The dist/myoutput.js file
})

CharetteJS grunt tasks

build

watch

grunt asciify
A nerd without an asscii art is not really a nerd !
Here we are ... Just display the project name in the console.
Github grunt-asciify

grunt bump
NPM is great! So work with it means publish semver package.
Let use this grunt-bump
Github grunt-bump

grunt clean and grunt cleanWorkspace
The project will build ts output in the ./dist folder
We need to ensure that this folder exists and is empty
Github grunt-contrib-clean

gh-pages
Github allows us to push on gh-pages branch and get a static host for free !
Let's use it :D
Github gh-pages

grunt html2js
Ok, write HTML in a JS file is ... beurk !
html2js will grab all *.tpl.html files in your /src/ folder and package them in an AngularJS Module !
Github grunt-html2js

karma

ngAnnotate

plato

safe
Often you have to check by hand if some debug values are still in source files.
Now feel nervous when you deploy, keep it easy !

size_report

template

tslint

ts

uglify

watch