diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..d5ff25078 --- /dev/null +++ b/.npmignore @@ -0,0 +1,15 @@ +test +tasks +examples +explorations +components +.jshintrc +.gitignore +.travis.yml +.npmignore +bower.json +component.json +gruntfile.js +TODO.md +sauce_connect.log +coverage \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..596019e07 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: +- '0.10' +branches: + only: + - master +before_install: +- npm install -g grunt-cli phantomjs casperjs +env: + global: + - secure: Ce9jxsESszOnGyj3A6wILO5W412El9iD/HCHiFgbr8/cSXa4Yt0ZOEZysZeyaBX6IFUCjHtQPLasVgCxijDHrhi7/drmyCE+ksruk/6LJWn9C46PZK6nI+N04iYA2TRnocFllhGbyttpbpxY04smCmGWqXwLppu9nb+VIDkKGmE= + - secure: cZQTby8mGxb4QHi9net2/kK7N2VMOZKPepa+8ob2+jxICSukPgTqGP1iVQWR+tVlU60lFAHpos2o8vQLB4e5Rt5IFEajCr+RppE9xUWxMUulbrXaIrzz1OYA5DvTi/8ZeE6/x0+MpZJT1b/GIqhlrU4QwjjpeJWLwAkv8ysZaEs= diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..49a49a361 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,82 @@ +# Vue.js Contributing Guide + +Hi! I’m really excited that you are interested in contributing to Vue.js. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines. + +## Issue Reporting Checklist + +- Make sure that you are using the latest version of Vue. +- Try to search for your issue, it may have already been answered or even fixed in the development branch. +- It is recommended that you make a JSFiddle to reproduce your issue. You could start with [this template](http://jsfiddle.net/5sH6A/) that already includes the latest version of Vue. +- If your issue is resolved but still open, don’t hesitate to close it. In case you found a solution by yourself, it could be helpful to explain how you fixed it. + +## Pull Request Checklist + +- Checkout a topic branch from `dev` and merge back against `dev`. +- Work in the `src` folder and **DO NOT** checkin `dist` in the commits. +- Squash the commit if there are too many small ones. +- Follow the [code style](#code-style). +- Make sure the default grunt task passes. (see [development setup](#development-setup)) +- If adding new feature: + - Add accompanying test case. + - Provide convincing reason to add this feature. Ideally you should open a suggestion issue first and have it greenlighted before working on it. +- If fixing a bug: + - Provide detailed description of the bug in the PR. Live demo preferred. + - Add appropriate test coverage if applicable. + +## Code Style + +- [No semicolons unless necessary](http://inimino.org/~inimino/blog/javascript_semicolons). +- 2 spaces indentation. +- multiple var declarations. +- align equal signs where possible. +- Return early in one line if possible. +- When in doubt, read the source code. +- Break long ternary conditionals like this: + +``` js +var a = superLongConditionalStatement + ? 'yep' + : 'nope' +``` + +## Development Setup + +You will need [Node](http://nodejs.org), [Grunt](http://gruntjs.com), [PhantomJS](http://phantomjs.org) and [CasperJS](http://casperjs.org). + +``` bash +# in case you don’t already these: +# npm install -g grunt-cli phantomjs casperjs +$ npm install +``` + +To watch and auto-build `dist/vue.js` during development: + +``` bash +$ grunt watch +``` + +To lint: + +``` bash +grunt jshint +``` + +To build: + +``` bash +$ grunt build +``` + +To test: + +``` bash +# if you don’t have these yet: +# npm install -g phantomjs casperjs +$ grunt test +``` + +The unit tests are written with Jasmine and run with Karma. The functional tests are written for and run with CasperJS. + +**If you are not using a Mac** + +You can modify the Gruntfile to only run Karma tests in browsers that are available on your system. Just make sure don’t check in the Gruntfile for the commit. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..17a9b2f1f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Yuxi Evan You + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 000000000..c43e786ce --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +

+ +# Vue.js [![Build Status](https://travis-ci.org/yyx990803/vue.svg?branch=master)](https://travis-ci.org/yyx990803/vue) [![Selenium Test Status](https://saucelabs.com/buildstatus/vuejs)](https://saucelabs.com/u/vuejs) [![Coverage Status](https://img.shields.io/coveralls/yyx990803/vue.svg)](https://coveralls.io/r/yyx990803/vue?branch=master) + +> MVVM made simple. + +## Introduction + +Vue.js is a library for building interactive web interfaces. It provides the benefits of MVVM data binding and a composable component system with a simple and flexible API. You should try it out if you like: + +- Intuitive API that simply makes sense +- Extendable Data bindings +- Plain JavaScript objects as models +- Building interface by composing reusable components +- Flexibility to mix & match the view layer with other libraries + +It's really really easy to get started. Seriously, it's so easy: + +``` html +
+ {{message}} + +
+``` + +``` js +var demo = new Vue({ + data: { + message: 'Hello Vue.js!' + } +}).$mount('#demo') +``` + +To check out the live demo, guides and API reference, visit [vuejs.org](http://vuejs.org). + +## Browser Support + +Vue.js supports [most ECMAScript 5 compliant browsers](https://saucelabs.com/u/vuejs), essentially IE9+. IE8 and below are not supported. + +## Contribution + +Read the [contributing guide](https://github.com/yyx990803/vue/blob/master/CONTRIBUTING.md). + +## Get in Touch + +- General, non source-code related questions: check the [FAQ](https://github.com/yyx990803/vue/wiki/FAQ) first, if it's not addressed in there, ask [here](https://github.com/vuejs/Discussion/issues). +- If you have a Vue-related project/component/tool, add it to [this list](https://github.com/yyx990803/vue/wiki/User-Contributed-Components-&-Tools)! +- Bugs, suggestions & feature requests: [open an issue](https://github.com/yyx990803/vue/issues) +- Twitter: [@vuejs](https://twitter.com/vuejs) +- [Google+ Community](https://plus.google.com/communities/112229843610661683911) +- freenode IRC Channel: #vuejs + +## Changelog + +See details changes for each version in the [release notes](https://github.com/yyx990803/vue/releases). + +## License + +[MIT](http://opensource.org/licenses/MIT) + +Copyright (c) 2014 Evan You \ No newline at end of file diff --git a/bower.json b/bower.json new file mode 100644 index 000000000..12a858592 --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "vue", + "version": "0.11.0", + "main": "dist/vue.js", + "description": "Simple, Fast & Composable MVVM for building interative interfaces", + "authors": ["Evan You "], + "license": "MIT", + "ignore": [ + ".*", + "examples", + "test", + "tasks", + "gruntfile.js", + "*.json", + "*.md" + ] +} \ No newline at end of file diff --git a/component.json b/component.json new file mode 100644 index 000000000..281ec708b --- /dev/null +++ b/component.json @@ -0,0 +1,43 @@ +{ + "name": "vue", + "version": "0.11.0", + "main": "src/main.js", + "author": "Evan You ", + "description": "Simple, Fast & Composable MVVM for building interative interfaces", + "keywords": [ + "mvvm", + "framework", + "data binding" + ], + "license": "MIT", + "scripts": [ + "src/api/asset-register.js", + "src/api/config.js", + "src/api/extend.js", + "src/api/require.js", + "src/api/use.js", + "src/batcher.js", + "src/binding.js", + "src/compiler/compiler.js", + "src/config.js", + "src/directive.js", + "src/emitter.js", + "src/instance/data.js", + "src/instance/dom.js", + "src/instance/events.js", + "src/instance/lifecycle.js", + "src/observer/observer.js", + "src/observer/watch-array.js", + "src/observer/watch-object.js", + "src/parsers/directive.js", + "src/parsers/expression.js", + "src/parsers/path.js", + "src/parsers/template.js", + "src/parsers/text.js", + "src/transition/css.js", + "src/transition/js.js", + "src/transition/transition.js", + "src/util.js", + "src/vue.js" + ] +} \ No newline at end of file diff --git a/gruntfile.js b/gruntfile.js index 29091f3d7..8aabb4a92 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -61,10 +61,16 @@ module.exports = function (grunt) { }) + // load npm tasks grunt.loadNpmTasks('grunt-contrib-jshint') grunt.loadNpmTasks('grunt-karma') grunt.loadNpmTasks('grunt-browserify') + // load custom tasks + grunt.file.recurse('tasks', function (path) { + require('./' + path)(grunt) + }) + grunt.registerTask('unit', ['karma:browsers']) grunt.registerTask('watch', ['browserify:watch']) grunt.registerTask('build', ['browserify:build']) diff --git a/package.json b/package.json index cef8c6910..ef5cd7f5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue", - "version": "0.10.5", + "version": "0.11.0", "author": "Evan You ", "license": "MIT", "description": "Simple, Fast & Composable MVVM for building interative interfaces", diff --git a/tasks/casper.js b/tasks/casper.js new file mode 100644 index 000000000..07d9b5460 --- /dev/null +++ b/tasks/casper.js @@ -0,0 +1,3 @@ +module.exports = function () { + +} \ No newline at end of file diff --git a/tasks/component.js b/tasks/component.js new file mode 100644 index 000000000..cef54a4cd --- /dev/null +++ b/tasks/component.js @@ -0,0 +1,16 @@ +// automatically fill in component.json's script field + +module.exports = function (grunt) { + grunt.registerTask('component', function () { + + var component = grunt.file.readJSON('component.json') + component.scripts = [] + + grunt.file.recurse('src', function (file) { + component.scripts.push(file) + }) + + grunt.file.write('component.json', JSON.stringify(component, null, 2)) + + }) +} \ No newline at end of file diff --git a/tasks/release.js b/tasks/release.js new file mode 100644 index 000000000..07d9b5460 --- /dev/null +++ b/tasks/release.js @@ -0,0 +1,3 @@ +module.exports = function () { + +} \ No newline at end of file