Giter VIP home page Giter VIP logo

elgg-grunt's Introduction

elgg-grunt

Shared grunt configuration for Elgg 2.0 plugins and sites.

Usage

1. Put this as your project's Gruntfile.js:

module.exports = require('elgg-grunt');

2. Add a profiles.local.json

Your local server needs to point to the /dist/ directory, which is where the built files will end up.

{
  "baseUrl": "http://localhost:8080/dist/"
}

3. Run grunt watch

Just grunt watch; no flags or subcommands.

This gives you the default local build, and automatically updates as you make changes. Load up the app at baseUrl to see it in action.

NB: You need to start the server yourself. How to do that is different based on each environment.

TODO(evan): Provide a default local server.

Releasing

This project and any project that relies on this one to provide its Gruntfile configuration can use the following commands to quickly push new versions to NPM.

# Bugfix releases (e.g. 1.0.x)
grunt release:patch
npm publish

# New feature releases (e.g. 1.x.0)
grunt release:minor
npm publish

# Backwards-incompatible releases (e.g. x.0.0)
grunt release:major
npm publish

Each of these will generate the appropriate changelog updates assuming you have been diligent to adhere to the recommended commit message format.

Continuous Testing

Add .travis.yml to your app:

language: node_js
node_js:
- '0.11'
script: grunt travis
branches:
  only:
  - master

Continuous Deployment

Travis-CI can push your app to gh-pages/staging/production every time all your tests pass. This example walks you through auto-pushing to GitHub pages:

Setup a gh-pages branch for deployment

You can follow the instructions here:

https://github.com/X1011/git-directory-deploy

Add a .travis.yml file

language: node_js
node_js:
- '0.11'
script: grunt travis
after_success: bin/deploy.sh gh-pages
branches:
  only:
  - master

Note that this also includes a after_success: bin/deploy.sh script. You need to copy deploy.sh from the ng-elgg repo until continuous deployment is supported out of the box.

Give Travis-CI your credentials

gem install travis
cd my_project
travis encrypt GITHUB_TOKEN=XXXXX --add

Replace XXXXX with your GitHub command line token for the repository.

Make sure Travis is running on commits to your repo

elgg-grunt's People

Contributors

ewinslow avatar

Watchers

 avatar  avatar  avatar

elgg-grunt's Issues

feature(dev): Support ES6 modules

These are the future of JS, so would prefer to switch to these from AMD when possible. Should compile to AMD for compatibility with older (and even modern!) browsers.

Problems blocking this move:

  • CSS/HTML dependencies -- ES6 doesn't come with plugin support the same way that AMD does.
  • more?

feature(deploy): Support `grunt deploy --profile=XXXXX`

We want to easily support continuous deployment out of the box. Currently you still have to copy the deploy.sh script to each repo you want to deploy from. Copy/paste is evil. Best to keep everyone up-to-date by bundling the script with elgg-grunt.

Support a src/ dir in addition to app/

Add cp src/* dist/some/ns in build process where ns is defined in volo.namespace.

The idea is that app/ contains a demo app that shows off the features of the library. If the project is for a website, it just contains the actual site itself. src/ would contain all the reusable stuff that can be added to vendors dirs of other projects.

This will allow us to break out ng-require and ng-elgg from cbcoverseas.org.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.