Merge remote-tracking branch 'origin/rewrite' into rewrite
This commit is contained in:
commit
fb856c0636
3 changed files with 50 additions and 11 deletions
17
.travis.yml
17
.travis.yml
|
|
@ -28,16 +28,19 @@ after_success:
|
|||
# Only want to commit when building a push on whatever $BRANCH is
|
||||
if [ "$TRAVIS_EVENT_TYPE" == "push" ] && \
|
||||
[ "$TRAVIS_BRANCH" == "$BRANCH" ] && \
|
||||
[ "$TRAVIS_REPO_SLUG" == "$REPO" ]; then
|
||||
[ "$TRAVIS_REPO_SLUG" == "$REPO" ]
|
||||
then
|
||||
# Set up SSH environment
|
||||
$(npm bin)/set-up-ssh --key "$encrypted_8b86e0359d64_key" \
|
||||
--iv "$encrypted_8b86e0359d64_iv" \
|
||||
--path-encrypted-key "./.deploy.enc"
|
||||
$(npm bin)/set-up-ssh \
|
||||
--key "$encrypted_8b86e0359d64_key" \
|
||||
--iv "$encrypted_8b86e0359d64_iv" \
|
||||
--path-encrypted-key "./.deploy.enc"
|
||||
|
||||
# Commit changes (if there were any) from running build earlier
|
||||
$(npm bin)/commit-changes --commands "echo committing" \
|
||||
--commit-message "Bundled output for commit $TRAVIS_COMMIT [skip ci]" \
|
||||
--branch "$BRANCH"
|
||||
$(npm bin)/commit-changes \
|
||||
--commands "echo committing" \
|
||||
--commit-message "Bundled output for commit $TRAVIS_COMMIT [skip ci]" \
|
||||
--branch "$BRANCH"
|
||||
else
|
||||
echo "Not submitting build artifacts"
|
||||
fi
|
||||
|
|
|
|||
34
docs/releasing.md
Normal file
34
docs/releasing.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# Releasing
|
||||
|
||||
Releasing new builds of mithril is mostly automated via `npm version`
|
||||
|
||||
## Publishing to NPM
|
||||
|
||||
1. `npm version <major|minor|patch|semver> -m "v%s"`
|
||||
|
||||
All further steps are automated and run as follows:
|
||||
|
||||
2. Tests are run
|
||||
3. Linting is run (but doesn't fail build)
|
||||
4. Version number in package.json is incremented
|
||||
5. New bundles are generated using updated version
|
||||
6. `git add` called on bundle output
|
||||
7. `package.json` and updated bundles are committed to git
|
||||
8. previous commit is tagged using new version number
|
||||
9. `git push --follow-tags` pushes up new version commit & tag to github
|
||||
10. Travis sees new release, starts build
|
||||
11. Travis generates new bundles before running tests
|
||||
12. Travis runs tests
|
||||
13. Travis lints files (but can't fail build)
|
||||
14. If build fails, abort
|
||||
15. Build succeeded, so travis will commit back any changes to the repo (but there won't be any)
|
||||
16. Travis sees that this commit has a tag associated with it
|
||||
17. Travis will use the encrypted npm creds in `.travis.yml` to publish a new version to npm
|
||||
|
||||
## Publishing a GitHub release
|
||||
|
||||
**TODO**
|
||||
|
||||
## Updating `docs/change-log.md`
|
||||
|
||||
**TODO**
|
||||
|
|
@ -429,7 +429,7 @@ Similar to the `UserList` component, `oninit` calls `User.load()`. Remember we h
|
|||
Now, let's modify the `UserList` view so that we can navigate from there to a `UserForm`:
|
||||
|
||||
```javascript
|
||||
// src/views/UserForm.js
|
||||
// src/views/UserList.js
|
||||
var m = require("mithril")
|
||||
var User = require("../model/User")
|
||||
|
||||
|
|
@ -456,7 +456,7 @@ The form itself still doesn't save when you press "Save". Let's make this form w
|
|||
```javascript
|
||||
// src/views/UserForm.js
|
||||
var m = require("mithril")
|
||||
var User = require("./model/User")
|
||||
var User = require("../model/User")
|
||||
|
||||
module.exports = {
|
||||
oninit: function(vnode) {User.load(vnode.attrs.id)},
|
||||
|
|
@ -536,7 +536,9 @@ Currently, we're only able to navigate back to the user list via the browser bac
|
|||
Let's create a file `src/views/Layout.js`:
|
||||
|
||||
```javascript
|
||||
var Layout = {
|
||||
var m = require("mithril")
|
||||
|
||||
module.exports = {
|
||||
view: function(vnode) {
|
||||
return m("main.layout", [
|
||||
m("nav.menu", [
|
||||
|
|
@ -579,6 +581,7 @@ var m = require("mithril")
|
|||
|
||||
var UserList = require("./view/UserList")
|
||||
var UserForm = require("./view/UserForm")
|
||||
var Layout = require("./view/Layout")
|
||||
|
||||
m.route(document.body, "/list", {
|
||||
"/list": {
|
||||
|
|
@ -609,4 +612,3 @@ This concludes the tutorial.
|
|||
In this tutorial, we went through the process of creating a very simple application where we can list users from a server and edit them individually. As an extra exercise, try to implement user creation and deletion on your own.
|
||||
|
||||
If you want to see more examples of Mithril code, check the [examples](examples.md) page. If you have questions, feel free to drop by the [Mithril chat room](https://gitter.im/lhorie/mithril.js).
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue