Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop bower and use bourbon npm module instead. #18

Merged
merged 1 commit into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

21 changes: 12 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
---
language: node_js
node_js:
- "0.12"
- "4"

sudo: false

cache:
directories:
- node_modules
- $HOME/.npm

env:
- EMBER_TRY_SCENARIO=default
# we recommend testing LTS's and latest stable release (bonus points to beta/canary)
- EMBER_TRY_SCENARIO=ember-lts-2.4
- EMBER_TRY_SCENARIO=ember-lts-2.8
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary
- EMBER_TRY_SCENARIO=ember-default

matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"
- npm config set spin false
- npm install -g phantomjs-prebuilt
- phantomjs --version

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

script:
- ember try $EMBER_TRY_SCENARIO test
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,20 @@

Include bourbon in an ember-cli app.

When the addon is installed, it will add bourbon as a bower dependency.

## Dependencies

Your project should already be set up to handle sass/scss builds. If you're not, do so by running:

npm install broccoli-sass --save-dev
ember install ember-cli-sass

## Usage

In your ember-cli (>= 0.1.1) project, run:

npm install ember-cli-bourbon --save-dev
ember g ember-cli-bourbon
ember install ember-cli-bourbon

The generator will create an `app.scss` with the sole contents being:

@import "bourbon";

If you already have content in your `app.scss`, you can just choose "n" and add that
line to the top of `app.scss` yourself.

## Developing this Addon

* `ember server`
* Visit the dummy app at http://localhost:4200.

## Running Tests

