@fleetbase/fleetops-engine 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- import 'leaflet-draw-src';
2
1
  import BaseLayer from 'ember-leaflet/components/base-layer';
3
2
  import { getProperties, computed } from '@ember/object';
4
3
  import { run } from '@ember/runloop';
@@ -1,5 +1,4 @@
1
1
  import MarkerLayer from 'ember-leaflet/components/marker-layer';
2
- import 'leaflet-rotatedmarker';
3
2
 
4
3
  export default class LeafletRotatedMarkerComponent extends MarkerLayer {
5
4
  leafletOptions = [
@@ -1,4 +1,3 @@
1
- import 'leaflet-contextmenu';
2
1
  import Component from '@glimmer/component';
3
2
  import { tracked } from '@glimmer/tracking';
4
3
  import { inject as service } from '@ember/service';
@@ -132,6 +131,7 @@ export default class LiveMapComponent extends Component {
132
131
  }
133
132
 
134
133
  const { contextmenu } = map;
134
+ console.log('map.contextmenu', contextmenu);
135
135
  const contextMenuItems = this.buildContextMenuItems();
136
136
 
137
137
  contextMenuItems.forEach((options) => contextmenu.addItem(options));
package/index.js CHANGED
@@ -3,9 +3,7 @@ const Funnel = require('broccoli-funnel');
3
3
  const MergeTrees = require('broccoli-merge-trees');
4
4
  const { buildEngine } = require('ember-engines/lib/engine-addon');
5
5
  const { name } = require('./package');
6
- const packagePrefix = `node_modules/${name}/node_modules`;
7
- // const fs = require('fs-extra');
8
- // const path = require('path');
6
+ const path = require('path');
9
7
 
10
8
  module.exports = buildEngine({
11
9
  name,
@@ -14,42 +12,35 @@ module.exports = buildEngine({
14
12
  enabled: true,
15
13
  },
16
14
 
17
- _concatStyles: () => {},
18
-
19
15
  included: function (app) {
20
16
  this._super.included.apply(this, arguments);
21
17
 
22
- // leaflet-rotatedmarker js
23
- this.import(`${packagePrefix}/leaflet-rotatedmarker/leaflet.rotatedMarker.js`, {
24
- using: [{ transformation: 'es6', as: 'leaflet-rotatedmarker' }],
25
- });
26
-
27
- // leaflet-contextmenu js
28
- this.import(`${packagePrefix}/leaflet-contextmenu/dist/leaflet.contextmenu.js`, {
29
- using: [{ transformation: 'es6', as: 'leaflet-contextmenu' }],
30
- });
18
+ const importJs = (module, file, options) => {
19
+ const modulePath = path.dirname(require.resolve(module));
20
+ this.import(`${modulePath}/${file}`, options);
21
+ };
31
22
 
32
- // leaflet-contextmenu css
33
- this.import(`${packagePrefix}/leaflet-contextmenu/dist/leaflet.contextmenu.css`);
23
+ importJs('leaflet-rotatedmarker', 'leaflet.rotatedMarker.js');
24
+ importJs('leaflet-draw', 'leaflet.draw-src.js');
25
+ importJs('leaflet-contextmenu', 'leaflet.contextmenu.js');
34
26
 
35
- // leaflet-draw js
36
- this.import(`${packagePrefix}/leaflet-draw/dist/leaflet.draw-src.js`, {
37
- using: [{ transformation: 'es6', as: 'leaflet-draw-src' }],
38
- });
39
-
40
- // leaflet-draw css
41
- this.import(`${packagePrefix}/leaflet-draw/dist/leaflet.draw.css`);
27
+ // import stylesheets
28
+ this.import('node_modules/leaflet-contextmenu/dist/leaflet.contextmenu.css');
29
+ this.import('node_modules/leaflet-draw/dist/leaflet.draw.css');
42
30
  },
43
31
 
44
32
  treeForPublic: function () {
45
33
  const publicTree = this._super.treeForPublic.apply(this, arguments);
46
34
 
47
35
  // Use a Funnel assets
36
+ const leafletPath = path.dirname(require.resolve('leaflet'));
37
+ const leafletImagesPath = path.join(leafletPath, 'images');
48
38
  const addonTree = [
49
39
  new Funnel(`node_modules/${name}/assets`, {
50
40
  destDir: '/',
51
41
  }),
52
- new Funnel(`${packagePrefix}/leaflet/dist/images`, {
42
+ new Funnel(leafletImagesPath, {
43
+ srcDir: '/',
53
44
  destDir: '/leaflet-images',
54
45
  }),
55
46
  ];
@@ -58,14 +49,7 @@ module.exports = buildEngine({
58
49
  return publicTree ? new MergeTrees([publicTree, ...addonTree], { overwrite: true }) : new MergeTrees([...addonTree], { overwrite: true });
59
50
  },
60
51
 
61
- // postBuild: function (result) {
62
- // const src = path.join(result.directory, 'assets', 'leaflet-images');
63
- // const dest = path.join(result.directory, '..', '..', 'public', 'fleet-ops', 'assets', 'images');
64
-
65
- // if (fs.existsSync(src)) {
66
- // fs.copySync(src, dest);
67
- // }
68
- // },
52
+ _concatStyles: () => {},
69
53
 
70
54
  isDevelopingAddon() {
71
55
  return true;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fleetbase/fleetops-engine",
3
3
  "extension": "Fleet Ops",
4
4
  "icon": "route",
5
- "version": "0.0.1",
5
+ "version": "0.0.3",
6
6
  "priority": 0,
7
7
  "description": "Fleetbase Fleet-Ops extension provides a fleet management and last mile delivery operations system module.",
8
8
  "keywords": [
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@fleetbase/ember-core": "^0.0.1",
40
- "@fleetbase/ember-ui": "^0.0.1",
40
+ "@fleetbase/ember-ui": "^0.0.2",
41
41
  "@fleetbase/fleetops-data": "^0.0.1",
42
42
  "@fleetbase/leaflet-routing-machine": "^3.2.15",
43
43
  "@fortawesome/ember-fontawesome": "^0.4.1",