chore: 🤖 setup linting and testing in core addon

This commit is contained in:
Randall Morey committed 2020-11-18 12:12:30 -05:00
1 parent 1511c51337
commit ed6aefbe9c
14 files changed
+116 -117

No files matched your search

+43 -43
View File
@@ -1,87 +1,87 @@
'use strict';
"use strict";
const getChannelURL = require('ember-source-channel-url');
const getChannelURL = require("ember-source-channel-url");
module.exports = async function() {
module.exports = async function () {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-3.12',
name: "ember-lts-3.12",
npm: {
devDependencies: {
'ember-source': '~3.12.0'
}
}
"ember-source": "~3.12.0",
},
},
},
{
name: 'ember-lts-3.16',
name: "ember-lts-3.16",
npm: {
devDependencies: {
'ember-source': '~3.16.0'
}
}
"ember-source": "~3.16.0",
},
},
},
{
name: 'ember-lts-3.20',
name: "ember-lts-3.20",
npm: {
devDependencies: {
'ember-source': '~3.20.5'
}
}
"ember-source": "~3.20.5",
},
},
},
{
name: 'ember-release',
name: "ember-release",
npm: {
devDependencies: {
'ember-source': await getChannelURL('release')
}
}
"ember-source": await getChannelURL("release"),
},
},
},
{
name: 'ember-beta',
name: "ember-beta",
npm: {
devDependencies: {
'ember-source': await getChannelURL('beta')
}
}
"ember-source": await getChannelURL("beta"),
},
},
},
{
name: 'ember-canary',
name: "ember-canary",
npm: {
devDependencies: {
'ember-source': await getChannelURL('canary')
}
}
"ember-source": await getChannelURL("canary"),
},
},
},
{
name: 'ember-default-with-jquery',
name: "ember-default-with-jquery",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'jquery-integration': true
})
"jquery-integration": true,
}),
},
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0'
}
}
"@ember/jquery": "^1.1.0",
},
},
},
{
name: 'ember-classic',
name: "ember-classic",
env: {
EMBER_OPTIONAL_FEATURES: JSON.stringify({
'application-template-wrapper': true,
'default-async-observers': false,
'template-only-glimmer-components': false
})
"application-template-wrapper": true,
"default-async-observers": false,
"template-only-glimmer-components": false,
}),
},
npm: {
ember: {
edition: 'classic'
}
}
}
]
edition: "classic",
},
},
},
],
};
};
+3 -3
View File
@@ -1,5 +1,5 @@
'use strict';
"use strict";
module.exports = function(/* environment, appConfig */) {
return { };
module.exports = function (/* environment, appConfig */) {
return {};
};
+3 -3
View File
@@ -1,8 +1,8 @@
'use strict';
"use strict";
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const EmberAddon = require("ember-cli/lib/broccoli/ember-addon");
module.exports = function(defaults) {
module.exports = function (defaults) {
let app = new EmberAddon(defaults, {
// Add options here
});
+2 -2
View File
@@ -1,4 +1,4 @@
'use strict';
"use strict";
module.exports = {
name: require('./package').name
name: require("./package").name,
};
+4 -2
View File
@@ -17,9 +17,10 @@
"lint": "npm-run-all --aggregate-output --continue-on-error --parallel lint:*",
"lint:hbs": "ember-template-lint .",
"lint:js": "eslint .",
"format": "npm run format:js",
"format:js": "prettier --write '{addon,app,config,stories,tests}/**/*.js' *.js",
"start": "ember serve",
"test": "npm-run-all lint:* test:*",
"test:ember": "ember test",
"test": "ember test",
"test:ember-compatibility": "ember try:each"
},
"dependencies": {
@@ -54,6 +55,7 @@
"eslint-plugin-node": "^11.1.0",
"loader.js": "^4.7.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.2",
"qunit-dom": "^1.2.0"
},
"engines": {
+14 -18
View File
@@ -1,27 +1,23 @@
'use strict';
"use strict";
module.exports = {
test_page: 'tests/index.html?hidepassed',
test_page: "tests/index.html?hidepassed",
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
launch_in_ci: ["Chrome"],
launch_in_dev: ["Chrome"],
browser_start_timeout: 120,
browser_args: {
Chrome: {
ci: [
// --no-sandbox is needed when running Chrome inside a container
process.env.CI ? '--no-sandbox' : null,
'--headless',
'--disable-dev-shm-usage',
'--disable-software-rasterizer',
'--mute-audio',
'--remote-debugging-port=0',
'--window-size=1440,900'
].filter(Boolean)
}
}
process.env.CI ? "--no-sandbox" : null,
"--headless",
"--disable-dev-shm-usage",
"--disable-software-rasterizer",
"--mute-audio",
"--remote-debugging-port=0",
"--window-size=1440,900",
].filter(Boolean),
},
},
};
+4 -4
View File
@@ -1,7 +1,7 @@
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'dummy/config/environment';
import Application from "@ember/application";
import Resolver from "ember-resolver";
import loadInitializers from "ember-load-initializers";
import config from "dummy/config/environment";
export default class App extends Application {
modulePrefix = config.modulePrefix;
+11 -11
View File
@@ -1,29 +1,29 @@
export default {
time: {
hhmmss: {
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour: "numeric",
minute: "numeric",
second: "numeric",
},
},
date: {
hhmmss: {
hour: 'numeric',
minute: 'numeric',
second: 'numeric',
hour: "numeric",
minute: "numeric",
second: "numeric",
},
},
number: {
compact: { notation: 'compact' },
compact: { notation: "compact" },
EUR: {
style: 'currency',
currency: 'EUR',
style: "currency",
currency: "EUR",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
USD: {
style: 'currency',
currency: 'USD',
style: "currency",
currency: "USD",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
},
+3 -4
View File
@@ -1,10 +1,9 @@
import EmberRouter from '@ember/routing/router';
import config from 'dummy/config/environment';
import EmberRouter from "@ember/routing/router";
import config from "dummy/config/environment";
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}
Router.map(function() {
});
Router.map(function () {});
+3 -3
View File
@@ -1,6 +1,6 @@
/* jshint node:true */
module.exports = function(/* environment */) {
module.exports = function (/* environment */) {
return {
/**
* Merges the fallback locale's translations into all other locales as a
@@ -25,7 +25,7 @@ module.exports = function(/* environment */) {
* @type {String}
* @default "'translations'"
*/
inputPath: 'translations',
inputPath: "translations",
/**
* Prevents the translations from being bundled with the application code.
@@ -90,6 +90,6 @@ module.exports = function(/* environment */) {
*/
requiresTranslation(/* key, locale */) {
return true;
}
},
};
};
+13 -13
View File
@@ -1,11 +1,11 @@
'use strict';
"use strict";
module.exports = function(environment) {
module.exports = function (environment) {
let ENV = {
modulePrefix: 'dummy',
modulePrefix: "dummy",
environment,
rootURL: '/',
locationType: 'auto',
rootURL: "/",
locationType: "auto",
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
@@ -13,17 +13,17 @@ module.exports = function(environment) {
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
Date: false,
},
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
},
};
if (environment === 'development') {
if (environment === "development") {
// ENV.APP.LOG_RESOLVER = true;
// ENV.APP.LOG_ACTIVE_GENERATION = true;
// ENV.APP.LOG_TRANSITIONS = true;
@@ -31,19 +31,19 @@ module.exports = function(environment) {
// ENV.APP.LOG_VIEW_LOOKUPS = true;
}
if (environment === 'test') {
if (environment === "test") {
// Testem prefers this...
ENV.locationType = 'none';
ENV.locationType = "none";
// keep test console output quieter
ENV.APP.LOG_ACTIVE_GENERATION = false;
ENV.APP.LOG_VIEW_LOOKUPS = false;
ENV.APP.rootElement = '#ember-testing';
ENV.APP.rootElement = "#ember-testing";
ENV.APP.autoboot = false;
}
if (environment === 'production') {
if (environment === "production") {
// here you can enable a production-specific feature
}
+7 -7
View File
@@ -1,18 +1,18 @@
'use strict';
"use strict";
const browsers = [
'last 1 Chrome versions',
'last 1 Firefox versions',
'last 1 Safari versions'
"last 1 Chrome versions",
"last 1 Firefox versions",
"last 1 Safari versions",
];
const isCI = Boolean(process.env.CI);
const isProduction = process.env.EMBER_ENV === 'production';
const isProduction = process.env.EMBER_ENV === "production";
if (isCI || isProduction) {
browsers.push('ie 11');
browsers.push("ie 11");
}
module.exports = {
browsers
browsers,
};
+4 -4
View File
@@ -1,7 +1,7 @@
import Application from 'dummy/app';
import config from 'dummy/config/environment';
import { setApplication } from '@ember/test-helpers';
import { start } from 'ember-qunit';
import Application from "dummy/app";
import config from "dummy/config/environment";
import { setApplication } from "@ember/test-helpers";
import { start } from "ember-qunit";
setApplication(Application.create(config.APP));
+2
View File
@@ -22,12 +22,14 @@
"lint": "npm-run-all lint:*",
"lint:addons-api": "cd addons/api && yarn lint",
"lint:addons-auth": "cd addons/auth && yarn lint",
"lint:addons-core": "cd addons/core && yarn lint",
"lint:addons-rose": "cd addons/rose && yarn lint",
"lint:ui-admin": "cd ui/admin && yarn lint",
"lint:ui-desktop": "cd ui/desktop && yarn lint",
"test": "npm-run-all test:*",
"test:addons-api": "cd addons/api && yarn test",
"test:addons-auth": "cd addons/auth && yarn test",
"test:addons-core": "cd addons/core && yarn test",
"test:addons-rose": "cd addons/rose && yarn test",
"test:ui-admin": "cd ui/admin && yarn test",
"test:ui-desktop": "cd ui/desktop && yarn test",