Skip to content

Commit

Permalink
Merge pull request #7 from leizhao4/node-assets
Browse files Browse the repository at this point in the history
0.0.3: Ember upgrade and NPM import improvements
  • Loading branch information
leizhao4 authored Mar 22, 2017
2 parents 549827e + 6a42e33 commit f0ce613
Show file tree
Hide file tree
Showing 13 changed files with 1,364 additions and 2,272 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,8 @@ rules:
semi-spacing: 2
semi: 2
sort-vars: 0
space-after-keywords: 0
space-before-blocks: 2
space-before-function-paren: [2, { anonymous: always, named: never }]
space-before-keywords: 0
space-in-parens: 2
space-infix-ops: 2
space-return-throw-case: 0
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

# dependencies
/node_modules
/bower_components

# misc
/.sass-cache
Expand Down
20 changes: 6 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
---
language: node_js
node_js:
- "4"
- "6"

sudo: false

cache:
directories:
- $HOME/.npm
- $HOME/.cache # includes bowers cache

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

matrix:
fast_finish: true
Expand All @@ -30,19 +24,17 @@ matrix:

before_install:
- npm config set spin false
- npm install -g bower
- bower --version
- npm install phantomjs-prebuilt
- node_modules/phantomjs-prebuilt/bin/phantomjs --version
- npm install -g phantomjs-prebuilt
- phantomjs --version

install:
- npm install
- bower install


script:
# Usually, it's ok to finish the test scenario without reverting
# to the addon's original dependency state, skipping "cleanup".
- ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup

- node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup
after_script:
- node_modules/.bin/codeclimate-test-reporter < coverage/lcov.info
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Test Coverage](https://codeclimate.com/github/leizhao4/ember-webcam/badges/coverage.svg)](https://codeclimate.com/github/leizhao4/ember-webcam/coverage)
[![Ember Observer Score](https://emberobserver.com/badges/ember-webcam.svg)](https://emberobserver.com/addons/ember-webcam)

This Ember CLI addon is a simple wrapper for [WebcamJS](https://pixlcore.com/read/WebcamJS) (v1.0.16). This addon uses Ember CLI v2.9.0.
This Ember CLI addon is a simple wrapper for [WebcamJS](https://pixlcore.com/read/WebcamJS).

## Installation

Expand Down
2 changes: 1 addition & 1 deletion addon/components/ember-webcam.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from 'ember-component';
import computed from 'ember-computed';
import Webcam from 'npm:webcamjs';
import Webcam from 'webcamjs';
import layout from '../templates/components/ember-webcam';

export default Component.extend({
Expand Down
2 changes: 1 addition & 1 deletion app/components/ember-webcam.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import WebcamComponent from 'ember-webcam/components/ember-webcam';
import Webcam from 'npm:webcamjs';
import Webcam from 'webcamjs';

export default WebcamComponent;
export { Webcam };
6 changes: 0 additions & 6 deletions blueprints/ember-webcam/index.js

This file was deleted.

10 changes: 0 additions & 10 deletions bower.json

This file was deleted.

25 changes: 25 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ module.exports = {
resolutions: {
'ember': 'lts-2-4'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -22,6 +27,11 @@ module.exports = {
resolutions: {
'ember': 'lts-2-8'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -33,6 +43,11 @@ module.exports = {
resolutions: {
'ember': 'release'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -44,6 +59,11 @@ module.exports = {
resolutions: {
'ember': 'beta'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
},
{
Expand All @@ -55,6 +75,11 @@ module.exports = {
resolutions: {
'ember': 'canary'
}
},
npm: {
devDependencies: {
'ember-source': null
}
}
}
]
Expand Down
25 changes: 17 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,24 @@

module.exports = {
name: 'ember-webcam',
init() {
this._super.init && this._super.init.apply(this, arguments);
let assetsPath = require('path').join('webcamjs', 'webcam.js');
this.treePaths['vendor'] =
require.resolve('webcamjs').replace(assetsPath, '');
options: {
nodeAssets: {
webcamjs: {
vendor: ['webcam.js'],
public: {
distDir: 'assets',
include: ['webcam.swf']
}
}
}
},
included() {
this.app.import('vendor/webcamjs/webcam.swf', {
destDir: 'assets'
included(parent) {
this._super.included.apply(this, arguments);
this.import('vendor/webcamjs/webcam.js', {
using: [{
transformation: 'amd',
as: 'webcamjs'
}]
});
}
};
29 changes: 14 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "ember-webcam",
"version": "0.0.2",
"version": "0.0.3",
"description": "Ember addon for WebcamJS integration",
"keywords": [
"ember-addon",
"ember",
"webcam",
"webcamjs"
],
Expand All @@ -25,35 +24,35 @@
},
"dependencies": {
"ember-cli-babel": "^5.1.7",
"ember-cli-htmlbars": "^1.0.10",
"ember-cli-htmlbars": "^1.1.1",
"ember-cli-node-assets": "^0.2.2",
"webcamjs": "^1.0.16"
},
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"codeclimate-test-reporter": "^0.4.0",
"ember-browserify": "1.1.13",
"ember-cli": "^2.9.0",
"ember-cli-app-version": "^2.0.0",
"ember-cli-code-coverage": "^0.3.7",
"codeclimate-test-reporter": "^0.4.1",
"ember-cli": "2.12.0",
"ember-cli-chai": "^0.3.0",
"ember-cli-code-coverage": "^0.3.11",
"ember-cli-dependency-checker": "^1.3.0",
"ember-cli-htmlbars-inline-precompile": "^0.3.3",
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-jshint": "^2.0.1",
"ember-cli-mocha": "0.10.4",
"ember-cli-mocha": "^0.13.2",
"ember-cli-page-object": "1.6.0",
"ember-cli-release": "^0.2.9",
"ember-cli-shims": "^1.0.2",
"ember-cli-sri": "^2.1.0",
"ember-cli-test-loader": "^1.1.0",
"ember-cli-uglify": "^1.2.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "^1.0.5",
"ember-load-initializers": "^0.5.1",
"ember-mocha": "0.9.1",
"ember-load-initializers": "^0.6.0",
"ember-resolver": "^2.0.3",
"loader.js": "^4.0.10"
"ember-source": "~2.12.0",
"loader.js": "^4.2.3"
},
"engines": {
"node": ">= 0.12.0"
"node": ">= 4"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down
Loading

0 comments on commit f0ce613

Please sign in to comment.