Skip to content

Commit

Permalink
refactor: upgrading project to latest ARC standards
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodek committed Aug 7, 2019
1 parent 6a7c448 commit 50e217c
Show file tree
Hide file tree
Showing 13 changed files with 3,029 additions and 4,738 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@advanced-rest-client/eslint-config'].map(require.resolve),
};
3 changes: 3 additions & 0 deletions .npmignore
Expand Up @@ -9,3 +9,6 @@ polymer.json
karma.*
husky.*
commitlint.*
.*
*.config.*
prettier.config.js
8 changes: 6 additions & 2 deletions anypoint-radio-button.js
Expand Up @@ -225,7 +225,9 @@ class AnypointRadioButton extends CheckedElementMixin(LitElement) {
}

connectedCallback() {
super.connectedCallback();
if (super.connectedCallback) {
super.connectedCallback();
}
if (!this.hasAttribute('role')) {
this.setAttribute('role', 'radio');
}
Expand All @@ -242,7 +244,9 @@ class AnypointRadioButton extends CheckedElementMixin(LitElement) {
}

disconnectedCallback() {
super.disconnectedCallback();
if (super.disconnectedCallback) {
super.disconnectedCallback();
}
this.addEventListener('keydown', this._keyDownHandler);
this.addEventListener('click', this._clickHandler);
}
Expand Down
4 changes: 2 additions & 2 deletions anypoint-radio-group.js
Expand Up @@ -51,12 +51,12 @@ class AnypointRadioGroup extends HTMLElement {
super();
this._nodesChanged = this._nodesChanged.bind(this);
this._radioAction = this._radioAction.bind(this);
}

connectedCallback() {
this.style.display = 'inline-block';
this.style.verticalAlign = 'middle';
}

connectedCallback() {
const config = {
attributes: true,
childList: true,
Expand Down
2 changes: 1 addition & 1 deletion commitlint.config.js
@@ -1,3 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
extends: ['@commitlint/config-conventional']
};
5 changes: 4 additions & 1 deletion gen-tsd.json
Expand Up @@ -2,9 +2,12 @@
"excludeFiles": [
"demo/*",
"test/*",
"coverage/*",
"karma.*",
"prettier.config.js",
"husky.config.js",
"commitlint.config.js"
"commitlint.config.js",
"prettier.config.js",
".*"
]
}
4 changes: 2 additions & 2 deletions husky.config.js
@@ -1,6 +1,6 @@
module.exports = {
hooks: {
'pre-commit': 'lint-staged',
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
},
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS'
}
};
29 changes: 23 additions & 6 deletions karma.conf.js
@@ -1,6 +1,6 @@
/* eslint-disable import/no-extraneous-dependencies */
const createDefaultConfig = require('@advanced-rest-client/a11y-suite/default-config.js');
const merge = require('webpack-merge');
const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');

module.exports = (config) => {
config.set(
Expand All @@ -11,12 +11,29 @@ module.exports = (config) => {
//
// npm run test -- --grep test/foo/bar.test.js
// npm run test -- --grep test/bar/*
{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
'node_modules/accessibility-developer-tools/dist/js/axs_testing.js'
{
pattern: config.grep ? config.grep : 'test/**/*.test.js',
type: 'module'
}
],

// you can overwrite/extend the config further
}),
// see the karma-esm docs for all options
esm: {
// if you are using 'bare module imports' you will need this option
nodeResolve: true
},

coverageIstanbulReporter: {
thresholds: {
global: {
statements: 80,
branches: 80,
functions: 90,
lines: 80
}
}
},
})
);
return config;
};
11 changes: 4 additions & 7 deletions karma.sl.config.js
@@ -1,5 +1,5 @@
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge');
const merge = require('deepmerge');
const slSettings = require('@advanced-rest-client/testing-karma-sl/sl-settings.js');
const createBaseConfig = require('./karma.conf.js');

Expand All @@ -12,17 +12,14 @@ module.exports = (config) => {
'SL_Firefox',
'SL_Firefox-1',
'SL_Safari',
'SL_Safari-1',
'SL_IE_11',
'SL_EDGE',
'SL_EDGE'
];
if (process.env.TRAVIS) {
const buildLabel =
'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
const buildLabel = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';

cnf.browserStack = {
build: buildLabel,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
};

cnf.sauceLabs.build = buildLabel;
Expand Down

0 comments on commit 50e217c

Please sign in to comment.