Skip to content

Commit

Permalink
ember addon ember-cli-autoprefixer
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdiliberto committed Feb 4, 2015
1 parent 4c661a1 commit 5ba5759
Show file tree
Hide file tree
Showing 41 changed files with 559 additions and 65 deletions.
4 changes: 4 additions & 0 deletions .bowerrc
@@ -0,0 +1,4 @@
{
"directory": "bower_components",
"analytics": false
}
33 changes: 33 additions & 0 deletions .editorconfig
@@ -0,0 +1,33 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.hbs]
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 2

[*.{diff,md}]
trim_trailing_whitespace = false
9 changes: 9 additions & 0 deletions .ember-cli
@@ -0,0 +1,9 @@
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.

Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
18 changes: 17 additions & 1 deletion .gitignore
@@ -1 +1,17 @@
node_modules/*
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp

# dependencies
/node_modules
/bower_components

# misc
/.sass-cache
/connect.lock
/coverage/*
/libpeerconnection.log
npm-debug.log
testem.log
32 changes: 32 additions & 0 deletions .jshintrc
@@ -0,0 +1,32 @@
{
"predef": [
"document",
"window",
"-Promise"
],
"browser": true,
"boss": true,
"curly": true,
"debug": false,
"devel": true,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": false,
"eqnull": true,
"esnext": true,
"unused": true
}
12 changes: 12 additions & 0 deletions .npmignore
@@ -0,0 +1,12 @@
bower_components/
tests/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
Brocfile.js
testem.json
20 changes: 20 additions & 0 deletions .travis.yml
@@ -0,0 +1,20 @@
---
language: node_js

sudo: false

cache:
directories:
- node_modules

before_install:
- "npm config set spin false"
- "npm install -g npm@^2"

install:
- npm install -g bower
- npm install
- bower install

script:
- npm test
27 changes: 27 additions & 0 deletions Brocfile.js
@@ -0,0 +1,27 @@
/* jshint node: true */
/* global require, module */

var EmberAddon = require('ember-cli/lib/broccoli/ember-addon');

var app = new EmberAddon({
autoprefixer: {
enabled: true,
browsers: ['Chrome 43'],
cascade: true
}
});

// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.

module.exports = app.toTree();
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

9 changes: 9 additions & 0 deletions LICENSE.md
@@ -0,0 +1,9 @@
The MIT License (MIT)

Copyright (c) 2015 Kim Røen

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.
Empty file added addon/.gitkeep
Empty file.
Empty file added app/.gitkeep
Empty file.
17 changes: 17 additions & 0 deletions bower.json
@@ -0,0 +1,17 @@
{
"name": "ember-cli-autoprefixer",
"dependencies": {
"handlebars": "~1.3.0",
"jquery": "^1.11.1",
"ember": "1.8.1",
"ember-data": "1.0.0-beta.12",
"ember-resolver": "~0.1.11",
"loader.js": "ember-cli/loader.js#1.0.1",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli/ember-cli-test-loader#0.1.0",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.5",
"qunit": "~1.17.1"
}
}
5 changes: 5 additions & 0 deletions config/environment.js
@@ -0,0 +1,5 @@
'use strict';

module.exports = function(/* environment, appConfig */) {
return { };
};
43 changes: 18 additions & 25 deletions index.js
@@ -1,32 +1,25 @@
/* jshint node: true */
'use strict';

var path = require('path');
var fs = require('fs');
var autoprefixer = require('broccoli-autoprefixer');
var defaults = require('lodash').defaults;
var defaults = require('lodash').defaults;

function EmberCLIAutoprefixer(project) {
this.project = project;
this.name = 'Ember CLI Autoprefixer';
}
module.exports = {
name: 'ember-cli-autoprefixer',
included: function(app, parentAddon) {
this.app = app;
this.options = defaults(this.app.options.autoprefixer || {}, {
enabled: true
});
this.enabled = this.options.enabled;
},
postprocessTree: function(type, tree) {
var tree;

EmberCLIAutoprefixer.prototype.postprocessTree = function (type, tree) {
if ((type === 'all' || type === 'styles') && this.enabled) {
tree = autoprefixer(tree, this.options);
}

return tree;
};
if ((type === 'all' || type === 'styles') && this.enabled) {
tree = autoprefixer(tree, this.options);
}

EmberCLIAutoprefixer.prototype.included = function included(app) {
this.app = app;
this.options = defaults(this.app.options.autoprefixer || {}, {
enabled: true
});
this.enabled = this.options.enabled;
delete this.options.enabled;
return tree;
}
};

EmberCLIAutoprefixer.prototype.treeFor = function treeFor() {};

module.exports = EmberCLIAutoprefixer;
61 changes: 43 additions & 18 deletions package.json
Expand Up @@ -2,9 +2,48 @@
"name": "ember-cli-autoprefixer",
"version": "0.3.0",
"description": "Process styles in an ember-cli application using Autoprefixer",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "tests"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "ember server",
"build": "ember build",
"test": "ember test"
},
"repository": {
"type": "git",
"url": "git://github.com/kimroen/ember-cli-autoprefixer.git"
},
"bugs": {
"url": "https://github.com/kimroen/ember-cli-autoprefixer/issues"
},
"homepage": "https://github.com/kimroen/ember-cli-autoprefixer",
"engines": {
"node": ">= 0.10.0"
},
"author": "Kim Røen",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.0",
"broccoli-ember-hbs-template-compiler": "^1.6.1",
"ember-cli": "0.1.12",
"ember-cli-6to5": "^3.0.0",
"ember-cli-content-security-policy": "0.3.0",
"ember-cli-dependency-checker": "0.0.7",
"ember-cli-ic-ajax": "0.1.1",
"ember-cli-inject-live-reload": "^1.3.0",
"ember-cli-qunit": "0.3.1",
"ember-cli-app-version": "0.3.1",
"ember-cli-uglify": "1.0.1",
"ember-data": "1.0.0-beta.12",
"ember-export-application-global": "^1.0.0",
"express": "^4.8.5",
"glob": "^4.0.5"
},
"dependencies": {
"broccoli-autoprefixer": "^2.1.0",
"lodash": "^3.1.0"
},
"keywords": [
"ember-addon",
Expand All @@ -14,20 +53,6 @@
"preprocess"
],
"ember-addon": {
"before": "broccoli-asset-rev"
},
"author": "Kim Røen",
"license": "MIT",
"dependencies": {
"broccoli-autoprefixer": "^2.1.0",
"lodash": "^3.0.1"
},
"repository": {
"type": "git",
"url": "git://github.com/kimroen/ember-cli-autoprefixer.git"
},
"bugs": {
"url": "https://github.com/kimroen/ember-cli-autoprefixer/issues"
},
"homepage": "https://github.com/kimroen/ember-cli-autoprefixer"
"configPath": "tests/dummy/config"
}
}
11 changes: 11 additions & 0 deletions testem.json
@@ -0,0 +1,11 @@
{
"framework": "qunit",
"test_page": "tests/index.html?hidepassed",
"launch_in_ci": [
"PhantomJS"
],
"launch_in_dev": [
"PhantomJS",
"Chrome"
]
}

0 comments on commit 5ba5759

Please sign in to comment.