Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from Techn1x/master
Browse files Browse the repository at this point in the history
Fixed npm install + updates
  • Loading branch information
drewda authored Jul 17, 2017
2 parents b62c919 + 7b6f0d4 commit 1710a2d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 21 deletions.
15 changes: 5 additions & 10 deletions blueprints/ember-leaflet-polyline-decorator/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
/*jshint node:true*/
module.exports = {
description: ''
description: 'add leaflet-polylinedecorator, using npm',

// locals: function(options) {
// // Return custom template variables here.
// return {
// foo: options.entity.options.foo
// };
// }

afterInstall: function(options) {
return this.addBowerPackageToProject('leaflet-polylinedecorator', 'bbecquet/Leaflet.PolylineDecorator#^leaflet-0.7.2');
normalizeEntityName: function() {}, // no-op since we're just adding dependencies

afterInstall: function() {
return this.addPackageToProject('leaflet-polylinedecorator', '^1.2.0'); // Add's a package to the project's package.json
}
};
5 changes: 1 addition & 4 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"dependencies": {
"ember": "~2.6.0",
"ember-cli-shims": "0.1.1",
"ember-cli-test-loader": "0.2.2",
"ember-qunit-notifications": "0.1.0",
"leaflet": "~0.7.2",
"leaflet-polylinedecorator": "bbecquet/Leaflet.PolylineDecorator#leaflet-0.7.2"
"ember-cli-test-loader": "0.2.2"
}
}
36 changes: 34 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
/* jshint node: true */
'use strict';
const resolve = require('resolve');
const path = require('path');
const Funnel = require('broccoli-funnel');

module.exports = {
name: 'ember-leaflet-polyline-decorator',

treeForVendor: function() {
let dist = path.join(this.pathBase('leaflet-polylinedecorator'), 'dist');
return new Funnel(dist, { destDir: 'leaflet-polylinedecorator' });
},

included: function(app) {
app.import(app.bowerDirectory + '/leaflet-polylinedecorator/leaflet.polylineDecorator.js');
this._super.included.apply(this, arguments);

// If the addon has the _findHost() method (in ember-cli >= 2.7.0), we'll just
// use that.
if (typeof this._findHost === 'function') {
app = this._findHost();
}

// Otherwise, we'll use this implementation borrowed from the _findHost()
// method in ember-cli.
// Keep iterating upward until we don't have a grandparent.
// Has to do this grandparent check because at some point we hit the project.
var current = this;
do {
app = current.app || app;
} while (current.parent.parent && (current = current.parent));

var baseDir = 'vendor/leaflet-polylinedecorator/';

app.import(baseDir + 'leaflet.polylineDecorator.js'); // Import the javascript into the app
},

pathBase: function(packageName) {
return path.dirname(resolve.sync(packageName + '/package.json', { basedir: __dirname }));
}
};
};
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@transitland/ember-leaflet-polyline-decorator",
"name": "ember-leaflet-polyline-decorator",
"version": "0.1.0",
"description": "An Ember-CLI addon for using the Leaflet Polyline Decorator plugin.",
"directories": {
Expand All @@ -26,7 +26,6 @@
"ember-cli": "2.6.1",
"ember-cli-app-version": "^1.0.0",
"ember-cli-dependency-checker": "^1.2.0",
"ember-cli-htmlbars": "^1.0.3",
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
"ember-cli-inject-live-reload": "^1.4.0",
"ember-cli-jshint": "^1.0.0",
Expand All @@ -37,10 +36,9 @@
"ember-data": "^2.6.0",
"ember-disable-prototype-extensions": "^1.1.0",
"ember-export-application-global": "^1.0.5",
"ember-leaflet": "^3.0.12",
"ember-load-initializers": "^0.5.1",
"ember-resolver": "^2.0.3",
"ember-welcome-page": "^1.0.1",
"ember-leaflet": "2.2.7",
"loader.js": "^4.0.1"
},
"keywords": [
Expand All @@ -50,8 +48,11 @@
"leaflet"
],
"dependencies": {
"broccoli-funnel": "^1.1.0",
"ember-cli-babel": "^5.1.6",
"ember-cli-htmlbars": "1.0.8"
"ember-cli-htmlbars": "^1.3.3",
"leaflet": "~1.1.0",
"leaflet-polylinedecorator": "~1.2.0"
},
"ember-addon": {
"configPath": "tests/dummy/config"
Expand Down

0 comments on commit 1710a2d

Please sign in to comment.