@fleetbase/ember-core 0.0.6 → 0.0.8

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.
@@ -0,0 +1,9 @@
1
+ export function initialize() {
2
+ const socketClusterClientScript = document.createElement('script');
3
+ socketClusterClientScript.src = '/assets/socketcluster-client.min.js';
4
+ document.body.appendChild(socketClusterClientScript);
5
+ }
6
+
7
+ export default {
8
+ initialize,
9
+ };
@@ -0,0 +1 @@
1
+ export { default, initialize } from '@fleetbase/ember-core/initializers/load-socketcluster-client';
package/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  'use strict';
2
+ const Funnel = require('broccoli-funnel');
3
+ const MergeTrees = require('broccoli-merge-trees');
2
4
  const path = require('path');
3
5
 
4
6
  module.exports = {
@@ -19,15 +21,20 @@ module.exports = {
19
21
  useSessionSetupMethod: true,
20
22
  };
21
23
  }
24
+ },
25
+
26
+ treeForPublic: function () {
27
+ const publicTree = this._super.treeForPublic.apply(this, arguments);
28
+ const trees = [];
22
29
 
23
- const importJs = (module, file, options) => {
24
- const modulePath = path.dirname(require.resolve(module));
25
- this.import(`${modulePath}/${file}`, options);
26
- };
30
+ trees.push(
31
+ new Funnel(path.dirname(require.resolve('socketcluster-client')), {
32
+ files: ['socketcluster-client.min.js'],
33
+ destDir: '/assets',
34
+ })
35
+ );
27
36
 
28
- // import socketcluster for use in all fleetbase engines
29
- // this will become globally available as socketClusterClient
30
- importJs('socketcluster-client', 'socketcluster-client.min.js');
31
- // app.import('node_modules/socketcluster-client/socketcluster-client.min.js');
37
+ // Merge the addon tree with the existing tree
38
+ return publicTree ? new MergeTrees([publicTree, ...trees], { overwrite: true }) : new MergeTrees([...trees], { overwrite: true });
32
39
  },
33
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/ember-core",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "Provides all the core services, decorators and utilities for building a Fleetbase extension for the Console.",
5
5
  "keywords": [
6
6
  "fleetbase-extension",
@@ -58,6 +58,8 @@
58
58
  "@glimmer/tracking": "^1.1.2",
59
59
  "babel-eslint": "^10.1.0",
60
60
  "broccoli-asset-rev": "^3.0.0",
61
+ "broccoli-funnel": "^3.0.8",
62
+ "broccoli-merge-trees": "^4.2.0",
61
63
  "broccoli-persistent-filter": "^3.1.3",
62
64
  "ember-cli": "~4.6.0",
63
65
  "ember-cli-dependency-checker": "^3.3.1",
@@ -85,6 +87,7 @@
85
87
  "prettier": "^2.7.1",
86
88
  "qunit": "^2.19.1",
87
89
  "qunit-dom": "^2.0.0",
90
+ "resolve": "^1.22.2",
88
91
  "webpack": "^5.74.0"
89
92
  },
90
93
  "overrides": {