* `ember test`
* `ember test --server`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).
If you already have content in your `app.scss`, you can add that line to the top of `app.scss` yourself.
12 changes: 0 additions & 12 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
{
"name": "ember-cli-bourbon",
"dependencies": {
"bourbon": "~4.2.6",
"ember": "1.13.11",
"ember-cli-shims": "0.0.6",
"ember-cli-test-loader": "0.2.1",
"ember-data": "1.13.15",
"ember-load-initializers": "0.1.7",
"ember-qunit": "0.4.16",
"ember-qunit-notifications": "0.1.0",
"ember-resolver": "~0.1.20",
"jquery": "^1.11.3",
"loader.js": "ember-cli/loader.js#3.4.0",
"qunit": "~1.20.0"
}
}
83 changes: 69 additions & 14 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,89 @@
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
name: 'ember-lts-2.4',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-4'
},
resolutions: {
'ember': 'lts-2-4'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-lts-2.8',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-8'
},
resolutions: {
'ember': 'lts-2-8'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
bower: {
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
resolutions: {
'ember': 'release'
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
bower: {
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
resolutions: {
'ember': 'beta'
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
bower: {
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
},
resolutions: {
'ember': 'canary'
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
name: 'ember-default',
npm: {
devDependencies: {}
}
}
]
Expand Down
22 changes: 17 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,28 @@ var Funnel = require('broccoli-funnel');

module.exports = {
name: 'ember-cli-bourbon',

blueprintsPath: function() {
return path.join(__dirname, 'blueprints');
},

included: function(app) {
this._super.included.apply(this, arguments);

// see: https://github.com/ember-cli/ember-cli/issues/3718
while (typeof app.import !== 'function' && app.app) {
app = app.app;
}

this.bourbonPath = path.dirname(require.resolve('bourbon'));
return app;
},

treeForStyles: function() {
var bourbonPath = path.join(this.project.bowerDirectory, 'bourbon', 'app');
var bourbonTree = new Funnel(this.treeGenerator(bourbonPath), {
srcDir: '/assets/stylesheets',
destDir: '/app/styles'
return new Funnel(this.bourbonPath, {
srcDir: 'app/assets/stylesheets',
destDir: 'app/styles',
annotation: 'Funnel (bourbon)'
});
return bourbonTree;
}
};
36 changes: 15 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"scripts": {
"start": "ember server",
"build": "ember build",
"test": "ember try:testall"
"test": "ember test"
},
"repository": "https://github.com/yapplabs/ember-cli-bourbon",
"engines": {
Expand All @@ -18,32 +18,26 @@
"author": "Yapp Labs",
"license": "MIT",
"devDependencies": {
"broccoli-asset-rev": "^2.0.2",
"ember-cli": "^1.13.13",
"ember-cli-app-version": "0.4.0",
"ember-cli-content-security-policy": "0.4.0",
"ember-cli-dependency-checker": "^1.1.0",
"ember-cli-htmlbars": "^1.0.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-ic-ajax": "0.2.4",
"ember-cli-inject-live-reload": "^1.3.1",
"ember-cli-qunit": "^1.0.4",
"ember-cli-release": "0.2.8",
"ember-cli-sri": "^1.0.1",
"ember-cli-uglify": "^1.0.1",
"ember-data": "1.13.15",
"ember-disable-proxy-controllers": "^1.0.0",
"ember-export-application-global": "^1.0.3",
"ember-cli-sass": "4.0.1",
"ember-disable-prototype-extensions": "^1.0.0",
"ember-try": "0.0.6"
"ember-cli": "^2.11.0",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-qunit": "^3.0.1",
"ember-cli-release": "^0.2.9",
"ember-cli-sass": "5.2.0",
"ember-cli-shims": "^1.0.2",
"ember-cli-test-loader": "^1.1.0",
"ember-load-initializers": "^0.6.0",
"ember-resolver": "^2.0.3",
"ember-source": "^2.11.0",
"loader.js": "^4.0.1"
},
"keywords": [
"ember-addon"
],
"dependencies": {
"bourbon": "^4.3.3",
"broccoli-funnel": "^1.0.1",
"ember-cli-babel": "^5.1.5"
"ember-cli-babel": "^5.1.7"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
37 changes: 37 additions & 0 deletions tests/dummy/.sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
rules:
no-ids: 0
property-sort-order: 0
mixins-before-declarations: 0
leading-zero: 0
empty-line-between-blocks: 0
space-after-comma: 0
no-color-literals: 0
no-color-keywords: 0
no-mergeable-selectors: 0
force-element-nesting: 0
nesting-depth: 0
force-pseudo-nesting: 0
single-line-per-selector: 0
no-vendor-prefixes: 0
indentation: 0
variable-name-format: 0
clean-import-paths: 0
one-declaration-per-line: 0
class-name-format: 0
no-qualifying-elements: 0
force-attribute-nesting: 0
no-important: 0
placeholder-in-extend: 0
extends-before-declarations: 0
# TODO: Encapsulate -webkit-overflow-scrolling in mixin to re-enable no-misspelled-properties rule
no-misspelled-properties: 0
# TODO: Encapsulate crazy cursor stuff in mixin to re-enable no-duplicate-properties rule
no-duplicate-properties: 0

# Need to glob file paths with ** in order to match differing relative paths:
# ember-cli-sass-lint app tree -- webfonts/proxima_nova_font.scss
# vs.
# project root for editor plugins -- app/styles/webfonts/proxima_nova_font.scss
files:
ignore:
- '**/base.scss'
4 changes: 2 additions & 2 deletions tests/dummy/app/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Ember from 'ember';
import Resolver from 'ember/resolver';
import loadInitializers from 'ember/load-initializers';
import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

let App;
Expand Down
3 changes: 3 additions & 0 deletions tests/dummy/app/resolver.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import Resolver from 'ember-resolver';

export default Resolver;
3 changes: 2 additions & 1 deletion tests/dummy/app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
location: config.locationType
location: config.locationType,
rootURL: config.rootURL
});

Router.map(function() {
Expand Down
7 changes: 5 additions & 2 deletions tests/dummy/config/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ module.exports = function(environment) {
var ENV = {
modulePrefix: 'dummy',
environment: environment,
baseURL: '/',
rootURL: '/',
locationType: 'auto',
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},

Expand All @@ -29,7 +33,6 @@ module.exports = function(environment) {

if (environment === 'test') {
// Testem prefers this...
ENV.baseURL = '/';
ENV.locationType = 'none';

// keep test console output quieter
Expand Down
Loading