From 9c6aef970c99550b9b675e22f24fef97e67c4c42 Mon Sep 17 00:00:00 2001 From: Randall Morey Date: Mon, 18 May 2020 17:18:50 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20add=20sass=20support=20?= =?UTF-8?q?to=20core=20ui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/core/README.md | 2 ++ ui/core/app/styles/app.css | 0 ui/core/app/styles/app.scss | 1 + ui/core/ember-cli-build.js | 4 ++++ ui/core/package.json | 15 ++++++++++----- ui/core/tests/acceptance/index-test.js | 4 ++-- 6 files changed, 19 insertions(+), 7 deletions(-) delete mode 100644 ui/core/app/styles/app.css create mode 100644 ui/core/app/styles/app.scss diff --git a/ui/core/README.md b/ui/core/README.md index d3ac6cd5a..144a0b034 100644 --- a/ui/core/README.md +++ b/ui/core/README.md @@ -44,8 +44,10 @@ List of available project commands. `yarn run ` | lint | Runs all lint commands. | | lint:hbs | Lints `hbs` template files. | | lint:js | Lints `js` files. | +| lint:sass | Lints `scss` files. | | format | Runs all auto-formatters. | | format:js | Auto-formats `js` files using Prettier. | +| format:sass | Auto-formats `scss` files using Prettier. | | start | Runs the dummy app local server. | | test | Runs all tests in random order, with coverage reporting. | | doc:toc | Automatically generates a table of contents for this README file. | diff --git a/ui/core/app/styles/app.css b/ui/core/app/styles/app.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/ui/core/app/styles/app.scss b/ui/core/app/styles/app.scss new file mode 100644 index 000000000..72d055984 --- /dev/null +++ b/ui/core/app/styles/app.scss @@ -0,0 +1 @@ +@import 'rose'; diff --git a/ui/core/ember-cli-build.js b/ui/core/ember-cli-build.js index 3e48b9e1e..9528c38e4 100644 --- a/ui/core/ember-cli-build.js +++ b/ui/core/ember-cli-build.js @@ -11,6 +11,10 @@ module.exports = function (defaults) { enabled: true, extensions: ['js'], }, + sassOptions: { + onlyIncluded: true, + extension: 'scss', + }, }); // Use `app.import` to add additional libraries to the generated diff --git a/ui/core/package.json b/ui/core/package.json index e098ccb98..0f2f736a5 100644 --- a/ui/core/package.json +++ b/ui/core/package.json @@ -13,11 +13,13 @@ "doc:toc": "doctoc README.md", "build": "ember build", "build:production": "ember build --environment=production", - "lint": "yarn lint:hbs && yarn lint:js", + "lint": "yarn lint:hbs && yarn lint:js && yarn lint:sass", "lint:hbs": "ember-template-lint .", "lint:js": "eslint .", - "format": "yarn format:js", - "format:js": "prettier --write '{addon,app,config,stories,tests}/**/*.js' *.js", + "lint:sass": "sass-lint -v -q", + "format": "yarn format:js && npm run format:sass", + "format:js": "prettier --write '{app,config,stories,tests}/**/*.js' *.js", + "format:sass": "prettier --write app/**/*.scss", "start": "ember serve", "clean:coverage": "rm -rf coverage_*", "pretest": "yarn clean:coverage && yarn lint", @@ -44,6 +46,7 @@ "ember-cli-eslint": "^5.1.0", "ember-cli-htmlbars": "^4.2.2", "ember-cli-inject-live-reload": "^2.0.2", + "ember-cli-sass": "^10.0.1", "ember-cli-sri": "^2.1.1", "ember-cli-template-lint": "^1.0.0-beta.3", "ember-cli-uglify": "^3.0.0", @@ -58,13 +61,15 @@ "ember-resolver": "^7.0.0", "ember-source": "~3.16.0", "ember-welcome-page": "^4.0.0", + "emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774", "eslint-plugin-ember": "^7.7.2", "eslint-plugin-node": "^11.0.0", "loader.js": "^4.7.0", "prettier": "^2.0.5", "qunit-dom": "^1.0.0", - "emberx-select": "github:adopted-ember-addons/emberx-select#bc5f774", - "rose": "*" + "rose": "*", + "sass": "^1.26.5", + "sass-lint": "^1.13.1" }, "engines": { "node": "10.* || >= 12" diff --git a/ui/core/tests/acceptance/index-test.js b/ui/core/tests/acceptance/index-test.js index f4006f235..5a2ec4631 100644 --- a/ui/core/tests/acceptance/index-test.js +++ b/ui/core/tests/acceptance/index-test.js @@ -3,10 +3,10 @@ import { visit, currentURL } from '@ember/test-helpers'; import { setupApplicationTest } from 'ember-qunit'; import a11yAudit from 'ember-a11y-testing/test-support/audit'; -module('Acceptance | index', function(hooks) { +module('Acceptance | index', function (hooks) { setupApplicationTest(hooks); - test('visiting /', async function(assert) { + test('visiting /', async function (assert) { assert.expect(1); await visit('/'); await a11yAudit();