open-consul/ui-v2/ember-cli-build.js
John Cowen e545c82e1e ui: Discovery Chain (#6746)
* Add data layer for discovery chain (model/adapter/serializer/repo)

* Add routing plus template for routing tab

* Add extra deps - consul-api-double upgrade plus ngraph for graphing

* Add discovery-chain and related components and helpers:

1. discovery-chain to orchestrate/view controller
2. route-card, splitter-card, resolver card to represent the 3 different
node types.
3. route-match helper for easy formatting of route rules
4. dom-position to figure out where things are in order to draw lines
5. svg-curve, simple wrapper around svg's <path d=""> attribute format.
6. data-structs service. This isn't super required but we are using
other data-structures provided by other third party npm modules in other
yet to be merged PRs. All of these types of things will live here for
easy access/injection/changability
7. Some additions to our css-var 'polyfill' for a couple of extra needed
rules

* Related CSS for discovery chain

1. We add a %card base component here, eventually this will go into our
base folder and %stats-card will also use it for a base component.
2. New icon for failovers

* ui: Discovery Chain Continued (#6939)

1. Add in the things we use for the animations
2 Use IntersectionObserver so we know when the tab is visible,
otherwise the dom-position helper won't work as the dom elements don't
have any display.
3. Add some base work for animations and use them a little
4. Try to detect if a resolver is a redirect. Right now this works for
datacenters and namespaces, but it can't work for services and subsets -
we are awaiting backend support for doing this properly.
5. Add a fake 'this service has no routes' route that says 'Default'
6. redirect icon
7. Add CSS.escape polyfill for Edge
2019-12-18 12:26:47 +00:00

95 lines
3.2 KiB
JavaScript

'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
const env = EmberApp.env();
const prodlike = ['production', 'staging'];
const isProd = env === 'production';
// if we ever need a 'prodlike' staging environment with staging settings
// const isProdLike = prodlike.indexOf(env) > -1;
const sourcemaps = !isProd;
let app = new EmberApp(
Object.assign(
{},
defaults,
{
productionEnvironments: prodlike
}
), {
'ember-cli-babel': {
includePolyfill: true
},
'ember-cli-string-helpers': {
only: ['capitalize', 'lowercase', 'truncate']
},
'ember-cli-math-helpers': {
only: ['div']
},
'babel': {
plugins: [
'@babel/plugin-proposal-object-rest-spread'
]
},
'codemirror': {
keyMaps: ['sublime'],
addonFiles: [
'lint/lint.css',
'lint/lint.js',
'lint/json-lint.js',
'lint/yaml-lint.js',
'mode/loadmode.js'
]
},
'ember-cli-uglify': {
uglify: {
compress: {
keep_fargs: false,
},
},
},
'sassOptions': {
implementation: require('node-sass'),
sourceMapEmbed: sourcemaps,
},
'autoprefixer': {
sourcemap: sourcemaps,
grid: true,
browsers: [
"defaults",
"ie 11"
]
},
});
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
// environments, specify an object as the first parameter. That
// object's keys should be the environment name and the values
// should be the asset to use in that environment.
//
// If the library that you are including contains AMD or ES6
// modules that you would like to import into your application
// please specify an object with the list of modules as keys
// along with the exports of each module as its value.
// TextEncoder/Decoder polyfill. See assets/index.html
app.import('node_modules/text-encoding/lib/encoding-indexes.js', {outputFile: 'assets/encoding-indexes.js'});
// CSS.escape polyfill
app.import('node_modules/css.escape/css.escape.js', {outputFile: 'assets/css.escape.js'});
// JSON linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/jsonlint/lib/jsonlint.js', {outputFile: 'assets/codemirror/mode/javascript/javascript.js'});
app.import('node_modules/codemirror/mode/javascript/javascript.js', {outputFile: 'assets/codemirror/mode/javascript/javascript.js'});
// HCL/Ruby linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/codemirror/mode/ruby/ruby.js', {outputFile: 'assets/codemirror/mode/ruby/ruby.js'});
// YAML linting support. Possibly dynamically loaded via CodeMirror linting. See components/code-editor.js
app.import('node_modules/js-yaml/dist/js-yaml.js', {outputFile: 'assets/codemirror/mode/yaml/yaml.js'});
app.import('node_modules/codemirror/mode/yaml/yaml.js', {outputFile: 'assets/codemirror/mode/yaml/yaml.js'});
let tree = app.toTree();
return tree;
};