UI: ember-auto-import (#4933)

* add auto-import
* remove imports that we can and get rid of autosize shim
* remove items from eslinrc
* import base64js in shamir key
This commit is contained in:
Matthew Irish 2018-07-18 09:13:39 -05:00 committed by GitHub
parent 9ff2081e8b
commit 3e5731a7b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 1304 additions and 143 deletions

View File

@ -3,9 +3,9 @@ module.exports = {
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
ecmaFeatures: {
experimentalObjectRestSpread: true,
},
},
extends: 'eslint:recommended',
env: {
@ -13,12 +13,10 @@ module.exports = {
es6: true,
},
rules: {
"no-unused-vars": ["error", { "ignoreRestSiblings": true }]
'no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
globals: {
base64js: true,
TextEncoderLite: true,
TextDecoderLite: true,
Duration: true
}
},
};

View File

@ -1,4 +1,5 @@
import Ember from 'ember';
import base64js from 'base64-js';
const { Component, inject, computed, get } = Ember;
const { camelize } = Ember.String;

View File

@ -1,4 +1,5 @@
import Ember from 'ember';
import Duration from 'Duration.js';
const { computed, get, set } = Ember;

View File

@ -1,5 +1,5 @@
import keys from 'vault/lib/keycodes';
import argTokenizer from 'yargs-parser-tokenizer';
import argTokenizer from 'yargs-parser/lib/tokenize-arg-string.js';
const supportedCommands = ['read', 'write', 'list', 'delete'];
const uiCommands = ['clearall', 'clear', 'fullscreen', 'refresh'];

View File

@ -1,3 +1,5 @@
import base64js from 'base64-js';
export function encodeString(string) {
var encoded = new TextEncoderLite('utf-8').encode(string);
return base64js.fromByteArray(encoded);

View File

@ -35,29 +35,25 @@ module.exports = function(defaults) {
grid: true,
browsers: ['defaults', 'ie 11'],
},
autoImport: {
webpack: {
// this makes `unsafe-eval` CSP unnecessary
// see https://github.com/ef4/ember-auto-import/issues/50
// and https://github.com/webpack/webpack/issues/5627
devtool: 'inline-source-map',
},
},
});
app.import('vendor/string-includes.js');
app.import('node_modules/string.prototype.endswith/endswith.js');
app.import('node_modules/string.prototype.startswith/startswith.js');
app.import('node_modules/autosize/dist/autosize.js');
app.import('vendor/shims/autosize.js');
app.import('node_modules/jsonlint/lib/jsonlint.js');
app.import('node_modules/codemirror/addon/lint/lint.css');
app.import('node_modules/codemirror/addon/lint/lint.js');
app.import('node_modules/codemirror/addon/lint/json-lint.js');
app.import('node_modules/base64-js/base64js.min.js');
app.import('node_modules/text-encoder-lite/index.js');
app.import('node_modules/Duration.js/duration.js');
app.import('node_modules/columnify/columnify.js', {
using: [{ transformation: 'cjs', as: 'columnify' }],
});
app.import('node_modules/yargs-parser/lib/tokenize-arg-string.js', {
using: [{ transformation: 'cjs', as: 'yargs-parser-tokenizer' }],
});
// Use `app.import` to add additional libraries to the generated
// output files.

View File

@ -47,12 +47,12 @@
"ember-ajax": "^3.0.0",
"ember-angle-bracket-invocation-polyfill": "^1.0.2",
"ember-api-actions": "^0.1.8",
"ember-auto-import": "^1.2.3",
"ember-basic-dropdown": "^1.0.0",
"ember-basic-dropdown-hover": "^0.5.0",
"ember-cli": "~2.16.0",
"ember-cli-autoprefixer": "^0.8.1",
"ember-cli-babel": "^6.3.0",
"ember-cli-cjs-transform": "^1.2.0",
"ember-cli-clipboard": "^0.8.0",
"ember-cli-content-security-policy": "^1.0.0",
"ember-cli-dependency-checker": "^1.3.0",

View File

@ -1,9 +0,0 @@
(function() {
function vendorModule() {
'use strict';
return { 'default': self['autosize'] };
}
define('autosize', [], vendorModule);
})();

File diff suppressed because it is too large Load Diff